From 6de9e22b4c32de27f3d2363d9d0fb0911f7ae71c Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Mon, 13 Jan 2025 22:05:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=90=E6=B3=A2=E6=AC=A1=E6=95=B0=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E6=97=B6=EF=BC=8C=E5=8E=9F=E5=A7=8B=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=BAT=E9=A1=B9NaN=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataCheckSingleChannelSingleTestPopup.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue index 7fab745..67d85dc 100644 --- a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue +++ b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue @@ -167,7 +167,7 @@ const checkResultData = reactive([]) const popoverWidth: ComputedRef = computed(() => { // return `${940 - (currentScriptTypeName.value.length + 7) * 14 - (harmNumList.length || checkList.length ? 160 : 0)}px` - return `${940 - (currentScriptTypeName.value.length + 7) * 14 - (checkList.length ? 230 : 0)}px` + return `${940 - (currentScriptTypeName.value.length + 7) * 14 - (checkList.length ? 220 : 0)}px` }) // 原始数据表格数据 @@ -486,7 +486,7 @@ const formatHarmNum = (num: string) => { } const setRawData = (data: CheckData.RawDataItem[]) => { - console.log("原始数据", data) + data.forEach((item: CheckData.RawDataItem) => { item.dataA = stringToFixed(item.dataA) item.dataB = stringToFixed(item.dataB) @@ -494,6 +494,7 @@ const setRawData = (data: CheckData.RawDataItem[]) => { item.dataT = stringToFixed(item.dataT) }) Object.assign(rawTableData, data) + console.log("原始数据", rawTableData) } const numberToFixed = (num: number): string => { @@ -512,11 +513,16 @@ const stringToFixed = (str: string): string => { if (str == null || str == undefined) { return '/' } else { - let result = Number(str).toFixed(fixed) - if (result === "-0.0000") { - return result.replace(/-/g, "") + let num = Number(str) + if (isNaN(num)) { + return '/' + }else{ + let result = num.toFixed(fixed) + if (result === "-0.0000") { + return result.replace(/-/g, "") + } + return result } - return result } }