1
lzhe
2024-05-13 f5edc2904945f37b164a7874d502cf002fae024e
src/views/console/system/allocationDialog.vue
@@ -70,6 +70,7 @@
      emits: ['success', 'closed'],
      data(){
         return {
            oldRow: {},
            selection: [],
            mode: "edit",
            visible: false,
@@ -127,7 +128,19 @@
         },
         //字典配置
         table_allocation(row) {
            this.addAllocation();
            this.addAllocation(row,"subitem");
         },
         showDict() {
            this.$HTTP.get("/api/blade-system/dict/tree?code=DICT").then(res=> {
               if(res.code == 200) {
                  res.data.forEach(item=> {
                     if(item.id == this.addAllocationForm.parentId) {
                        this.addAllocationForm.$parentId = item.title;
                     }
                  })
                  this.parentData = res.data;
               }
            })
         },
         //删除
         table_del(row) {
@@ -146,14 +159,19 @@
            })
         },
         //添加
         addAllocation(){
            this.dialog.allocation = true
         addAllocation(row,type){
            this.dialog.allocation = true;
            this.$nextTick(() => {
               this.$refs.SubitemAddDict.open('edit').setData(this.allocationTableData[0])
               if(type == "subitem") {  //添加子项
                  this.$refs.SubitemAddDict.open('edit').setData(row)
               }else {
                  this.$refs.SubitemAddDict.open('edit').setData(this.oldRow)
               }
            })
         },
         table_edit(row){
            this.dialog.allocation = true
            row.mode = "edit";
            this.$nextTick(() => {
               this.$refs.SubitemAddDict.open('edit').setData(row)
            })
@@ -161,6 +179,7 @@
         //查看
         table_show(row){
            this.dialog.allocation = true
            row.mode = "show";
            this.$nextTick(() => {
               this.$refs.SubitemAddDict.open('show').setData(row)
            })
@@ -209,6 +228,7 @@
         setData(row){
            //可以和上面一样单个注入,也可以像下面一样直接合并进去
            this.searchData.parentId = row.id;
            this.oldRow = row;
            this.searchBtn();
         },
         //显示