| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- export default {
- name: "user_cards_list",
- data() {
- return {
- list: [],
- menuDialog:false,
- loading:false,
- outerVisible: false,
- addDialog:false,
- editDialog:false,
- infoDialog:false,
- add_form: {
- id: 0,
- uid: 0,
- group_id: '',
- },
- info:{
- },
- menuData: [],
- groupData: [],
- groupValue: ''
- }
- },
- mounted() {
- this.getList();
- this.getGroup();
- },
- methods: {
- formAdd() {
- var that=this;
- var add_form=this.add_form;
- add_form.group_id=this.groupValue;
- this.$post("/api/admin/admin_user/add", this.add_form).then(res => {
- if (res && res.status === 1) {
- that.getList();
- that.$message.success('操作成功')
- that.addDialog = false;
- that.add_form.id =0;
- that.add_form.group_id ='';
- that.editDialog = false;
- }
- });
- },
- form(){
- },
- async del(id)
- {
- let res = await this.$post("/api/admin/admin_user/del", {id: id});
- if (res && res.status === 1) {
- this.$message({
- type: 'success',
- message: '操作成功!'
- });
- this.getList();
- }
- },
- async delData(row) {
- this.$confirm('确定删除后将不可逆, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.del(row.id);
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'
- });
- });
- },
- editGroup(row) {
- let form = this.add_form;
- form.id = row.id;
- form.name = row.name;
- this.addDialog=true;
- },
- addGroup() {
- let form = this.add_form;
- form.id = "";
- form.name = "";
- this.addDialog=true;
- },
- menuDialogShow(row) {
- this.menuDialog=true;
- this.menuData=[];
- this.getMenuData(row.id);
- },
- async getList() {
- let res = await this.$post("/api/admin/admin_user/list");
- if (res && res.status === 1) {
- this.list = res.data.list || [];
- }
- },
- async getGroup() {
- let res = await this.$post("/api/admin/admin_group/list");
- if (res && res.status === 1) {
- this.groupData = res.data.list || [];
- }
- },
- }
- }
|