Просмотр исходного кода

文件夹分类树添加私有按钮增加配置控制

cyy 1 неделя назад
Родитель
Сommit
d5913142bc
2 измененных файлов с 13 добавлено и 5 удалено
  1. 6 2
      src/components/ibps-tree/index.vue
  2. 7 3
      src/views/platform/cat/type/manage.vue

+ 6 - 2
src/components/ibps-tree/index.vue

@@ -134,6 +134,7 @@ import PopupManager from '@/utils/popup'
 import IbpsContextmenu from '@/components/ibps-contextmenu'
 import IbpsContextmenuList from '@/components/ibps-contextmenu/components/contentmenu-list'
 import filePng from '@/assets/images/form/file.png'
+import { getSetting } from '@/utils/query'
 export default {
   components: {
     IbpsContextmenu,
@@ -435,8 +436,11 @@ export default {
         this.handleReferenceContextmenu(event)
       }
     },
-    handleContextmenuList(data) {
+    async handleContextmenuList(data) {
       this.contextmenuList = []
+      const res = await getSetting('fileLeftTree')
+      const privateShow =
+        res && res.privateShow !== undefined ? res.privateShow : true
       const isRoot = data[this.pidKey] === this.rootPId
       this.contextmenus.forEach((menu) => {
         if (!menu.rights) {
@@ -447,7 +451,7 @@ export default {
               this.contextmenuList.push(menu)
             }
           } else if (typeof menu.rights === 'function') {
-            if (menu.rights.call(this, menu, data, isRoot)) {
+            if (menu.rights.call(this, menu, data, isRoot, privateShow)) {
               this.contextmenuList.push(menu)
             }
           }

+ 7 - 3
src/views/platform/cat/type/manage.vue

@@ -117,8 +117,9 @@ export default {
           icon: 'add',
           label: '添加私有分类',
           value: 'addPrivate',
-          rights: function (menu, data, isRoot) {
-            if (data.struType === '0') return false // 平铺结构类型不允许添加子分类
+          rights: function (menu, data, isRoot, privateShow) {
+            if (!privateShow) return false
+            // if (data.struType === '0') return false  平铺结构类型不允许添加子分类
             return true
           }
         },
@@ -186,7 +187,10 @@ export default {
       this.loading = true
       let whereParams = {}
       const allRequests = []
-      if (this.$route?.meta?.name === 'wjjflsz' || this.$route?.meta?.name === 'wjjflsz1') {
+      if (
+        this.$route?.meta?.name === 'wjjflsz' ||
+        this.$route?.meta?.name === 'wjjflsz1'
+      ) {
         this.categoryKey = 'FILE_TYPE'
         const keys = ['FILE_TYPE', 'FLOW_TYPE']
         keys.forEach((item) => {