From 5cd8fea60cac0b05bd799f9778f605bdb51dbd80 Mon Sep 17 00:00:00 2001 From: sjl <1716605279@qq.com> Date: Fri, 8 Aug 2025 13:18:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=A7=81=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/stores/modules/auth.ts | 26 +- .../compareDataCheckRawDataTable.vue | 67 ++ .../compareDataCheckResultTable.vue | 180 +++++ ...eDataCheckSingleChannelSingleTestPopup.vue | 702 ++++++++++++++++++ .../views/home/components/comparePreTest.vue | 27 +- .../src/views/home/components/compareTest.vue | 73 +- .../home/components/compareTestPopup.vue | 77 +- .../home/components/deviceConnectionPopup.vue | 74 +- .../src/views/home/components/factorTest.vue | 2 +- .../home/components/realTimeDataAlign.vue | 41 +- frontend/src/views/home/components/table.vue | 2 +- .../src/views/home/components/testPopup.vue | 10 +- frontend/src/views/log/index.vue | 2 +- .../machine/device/components/devicePopup.vue | 8 +- 14 files changed, 1142 insertions(+), 149 deletions(-) create mode 100644 frontend/src/views/home/components/compareDataCheckRawDataTable.vue create mode 100644 frontend/src/views/home/components/compareDataCheckResultTable.vue create mode 100644 frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue 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 @@ + + + + + + + + + + + + + + + + + 误差范围:{{ scope.row.maxErrorA }} + 误差值:{{ scope.row.errorA }} {{ scope.row.errorA !== '/' ? innerUnitA : '' }} + + 符合 + 不符合 + / + - + + + + + + + + + + + + 误差范围:{{ scope.row.maxErrorB }} + 误差值:{{ scope.row.errorB }} {{ scope.row.errorB !== '/' ? innerUnitB : '' }} + + 符合 + 不符合 + / + - + + + + + + + + + + + + 误差范围: {{ scope.row.maxErrorC }} + 误差值:{{ scope.row.errorC }} {{ scope.row.errorC !== '/' ? innerUnitC : '' }} + + 符合 + 不符合 + / + - + + + + + + + + + + + + + 误差范围: {{ scope.row.maxErrorT }} + 误差值:{{ scope.row.errorT }} {{ scope.row.errorT !== '/' ? innerUnitT : '' }} + + 符合 + 不符合 + / + - + + + + + + + + + + + + \ 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 @@ - +