实时数据过了录波状态处理和进度条

This commit is contained in:
sjl
2025-09-12 13:35:29 +08:00
parent cfd8b072dd
commit c78f591baf
2 changed files with 26 additions and 2 deletions

View File

@@ -349,6 +349,7 @@ watch(
// 触发响应式更新 // 触发响应式更新
checkResult.splice(0, 0) checkResult.splice(0, 0)
stopTimeCount() stopTimeCount()
updatePercentage()
break break
} }
} }
@@ -439,6 +440,7 @@ watch(
case 25005: case 25005:
{ {
let result: CheckData.ScriptChnItem[] = [] let result: CheckData.ScriptChnItem[] = []
let message = JSON.parse(newValue.data) let message = JSON.parse(newValue.data)
// 当收到 25005 消息时录波项目开始loading // 当收到 25005 消息时录波项目开始loading
if (newValue.code == 25005) { if (newValue.code == 25005) {
@@ -459,6 +461,7 @@ watch(
scriptName: item.scriptName, scriptName: item.scriptName,
devices: [] devices: []
} }
// 特殊处理录波项目 - 如果是25005消息且当前项目是录波项目则使用已设置的状态 // 特殊处理录波项目 - 如果是25005消息且当前项目是录波项目则使用已设置的状态
if (newValue.code == 25005 && item.code === 'wave_data') { if (newValue.code == 25005 && item.code === 'wave_data') {
const existingWaveItem = checkResult.find(checkItem => checkItem.scriptType === 'wave_data') const existingWaveItem = checkResult.find(checkItem => checkItem.scriptType === 'wave_data')
@@ -474,9 +477,28 @@ watch(
deviceName: msg.deviceName, deviceName: msg.deviceName,
chnResult: msg.chnResult chnResult: msg.chnResult
})) }))
// 添加匹配到的设备 // 添加匹配到的设备
temp.devices.push(...matchedDevices) temp.devices.push(...matchedDevices)
// 对于未匹配到的设备,也要添加占位符(特别是录波项目)
if (item.code === 'wave_data') {
deviceList.forEach(device => {
const isDeviceExist = matchedDevices.some((matchedDevice: any) => matchedDevice.deviceId === device.deviceId)
if (!isDeviceExist) {
// 对于录波项目或未匹配到的设备,添加默认状态
temp.devices.push({
deviceId: device.deviceId,
deviceName: device.deviceName,
chnResult: new Array(checkStore.chnNumList.length).fill(
item.code === 'wave_data' ?
CheckData.ChnCheckResultEnum.UNKNOWN :
CheckData.ChnCheckResultEnum.UNKNOWN
)
})
}
})
}
} }
result.push(temp) result.push(temp)
}) })

View File

@@ -98,10 +98,12 @@
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.code || ''" :value="item.code || ''"
:disabled="(selectByMode && planType == 0) || allDisabled" :disabled="(selectByMode && planType == 0) || allDisabled">
</el-option>
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="!selectByMode" :label-width="110" label="检测脚本" prop="scriptId"> <el-form-item v-if="!selectByMode" :label-width="110" label="检测脚本" prop="scriptId">
<el-select <el-select
v-model="formContent.scriptId" v-model="formContent.scriptId"