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

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) => { watch(currentCheckItem, (newVal, oldVal) => {
// console.log("当前检测项", newVal); // console.log("当前检测项", newVal);
if (newVal) { if (newVal) {
// let key = newVal.toString() === 'Voltage' ? '电压幅值' : '持续时间' doCurrentCheckItemUpdate(newVal)
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' activeTab.value = 'resultTab'
}) })
@@ -371,10 +362,12 @@ const updateTableData = async () => {
}) })
} }
Object.assign(checkList, tempCheckList) Object.assign(checkList, tempCheckList)
if (currentCheckItem.value == tempCheckList[0].value) {
currentCheckItem.value = checkList[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) => { const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => {
deviceId = _deviceId deviceId = _deviceId
scriptType = _scriptType scriptType = _scriptType