联调 正式检测结果页面

This commit is contained in:
guanj
2025-08-22 15:33:57 +08:00
parent 959ae1dee9
commit dd9ca8f956
7 changed files with 664 additions and 475 deletions

View File

@@ -40,7 +40,7 @@
<el-table-column
v-for="(chnItem, index2) in checkStore.chnNumList"
:key="`${item.deviceId}${chnItem}`"
:label="'通道' + chnItem.label"
:label="'通道' + chnItem"
align="center"
>
<template #default="{ row }">
@@ -70,7 +70,7 @@
"
:color="row.devices[index1].chnResult[index2].color"
size="small"
@click="handleClick(item, chnItem, row.scriptType)"
@click="handleClick(row, chnItem, row.scriptType)"
style="align-self: center"
>
<el-icon
@@ -329,6 +329,8 @@ watch(
// 失败
if (newValue.data != undefined) return
setLogList('error', str + '失败!')
emit('update:testStatus', 'error')
stopTimeCount()
if (newValue.requestId == 'YJC_xujy') setLogList('info', '初始化失败!')
break
}
@@ -361,17 +363,16 @@ watch(
Object.assign(checkResult, result)
setLogList('info', '检测完成!')
stopTimeCount()
updatePercentage()
break
case 25003:
setLogList('error', '检测失败!')
stopTimeCount()
updatePercentage()
break
default:
if (newValue.code != 10201) {
setLogList(newValue.code == 10200 ? 'info' : 'error', newValue.data)
updatePercentage()
}
break
@@ -382,6 +383,7 @@ watch(
switch (newValue.operateCode) {
case 'Contrast_Dev':
setLogList('error', '设备服务端连接失败!')
stopTimeCount()
break
}
break
@@ -393,6 +395,7 @@ watch(
type: 'error'
})
setLogList('error', '当前流程存在异常结束!')
stopTimeCount()
break
case 'socket_timeout':
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', {
@@ -400,6 +403,7 @@ watch(
type: 'error'
})
setLogList('error', '设备连接异常,请检查设备连接情况!')
stopTimeCount()
break
case 'server_error':
ElMessageBox.alert('服务端主动关闭连接!', '初始化失败', {
@@ -407,6 +411,7 @@ watch(
type: 'error'
})
setLogList('error', '服务端主动关闭连接!')
stopTimeCount()
break
case 'device_error':
ElMessageBox.alert('设备主动关闭连接!', '初始化失败', {
@@ -414,6 +419,7 @@ watch(
type: 'error'
})
setLogList('error', '设备主动关闭连接!')
stopTimeCount()
break
}
},
@@ -501,6 +507,7 @@ const showTestLog = () => {
// 初始化检测脚本数据
const initScriptData = async () => {
scriptData = []
const pattern = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''
let response: any = await getBigTestItem({
reCheckType: checkStore.reCheckType,
@@ -675,41 +682,41 @@ const getResult = (devices: CheckData.DeviceCheckResult[] = []) => {
// 点击查看设备通道检测详情。参数1设备信息参数2通道号-1代表查看全部通道
const handleClick = (item: any, chnNum: number, scriptType: string) => {
// let checkResultItem = checkResult.find(obj => obj.scriptType === scriptType)
// let flag = -1
// if (checkResultItem) {
// let device = checkResultItem.devices.find(obj => obj.deviceId === item.deviceId)
// if (device) {
// let chnResult = device.chnResult
// if (chnNum === -1) {
// if (chnResult.findIndex(obj => obj === CheckData.ChnCheckResultEnum.TIMEOUT) !== -1) {
// flag = 0
// }
// if (chnResult.findIndex(obj => obj === CheckData.ChnCheckResultEnum.ERRORDATA) !== -1) {
// flag = 1
// }
// } else {
// if (chnResult[chnNum - 1] === CheckData.ChnCheckResultEnum.TIMEOUT) {
// flag = 0
// }
// if (chnResult[chnNum - 1] === CheckData.ChnCheckResultEnum.ERRORDATA) {
// flag = 1
// }
// }
// }
// }
let checkResultItem = checkResult.find(obj => obj.scriptType === scriptType)
let flag = -1
if (checkResultItem) {
let device = checkResultItem.devices.find(obj => obj.deviceId === item.deviceId)
if (device) {
let chnResult = device.chnResult
if (chnNum === -1) {
if (chnResult.findIndex(obj => obj === CheckData.ChnCheckResultEnum.TIMEOUT) !== -1) {
flag = 0
}
if (chnResult.findIndex(obj => obj === CheckData.ChnCheckResultEnum.ERRORDATA) !== -1) {
flag = 1
}
} else {
if (chnResult[chnNum - 1] === CheckData.ChnCheckResultEnum.TIMEOUT) {
flag = 0
}
if (chnResult[chnNum - 1] === CheckData.ChnCheckResultEnum.ERRORDATA) {
flag = 1
}
}
}
}
// if (flag === 0) {
// ElMessageBox.alert('连接超时,请检查设备通讯是否正常', '连接超时', {
// confirmButtonText: '确定',
// type: 'warning',
// })
// }
// if (flag === -1 || flag === 1) {
// checkStore.setShowDetailType(2)
console.log('handleTest', item.deviceId, chnNum, scriptType)
dataCheckSingleChannelSingleTestPopupRef.value?.open(item.deviceId, chnNum + '', scriptType)
//}
if (flag === 0) {
ElMessageBox.alert('连接超时,请检查设备通讯是否正常', '连接超时', {
confirmButtonText: '确定',
type: 'warning',
})
}
if (flag === -1 || flag === 1) {
checkStore.setShowDetailType(2)
dataCheckSingleChannelSingleTestPopupRef.value?.open(item, chnNum+'', item.devices[0].deviceId,1)
}
}
const handlePause = () => {
@@ -723,9 +730,9 @@ const initializeParameters = async () => {
await initScriptData()
initDeviceList()
initCheckResult()
percentage.value = 0
timeCount.value = 0
timeView.value = '00:00:00'
testLogList.splice(0, testLogList.length, {
type: 'info',
log: checkStore.selectTestItems.preTest ? '正在检测,请稍等...' : '暂无数据,等待检测开始'
@@ -754,9 +761,10 @@ const handleResumeTest = () => {
}
//
onMounted(() => {
console.log(123123)
initializeParameters()
if (!checkStore.selectTestItems.preTest) {
// 判断是否预检测
initializeParameters()
}
})
defineExpose({