Browse Source

修改问题

tangning 3 năm trước cách đây
mục cha
commit
77426bf75d
2 tập tin đã thay đổi với 8 bổ sung8 xóa
  1. 6 6
      src/state/user.js
  2. 2 2
      src/view/role/index.vue

+ 6 - 6
src/state/user.js

@@ -109,10 +109,11 @@ export const setInfoPermission = val => {
     ],
     ],
     viewName:'home',
     viewName:'home',
     resourceKey: 'home'
     resourceKey: 'home'
-  }].concat(val.map(ele => {
-    if(ele.type == "menu"){
+  }]
+  val.map(ele => {
+    if(ele.type == "menu" && ele.authority){
       let key = replacetest[ele.module]||ele.module
       let key = replacetest[ele.module]||ele.module
-      return {
+      permission.push({
         resourceKey:key,
         resourceKey:key,
         viewName: keyViewMap[key] || key,
         viewName: keyViewMap[key] || key,
         children: [
         children: [
@@ -121,10 +122,9 @@ export const setInfoPermission = val => {
             { resourceKey: ele.module + ':delete' },
             { resourceKey: ele.module + ':delete' },
             { resourceKey: ele.module + ':add' }
             { resourceKey: ele.module + ':add' }
           ],
           ],
-      }
+      })
     }
     }
-  }))
-  console.log('permission',permission)
+  })
   user.value.permission = permission || []
   user.value.permission = permission || []
 }
 }
 
 

+ 2 - 2
src/view/role/index.vue

@@ -318,7 +318,7 @@ export default {
     handClick(data) {
     handClick(data) {
       let checkedNodes = this.$refs.tree.getCheckedNodes();
       let checkedNodes = this.$refs.tree.getCheckedNodes();
       let selectShow = checkedNodes.find((ele) => data.id == ele.id) || null;
       let selectShow = checkedNodes.find((ele) => data.id == ele.id) || null;
-      if (data.type == 'button'&& this.operateType !== '查看') {
+      if (data.type == 'button') {
         this.setselectShow(selectShow, data.id);
         this.setselectShow(selectShow, data.id);
       }
       }
       console.log("handClick",data);
       console.log("handClick",data);
@@ -326,7 +326,7 @@ export default {
     setselectShow(selectShow, id) {
     setselectShow(selectShow, id) {
       this.selectShow = selectShow;
       this.selectShow = selectShow;
       this.radio = parseInt(this.radioData[id] || 1)
       this.radio = parseInt(this.radioData[id] || 1)
-      if(!this.radioData[id])this.radioData[id] = 1
+      if(!this.radioData[id]&& this.operateType !== '查看')this.radioData[id] = 1
     },
     },
     handcurrentChange(a, b) {
     handcurrentChange(a, b) {
       console.log("handcurrentChange", a, b);
       console.log("handcurrentChange", a, b);