Browse Source

账号管理,模块权限标题相关

MaiXinRong 4 months ago
parent
commit
c53c4adce3

+ 2 - 1
app/controller/sub_proj_setting_controller.js

@@ -292,9 +292,10 @@ module.exports = app => {
                     const groupList = accountList.filter(item1 => item1.company === item.name);
                     return { id: item.id, name: item.name, groupList };
                 }).filter(x => { return x.groupList.length > 0; });
+                const relaBlock = ctx.service.subProjPermission.getRelaPermissionBlock(ctx.query.ptype);
                 const renderData = {
                     ptype: ctx.query.ptype,
-                    ptypeStr: permissionConst[ctx.query.ptype].title,
+                    ptypeStr: relaBlock ? relaBlock.name : '',
                     accountGroup,
                     subProjectAccountList,
                     subProjectAllAccountList,

+ 0 - 1
app/service/project_account.js

@@ -782,7 +782,6 @@ module.exports = app => {
             } else {
                 updateData.wx_type = JSON.stringify(data);
             }
-            console.log(updateData);
 
             const operate = await this.db.update(this.tableName, updateData);
 

+ 11 - 2
app/service/sub_proj_permission.js

@@ -85,7 +85,6 @@ module.exports = app => {
                         for (const prop in pConst) {
                             c.permission.push({ key: prop, ...pConst[prop]});
                         }
-                        pConst.title = c.name;
                     }
                 } else {
                     p.permission = [];
@@ -94,7 +93,17 @@ module.exports = app => {
                     for (const prop in pConst) {
                         p.permission.push({ key: prop, ...pConst[prop]});
                     }
-                    pConst.title = p.name;
+                }
+            }
+        }
+
+        getRelaPermissionBlock(key) {
+            for (const p of this.PermissionBlock) {
+                if (p.key === key) return p;
+                if (p.children) {
+                    for (const c of p.children) {
+                        if (c.key === key) return c;
+                    }
                 }
             }
         }