diff --git a/frontend/src/stores/modules/auth.ts b/frontend/src/stores/modules/auth.ts index 2b1fe88..238ab04 100644 --- a/frontend/src/stores/modules/auth.ts +++ b/frontend/src/stores/modules/auth.ts @@ -49,11 +49,12 @@ export const useAuthStore = defineStore({ const modeStore = useModeStore() const { data: menuData } = await getAuthMenuListApi(); - let data = menuData; // 新增变量接收并操作 - if(modeStore.currentMode === '比对式'){ - data = filterMenuTree(data); - } - this.authMenuList = data; + // 根据不同模式过滤菜单 + const filteredMenu = modeStore.currentMode === '比对式' + ? filterMenuByExcludedNames(menuData, ['testSource', 'testScript', 'controlSource']) + : filterMenuByExcludedNames(menuData, ['standardDevice']); + + this.authMenuList = filteredMenu; }, // Set RouteName @@ -84,14 +85,19 @@ export const useAuthStore = defineStore({ }); -// 工具函数:递归过滤掉 name == 'test' 的菜单项 -function filterMenuTree(menuList: any[]) { +/** + * 通用菜单过滤函数 + * @param menuList 菜单列表 + * @param excludedNames 需要排除的菜单名称数组 + * @returns 过滤后的菜单列表 + */ +function filterMenuByExcludedNames(menuList: any[], excludedNames: string[]): any[] { return menuList.filter(menu => { // 如果当前项有 children,递归处理子项 if (menu.children && menu.children.length > 0) { - menu.children = filterMenuTree(menu.children); + menu.children = filterMenuByExcludedNames(menu.children, excludedNames); } - // 过滤掉 name 是 testSource、testScript 或 controlSource 的菜单项 - return !['testSource', 'testScript', 'controlSource'].includes(menu.name); + // 过滤掉在排除列表中的菜单项 + return !excludedNames.includes(menu.name); }); } diff --git a/frontend/src/views/home/components/compareDataCheckRawDataTable.vue b/frontend/src/views/home/components/compareDataCheckRawDataTable.vue new file mode 100644 index 0000000..25ef318 --- /dev/null +++ b/frontend/src/views/home/components/compareDataCheckRawDataTable.vue @@ -0,0 +1,67 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/views/home/components/compareDataCheckResultTable.vue b/frontend/src/views/home/components/compareDataCheckResultTable.vue new file mode 100644 index 0000000..95bba6d --- /dev/null +++ b/frontend/src/views/home/components/compareDataCheckResultTable.vue @@ -0,0 +1,180 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue b/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue new file mode 100644 index 0000000..4e281fb --- /dev/null +++ b/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue @@ -0,0 +1,702 @@ + + + + diff --git a/frontend/src/views/home/components/comparePreTest.vue b/frontend/src/views/home/components/comparePreTest.vue index 005743d..515e9e3 100644 --- a/frontend/src/views/home/components/comparePreTest.vue +++ b/frontend/src/views/home/components/comparePreTest.vue @@ -87,11 +87,11 @@ - +