From d7cfe665e21d5064a99f6c6d021955a9250d666b Mon Sep 17 00:00:00 2001 From: sjl <1716605279@qq.com> Date: Tue, 9 Sep 2025 09:14:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=95=E6=B3=A2=E6=95=B0=E6=8D=AE=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/check/test/index.ts | 5 + ...eDataCheckSingleChannelSingleTestPopup.vue | 80 +++++++++++-- .../src/views/home/components/compareTest.vue | 112 ++++++++++++++++-- 3 files changed, 180 insertions(+), 17 deletions(-) diff --git a/frontend/src/api/check/test/index.ts b/frontend/src/api/check/test/index.ts index 92eeda9..6df8cd5 100644 --- a/frontend/src/api/check/test/index.ts +++ b/frontend/src/api/check/test/index.ts @@ -74,6 +74,7 @@ export const reCalculate = (params: { deviceId: string code: string patternId: string + }) => { return http.post('/result/reCalculate', params, {loading: true}) } @@ -87,6 +88,8 @@ export const getContrastFormContent = (params: { deviceId: string chnNum: string num: number | null + // waveNum: number | null + // isWave: boolean }) => { return http.post('/result/getContrastFormContent', params, {loading: false}) } @@ -100,6 +103,8 @@ export const getContrastResult = (params: { deviceId: string chnNum: string | number num: number | string | null + waveNum: number | null + isWave: boolean }) => { return http.post('/result/getContrastResult', params, {loading: true}) } diff --git a/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue b/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue index fdeb76d..527730b 100644 --- a/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue +++ b/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue @@ -69,14 +69,43 @@ />
-
+
当前检测项目: - {{ rowList.scriptName }} + + + + + + {{ rowList.scriptName }}
+ + + + + ([]) +// 添加处理scriptName变化的方法 +const handleScriptNameChange = (value: string) => { + rowList.value.scriptName = value + // 查找选中项的scriptType + const selectedItem = scriptData.value.find(item => item.scriptName === value) + if (selectedItem) { + rowList.value.scriptType = selectedItem.id + getResults('wave_data') + } +} // 表单数据 const formContent = reactive({ scriptName: '', @@ -244,7 +288,7 @@ const getBasicInformation = async () => { scriptType: rowList.value.scriptType, deviceId: formContent.deviceId, chnNum: formContent.chnNum, - num: formContent.num == '' ? null : parseInt(formContent.num) + num: formContent.num == '' ? null : parseInt(formContent.num), }).then((res: any) => { formContent.dataRule = res.data.dataRule formContent.deviceName = res.data.deviceName @@ -257,19 +301,35 @@ const getBasicInformation = async () => { } chnList.value = chnMap formContent.chnNum = formContent.chnNum == null ? chnList.value[0] : formContent.chnNum + waveNumCount.value = res.data.waveNumTotal // 查询表格数据 - getResults() + getResults('') }) } // 左边树变化 const handleNodeClick = (data: any) => { + console.log('data', data) rowList.value.scriptName = data.scriptName rowList.value.scriptType = data.id - getResults() + + // 判断是否为录波数据 + if (data.code === 'wave_data') { + isWaveData.value = true + // 过滤掉"录波"选项,设置下拉框数据 + scriptNameOptions.value = scriptData.value + .filter(item => item.code !== 'wave_data') + .map(item => ({ + label: item.scriptName, + value: item.scriptName + })) + } else { + isWaveData.value = false + getResults(data.code) + } } // 获取结果 -const getResults = async () => { +const getResults = async (code: any) => { checkResultData.value = [] rawTableData.value = [] @@ -278,7 +338,9 @@ const getResults = async () => { scriptType: rowList.value.scriptType, deviceId: formContent.deviceId, chnNum: formContent.chnNum, - num: formContent.num == '' ? null : formContent.num + num: formContent.num == '' ? null : formContent.num, + waveNum: code == 'wave_data' ? null : 0 , + isWave: code == 'wave_data' ? true : false }).then((res: any) => { let list: string[] = [] for (let key in res.data.resultMap) { diff --git a/frontend/src/views/home/components/compareTest.vue b/frontend/src/views/home/components/compareTest.vue index cf9f18f..6f90ea5 100644 --- a/frontend/src/views/home/components/compareTest.vue +++ b/frontend/src/views/home/components/compareTest.vue @@ -122,7 +122,7 @@