fix(系统设置): 报表统计二级菜单显示问题

--bug=1015855 --user=李玉号 【系统设置】报表统计,没有报表 /
报告权限,但是会显示二级菜单
https://www.tapd.cn/55049933/s/1230951
This commit is contained in:
shiziyuan9527 2022-08-23 14:19:04 +08:00 committed by 刘瑞斌
parent ee2a4e8a70
commit d047fb2d57
2 changed files with 18 additions and 5 deletions

View File

@ -94,7 +94,7 @@ function redirectLoginPath(originPath, next) {
} }
export function getDefaultSecondLevelMenu(toPath) { export function getDefaultSecondLevelMenu(toPath) {
let {TRACK: tracks, API: apis, LOAD: loads, UI: ui} = SECOND_LEVEL_ROUTE_PERMISSION_MAP; let {TRACK: tracks, API: apis, LOAD: loads, UI: ui, REPORT: report} = SECOND_LEVEL_ROUTE_PERMISSION_MAP;
if (tracks.map(r => r.router).indexOf(toPath) > -1) { if (tracks.map(r => r.router).indexOf(toPath) > -1) {
return _getDefaultSecondLevelMenu(tracks, toPath); return _getDefaultSecondLevelMenu(tracks, toPath);
} else if (apis.map(r => r.router).indexOf(toPath) > -1) { } else if (apis.map(r => r.router).indexOf(toPath) > -1) {
@ -103,6 +103,8 @@ export function getDefaultSecondLevelMenu(toPath) {
return _getDefaultSecondLevelMenu(loads, toPath); return _getDefaultSecondLevelMenu(loads, toPath);
} else if (ui.map(r => r.router).indexOf(toPath) > -1) { } else if (ui.map(r => r.router).indexOf(toPath) > -1) {
return _getDefaultSecondLevelMenu(ui, toPath); return _getDefaultSecondLevelMenu(ui, toPath);
} else if (report.map(r => r.router).indexOf(toPath) > -1) {
return _getDefaultSecondLevelMenu(report, toPath);
} else { } else {
return toPath; return toPath;
} }

View File

@ -193,10 +193,10 @@ export const CONFIG_TYPE = {
ABNORMAL: "ABNORMAL" ABNORMAL: "ABNORMAL"
} }
export const WORKSTATION={ export const WORKSTATION = {
UPCOMING:"upcoming", UPCOMING: "upcoming",
FOCUS:"focus", FOCUS: "focus",
NODE:"node" NODE: "node"
} }
export const ENV_TYPE = { export const ENV_TYPE = {
@ -231,5 +231,16 @@ export const SECOND_LEVEL_ROUTE_PERMISSION_MAP = {
{router: '/ui/automation', permission: ['PROJECT_UI_SCENARIO:READ']}, {router: '/ui/automation', permission: ['PROJECT_UI_SCENARIO:READ']},
{router: '/ui/element', permission: ['PROJECT_UI_ELEMENT:READ']}, {router: '/ui/element', permission: ['PROJECT_UI_ELEMENT:READ']},
{router: '/ui/report', permission: ['PROJECT_UI_REPORT:READ']}, {router: '/ui/report', permission: ['PROJECT_UI_REPORT:READ']},
],
REPORT: [
{router: '/report/projectStatistics', permission: ['PROJECT_REPORT_ANALYSIS:READ']},
{
router: '/report/projectReport',
permission: [
'PROJECT_ENTERPRISE_REPORT:READ+EXPORT', 'PROJECT_ENTERPRISE_REPORT:READ+CREATE',
'PROJECT_ENTERPRISE_REPORT:READ+DELETE', 'PROJECT_ENTERPRISE_REPORT:READ+COPY',
'PROJECT_ENTERPRISE_REPORT:READ+SCHEDULE', 'PROJECT_ENTERPRISE_REPORT:READ+EDIT'
]
}
] ]
} }