lilei 2 年之前
父節點
當前提交
9b926f70d6
共有 1 個文件被更改,包括 12 次插入3 次删除
  1. 12 3
      src/views/power/role/menuModal.vue

+ 12 - 3
src/views/power/role/menuModal.vue

@@ -102,14 +102,23 @@ export default {
       // this.autoExpandParent = false
       // this.autoExpandParent = false
     },
     },
     onCheck (checkedKeys, info) {
     onCheck (checkedKeys, info) {
-      // console.log(checkedKeys, info.halfCheckedKeys)
+      // console.log(checkedKeys, info)
       this.halfCheckedKeys = info.halfCheckedKeys
       this.halfCheckedKeys = info.halfCheckedKeys
       this.checkedKeys = checkedKeys
       this.checkedKeys = checkedKeys
+      // 判断某分类是否全选
+      this.checkLeafNode = []
+      info.checkedNodes.map(item => {
+        const node = item.data.props
+        const a = node.code.split('_')
+        this.checkLeafNode.push({pr:a[a.length-1],id:node.id})
+      })
+      this.hasAllSelect()
     },
     },
     // 判断某分类是否全选
     // 判断某分类是否全选
     hasAllSelect(){
     hasAllSelect(){
-      console.log(this.leafNode)
-      console.log(this.checkLeafNode)
+      // console.log(this.leafNode)
+      // console.log(this.checkLeafNode)
+      this.authAllPrice = []
       this.priceOptions.map(item => {
       this.priceOptions.map(item => {
         const a = this.leafNode.filter(n => n.pr == item.value)
         const a = this.leafNode.filter(n => n.pr == item.value)
         const b = this.checkLeafNode.filter(n => n.pr == item.value)
         const b = this.checkLeafNode.filter(n => n.pr == item.value)