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

选择器 部门 管理员 能选择全部部门

linweizeng 2 лет назад
Родитель
Сommit
613a542248
1 измененных файлов с 9 добавлено и 8 удалено
  1. 9 8
      src/business/platform/org/position/panel.vue

+ 9 - 8
src/business/platform/org/position/panel.vue

@@ -248,9 +248,9 @@ export default {
                         }
 
                         if (type === '2') {
-                            this.getPosiData(arrList, true, true)
+                            this.getPosiData(arrList, true, true, type)
                         } else if (type === '1') {
-                            this.disabledDotCount(arrList)
+                            this.disabledDotCount(arrList, type)
                         }
 
                         if (this.$utils.isEmpty(node.data)) {
@@ -289,9 +289,9 @@ export default {
                     }
 
                     if (type === '2') {
-                        this.getPosiData(arrList, node.data.disabled, node.data.disabledShow)
+                        this.getPosiData(arrList, node.data.disabled, node.data.disabledShow, type)
                     } else if (type === '1') {
-                        this.disabledDotCount(arrList)
+                        this.disabledDotCount(arrList, type)
                     }
 
                     resolve(this.toTree(arrList))
@@ -301,7 +301,7 @@ export default {
                 })
             }
         },
-        getPosiData (arrList, disabled, disabledShow = false) {
+        getPosiData (arrList, disabled, disabledShow = false, type) {
             const positions = this.$store.getters.userInfo.employee.positions
             if (positions) {
                 const positionsList = positions.split(',')
@@ -331,15 +331,16 @@ export default {
                     }
                 })
             }
-            this.disabledDotCount(arrList)
+            this.disabledDotCount(arrList, type)
         },
-        disabledDotCount (arrList) {
+        disabledDotCount (arrList, type = 1) {
+            const isSuper = this.$store.getters.isSuper
             let dotCount = 0
             if (arrList && Array.isArray(arrList) && arrList.length > 0 && arrList[0].path) {
                 dotCount = arrList[0].depth
             }
             //
-            if (dotCount <= 2) {
+            if (((type === '1' && !isSuper) || (type === '2')) && dotCount <= 2) {
                 arrList.forEach(item => {
                     item.disabled = true
                 })