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

@@ -304,6 +304,20 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
} }
break; break;
case 'yjc_xyjy':
switch (newValue.operateCode) {
case 'VERIFY_MAPPING$01':
if (newValue.code == 10200) {
let data = JSON.parse(newValue.data)
ElMessageBox.alert(`脚本与icd检验失败! icd名称${data['icdType']} -> 校验项:${data['dataType']}`, '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
}
break;
}
break;
case 'Coefficient_Check': case 'Coefficient_Check':
console.log("Coefficient_Checkactive", active.value); console.log("Coefficient_Checkactive", active.value);
switch (newValue.operateCode) { switch (newValue.operateCode) {

View File

@@ -189,6 +189,7 @@ watch(testStatus, function (newValue, oldValue) {
watch(webMsgSend, function (newValue, oldValue) { watch(webMsgSend, function (newValue, oldValue) {
console.log('webMsgSend---code', newValue.code) console.log('webMsgSend---code', newValue.code)
console.log('webMsgSend---requestId', newValue.requestId) console.log('webMsgSend---requestId', newValue.requestId)
if (testStatus.value !== 'waiting') {
if (newValue.code == 10520) { if (newValue.code == 10520) {
ElMessageBox.alert('报文解析异常!', '初始化失败', { ElMessageBox.alert('报文解析异常!', '初始化失败', {
confirmButtonText: '确定', confirmButtonText: '确定',
@@ -344,6 +345,20 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
} }
break; break;
case 'yjc_xyjy':
switch (newValue.operateCode) {
case 'VERIFY_MAPPING$01':
if (newValue.code == 10200) {
let data = JSON.parse(newValue.data)
ElMessageBox.alert(`脚本与icd校验失败icd名称${data['icdType']} -> 校验项:${data['dataType']}`, '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
}
break;
}
break;
case 'Coefficient_Check': case 'Coefficient_Check':
console.log("Coefficient_Checkactive", active.value); console.log("Coefficient_Checkactive", active.value);
switch (newValue.operateCode) { switch (newValue.operateCode) {
@@ -406,7 +421,7 @@ watch(webMsgSend, function (newValue, oldValue) {
switch (newValue.operateCode) { switch (newValue.operateCode) {
case 'DATA_CHNFACTOR$02'://表格 case 'DATA_CHNFACTOR$02'://表格
// 输出 key 为 0 的数组中的第一条 ChannelsTest.CoefficientVO 对象 // 输出 key 为 0 的数组中的第一条 ChannelsTest.CoefficientVO 对象
console.log('表格',name.value) console.log('表格', name.value)
for (let i = 0; i < name.value.length; i++) { for (let i = 0; i < name.value.length; i++) {
const targetArrayRef = tableDataMap.get(i); const targetArrayRef = tableDataMap.get(i);
if (targetArrayRef) { if (targetArrayRef) {
@@ -474,13 +489,13 @@ watch(webMsgSend, function (newValue, oldValue) {
console.log(newValue.data.devName + '对象:', firstCoefficientVO); console.log(newValue.data.devName + '对象:', firstCoefficientVO);
activeIndex.value++; activeIndex.value++;
} else { } else {
console.log('未找到匹配的'+ newValue.data.devName+'对象'); console.log('未找到匹配的' + newValue.data.devName + '对象');
} }
} else { } else {
console.log(newValue.data.devName + '数组为空'); console.log(newValue.data.devName + '数组为空');
} }
} else { } else {
console.log('未找到'+newValue.data.devName+'对应的数组'); console.log('未找到' + newValue.data.devName + '对应的数组');
} }
} }
break; break;
@@ -518,6 +533,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
} }
} }
}
}) })
//出错系数检测初始化 //出错系数检测初始化

View File

@@ -233,8 +233,7 @@ const webMsgSend = toRef(props, 'webMsgSend');
const ts = ref(''); const ts = ref('');
watch(webMsgSend, function (newValue, oldValue) { watch(webMsgSend, function (newValue, oldValue) {
// console.log(newValue) if (testStatus.value !== 'waiting') {
switch (newValue.requestId) { switch (newValue.requestId) {
case 'yjc_ytxjy': case 'yjc_ytxjy':
switch (newValue.operateCode) { switch (newValue.operateCode) {
@@ -446,14 +445,25 @@ watch(webMsgSend, function (newValue, oldValue) {
}]; }];
ts.value = 'error' ts.value = 'error'
step5.value = 'error' step5.value = 'error'
} else if (newValue.code == 25001) { }
break;
case 'VERIFY_MAPPING$01':
if (newValue.code == 25001) {
activeIndex.value = 3 activeIndex.value = 3
step3.value = 'success' step3.value = 'success'
step4.value = 'process' 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;
} }
break; break;
case 'YJC_xujy': case 'YJC_xujy':
switch (newValue.operateCode) { switch (newValue.operateCode) {
@@ -496,7 +506,7 @@ watch(webMsgSend, function (newValue, oldValue) {
newValue.data.split('<br/>') newValue.data.split('<br/>')
step4InitLog.value.push({ step4InitLog.value.push({
type: type, type: type,
log:newValue.data, log: newValue.data,
}) })
} else if (newValue.code == 10201) { } else if (newValue.code == 10201) {
@@ -523,7 +533,7 @@ watch(webMsgSend, function (newValue, oldValue) {
} }
activeIndex.value = 5 activeIndex.value = 5
ts.value = 'success' ts.value = 'success'
console.log("@@@@",ts.value) console.log("@@@@", ts.value)
break break
} }
@@ -564,7 +574,7 @@ watch(webMsgSend, function (newValue, oldValue) {
step5.value = 'error' step5.value = 'error'
break; break;
} }
}
}) })
watch(activeIndex, function (newValue, oldValue) { watch(activeIndex, function (newValue, oldValue) {

View File

@@ -355,6 +355,7 @@ watch(testStatus, function (newValue, oldValue) {
let count = 0 let count = 0
watch(webMsgSend, function (newValue, oldValue) { watch(webMsgSend, function (newValue, oldValue) {
if (testStatus.value !== 'waiting') {
if (props.stepsActive === 4) { if (props.stepsActive === 4) {
if (newValue.code == 10520) { if (newValue.code == 10520) {
ElMessageBox.alert('报文解析异常!', '初始化失败', { ElMessageBox.alert('报文解析异常!', '初始化失败', {
@@ -535,7 +536,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'yjc_xyjy': case 'yjc_xyjy':
switch (newValue.operateCode) { switch (newValue.operateCode) {
case 'INIT_GATHER$03': case 'VERIFY_MAPPING$01':
if (newValue.code == 25001) { if (newValue.code == 25001) {
ElMessage.success('初始化成功!') ElMessage.success('初始化成功!')
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:协议校验成功!`}) testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:协议校验成功!`})
@@ -543,11 +544,21 @@ watch(webMsgSend, function (newValue, oldValue) {
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化成功!`}) testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化成功!`})
percentage.value = 3 percentage.value = 3
activeIndex = getNextActiveIndex() + 2 activeIndex = getNextActiveIndex() + 2
//startTimer() //startTimer()
emit('update:testStatus', 'process') emit('update:testStatus', 'process')
} else if (newValue.code == 10200) {
let data = JSON.parse(newValue.data)
ElMessageBox.alert(`脚本与icd校验失败icd名称${data['icdType']} -> 校验项:${data['dataType']}`, '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
testLogList.push({
type: 'error',
log: `${new Date().toLocaleString()}脚本与icd校验失败icd名称${newValue.data.icdType} -> 校验项:${newValue.data.dataType}`
})
emit('update:testStatus', 'test_init_fail')
} }
break; break;
} }
@@ -648,6 +659,7 @@ watch(webMsgSend, function (newValue, oldValue) {
} }
} }
} }
}
}, {deep: true}) }, {deep: true})
const handleStartItem = (code: string, desc: string | undefined) => { const handleStartItem = (code: string, desc: string | undefined) => {