From 50fc02d4eb1838b89f959b463c680ae2470735bf Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Thu, 13 Mar 2025 14:40:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/check/test/index.ts | 14 ++++++++ .../dataCheckSingleChannelSingleTestPopup.vue | 36 +++++++++++++------ 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/frontend/src/api/check/test/index.ts b/frontend/src/api/check/test/index.ts index 6bc5cf2..a14cd62 100644 --- a/frontend/src/api/check/test/index.ts +++ b/frontend/src/api/check/test/index.ts @@ -62,6 +62,20 @@ export const exportRawData = (params: { return http.download("/result/exportRawData", params, {loading: false}); } +/** + * 重新计算 + * @param params + */ +export const reCalculate = (params: { + planId: string, + scriptId: string, + errorSysId: string, + deviceId: string, + code: string +}) => { + return http.post("/result/reCalculate", params, {loading: true}); +} + /** * 更换误差体系 * @param params diff --git a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue index b22eead..b8818d6 100644 --- a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue +++ b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue @@ -28,8 +28,11 @@ - - 报告生成 + + 报告生成 + + + 重新计算 @@ -108,10 +111,10 @@ import DataCheckRawDataTable from './dataCheckRawDataTable.vue' import {CheckData} from "@/api/check/interface"; import {useDictStore} from "@/stores/modules/dict"; import {useCheckStore} from "@/stores/modules/check"; -import {deleteTempTable, exportRawData, getFormData, getTableData, getTreeData} from "@/api/check/test"; +import {changeErrorSystem, deleteTempTable, exportRawData, getFormData, getTableData, getTreeData, reCalculate} from "@/api/check/test"; import {getPqErrSysList} from '@/api/plan/plan' import {useDownload} from "@/hooks/useDownload"; -import {Postcard} from "@element-plus/icons-vue"; +import {Histogram, Postcard} from "@element-plus/icons-vue"; const {appendToBody} = withDefaults(defineProps<{ appendToBody: boolean @@ -216,13 +219,13 @@ const handleNodeClick = async (data: any) => { const handleErrorSysChange = async () => { console.log("切换误差体系", formContent.errorSysId); - // await changeErrorSystem({ - // planId: checkStore.plan.id, - // scriptId: checkStore.plan.scriptId, - // errorSysId: formContent.errorSysId, - // deviceId: deviceId, - // code: parseInt(checkStore.plan.code), - // }) + await changeErrorSystem({ + planId: checkStore.plan.id, + scriptId: checkStore.plan.scriptId, + errorSysId: formContent.errorSysId, + deviceId: deviceId, + code: checkStore.plan.code + '', + }) if (originErrorSysId != formContent.errorSysId) { planCode = checkStore.plan.code + "_temp" } else { @@ -451,6 +454,17 @@ const handleGenerateReport = () => { console.log("生成报告", checkStore.plan.id, deviceId) } +const handleReCalculate = async () => { + await reCalculate({ + planId: checkStore.plan.id, + scriptId: checkStore.plan.scriptId, + errorSysId: formContent.errorSysId, + deviceId: deviceId, + code: checkStore.plan.code + '' + }) + ElMessage.success('重新计算成功!') +} + const close = async () => { //数据清空 Object.assign(formContent, {