修复数据查询弹窗,左侧切换,检测项目切换时,数据错误

This commit is contained in:
caozehui
2025-01-14 16:16:30 +08:00
parent fa1cb02a51
commit fcd8c1a0dd

View File

@@ -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