diff --git a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue index 8990b6e..28c7d29 100644 --- a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue +++ b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue @@ -237,16 +237,7 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => { watch(currentCheckItem, (newVal, oldVal) => { // console.log("当前检测项", newVal); if (newVal) { - // let key = newVal.toString() === 'Voltage' ? '电压幅值' : '持续时间' - let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(newVal) - setCheckResultData(resCheckResult) - - let tempRawData = resTableData.rawData.get(newVal) - if (tempRawData) { - setRawData(tempRawData) - } else { - setRawData([]) - } + doCurrentCheckItemUpdate(newVal) } activeTab.value = 'resultTab' }) @@ -371,10 +362,12 @@ const updateTableData = async () => { }) } - Object.assign(checkList, tempCheckList) - - currentCheckItem.value = checkList[0].value + if (currentCheckItem.value == tempCheckList[0].value) { + doCurrentCheckItemUpdate(tempCheckList[0].value) + } else { + currentCheckItem.value = tempCheckList[0].value + } } } @@ -385,6 +378,20 @@ const updateTableData = async () => { } } +const doCurrentCheckItemUpdate = (newVal: string)=>{ + let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(newVal) + setCheckResultData(resCheckResult) + + let tempRawData = resTableData.rawData.get(newVal) + if (tempRawData) { + setRawData(tempRawData) + } else { + setRawData([]) + } + + activeTab.value = 'resultTab' +} + const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => { deviceId = _deviceId scriptType = _scriptType