From 6e573cc597c21248ce933ff8f6aa8d336fd01734 Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Thu, 7 Aug 2025 08:47:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/device/device/deviceData.ts | 168 -- frontend/src/stores/modules/check.ts | 21 +- frontend/src/stores/modules/global.ts | 3 +- .../views/home/components/channelsTest.vue | 999 -------- .../components/dataCheckChangeErrSysPopup.vue | 2017 ----------------- .../src/views/home/components/matchPopup.vue | 202 -- .../src/views/home/components/reportPopup.vue | 154 -- .../src/views/home/components/resultPopup.vue | 1 - frontend/src/views/home/components/table.vue | 1128 ++++----- .../views/home/components/writeTHPopup.vue | 86 +- frontend/src/views/home/tabs/dashboard.vue | 15 +- 11 files changed, 477 insertions(+), 4317 deletions(-) delete mode 100644 frontend/src/views/home/components/channelsTest.vue delete mode 100644 frontend/src/views/home/components/dataCheckChangeErrSysPopup.vue delete mode 100644 frontend/src/views/home/components/matchPopup.vue delete mode 100644 frontend/src/views/home/components/reportPopup.vue diff --git a/frontend/src/api/device/device/deviceData.ts b/frontend/src/api/device/device/deviceData.ts index 58e2215..7dbf278 100644 --- a/frontend/src/api/device/device/deviceData.ts +++ b/frontend/src/api/device/device/deviceData.ts @@ -266,172 +266,4 @@ const data = [ reCheck_Num: 0, //复检次数 }, ] - // const plan_devicedata = [ - // { - // id: '1', //装置序号ID - // name: '模拟装置1', //设备名称 - // dev_Type: 'PQS882A',//设备类型 - // dev_Chns: 1, //设备通道数 - // check_Result: '合格', //检测结果 - // report_State: '已生成', //报告状态 - // document_State: '归档', //归档状态 - // check_State:'检测完成',//检测状态 - // reCheck_Num: 0, //复检次数 - // }, - // { - // id: '2', //装置序号ID - // name: '模拟装置2', //设备名称 - // dev_Type: 'PQS882B4',//设备类型 - // dev_Chns: 4, //设备通道数 - // check_Result: '/', //检测结果 - // report_State: '未生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'未检',//检测状态 - // reCheck_Num: 0, //复检次数 - // }, - // { - // id: '3', //装置序号ID - // name: '模拟装置3', //设备名称 - // dev_Type: 'PQS882B4',//设备类型 - // dev_Chns: 4, //设备通道数 - // check_Result: '/', //检测结果 - // report_State: '未生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'检测中',//检测状态 - // reCheck_Num: 0, //复检次数 - // }, - // { - // id: '4', //装置序号ID - // name: '模拟装置4', //设备名称 - // dev_Type: 'PQS882B4',//设备类型 - // dev_Chns: 4, //设备通道数 - // check_Result: '不合格', //检测结果 - // report_State: '未生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'检测完成',//检测状态 - // reCheck_Num: 1, //复检次数 - // }, - // { - // id: '5', //装置序号ID - // name: '中电测试装置', //设备名称 - // dev_Type: 'PMC-680M-22-22-00-115ANBC',//设备类型 - // dev_Chns: 4, //设备通道数 - // check_Result: '不合格', //检测结果 - // report_State: '未生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'检测完成',//检测状态 - // reCheck_Num: 1, //复检次数 - // }, - // { - // id: '6', //装置序号ID - // name: '易司拓测试装置1', //设备名称 - // dev_Type: 'E703A',//设备类型 - // dev_Chns: 1, //设备通道数 - // check_Result: '不合格', //检测结果 - // report_State: '已生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'检测完成',//检测状态 - // reCheck_Num: 1, //复检次数 - // }, - // { - // id: '7', //装置序号ID - // name: '易司拓测试装置2', //设备名称 - // dev_Type: 'E703A',//设备类型 - // dev_Chns: 1, //设备通道数 - // check_Result: '不合格', //检测结果 - // report_State: '已生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'检测完成',//检测状态 - // reCheck_Num: 1, //复检次数 - // }, - // { - // id: '8', //装置序号ID - // name: '山大电力测试装置1', //设备名称 - // dev_Type: 'SDL-3002C',//设备类型 - // dev_Chns: 1, //设备通道数 - // check_Result: '不合格', //检测结果 - // report_State: '已生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'检测完成',//检测状态 - // reCheck_Num: 1, //复检次数 - // }, - // { - // id: '9', //装置序号ID - // name: '山大电力测试装置2', //设备名称 - // dev_Type: 'SDL-3002C',//设备类型 - // dev_Chns: 1, //设备通道数 - // check_Result: '不合格', //检测结果 - // report_State: '已生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'检测完成',//检测状态 - // reCheck_Num: 2, //复检次数 - // }, - // { - // id: '10', //装置序号ID - // name: '山大电力测试装置2', //设备名称 - // dev_Type: 'SDL-3002C',//设备类型 - // dev_Chns: 1, //设备通道数 - // check_Result: '不合格', //检测结果 - // report_State: '已生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'检测完成',//检测状态 - // reCheck_Num: 2, //复检次数 - // }, - // { - // id: '11', //装置序号ID - // name: '山大电力测试装置2', //设备名称 - // dev_Type: 'SDL-3002C',//设备类型 - // dev_Chns: 1, //设备通道数 - // check_Result: '不合格', //检测结果 - // report_State: '已生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'检测完成',//检测状态 - // reCheck_Num: 2, //复检次数 - // }, - // { - // id: '12', //装置序号ID - // name: '山大电力测试装置2', //设备名称 - // dev_Type: 'SDL-3002C',//设备类型 - // dev_Chns: 1, //设备通道数 - // check_Result: '不合格', //检测结果 - // report_State: '已生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'检测完成',//检测状态 - // reCheck_Num: 2, //复检次数 - // }, - // { - // id: '13', //装置序号ID - // name: '山大电力测试装置2', //设备名称 - // dev_Type: 'SDL-3002C',//设备类型 - // dev_Chns: 1, //设备通道数 - // check_Result: '不合格', //检测结果 - // report_State: '已生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'检测完成',//检测状态 - // reCheck_Num: 2, //复检次数 - // }, - // { - // id: '14', //装置序号ID - // name: '山大电力测试装置3', //设备名称 - // dev_Type: 'SDL-3002C',//设备类型 - // dev_Chns: 1, //设备通道数 - // check_Result: '不合格', //检测结果 - // report_State: '已生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'检测完成',//检测状态 - // reCheck_Num: 2, //复检次数 - // }, - // { - // id: '15', //装置序号ID - // name: '山大电力测试装置4', //设备名称 - // dev_Type: 'SDL-3002C',//设备类型 - // dev_Chns: 1, //设备通道数 - // check_Result: '不合格', //检测结果 - // report_State: '已生成', //报告状态 - // document_State: '未归档', //归档状态 - // check_State:'检测完成',//检测状态 - // reCheck_Num: 2, //复检次数 - // }, - // ] - export default {data,plan_devicedata} \ No newline at end of file diff --git a/frontend/src/stores/modules/check.ts b/frontend/src/stores/modules/check.ts index 5bbc071..b2f4945 100644 --- a/frontend/src/stores/modules/check.ts +++ b/frontend/src/stores/modules/check.ts @@ -3,25 +3,19 @@ import {CHECK_STORE_KEY} from "@/stores/constant"; import type {CheckData} from "@/api/check/interface"; import type {Plan} from '@/api/plan/interface' import {useAppSceneStore} from "@/stores/modules/mode"; -import { set } from "lodash"; - -const AppSceneStore = useAppSceneStore() -export const useCheckStore = defineStore("check", { - id: CHECK_STORE_KEY, +export const useCheckStore = defineStore(CHECK_STORE_KEY, { state: () => ({ - devices: Array(), - plan: Object(), - selectTestItems: Object({preTest: true, timeTest: false, channelsTest: false, test: true}), - checkType:1, // 0:手动检测 1:自动检测 + devices: [] as CheckData.Device[], + plan: {} as Plan.ResPlan, + selectTestItems: {preTest: true, timeTest: false, channelsTest: false, test: true} as CheckData.SelectTestItem, + checkType: 1, // 0:手动检测 1:自动检测 reCheckType: 1, // 0:不合格项复检 1:全部复检 - showDetailType: 0 ,// 0:数据查询 1:误差体系跟换 2:正式检测 + showDetailType: 0, // 0:数据查询 1:误差体系跟换 2:正式检测 temperature: 0, humidity: 0 }), - getters: {}, - actions: { addDevices(device: CheckData.Device[]) { this.devices.push(...device); @@ -33,8 +27,9 @@ export const useCheckStore = defineStore("check", { this.devices = []; }, initSelectTestItems() { + const appSceneStore = useAppSceneStore() this.selectTestItems.preTest = true - if (AppSceneStore.currentScene === '1') { + if (appSceneStore.currentScene === '1') { this.selectTestItems.channelsTest = true } else { this.selectTestItems.channelsTest = false diff --git a/frontend/src/stores/modules/global.ts b/frontend/src/stores/modules/global.ts index 613b6ae..63d7c07 100644 --- a/frontend/src/stores/modules/global.ts +++ b/frontend/src/stores/modules/global.ts @@ -1,5 +1,5 @@ import { defineStore } from "pinia"; -import { GlobalState } from "@/stores/interface"; +import { type GlobalState } from "@/stores/interface"; import { DEFAULT_PRIMARY} from "@/config"; import piniaPersistConfig from "@/stores/helper/persist"; import {GLOBAL_STORE_KEY} from "@/stores/constant"; @@ -49,7 +49,6 @@ export const useGlobalStore = defineStore({ // Set GlobalState setGlobalState(...args: ObjToKeyValArray) { this.$patch({ [args[0]]: args[1] }); - console.log(DEFAULT_PRIMARY); } }, persist: piniaPersistConfig(GLOBAL_STORE_KEY) diff --git a/frontend/src/views/home/components/channelsTest.vue b/frontend/src/views/home/components/channelsTest.vue deleted file mode 100644 index ba7ad6e..0000000 --- a/frontend/src/views/home/components/channelsTest.vue +++ /dev/null @@ -1,999 +0,0 @@ - - - diff --git a/frontend/src/views/home/components/dataCheckChangeErrSysPopup.vue b/frontend/src/views/home/components/dataCheckChangeErrSysPopup.vue deleted file mode 100644 index ebe9cac..0000000 --- a/frontend/src/views/home/components/dataCheckChangeErrSysPopup.vue +++ /dev/null @@ -1,2017 +0,0 @@ - - - - \ No newline at end of file diff --git a/frontend/src/views/home/components/matchPopup.vue b/frontend/src/views/home/components/matchPopup.vue deleted file mode 100644 index 999ed91..0000000 --- a/frontend/src/views/home/components/matchPopup.vue +++ /dev/null @@ -1,202 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/src/views/home/components/reportPopup.vue b/frontend/src/views/home/components/reportPopup.vue deleted file mode 100644 index 03a0059..0000000 --- a/frontend/src/views/home/components/reportPopup.vue +++ /dev/null @@ -1,154 +0,0 @@ - - - \ No newline at end of file diff --git a/frontend/src/views/home/components/resultPopup.vue b/frontend/src/views/home/components/resultPopup.vue index f324608..e5a0c4b 100644 --- a/frontend/src/views/home/components/resultPopup.vue +++ b/frontend/src/views/home/components/resultPopup.vue @@ -43,7 +43,6 @@ import { useDictStore } from '@/stores/modules/dict' import preTest from './preTest.vue' import timeTest from './timeTest.vue' - import channelsTest from './channelsTest.vue' import DataCheckPopup from './dataCheckPopup.vue'; import { log } from 'console'; diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index 7992634..24d70a8 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -1,312 +1,206 @@ + \ No newline at end of file diff --git a/frontend/src/views/home/tabs/dashboard.vue b/frontend/src/views/home/tabs/dashboard.vue index 73986f0..9d85b4f 100644 --- a/frontend/src/views/home/tabs/dashboard.vue +++ b/frontend/src/views/home/tabs/dashboard.vue @@ -120,7 +120,7 @@ import pie from '@/components/echarts/pie/default.vue' import tree from '../components/tree.vue' import Table from '../components/table.vue' import { getBoundPqDevList, getPlanListByPattern, getPlanList } from '@/api/plan/plan' -import { onBeforeMount, onUnmounted, ref, watch } from 'vue' +import { onBeforeMount, onUnmounted, ref, watch, nextTick } from 'vue' import { useModeStore } from '@/stores/modules/mode' // 引入模式 store import { useDictStore } from '@/stores/modules/dict' import { useViewSize } from '@/hooks/useViewSize' @@ -223,16 +223,25 @@ const tableRef1 = ref() // 主表格组件引用 const currentId = ref('') // 当前选中的计划ID // ============================ 监听器 ============================ +let isUpdatingTabs = false // 防止重复调用的标志 + /** * 监听功能切换并通知表格组件更新配置 * 不再传递静态数据,让表格组件通过API获取真实数据 */ watch( () => form.value.activeTabs, - (newTabs) => { + async (newTabs) => { + if (isUpdatingTabs) return // 如果正在更新中,跳过 + + isUpdatingTabs = true // 只传递功能模式,不传递静态假数据 // 表格组件会根据功能模式通过API获取对应的真实数据 tableRef1.value && tableRef1.value.changeActiveTabs(newTabs) + + // 等待一个微任务队列后重置标志 + await nextTick() + isUpdatingTabs = false } // 去掉 immediate: true,避免初始化时重复调用 ) @@ -662,7 +671,7 @@ const handleBatchGenerate = async () => { // 重新获取饼图数据,deviceData更新后watch会自动触发表格更新 getPieData(currentId.value) - // 移除重复的表格渲染调用 - watch监听器已经处理了这部分逻辑 + // 批量操作后的表格刷新 - 这个调用与watch监听器无关,是通过emit触发的 tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs) } From f59f287b63c21c157b30565372c35c20ebf4e239 Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Thu, 7 Aug 2025 08:55:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/home/components/table.vue | 4 ---- 1 file changed, 4 deletions(-) diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index 24d70a8..832d5e3 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -198,7 +198,6 @@ import { ResultEnum } from '@/enums/httpEnum' const checkStore = useCheckStore() let devNum = 0//当前选取的被检设备数量 let devChannelsNum = 0//当前选择的被检设备通道总数 -let devTestedNum = 0//当前选择的已完成检测的被检设备数量 const tableKey = ref(0) const tableHeight = ref(0) @@ -206,7 +205,6 @@ const dataCheckPopupRef = ref>() const selectTestItemPopupRef = ref>() const writeTHPopupRef = ref>() const deviceConnectionPopupRef = ref>() -const matchDialogVisible = ref(false) const dialogTitle = ref('手动检测') const checkStateTable = ref([0, 1, 2]) const modeStore = useModeStore() @@ -531,7 +529,6 @@ const handleSelectionChange = (selection: any[]) => { } // 统计已完成检测的设备数量 - devTestedNum = selection.filter((item) => item.checkState === 2).length const result = selection.filter((item) => item.checkResult != 0) if (result.length > 0) { testType = 'test' @@ -662,7 +659,6 @@ function refreshStatusList() { // 重置设备选择统计信息 devNum = 0 devChannelsNum = 0 - devTestedNum = 0 // 清空查询表单 form.value.search = null form.value.checkStatus = null//检测状态默认为未检