From e181f04c642204e79749af93fa921875ff6c21ba Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期二, 20 五月 2025 10:46:35 +0800 Subject: [PATCH] refactor(qms): 重构趋势图展示逻辑 --- src/store/modules/permission.ts | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index e90df4c..43fcef8 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -158,9 +158,12 @@ export const loadView = (view: any, name: string) => { let res; for (const path in modules) { - const dir = path.split('views/')[1].split('.vue')[0]; + const viewsIndex = path.indexOf('/views/'); + let dir = path.substring(viewsIndex + 7); + dir = dir.substring(0, dir.lastIndexOf('.vue')); if (dir === view) { res = createCustomNameComponent(modules[path], { name }); + return res; } } return res; -- Gitblit v1.9.3