浏览代码

修改问题

tangning 3 年之前
父节点
当前提交
77426bf75d
共有 2 个文件被更改,包括 8 次插入8 次删除
  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',
     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
-      return {
+      permission.push({
         resourceKey:key,
         viewName: keyViewMap[key] || key,
         children: [
@@ -121,10 +122,9 @@ export const setInfoPermission = val => {
             { resourceKey: ele.module + ':delete' },
             { resourceKey: ele.module + ':add' }
           ],
-      }
+      })
     }
-  }))
-  console.log('permission',permission)
+  })
   user.value.permission = permission || []
 }
 

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

@@ -318,7 +318,7 @@ export default {
     handClick(data) {
       let checkedNodes = this.$refs.tree.getCheckedNodes();
       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);
       }
       console.log("handClick",data);
@@ -326,7 +326,7 @@ export default {
     setselectShow(selectShow, id) {
       this.selectShow = selectShow;
       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) {
       console.log("handcurrentChange", a, b);