diff --git a/frontend/src/api/check/test/index.ts b/frontend/src/api/check/test/index.ts index f22943c..4461508 100644 --- a/frontend/src/api/check/test/index.ts +++ b/frontend/src/api/check/test/index.ts @@ -72,7 +72,7 @@ export const exportRawData = (params: { } /** - * 数模式重新计算 + * 重新计算 * @param params */ export const reCalculate = (params: { @@ -87,21 +87,6 @@ export const reCalculate = (params: { return http.post('/result/reCalculate', params, {loading: true}) } -/** - * 比对式重新计算 - * @param params - */ -export const reCalculate2 = (params: { - planId: string - deviceId: string - errorSysId: string - code: string - patternId: string - -}) => { - return http.post('/result/reCalculate', params, {loading: true}) -} - /** * 获取数据获取基本信息 * @param params diff --git a/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue b/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue index 5523c93..784f12c 100644 --- a/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue +++ b/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue @@ -18,6 +18,7 @@ v-model="formContent.errorSysId" placeholder="请选择误差体系" autocomplete="off" + @change="handleErrorSysChange" > { getResults('wave_data') } -const close = () => { +const close = async () => { visible.value = false formContent.num = '' // 可以在这里添加其他清理逻辑 + if (checkStore.showDetailType === 1) { + await deleteTempTable(checkStore.plan.code + '') + } } - -const handleReCalculate = async () => { - reCalculate2({ +const handleErrorSysChange = async () => { + console.log("切换误差体系", formContent.errorSysId); + changeErrorSystem({ planId: checkStore.plan.id, + scriptId: '', errorSysId: formContent.errorSysId, deviceId: formContent.deviceId, code: checkStore.plan.code + '', patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? '', }).then((res) => { - ElMessage.success('重新计算成功!') - handleChnNumChange(formContent.chnNum) + if (res.code === ResultEnum.SUCCESS) { + ElMessage.success('切换误差体系成功') + handleChnNumChange(formContent.chnNum) + } + }) +} + + + +const handleReCalculate = async () => { + reCalculate({ + planId: checkStore.plan.id, + scriptId: '', + errorSysId: formContent.errorSysId, + deviceId: formContent.deviceId, + code: checkStore.plan.code + '', + patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? '', + }).then((res) => { + if (res.code === ResultEnum.SUCCESS) { + ElMessage.success('重新计算成功!') + handleChnNumChange(formContent.chnNum) + } + }) }