This commit is contained in:
sjl
2025-10-21 10:43:27 +08:00
parent f1b76376c6
commit b2db5622bc
8 changed files with 96 additions and 47 deletions

View File

@@ -285,7 +285,7 @@ watch(testStatus, function (newValue, oldValue) {
startData.value = new Date()
timeDifference.value = 0
} else if (newValue == 'error') {
stopTimeCount()
stopTimeCount(0)
}
})
@@ -300,13 +300,14 @@ watch(
break
case 25002:
setLogList('error', newValue.data)
stopTimeCount(0)
break
case 25003:
ElMessageBox.alert('录波数据异常!', {
ElMessageBox.alert('录波数据异常!','检测失败',{
confirmButtonText: '确定',
type: 'error'
})
stopTimeCount()
stopTimeCount(0)
break
case 25001: {
// 当录波校验完成时,更新录波项目的按钮状态
@@ -345,7 +346,7 @@ watch(
}
// 触发响应式更新
checkResult.splice(0, 0)
stopTimeCount()
stopTimeCount(1)
updatePercentage()
break
}
@@ -355,13 +356,14 @@ watch(
switch (newValue.code) {
case 25002:
setLogList('error', newValue.data)
stopTimeCount(0)
break
case 25003:
ElMessageBox.alert('闪变收集失败!', {
ElMessageBox.alert('闪变收集失败!','检测失败', {
confirmButtonText: '确定',
type: 'error'
})
stopTimeCount()
stopTimeCount(0)
break
case 25001: {
// 当录波校验完成时,更新录波项目的按钮状态
@@ -394,7 +396,7 @@ watch(
}
// 触发响应式更新
checkResult.splice(0, 0)
stopTimeCount()
stopTimeCount(1)
updatePercentage()
break
}
@@ -412,18 +414,19 @@ watch(
device.chnResult.fill(CheckData.ChnCheckResultEnum.UNKNOWN)
})
}
stopTimeCount()
stopTimeCount(0)
break
}
case 'connect':
switch (newValue.operateCode) {
case 'Contrast_Dev':
setLogList('error', '设备服务端连接失败!')
stopTimeCount()
stopTimeCount(0)
break
}
break
case 'unknown_operate':
stopTimeCount(0)
break
case 'error_flow_end':
ElMessageBox.alert(`当前流程存在异常结束!`, '检测失败', {
@@ -431,7 +434,7 @@ watch(
type: 'error'
})
setLogList('error', '当前流程存在异常结束!')
stopTimeCount()
stopTimeCount(0)
break
case 'socket_timeout':
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', {
@@ -439,7 +442,7 @@ watch(
type: 'error'
})
setLogList('error', '设备连接异常,请检查设备连接情况!')
stopTimeCount()
stopTimeCount(0)
break
case 'server_error':
ElMessageBox.alert('服务端主动关闭连接!', '初始化失败', {
@@ -447,7 +450,7 @@ watch(
type: 'error'
})
setLogList('error', '服务端主动关闭连接!')
stopTimeCount()
stopTimeCount(0)
break
case 'device_error':
ElMessageBox.alert('设备主动关闭连接!', '初始化失败', {
@@ -455,12 +458,12 @@ watch(
type: 'error'
})
setLogList('error', '设备主动关闭连接!')
stopTimeCount()
stopTimeCount(0)
break
case 'yjc_xyjy' :
if(newValue.code == 10550){
setLogList('error', '协议校验时,设备连接异常!')
stopTimeCount()
stopTimeCount(0)
}
if (newValue.code == 10552) {
ElMessageBox.alert('重复的初始化操作!', '检测失败', {
@@ -468,7 +471,7 @@ watch(
type: 'error',
})
setLogList('error', '重复的初始化操作!')
stopTimeCount()
stopTimeCount(0)
}
break;
case 'yjc_sbtxjy' :
@@ -478,7 +481,7 @@ watch(
type: 'error',
})
setLogList('error', '重复的初始化操作!')
stopTimeCount()
stopTimeCount(0)
}
break;
}
@@ -509,15 +512,12 @@ watch(
// 失败
if (newValue.data != undefined) return
setLogList('error', str + '失败!')
emit('update:testStatus', 'error')
stopTimeCount()
stopTimeCount(0)
if (newValue.requestId == 'YJC_xujy') setLogList('info', '初始化失败!')
break
case 10550:
setLogList('error', str +'时,设备连接异常!')
emit('update:testStatus', 'error')
stopTimeCount()
stopTimeCount(0)
break
}
@@ -621,7 +621,7 @@ watch(
if (newValue.code == 25001) {
setLogList('info', '检测完成!')
stopTimeCount()
stopTimeCount(1)
updatePercentage()
}
if(newValue.code == 25005){
@@ -634,12 +634,12 @@ watch(
}
case 25003:
setLogList('error', '检测失败!')
stopTimeCount()
stopTimeCount(0)
updatePercentage()
break
case 10550:
setLogList('error', '设备连接异常!')
stopTimeCount()
stopTimeCount(0)
updatePercentage()
break
default:
@@ -682,7 +682,7 @@ const updatePercentage = async () => {
// planCode: checkStore.plan.code + ''
// })
}
stopTimeCount()
stopTimeCount(1)
ElMessageBox.alert(
'检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作',
'检测完成',
@@ -712,10 +712,14 @@ const startTimeCount = () => {
}
// 停止计时
const stopTimeCount = () => {
const stopTimeCount = (type: number) => {
if (timer) {
clearInterval(timer)
timer = null
if(type === 0){
emit('update:testStatus', 'error')
}
}
}
@@ -977,9 +981,7 @@ defineExpose({
transform: rotate(360deg);
}
}
</style>
<style lang="scss" scoped>
:deep(.el-button--small) {
height: 20px !important;
width: 20px !important;