lilei 1 week ago
parent
commit
fdc849d9a7
2 changed files with 8 additions and 14 deletions
  1. 3 12
      src/views/power/role/menuModal.vue
  2. 5 2
      src/views/power/role/roleList.vue

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

@@ -32,6 +32,7 @@
               @check="onCheck"
               @check="onCheck"
               @expand="onExpand"
               @expand="onExpand"
               :expandedKeys="expandedKeys"
               :expandedKeys="expandedKeys"
+              :defaultExpandAll="true"
               :autoExpandParent="autoExpandParent"
               :autoExpandParent="autoExpandParent"
               v-model="checkedKeys"
               v-model="checkedKeys"
               :treeData="treeData"
               :treeData="treeData"
@@ -102,9 +103,7 @@ export default {
   methods: {
   methods: {
     // 展开/收起节点
     // 展开/收起节点
     onExpand (expandedKeys) {
     onExpand (expandedKeys) {
-      console.log(expandedKeys)
       this.expandedKeys = expandedKeys
       this.expandedKeys = expandedKeys
-      this.autoExpandParent = false
     },
     },
     // 点击复选框
     // 点击复选框
     onCheck (checkedKeys, info) {
     onCheck (checkedKeys, info) {
@@ -320,8 +319,8 @@ export default {
         this.findPrice(treeData, this.checkedData)
         this.findPrice(treeData, this.checkedData)
         this.hasAllSelect()
         this.hasAllSelect()
       }
       }
-      // console.log(this.checkedKeys)
-      // console.log(this.checkedData)
+      console.log(this.checkedKeys)
+      console.log(this.checkedData)
 
 
       this.treeData = treeData
       this.treeData = treeData
 
 
@@ -359,14 +358,6 @@ export default {
       } else {
       } else {
         this.priceOptions = this.$store.state.app.priceAuthOptions
         this.priceOptions = this.$store.state.app.priceAuthOptions
       }
       }
-    },
-    nowData: {
-      handler (newValue, oldValue) {
-        if (this.isshow && newValue) {
-          this.pageInit()
-        }
-      },
-      deep: true
     }
     }
   }
   }
 }
 }

+ 5 - 2
src/views/power/role/roleList.vue

@@ -112,7 +112,7 @@
       <!-- 添加角色弹窗 -->
       <!-- 添加角色弹窗 -->
       <roleModal :visible="showModal" @refresh="$refs.table.refresh()" :nowData="itemData" @close="closeRole"></roleModal>
       <roleModal :visible="showModal" @refresh="$refs.table.refresh()" :nowData="itemData" @close="closeRole"></roleModal>
       <!-- 价格权限、功能权限弹窗 -->
       <!-- 价格权限、功能权限弹窗 -->
-      <menuModal :visible="showMenuModal" @refresh="$refs.table.refresh()" :nowData="menuData" @close="showMenuModal = false"></menuModal>
+      <menuModal ref="menuModal" :visible="showMenuModal" @refresh="$refs.table.refresh()" :nowData="menuData" @close="showMenuModal = false"></menuModal>
     </a-card>
     </a-card>
   </div>
   </div>
 </template>
 </template>
@@ -213,7 +213,10 @@ export default {
         if (res.status == 200) {
         if (res.status == 200) {
           _this.menuData = res.data
           _this.menuData = res.data
           _this.menuData.type = type
           _this.menuData.type = type
-          this.showMenuModal = true
+          _this.showMenuModal = true
+          _this.$nextTick(() => {
+            _this.$refs.menuModal.pageInit()
+          })
         }
         }
       })
       })
     },
     },