icd校验

This commit is contained in:
caozehui
2025-04-14 13:22:46 +08:00
parent 1853152138
commit ecec9adeea
4 changed files with 948 additions and 896 deletions

View File

@@ -233,338 +233,348 @@ const webMsgSend = toRef(props, 'webMsgSend');
const ts = ref('');
watch(webMsgSend, function (newValue, oldValue) {
// console.log(newValue)
switch (newValue.requestId) {
case 'yjc_ytxjy':
switch (newValue.operateCode) {
case 'INIT_GATHER':
if (newValue.code == 10200) {
step1InitLog.value.push({
type: 'info',
log: '源初始化成功!',
})
activeIndex.value = 1
step1.value = 'success'
step2.value = 'process'
} else if (newValue.code == 10201) {
step1.value = 'process'
step1InitLog.value = [{
type: 'wait',
log: '正在进行源初始化!',
}];
} else if (newValue.code == 10552) {
ElMessage.error(newValue.code)
step1.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 10523) {
step1.value = 'error'
ts.value = 'error'
step5.value = 'error'
step1InitLog.value = [{
type: 'error',
log: '源连接失败!',
}];
} else if (newValue.code == -1) {
step1.value = 'error'
ts.value = 'error'
step5.value = 'error'
step1InitLog.value = [{
type: 'error',
log: '源未知异常!',
}];
}
break;
}
break;
case 'yjc_sbtxjy':
switch (newValue.operateCode) {
case 'INIT_GATHER$01':
if (newValue.code == 10200) {
step2InitLog.value.push({
type: 'info',
log: newValue.data + '设备通讯校验成功!',
})
} else if (newValue.code == 10201) {
step2.value = 'process'
step2InitLog.value = [{
type: 'wait',
log: '正在进行设备通讯校验.....',
}];
} else if (newValue.code == 10550) {
step2InitLog.value.push({
type: 'error',
log: newValue.data + '设备连接异常!',
})
step2.value = 'error'
// ts.value = 'error'
// step5.value = 'error'
} else if (newValue.code == 10551) {
step2InitLog.value.push({
type: 'error',
log: newValue.data + '设备触发报告异常!',
})
step2.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 10552) {
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
step2InitLog.value = [{
type: 'wait',
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
}];
step2.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 25001) {
activeIndex.value = 2
step2.value = 'success'
step3.value = 'process'
}
break;
}
break;
case 'yjc_xyjy':
switch (newValue.operateCode) {
case 'INIT_GATHER$01':
if (newValue.code == 10200) {
step3InitLog.value.push({
type: 'info',
log: '统计数据协议校验:' + newValue.data + '通讯协议校验成功!',
})
} else if (newValue.code == 10201) {
step3.value = 'process'
step3InitLog.value = [{
type: 'wait',
log: '正在进行通讯协议校验.....',
}];
} else if (newValue.code == 10550) {
step3InitLog.value.push({
type: 'error',
log: newValue.data + '设备连接异常!',
})
step3.value = 'error'
// ts.value = 'error'
// step5.value = 'error'
} else if (newValue.code == 10551) {
step3InitLog.value.push({
type: 'error',
log: newValue.data + '设备触发报告异常!',
})
step3.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 10552) {
step3.value = 'error'
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
step3InitLog.value = [{
type: 'wait',
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
}];
ts.value = 'error'
step5.value = 'error'
}
break;
case 'INIT_GATHER$02':
if (newValue.code == 10200) {
step3InitLog.value.push({
type: 'info',
log: '实时数据协议校验:' + newValue.data + '通讯协议校验成功!',
})
} else if (newValue.code == 10201) {
step3.value = 'process'
step3InitLog.value = [{
type: 'wait',
log: '正在进行通讯协议校验.....',
}];
} else if (newValue.code == 10550) {
step3InitLog.value.push({
type: 'error',
log: newValue.data + '设备连接异常!',
})
step3.value = 'error'
// ts.value = 'error'
// step5.value = 'error'
} else if (newValue.code == 10551) {
step3InitLog.value.push({
type: 'error',
log: newValue.data + '设备触发报告异常!',
})
step3.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 10552) {
step3.value = 'error'
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
step3InitLog.value = [{
type: 'wait',
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
}];
ts.value = 'error'
step5.value = 'error'
}
break;
case 'INIT_GATHER$03':
if (newValue.code == 10200) {
step3InitLog.value.push({
type: 'info',
log: '暂态数据协议校验:' + newValue.data + '通讯协议校验成功!',
})
} else if (newValue.code == 10201) {
step3.value = 'process'
} else if (newValue.code == 10550) {
step3InitLog.value.push({
type: 'error',
log: newValue.data + '设备连接异常!',
})
step3.value = 'error'
// ts.value = 'error'
// step5.value = 'error'
} else if (newValue.code == 10551) {
step3InitLog.value.push({
type: 'error',
log: newValue.data + '设备触发报告异常!',
})
step3.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 10552) {
//ElMessage.error("当前步骤已经初始化,执行自动关闭,请重新发起检测!")
step3.value = 'error'
step3InitLog.value = [{
type: 'wait',
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
}];
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 25001) {
activeIndex.value = 3
step3.value = 'success'
step4.value = 'process'
}
break;
}
break;
case 'YJC_xujy':
switch (newValue.operateCode) {
case 'OPER_GATHER':
if (newValue.code == 10200) {
step4InitLog.value.push({
type: 'info',
log: '源参数下发成功,等待校验中.....',
})
} else if (newValue.code == 10201) {
step4.value = 'process'
step4InitLog.value = [{
type: 'wait',
log: '源参数下发中.....',
}];
} else if (newValue.code == 10552) {
ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
step4.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 10520) {
step4.value = 'error'
step4InitLog.value.push({
type: 'error',
log: '解析报文异常',
})
ts.value = 'error'
step5.value = 'error'
}
break;
case 'DATA_REQUEST$02':
if (newValue.code == 10200) {
let type = 'info'
if (newValue.data.includes('不合格')) {
type = 'error'
if (testStatus.value !== 'waiting') {
switch (newValue.requestId) {
case 'yjc_ytxjy':
switch (newValue.operateCode) {
case 'INIT_GATHER':
if (newValue.code == 10200) {
step1InitLog.value.push({
type: 'info',
log: '源初始化成功!',
})
activeIndex.value = 1
step1.value = 'success'
step2.value = 'process'
} else if (newValue.code == 10201) {
step1.value = 'process'
step1InitLog.value = [{
type: 'wait',
log: '正在进行源初始化!',
}];
} else if (newValue.code == 10552) {
ElMessage.error(newValue.code)
step1.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 10523) {
step1.value = 'error'
ts.value = 'error'
step5.value = 'error'
step1InitLog.value = [{
type: 'error',
log: '源连接失败!',
}];
} else if (newValue.code == -1) {
step1.value = 'error'
ts.value = 'error'
step5.value = 'error'
step1InitLog.value = [{
type: 'error',
log: '源未知异常!',
}];
}
break;
newValue.data.split('<br/>')
step4InitLog.value.push({
type: type,
log:newValue.data,
})
} else if (newValue.code == 10201) {
step4.value = 'process'
step4InitLog.value = [{
type: 'wait',
log: '获取数据相序校验数据!',
}];
} else if (newValue.code == 25003) {
step4.value = 'error'
step4InitLog.value.push({
}
break;
case 'yjc_sbtxjy':
switch (newValue.operateCode) {
case 'INIT_GATHER$01':
if (newValue.code == 10200) {
step2InitLog.value.push({
type: 'info',
log: newValue.data + '设备通讯校验成功!',
})
} else if (newValue.code == 10201) {
step2.value = 'process'
step2InitLog.value = [{
type: 'wait',
log: '正在进行设备通讯校验.....',
}];
} else if (newValue.code == 10550) {
step2InitLog.value.push({
type: 'error',
log: newValue.data + '设备连接异常!',
})
step2.value = 'error'
// ts.value = 'error'
// step5.value = 'error'
} else if (newValue.code == 10551) {
step2InitLog.value.push({
type: 'error',
log: newValue.data + '设备触发报告异常!',
})
step2.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 10552) {
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
step2InitLog.value = [{
type: 'wait',
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
}];
step2.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 25001) {
activeIndex.value = 2
step2.value = 'success'
step3.value = 'process'
}
break;
}
break;
case 'yjc_xyjy':
switch (newValue.operateCode) {
case 'INIT_GATHER$01':
if (newValue.code == 10200) {
step3InitLog.value.push({
type: 'info',
log: '统计数据协议校验:' + newValue.data + '通讯协议校验成功!',
})
} else if (newValue.code == 10201) {
step3.value = 'process'
step3InitLog.value = [{
type: 'wait',
log: '正在进行通讯协议校验.....',
}];
} else if (newValue.code == 10550) {
step3InitLog.value.push({
type: 'error',
log: newValue.data + '设备连接异常!',
})
step3.value = 'error'
// ts.value = 'error'
// step5.value = 'error'
} else if (newValue.code == 10551) {
step3InitLog.value.push({
type: 'error',
log: newValue.data + '设备触发报告异常!',
})
step3.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 10552) {
step3.value = 'error'
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
step3InitLog.value = [{
type: 'wait',
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
}];
ts.value = 'error'
step5.value = 'error'
}
break;
case 'INIT_GATHER$02':
if (newValue.code == 10200) {
step3InitLog.value.push({
type: 'info',
log: '实时数据协议校验:' + newValue.data + '通讯协议校验成功!',
})
} else if (newValue.code == 10201) {
step3.value = 'process'
step3InitLog.value = [{
type: 'wait',
log: '正在进行通讯协议校验.....',
}];
} else if (newValue.code == 10550) {
step3InitLog.value.push({
type: 'error',
log: newValue.data + '设备连接异常!',
})
step3.value = 'error'
// ts.value = 'error'
// step5.value = 'error'
} else if (newValue.code == 10551) {
step3InitLog.value.push({
type: 'error',
log: newValue.data + '设备触发报告异常!',
})
step3.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 10552) {
step3.value = 'error'
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
step3InitLog.value = [{
type: 'wait',
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
}];
ts.value = 'error'
step5.value = 'error'
}
break;
case 'INIT_GATHER$03':
if (newValue.code == 10200) {
step3InitLog.value.push({
type: 'info',
log: '暂态数据协议校验:' + newValue.data + '通讯协议校验成功!',
})
} else if (newValue.code == 10201) {
step3.value = 'process'
} else if (newValue.code == 10550) {
step3InitLog.value.push({
type: 'error',
log: newValue.data + '设备连接异常!',
})
step3.value = 'error'
// ts.value = 'error'
// step5.value = 'error'
} else if (newValue.code == 10551) {
step3InitLog.value.push({
type: 'error',
log: newValue.data + '设备触发报告异常!',
})
step3.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 10552) {
//ElMessage.error("当前步骤已经初始化,执行自动关闭,请重新发起检测!")
step3.value = 'error'
step3InitLog.value = [{
type: 'wait',
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
}];
ts.value = 'error'
step5.value = 'error'
}
break;
case 'VERIFY_MAPPING$01':
if (newValue.code == 25001) {
activeIndex.value = 3
step3.value = 'success'
step4.value = 'process'
} else if (newValue.code == 10200) {
let data = JSON.parse(newValue.data)
step3InitLog.value.push({
type: 'error',
log: `脚本与icd检验失败! icd名称${data['icdType']} -> 校验项:${data['dataType']}`,
})
step3.value = 'error'
ts.value = 'error'
step5.value = 'error'
}
break;
}
break;
case 'YJC_xujy':
switch (newValue.operateCode) {
case 'OPER_GATHER':
if (newValue.code == 10200) {
step4InitLog.value.push({
type: 'info',
log: '源参数下发成功,等待校验中.....',
})
} else if (newValue.code == 10201) {
step4.value = 'process'
step4InitLog.value = [{
type: 'wait',
log: '源参数下发中.....',
}];
} else if (newValue.code == 10552) {
ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
step4.value = 'error'
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 10520) {
step4.value = 'error'
step4InitLog.value.push({
type: 'error',
log: '解析报文异常',
})
ts.value = 'error'
step5.value = 'error'
}
break;
case 'DATA_REQUEST$02':
if (newValue.code == 10200) {
let type = 'info'
if (newValue.data.includes('不合格')) {
type = 'error'
}
newValue.data.split('<br/>')
step4InitLog.value.push({
type: type,
log: newValue.data,
})
} else if (newValue.code == 10201) {
step4.value = 'process'
step4InitLog.value = [{
type: 'wait',
log: '获取数据相序校验数据!',
}];
} else if (newValue.code == 25003) {
step4.value = 'error'
step4InitLog.value.push({
type: 'error',
log: '相序校验未通过!',
})
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 25001) {
step4.value = 'success'
step5.value = 'success'
step4InitLog.value.push({
type: 'wait',
log: '相序校验成功!',
})
}
activeIndex.value = 5
ts.value = 'success'
console.log("@@@@", ts.value)
break
}
break;
case 'quit':
break;
case 'connect':
switch (newValue.operateCode) {
case "Source":
step1.value = 'error'
step1InitLog.value = [{
type: 'error',
log: '相序校验未通过!',
})
log: '源服务端连接失败!',
}];
ts.value = 'error'
step5.value = 'error'
} else if (newValue.code == 25001) {
step4.value = 'success'
step5.value = 'success'
step4InitLog.value.push({
type: 'wait',
log: '相序校验成功!',
})
}
activeIndex.value = 5
ts.value = 'success'
console.log("@@@@",ts.value)
break
}
break;
case "Dev":
step2.value = 'error'
step2InitLog.value = [{
type: 'error',
log: '设备服务端连接失败!',
}];
ts.value = 'error'
step5.value = 'error'
break;
}
break;
case 'unknown_operate':
break;
case 'quit':
break;
case 'connect':
switch (newValue.operateCode) {
case "Source":
step1.value = 'error'
step1InitLog.value = [{
type: 'error',
log: '源服务端连接失败!',
}];
ts.value = 'error'
step5.value = 'error'
break;
case "Dev":
step2.value = 'error'
step2InitLog.value = [{
type: 'error',
log: '设备服务端连接失败!',
}];
ts.value = 'error'
step5.value = 'error'
break;
}
break;
case 'unknown_operate':
break;
case 'error_flow_end':
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', {
confirmButtonText: '确定',
type: 'error',
})
ts.value = 'error'
step5.value = 'error'
break;
break;
case 'error_flow_end':
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', {
confirmButtonText: '确定',
type: 'error',
})
ts.value = 'error'
step5.value = 'error'
break;
}
}
})
watch(activeIndex, function (newValue, oldValue) {