فهرست منبع

设置分类authorityName,authorityObject字段获取修改

shenqilong 1 سال پیش
والد
کامیت
d949c94323
2فایلهای تغییر یافته به همراه3 افزوده شده و 4 حذف شده
  1. 1 1
      src/business/platform/cat/type/tree.vue
  2. 2 3
      src/views/platform/cat/type/edit.vue

+ 1 - 1
src/business/platform/cat/type/tree.vue

@@ -134,7 +134,7 @@ export default {
                     const tree = data.filter(item => item.isShow !== '1' && !noIdList.includes(item.parentId))
                     for (const item of tree) {
                         item.authorityName = item.authorityName || '{"chaYue":"","buMen":"","shenCha":"","shenHeZouXiang":"","fenLei":""}'
-                        item.authorityObject = item.authorityObject || { chaYue: '', buMen: '', shenCha: '', shenHeZouXiang: '', fenLei: '' }
+                        item.authorityObject = item.authorityObject || JSON.parse(data.authorityName)
                     }
                     this.treeData = tree
                 }

+ 2 - 3
src/views/platform/cat/type/edit.vue

@@ -298,7 +298,6 @@ export default {
                 this.isPrivateLocal = this.isPrivate
                 if (this.categoryKey === 'FILE_TYPE' && this.parentData.authorityName !== undefined) {
                     this.type.authorityObject = JSON.parse(this.parentData.authorityName)
-                    console.log(this.type.authorityObject, 'aaaaaaaa')
                 }
             },
             immediate: true
@@ -426,8 +425,8 @@ export default {
             get({ typeId: this.formId }).then(response => {
                 this.$refs[this.formName].clearValidate()
                 const data = response.data
-                data.authorityName = response.data.authorityName ? JSON.parse(response.data.authorityName) : '{"chaYue":"","buMen":"","shenCha":"","shenHeZouXiang":"","fenLei":""}'
-                data.authorityObject = response.data.authorityObject ? JSON.parse(response.data.authorityObject) : { chaYue: '', buMen: '', shenCha: '', shenHeZouXiang: '', fenLei: '' }
+                data.authorityName = response.data.authorityName || '{"chaYue":"","buMen":"","shenCha":"","shenHeZouXiang":"","fenLei":""}'
+                data.authorityObject = response.data.authorityObject || JSON.parse(data.authorityName)
                 this.type = data
                 this.isPrivateLocal = !((this.$utils.isEmpty(this.type.ownerId) || this.type.ownerId === '0'))
             }).catch(() => { })