liujiayin 2 lat temu
rodzic
commit
4cc8305eb7
1 zmienionych plików z 10 dodań i 6 usunięć
  1. 10 6
      src/views/platform/cat/type/edit.vue

+ 10 - 6
src/views/platform/cat/type/edit.vue

@@ -212,16 +212,18 @@ export default {
       handler: function (val, oldVal) {
         this.dialogVisible = this.visible
         this.isPrivateLocal = this.isPrivate
-        this.type.authorityObject = JSON.parse(this.parentData.authorityName)
+        if (this.categoryKey === 'FILE_TYPE') {
+          this.type.authorityObject = JSON.parse(this.parentData.authorityName)
+        }
       },
       immediate: true
     },
     parentData: {
       handler: function (val, oldVal) {
-        this.getRadioOptions()
-        this.type.authorityObject = JSON.parse(val.authorityName)
-        console.log('this.type.authorityObject', this.type.authorityObject)
-
+        if (this.categoryKey === 'FILE_TYPE') {
+          this.getRadioOptions()
+          this.type.authorityObject = JSON.parse(val.authorityName)
+        }
       },
       immediate: true
     },
@@ -344,9 +346,11 @@ export default {
       curdPost('sql', sql).then(res => {
         let datas = res.variables.data
         let treeDatas = this.buildTree(datas, 'ID_', 'PARENT_ID_')
+        let tree = []
         for (let i in treeDatas) {
-          this.cascaderOptions.push(treeDatas[i])
+          tree.push(treeDatas[i])
         }
+        this.cascaderOptions = tree
       })
     },
     radioChangeHandle(h) {