diff --git a/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue b/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue index 7737ef2..7bec915 100644 --- a/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue +++ b/frontend/src/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue @@ -34,7 +34,7 @@ - + @@ -305,7 +305,7 @@ const getBasicInformation = async () => { formContent.deviceName = res.data.deviceName formContent.errorSysId = res.data.errorSysId chnMapList.value = res.data.chnMap - formContent.num = res.data.checkNum + //formContent.num = res.data.checkNum let chnMap: string[] = [] for (let key in res.data.chnMap) { @@ -313,6 +313,12 @@ const getBasicInformation = async () => { } chnList.value = chnMap formContent.chnNum = formContent.chnNum == null ? chnList.value[0] : formContent.chnNum + // 新增:设置检测次数默认值为chnMap数组的最后一位 + if (chnMapList.value[formContent.chnNum] && chnMapList.value[formContent.chnNum].length > 0) { + // 获取当前通道号对应的检测次数数组,并设置为最后一个值(最大值) + const numList = chnMapList.value[formContent.chnNum] + formContent.num = numList[numList.length - 1] + } waveNumCount.value = res.data.waveNumTotal // 查询表格数据 @@ -343,6 +349,24 @@ const getBasicInformation = async () => { }) } + +const handleChnNumChange = (value: string) => { + formContent.chnNum = value + // 更新检测次数为当前通道的最后一条记录 + updateCheckNumForChn(value) + // 获取结果数据 + getResults('') +} + +// 更新检测次数为指定通道的最后一条记录 +const updateCheckNumForChn = (chnNum: string) => { + if (chnMapList.value[chnNum] && chnMapList.value[chnNum].length > 0) { + // 获取当前通道号对应的检测次数数组,并设置为最后一个值(最大值) + const numList = chnMapList.value[chnNum] + formContent.num = numList[numList.length - 1] + } +} + // 左边树变化 const handleNodeClick = (data: any) => { rowList.value.scriptName = data.scriptName @@ -377,17 +401,22 @@ const handleNodeClick = (data: any) => { } // 获取结果 const getResults = async (code: any) => { + console.log('getResults', code) checkResultData.value = [] rawTableData.value = [] + + // 判断是否为录波数据请求 + const isWaveDataRequest = code === 'wave_data' || isWaveData.value + getContrastResult({ planId: checkStore.plan.id, scriptType: rowList.value.scriptType, deviceId: formContent.deviceId, chnNum: formContent.chnNum, num: formContent.num == '' ? null : formContent.num, - waveNum: code == 'wave_data' ? waveNumber.value : null, - isWave: code == 'wave_data' ? true : false , + waveNum: isWaveDataRequest ? waveNumber.value : null, + isWave: isWaveDataRequest , patternId: pattern.value }).then((res: any) => { let list: string[] = []