lilei 2 tahun lalu
induk
melakukan
7221cd3ea0
2 mengubah file dengan 14 tambahan dan 3 penghapusan
  1. 1 1
      src/utils/request.js
  2. 13 2
      src/views/power/role/menuModal.vue

+ 1 - 1
src/utils/request.js

@@ -59,7 +59,7 @@ const err = (error) => {
       }else{
         notification.error({
           message: '提示',
-          description: resData.message || error.response.statusText
+          description: resData.message || error.response.statusText || '服务器出错,请稍后再试!'
         })
       }
     }

+ 13 - 2
src/views/power/role/menuModal.vue

@@ -107,6 +107,17 @@ export default {
       this.checkedKeys = checkedKeys
     },
     // 判断某分类是否全选
+    hasAllSelect(){
+      console.log(this.leafNode)
+      console.log(this.checkLeafNode)
+      this.priceOptions.map(item => {
+        const a = this.leafNode.filter(n => n.pr == item.value)
+        const b = this.checkLeafNode.filter(n => n.pr == item.value)
+        if(a&&b&&a.length == b.length && !this.authAllPrice.find(d => d==item.value)){
+          this.authAllPrice.push(item.value)
+        }
+      })
+    },
     // 全选某分类价格
     allSelect(data,authPrice,flag){
       const _this = this
@@ -254,8 +265,7 @@ export default {
       }
       if(this.authType == 0){
         this.findPrice(treeData, this.checkedData)
-        console.log(this.leafNode)
-        console.log(this.checkLeafNode)
+        this.hasAllSelect()
       }
       this.checkedData = this.checkedData.filter(item => !this.checkedKeys.includes(item))
       // console.log(this.checkedData)
@@ -288,6 +298,7 @@ export default {
         this.$refs.ruleForm.resetFields()
         this.id = ''
         this.authAllPrice = []
+        this.checkLeafNode = []
         this.leafNode = []
         this.checkedKeys = []
         this.expandedKeys = []