icd校验
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
@@ -189,333 +189,349 @@ 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 (newValue.code == 10520) {
|
if (testStatus.value !== 'waiting') {
|
||||||
ElMessageBox.alert('报文解析异常!', '初始化失败', {
|
if (newValue.code == 10520) {
|
||||||
confirmButtonText: '确定',
|
ElMessageBox.alert('报文解析异常!', '初始化失败', {
|
||||||
type: 'error',
|
confirmButtonText: '确定',
|
||||||
})
|
type: 'error',
|
||||||
TableInit();
|
})
|
||||||
} else if (newValue.code == 10521) {
|
TableInit();
|
||||||
ElMessageBox.alert('程控源參数有误!', '初始化失败', {
|
} else if (newValue.code == 10521) {
|
||||||
confirmButtonText: '确定',
|
ElMessageBox.alert('程控源參数有误!', '初始化失败', {
|
||||||
type: 'error',
|
confirmButtonText: '确定',
|
||||||
})
|
type: 'error',
|
||||||
TableInit();
|
})
|
||||||
} else if (newValue.code == 10522) {
|
TableInit();
|
||||||
ElMessageBox.alert('测试项解析有误!', '初始化失败', {
|
} else if (newValue.code == 10522) {
|
||||||
confirmButtonText: '确定',
|
ElMessageBox.alert('测试项解析有误!', '初始化失败', {
|
||||||
type: 'error',
|
confirmButtonText: '确定',
|
||||||
})
|
type: 'error',
|
||||||
TableInit();
|
})
|
||||||
} else if (newValue.code == 10523) {
|
TableInit();
|
||||||
ElMessageBox.alert('源连接失败!', '初始化失败', {
|
} else if (newValue.code == 10523) {
|
||||||
confirmButtonText: '确定',
|
ElMessageBox.alert('源连接失败!', '初始化失败', {
|
||||||
type: 'error',
|
confirmButtonText: '确定',
|
||||||
})
|
type: 'error',
|
||||||
TableInit();
|
})
|
||||||
} else if (newValue.code == 10524) {
|
TableInit();
|
||||||
ElMessageBox.alert('获取源控制权失败!', '初始化失败', {
|
} else if (newValue.code == 10524) {
|
||||||
confirmButtonText: '确定',
|
ElMessageBox.alert('获取源控制权失败!', '初始化失败', {
|
||||||
type: 'error',
|
confirmButtonText: '确定',
|
||||||
})
|
type: 'error',
|
||||||
TableInit();
|
})
|
||||||
} else if (newValue.code == 10525) {
|
TableInit();
|
||||||
ElMessageBox.alert('重置源失败!', '初始化失败', {
|
} else if (newValue.code == 10525) {
|
||||||
confirmButtonText: '确定',
|
ElMessageBox.alert('重置源失败!', '初始化失败', {
|
||||||
type: 'error',
|
confirmButtonText: '确定',
|
||||||
})
|
type: 'error',
|
||||||
TableInit();
|
})
|
||||||
} else if (newValue.code == 10527) {
|
TableInit();
|
||||||
ElMessageBox.alert('源未进行初始化!', '初始化失败', {
|
} else if (newValue.code == 10527) {
|
||||||
confirmButtonText: '确定',
|
ElMessageBox.alert('源未进行初始化!', '初始化失败', {
|
||||||
type: 'error',
|
confirmButtonText: '确定',
|
||||||
})
|
type: 'error',
|
||||||
TableInit();
|
})
|
||||||
} else if (newValue.code == 10528) {
|
TableInit();
|
||||||
ElMessageBox.alert('目标源有误(该用户已控制其他源,在关闭前无法操作新的源)!', '初始化失败', {
|
} else if (newValue.code == 10528) {
|
||||||
confirmButtonText: '确定',
|
ElMessageBox.alert('目标源有误(该用户已控制其他源,在关闭前无法操作新的源)!', '初始化失败', {
|
||||||
type: 'error',
|
confirmButtonText: '确定',
|
||||||
})
|
type: 'error',
|
||||||
TableInit();
|
})
|
||||||
} else if (newValue.code == 10529) {
|
TableInit();
|
||||||
ElMessageBox.alert('源状态有误,无法响应报文(例如源处于输出状态,无法响应初始化报文)!', '初始化失败', {
|
} else if (newValue.code == 10529) {
|
||||||
confirmButtonText: '确定',
|
ElMessageBox.alert('源状态有误,无法响应报文(例如源处于输出状态,无法响应初始化报文)!', '初始化失败', {
|
||||||
type: 'error',
|
confirmButtonText: '确定',
|
||||||
})
|
type: 'error',
|
||||||
TableInit();
|
})
|
||||||
} else if (newValue.code == 10550) {
|
TableInit();
|
||||||
ElMessageBox.alert(`${newValue.data}设备连接异常!`, '初始化失败', {
|
} else if (newValue.code == 10550) {
|
||||||
confirmButtonText: '确定',
|
ElMessageBox.alert(`${newValue.data}设备连接异常!`, '初始化失败', {
|
||||||
type: 'error',
|
confirmButtonText: '确定',
|
||||||
})
|
type: 'error',
|
||||||
TableInit();
|
})
|
||||||
} else if (newValue.code == 10551) {
|
TableInit();
|
||||||
ElMessageBox.alert(`${newValue.data}设备触发报告异常!`, '初始化失败', {
|
} else if (newValue.code == 10551) {
|
||||||
confirmButtonText: '确定',
|
ElMessageBox.alert(`${newValue.data}设备触发报告异常!`, '初始化失败', {
|
||||||
type: 'error',
|
confirmButtonText: '确定',
|
||||||
})
|
type: 'error',
|
||||||
TableInit();
|
})
|
||||||
} else if (newValue.code == 10552) { //todo 10552之后还会发送消息吗?
|
TableInit();
|
||||||
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
|
} else if (newValue.code == 10552) { //todo 10552之后还会发送消息吗?
|
||||||
confirmButtonText: '确定',
|
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
|
||||||
type: 'error',
|
confirmButtonText: '确定',
|
||||||
})
|
type: 'error',
|
||||||
TableInit();
|
})
|
||||||
} else {
|
TableInit();
|
||||||
console.log('显示东西code', newValue.code)
|
} else {
|
||||||
console.log('显示东西requestId', newValue.requestId)
|
console.log('显示东西code', newValue.code)
|
||||||
switch (newValue.requestId) {
|
console.log('显示东西requestId', newValue.requestId)
|
||||||
|
switch (newValue.requestId) {
|
||||||
case 'yjc_ytxjy':
|
|
||||||
switch (newValue.operateCode) {
|
|
||||||
case'INIT_GATHER':
|
|
||||||
if (newValue.code == -1) {
|
|
||||||
ElMessageBox.alert('源未知异常', '初始化失败', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
TableInit();
|
|
||||||
} else if (newValue.code == 10523) {
|
|
||||||
ElMessageBox.alert('源连接失败', '源连接失败', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
TableInit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'YJC_xujy':
|
|
||||||
switch (newValue.operateCode) {
|
|
||||||
case 'OPER_GATHER':
|
|
||||||
if (newValue.code == 10552) {
|
|
||||||
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
TableInit();
|
|
||||||
} else if (newValue.code == 10520) {
|
|
||||||
ElMessageBox.alert('解析报文异常,执行自动关闭,请重新发起检测', '解析报文异常', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
TableInit();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'DATA_REQUEST$02':
|
|
||||||
if (newValue.code == 25003) {
|
|
||||||
ElMessageBox.alert('相序校验未通过,执行自动关闭,请重新发起检测', '相序校验未通过', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
TableInit();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'yjc_sbtxjy':
|
|
||||||
switch (newValue.operateCode) {
|
|
||||||
case 'INIT_GATHER$01':
|
|
||||||
if (newValue.code == 10550) {
|
|
||||||
ElMessageBox.alert('设备连接异常', '设备连接异常', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
TableInit();
|
|
||||||
} else if (newValue.code == 10551) {
|
|
||||||
ElMessageBox.alert('设备触发报告异常', '设备触发报告异常', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
TableInit();
|
|
||||||
} else if (newValue.code == 10552) {
|
|
||||||
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
TableInit();
|
|
||||||
} else if (newValue.code == 10520) {
|
|
||||||
ElMessageBox.alert('解析报文异常,执行自动关闭,请重新发起检测', '解析报文异常', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
TableInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
case 'yjc_ytxjy':
|
||||||
}
|
switch (newValue.operateCode) {
|
||||||
break;
|
case'INIT_GATHER':
|
||||||
case 'Coefficient_Check':
|
if (newValue.code == -1) {
|
||||||
console.log("Coefficient_Checkactive", active.value);
|
ElMessageBox.alert('源未知异常', '初始化失败', {
|
||||||
switch (newValue.operateCode) {
|
confirmButtonText: '确定',
|
||||||
case 'big_end'://大电压,电流下装
|
type: 'error',
|
||||||
console.log('大电压,电流下装')
|
})
|
||||||
active.value++;
|
TableInit();
|
||||||
big_V_Download.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
|
} else if (newValue.code == 10523) {
|
||||||
big_I_Download.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
|
ElMessageBox.alert('源连接失败', '源连接失败', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
tableLoading('small', '系数下装')
|
type: 'error',
|
||||||
break;
|
})
|
||||||
}
|
TableInit();
|
||||||
switch (newValue.operateCode) {
|
}
|
||||||
case 'small_end'://小电压,电流下装
|
}
|
||||||
console.log('小电压,电流下装')
|
break;
|
||||||
active.value++;
|
case 'YJC_xujy':
|
||||||
small_V_Download.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
|
switch (newValue.operateCode) {
|
||||||
small_I_Download.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
|
case 'OPER_GATHER':
|
||||||
|
if (newValue.code == 10552) {
|
||||||
tableLoading('big', '系数校准')
|
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
|
||||||
break;
|
confirmButtonText: '确定',
|
||||||
}
|
type: 'error',
|
||||||
switch (newValue.operateCode) {
|
})
|
||||||
case 'big_comp_end'://大电压,电流校准
|
TableInit();
|
||||||
console.log('大电压,电流校准')
|
} else if (newValue.code == 10520) {
|
||||||
active.value++;
|
ElMessageBox.alert('解析报文异常,执行自动关闭,请重新发起检测', '解析报文异常', {
|
||||||
big_V_Adjust.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
|
confirmButtonText: '确定',
|
||||||
big_I_Adjust.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
|
type: 'error',
|
||||||
|
})
|
||||||
tableLoading('small', '系数校准')
|
TableInit();
|
||||||
break;
|
}
|
||||||
}
|
break;
|
||||||
switch (newValue.operateCode) {
|
case 'DATA_REQUEST$02':
|
||||||
case 'small_comp_end'://小电压,电流校准
|
if (newValue.code == 25003) {
|
||||||
console.log('小电压,电流校准')
|
ElMessageBox.alert('相序校验未通过,执行自动关闭,请重新发起检测', '相序校验未通过', {
|
||||||
active.value++;
|
confirmButtonText: '确定',
|
||||||
small_V_Adjust.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
|
type: 'error',
|
||||||
small_I_Adjust.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
|
})
|
||||||
active.value++;
|
TableInit();
|
||||||
|
}
|
||||||
for (let i = 0; i < name.value.length; i++) {
|
break;
|
||||||
const currentDataRef = tableDataMap.get(i);
|
}
|
||||||
if (currentDataRef) {
|
break;
|
||||||
const currentData = currentDataRef.value;
|
case 'yjc_sbtxjy':
|
||||||
// 检查当前数据中有无不合格字段
|
switch (newValue.operateCode) {
|
||||||
const hasError = checkForErrors(currentData);
|
case 'INIT_GATHER$01':
|
||||||
if (hasError) {
|
if (newValue.code == 10550) {
|
||||||
} else {
|
ElMessageBox.alert('设备连接异常', '设备连接异常', {
|
||||||
qualified.value++;
|
confirmButtonText: '确定',
|
||||||
}
|
type: 'error',
|
||||||
updateErrorState(i, hasError);
|
})
|
||||||
|
TableInit();
|
||||||
|
} else if (newValue.code == 10551) {
|
||||||
|
ElMessageBox.alert('设备触发报告异常', '设备触发报告异常', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
TableInit();
|
||||||
|
} else if (newValue.code == 10552) {
|
||||||
|
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
TableInit();
|
||||||
|
} else if (newValue.code == 10520) {
|
||||||
|
ElMessageBox.alert('解析报文异常,执行自动关闭,请重新发起检测', '解析报文异常', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
TableInit();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//editableTabsValue.value = (tabNumber.value).toString();//显示下一个tab
|
break;
|
||||||
isButtonDisabled.value = false; // 恢复按钮
|
}
|
||||||
emit('update:testStatus', 'success')
|
break;
|
||||||
break;
|
case 'yjc_xyjy':
|
||||||
}
|
switch (newValue.operateCode) {
|
||||||
switch (newValue.operateCode) {
|
case 'VERIFY_MAPPING$01':
|
||||||
case 'DATA_CHNFACTOR$02'://表格
|
if (newValue.code == 10200) {
|
||||||
// 输出 key 为 0 的数组中的第一条 ChannelsTest.CoefficientVO 对象
|
let data = JSON.parse(newValue.data)
|
||||||
console.log('表格',name.value)
|
ElMessageBox.alert(`脚本与icd校验失败!icd名称:${data['icdType']} -> 校验项:${data['dataType']}`, '初始化失败', {
|
||||||
for (let i = 0; i < name.value.length; i++) {
|
confirmButtonText: '确定',
|
||||||
const targetArrayRef = tableDataMap.get(i);
|
type: 'error',
|
||||||
if (targetArrayRef) {
|
})
|
||||||
const targetArray = targetArrayRef.value;
|
TableInit();
|
||||||
if (targetArray.length > 0) {
|
}
|
||||||
const firstCoefficientVO = targetArray.find(item => item.monitorNum === newValue.data.monitorNum &&
|
break;
|
||||||
item.type === newValue.data.type &&
|
}
|
||||||
item.desc === newValue.data.desc &&
|
break;
|
||||||
item.devName === newValue.data.devName);
|
case 'Coefficient_Check':
|
||||||
if (firstCoefficientVO) { // 检查 firstCoefficientVO 是否存在
|
console.log("Coefficient_Checkactive", active.value);
|
||||||
firstCoefficientVO.aVuData = parseFloat(newValue.data.aVuData).toFixed(4);
|
switch (newValue.operateCode) {
|
||||||
|
case 'big_end'://大电压,电流下装
|
||||||
|
console.log('大电压,电流下装')
|
||||||
|
active.value++;
|
||||||
|
big_V_Download.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
|
||||||
|
big_I_Download.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
|
||||||
|
|
||||||
if (!isNaN(parseFloat(newValue.data.aVuXi)) && isFinite(newValue.data.aVuXi)) {
|
tableLoading('small', '系数下装')
|
||||||
firstCoefficientVO.aVuXi = (parseFloat(newValue.data.aVuXi) / 10000).toFixed(4);
|
break;
|
||||||
} else {
|
}
|
||||||
firstCoefficientVO.aVuXi = newValue.data.aVuXi;
|
switch (newValue.operateCode) {
|
||||||
}
|
case 'small_end'://小电压,电流下装
|
||||||
|
console.log('小电压,电流下装')
|
||||||
|
active.value++;
|
||||||
|
small_V_Download.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
|
||||||
|
small_I_Download.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
|
||||||
|
|
||||||
firstCoefficientVO.bVuData = parseFloat(newValue.data.bVuData).toFixed(4);
|
tableLoading('big', '系数校准')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (newValue.operateCode) {
|
||||||
|
case 'big_comp_end'://大电压,电流校准
|
||||||
|
console.log('大电压,电流校准')
|
||||||
|
active.value++;
|
||||||
|
big_V_Adjust.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
|
||||||
|
big_I_Adjust.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
|
||||||
|
|
||||||
if (!isNaN(parseFloat(newValue.data.bVuXi)) && isFinite(newValue.data.bVuXi)) {
|
tableLoading('small', '系数校准')
|
||||||
firstCoefficientVO.bVuXi = (parseFloat(newValue.data.bVuXi) / 10000).toFixed(4);
|
break;
|
||||||
} else {
|
}
|
||||||
firstCoefficientVO.bVuXi = newValue.data.bVuXi;
|
switch (newValue.operateCode) {
|
||||||
}
|
case 'small_comp_end'://小电压,电流校准
|
||||||
|
console.log('小电压,电流校准')
|
||||||
|
active.value++;
|
||||||
|
small_V_Adjust.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
|
||||||
|
small_I_Adjust.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
|
||||||
|
active.value++;
|
||||||
|
|
||||||
firstCoefficientVO.cVuData = parseFloat(newValue.data.cVuData).toFixed(4);
|
for (let i = 0; i < name.value.length; i++) {
|
||||||
|
const currentDataRef = tableDataMap.get(i);
|
||||||
if (!isNaN(parseFloat(newValue.data.cVuXi)) && isFinite(newValue.data.cVuXi)) {
|
if (currentDataRef) {
|
||||||
firstCoefficientVO.cVuXi = (parseFloat(newValue.data.cVuXi) / 10000).toFixed(4);
|
const currentData = currentDataRef.value;
|
||||||
} else {
|
// 检查当前数据中有无不合格字段
|
||||||
firstCoefficientVO.cVuXi = newValue.data.cVuXi;
|
const hasError = checkForErrors(currentData);
|
||||||
}
|
if (hasError) {
|
||||||
|
|
||||||
firstCoefficientVO.aIeData = parseFloat(newValue.data.aIeData).toFixed(4);
|
|
||||||
|
|
||||||
if (!isNaN(parseFloat(newValue.data.aIeXi)) && isFinite(newValue.data.aIeXi)) {
|
|
||||||
firstCoefficientVO.aIeXi = (parseFloat(newValue.data.aIeXi) / 10000).toFixed(4);
|
|
||||||
} else {
|
|
||||||
firstCoefficientVO.aIeXi = newValue.data.aIeXi;
|
|
||||||
}
|
|
||||||
|
|
||||||
firstCoefficientVO.bIeData = parseFloat(newValue.data.bIeData).toFixed(4);
|
|
||||||
|
|
||||||
if (!isNaN(parseFloat(newValue.data.bIeXi)) && isFinite(newValue.data.bIeXi)) {
|
|
||||||
firstCoefficientVO.bIeXi = (parseFloat(newValue.data.bIeXi) / 10000).toFixed(4);
|
|
||||||
} else {
|
|
||||||
firstCoefficientVO.bIeXi = newValue.data.bIeXi;
|
|
||||||
}
|
|
||||||
|
|
||||||
firstCoefficientVO.cIeData = parseFloat(newValue.data.cIeData).toFixed(4);
|
|
||||||
|
|
||||||
if (!isNaN(parseFloat(newValue.data.cIeXi)) && isFinite(newValue.data.cIeXi)) {
|
|
||||||
firstCoefficientVO.cIeXi = (parseFloat(newValue.data.cIeXi) / 10000).toFixed(4);
|
|
||||||
} else {
|
|
||||||
firstCoefficientVO.cIeXi = newValue.data.cIeXi;
|
|
||||||
}
|
|
||||||
|
|
||||||
firstCoefficientVO.aV = newValue.data.aV;
|
|
||||||
firstCoefficientVO.bV = newValue.data.bV;
|
|
||||||
firstCoefficientVO.cV = newValue.data.cV;
|
|
||||||
firstCoefficientVO.aI = newValue.data.aI;
|
|
||||||
firstCoefficientVO.bI = newValue.data.bI;
|
|
||||||
firstCoefficientVO.cI = newValue.data.cI;
|
|
||||||
console.log(newValue.data.devName + '对象:', firstCoefficientVO);
|
|
||||||
activeIndex.value++;
|
|
||||||
} else {
|
} else {
|
||||||
console.log('未找到匹配的'+ newValue.data.devName+'对象');
|
qualified.value++;
|
||||||
|
}
|
||||||
|
updateErrorState(i, hasError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//editableTabsValue.value = (tabNumber.value).toString();//显示下一个tab
|
||||||
|
isButtonDisabled.value = false; // 恢复按钮
|
||||||
|
emit('update:testStatus', 'success')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (newValue.operateCode) {
|
||||||
|
case 'DATA_CHNFACTOR$02'://表格
|
||||||
|
// 输出 key 为 0 的数组中的第一条 ChannelsTest.CoefficientVO 对象
|
||||||
|
console.log('表格', name.value)
|
||||||
|
for (let i = 0; i < name.value.length; i++) {
|
||||||
|
const targetArrayRef = tableDataMap.get(i);
|
||||||
|
if (targetArrayRef) {
|
||||||
|
const targetArray = targetArrayRef.value;
|
||||||
|
if (targetArray.length > 0) {
|
||||||
|
const firstCoefficientVO = targetArray.find(item => item.monitorNum === newValue.data.monitorNum &&
|
||||||
|
item.type === newValue.data.type &&
|
||||||
|
item.desc === newValue.data.desc &&
|
||||||
|
item.devName === newValue.data.devName);
|
||||||
|
if (firstCoefficientVO) { // 检查 firstCoefficientVO 是否存在
|
||||||
|
firstCoefficientVO.aVuData = parseFloat(newValue.data.aVuData).toFixed(4);
|
||||||
|
|
||||||
|
if (!isNaN(parseFloat(newValue.data.aVuXi)) && isFinite(newValue.data.aVuXi)) {
|
||||||
|
firstCoefficientVO.aVuXi = (parseFloat(newValue.data.aVuXi) / 10000).toFixed(4);
|
||||||
|
} else {
|
||||||
|
firstCoefficientVO.aVuXi = newValue.data.aVuXi;
|
||||||
|
}
|
||||||
|
|
||||||
|
firstCoefficientVO.bVuData = parseFloat(newValue.data.bVuData).toFixed(4);
|
||||||
|
|
||||||
|
if (!isNaN(parseFloat(newValue.data.bVuXi)) && isFinite(newValue.data.bVuXi)) {
|
||||||
|
firstCoefficientVO.bVuXi = (parseFloat(newValue.data.bVuXi) / 10000).toFixed(4);
|
||||||
|
} else {
|
||||||
|
firstCoefficientVO.bVuXi = newValue.data.bVuXi;
|
||||||
|
}
|
||||||
|
|
||||||
|
firstCoefficientVO.cVuData = parseFloat(newValue.data.cVuData).toFixed(4);
|
||||||
|
|
||||||
|
if (!isNaN(parseFloat(newValue.data.cVuXi)) && isFinite(newValue.data.cVuXi)) {
|
||||||
|
firstCoefficientVO.cVuXi = (parseFloat(newValue.data.cVuXi) / 10000).toFixed(4);
|
||||||
|
} else {
|
||||||
|
firstCoefficientVO.cVuXi = newValue.data.cVuXi;
|
||||||
|
}
|
||||||
|
|
||||||
|
firstCoefficientVO.aIeData = parseFloat(newValue.data.aIeData).toFixed(4);
|
||||||
|
|
||||||
|
if (!isNaN(parseFloat(newValue.data.aIeXi)) && isFinite(newValue.data.aIeXi)) {
|
||||||
|
firstCoefficientVO.aIeXi = (parseFloat(newValue.data.aIeXi) / 10000).toFixed(4);
|
||||||
|
} else {
|
||||||
|
firstCoefficientVO.aIeXi = newValue.data.aIeXi;
|
||||||
|
}
|
||||||
|
|
||||||
|
firstCoefficientVO.bIeData = parseFloat(newValue.data.bIeData).toFixed(4);
|
||||||
|
|
||||||
|
if (!isNaN(parseFloat(newValue.data.bIeXi)) && isFinite(newValue.data.bIeXi)) {
|
||||||
|
firstCoefficientVO.bIeXi = (parseFloat(newValue.data.bIeXi) / 10000).toFixed(4);
|
||||||
|
} else {
|
||||||
|
firstCoefficientVO.bIeXi = newValue.data.bIeXi;
|
||||||
|
}
|
||||||
|
|
||||||
|
firstCoefficientVO.cIeData = parseFloat(newValue.data.cIeData).toFixed(4);
|
||||||
|
|
||||||
|
if (!isNaN(parseFloat(newValue.data.cIeXi)) && isFinite(newValue.data.cIeXi)) {
|
||||||
|
firstCoefficientVO.cIeXi = (parseFloat(newValue.data.cIeXi) / 10000).toFixed(4);
|
||||||
|
} else {
|
||||||
|
firstCoefficientVO.cIeXi = newValue.data.cIeXi;
|
||||||
|
}
|
||||||
|
|
||||||
|
firstCoefficientVO.aV = newValue.data.aV;
|
||||||
|
firstCoefficientVO.bV = newValue.data.bV;
|
||||||
|
firstCoefficientVO.cV = newValue.data.cV;
|
||||||
|
firstCoefficientVO.aI = newValue.data.aI;
|
||||||
|
firstCoefficientVO.bI = newValue.data.bI;
|
||||||
|
firstCoefficientVO.cI = newValue.data.cI;
|
||||||
|
console.log(newValue.data.devName + '对象:', firstCoefficientVO);
|
||||||
|
activeIndex.value++;
|
||||||
|
} else {
|
||||||
|
console.log('未找到匹配的' + newValue.data.devName + '对象');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(newValue.data.devName + '数组为空');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(newValue.data.devName + '数组为空');
|
console.log('未找到' + newValue.data.devName + '对应的数组');
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
console.log('未找到'+newValue.data.devName+'对应的数组');
|
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
break;
|
}
|
||||||
}
|
break;
|
||||||
break;
|
case 'socket_timeout':
|
||||||
case 'socket_timeout':
|
switch (newValue.operateCode) {
|
||||||
switch (newValue.operateCode) {
|
case 'VOLTAGE':
|
||||||
case 'VOLTAGE':
|
ElMessageBox.alert('连接超时!', '连接超时', {
|
||||||
ElMessageBox.alert('连接超时!', '连接超时', {
|
confirmButtonText: '确定',
|
||||||
confirmButtonText: '确定',
|
type: 'error',
|
||||||
type: 'error',
|
})
|
||||||
})
|
TableInit();
|
||||||
TableInit();
|
break;
|
||||||
break;
|
}
|
||||||
}
|
break;
|
||||||
break;
|
case 'connect':
|
||||||
case 'connect':
|
switch (newValue.operateCode) {
|
||||||
switch (newValue.operateCode) {
|
case "Source":
|
||||||
case "Source":
|
ElMessageBox.alert('源服务端连接失败', '源服务端连接失败', {
|
||||||
ElMessageBox.alert('源服务端连接失败', '源服务端连接失败', {
|
confirmButtonText: '确定',
|
||||||
confirmButtonText: '确定',
|
type: 'error',
|
||||||
type: 'error',
|
})
|
||||||
})
|
TableInit();
|
||||||
TableInit();
|
break;
|
||||||
break;
|
case "Dev":
|
||||||
case "Dev":
|
ElMessageBox.alert('设备服务端连接失败', '设备服务端连接失败', {
|
||||||
ElMessageBox.alert('设备服务端连接失败', '设备服务端连接失败', {
|
confirmButtonText: '确定',
|
||||||
confirmButtonText: '确定',
|
type: 'error',
|
||||||
type: 'error',
|
})
|
||||||
})
|
TableInit();
|
||||||
TableInit();
|
break;
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -233,338 +233,348 @@ 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) {
|
case 'INIT_GATHER':
|
||||||
case 'INIT_GATHER':
|
if (newValue.code == 10200) {
|
||||||
if (newValue.code == 10200) {
|
step1InitLog.value.push({
|
||||||
step1InitLog.value.push({
|
type: 'info',
|
||||||
type: 'info',
|
log: '源初始化成功!',
|
||||||
log: '源初始化成功!',
|
})
|
||||||
})
|
activeIndex.value = 1
|
||||||
activeIndex.value = 1
|
step1.value = 'success'
|
||||||
step1.value = 'success'
|
step2.value = 'process'
|
||||||
step2.value = 'process'
|
} else if (newValue.code == 10201) {
|
||||||
} else if (newValue.code == 10201) {
|
step1.value = 'process'
|
||||||
step1.value = 'process'
|
step1InitLog.value = [{
|
||||||
step1InitLog.value = [{
|
type: 'wait',
|
||||||
type: 'wait',
|
log: '正在进行源初始化!',
|
||||||
log: '正在进行源初始化!',
|
}];
|
||||||
}];
|
} else if (newValue.code == 10552) {
|
||||||
} else if (newValue.code == 10552) {
|
ElMessage.error(newValue.code)
|
||||||
ElMessage.error(newValue.code)
|
step1.value = 'error'
|
||||||
step1.value = 'error'
|
ts.value = 'error'
|
||||||
ts.value = 'error'
|
step5.value = 'error'
|
||||||
step5.value = 'error'
|
} else if (newValue.code == 10523) {
|
||||||
} else if (newValue.code == 10523) {
|
step1.value = 'error'
|
||||||
step1.value = 'error'
|
ts.value = 'error'
|
||||||
ts.value = 'error'
|
step5.value = 'error'
|
||||||
step5.value = 'error'
|
step1InitLog.value = [{
|
||||||
step1InitLog.value = [{
|
type: 'error',
|
||||||
type: 'error',
|
log: '源连接失败!',
|
||||||
log: '源连接失败!',
|
}];
|
||||||
}];
|
} else if (newValue.code == -1) {
|
||||||
} else if (newValue.code == -1) {
|
step1.value = 'error'
|
||||||
step1.value = 'error'
|
ts.value = 'error'
|
||||||
ts.value = 'error'
|
step5.value = 'error'
|
||||||
step5.value = 'error'
|
step1InitLog.value = [{
|
||||||
step1InitLog.value = [{
|
type: 'error',
|
||||||
type: 'error',
|
log: '源未知异常!',
|
||||||
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'
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
newValue.data.split('<br/>')
|
|
||||||
step4InitLog.value.push({
|
|
||||||
type: type,
|
|
||||||
log:newValue.data,
|
|
||||||
})
|
|
||||||
|
|
||||||
} else if (newValue.code == 10201) {
|
}
|
||||||
step4.value = 'process'
|
break;
|
||||||
step4InitLog.value = [{
|
case 'yjc_sbtxjy':
|
||||||
type: 'wait',
|
|
||||||
log: '获取数据相序校验数据!',
|
switch (newValue.operateCode) {
|
||||||
}];
|
case 'INIT_GATHER$01':
|
||||||
} else if (newValue.code == 25003) {
|
if (newValue.code == 10200) {
|
||||||
step4.value = 'error'
|
step2InitLog.value.push({
|
||||||
step4InitLog.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',
|
type: 'error',
|
||||||
log: '相序校验未通过!',
|
log: '源服务端连接失败!',
|
||||||
})
|
}];
|
||||||
ts.value = 'error'
|
ts.value = 'error'
|
||||||
step5.value = 'error'
|
step5.value = 'error'
|
||||||
} else if (newValue.code == 25001) {
|
break;
|
||||||
step4.value = 'success'
|
case "Dev":
|
||||||
step5.value = 'success'
|
step2.value = 'error'
|
||||||
step4InitLog.value.push({
|
step2InitLog.value = [{
|
||||||
type: 'wait',
|
type: 'error',
|
||||||
log: '相序校验成功!',
|
log: '设备服务端连接失败!',
|
||||||
})
|
}];
|
||||||
}
|
ts.value = 'error'
|
||||||
activeIndex.value = 5
|
step5.value = 'error'
|
||||||
ts.value = 'success'
|
break;
|
||||||
console.log("@@@@",ts.value)
|
}
|
||||||
break
|
break;
|
||||||
}
|
case 'unknown_operate':
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'quit':
|
case 'error_flow_end':
|
||||||
break;
|
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', {
|
||||||
case 'connect':
|
confirmButtonText: '确定',
|
||||||
switch (newValue.operateCode) {
|
type: 'error',
|
||||||
case "Source":
|
})
|
||||||
step1.value = 'error'
|
ts.value = 'error'
|
||||||
step1InitLog.value = [{
|
step5.value = 'error'
|
||||||
type: 'error',
|
break;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(activeIndex, function (newValue, oldValue) {
|
watch(activeIndex, function (newValue, oldValue) {
|
||||||
|
|||||||
@@ -355,137 +355,138 @@ watch(testStatus, function (newValue, oldValue) {
|
|||||||
let count = 0
|
let count = 0
|
||||||
|
|
||||||
watch(webMsgSend, function (newValue, oldValue) {
|
watch(webMsgSend, function (newValue, oldValue) {
|
||||||
if (props.stepsActive === 4) {
|
if (testStatus.value !== 'waiting') {
|
||||||
if (newValue.code == 10520) {
|
if (props.stepsActive === 4) {
|
||||||
ElMessageBox.alert('报文解析异常!', '初始化失败', {
|
if (newValue.code == 10520) {
|
||||||
confirmButtonText: '确定',
|
ElMessageBox.alert('报文解析异常!', '初始化失败', {
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:报文解析异常!`})
|
|
||||||
emit('update:testStatus', 'test_init_fail')
|
|
||||||
} else if (newValue.code == 10521) {
|
|
||||||
ElMessageBox.alert('程控源參数有误!', '初始化失败', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:程控源參数有误!`})
|
|
||||||
emit('update:testStatus', 'test_init_fail')
|
|
||||||
} else if (newValue.code == 10522) {
|
|
||||||
ElMessageBox.alert('测试项解析有误!', '初始化失败', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:测试项解析有误!`})
|
|
||||||
emit('update:testStatus', 'test_init_fail')
|
|
||||||
} else if (newValue.code == 10523) {
|
|
||||||
if (count === 0) {
|
|
||||||
ElMessageBox.alert('源连接失败!', '初始化失败', {
|
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
})
|
})
|
||||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源连接失败!`})
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:报文解析异常!`})
|
||||||
emit('update:testStatus', 'test_init_fail')
|
emit('update:testStatus', 'test_init_fail')
|
||||||
count++
|
} else if (newValue.code == 10521) {
|
||||||
}
|
ElMessageBox.alert('程控源參数有误!', '初始化失败', {
|
||||||
} else if (newValue.code == 10524) {
|
confirmButtonText: '确定',
|
||||||
ElMessageBox.alert('获取源控制权失败!', '初始化失败', {
|
type: 'error',
|
||||||
confirmButtonText: '确定',
|
})
|
||||||
type: 'error',
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:程控源參数有误!`})
|
||||||
})
|
emit('update:testStatus', 'test_init_fail')
|
||||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:获取源控制权失败!`})
|
} else if (newValue.code == 10522) {
|
||||||
emit('update:testStatus', 'test_init_fail')
|
ElMessageBox.alert('测试项解析有误!', '初始化失败', {
|
||||||
} else if (newValue.code == 10525) {
|
confirmButtonText: '确定',
|
||||||
ElMessageBox.alert('重置源失败!', '初始化失败', {
|
type: 'error',
|
||||||
confirmButtonText: '确定',
|
})
|
||||||
type: 'error',
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:测试项解析有误!`})
|
||||||
})
|
emit('update:testStatus', 'test_init_fail')
|
||||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:重置源失败!`})
|
} else if (newValue.code == 10523) {
|
||||||
emit('update:testStatus', 'test_init_fail')
|
if (count === 0) {
|
||||||
} else if (newValue.code == 10527) {
|
ElMessageBox.alert('源连接失败!', '初始化失败', {
|
||||||
ElMessageBox.alert('源未进行初始化!', '初始化失败', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源未进行初始化!`})
|
|
||||||
emit('update:testStatus', 'test_init_fail')
|
|
||||||
} else if (newValue.code == 10528) {
|
|
||||||
ElMessageBox.alert('目标源有误(该用户已控制其他源,在关闭前无法操作新的源)!', '初始化失败', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:目标源有误(该用户已控制其他源,在关闭前无法操作新的源)!`})
|
|
||||||
emit('update:testStatus', 'test_init_fail')
|
|
||||||
} else if (newValue.code == 10529) {
|
|
||||||
ElMessageBox.alert('源状态有误,无法响应报文(例如源处于输出状态,无法响应初始化报文)!', '初始化失败', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源状态有误,无法响应报文(例如源处于输出状态,无法响应初始化报文)!`})
|
|
||||||
emit('update:testStatus', 'test_init_fail')
|
|
||||||
} else if (newValue.code == 10550) {
|
|
||||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:${newValue.data}设备连接异常!`})
|
|
||||||
emit('update:testStatus', 'test_init_fail')
|
|
||||||
} else if (newValue.code == 10551) {
|
|
||||||
ElMessageBox.alert(`${newValue.data}设备触发报告异常!`, '初始化失败', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:${newValue.data}设备触发报告异常!`})
|
|
||||||
emit('update:testStatus', 'test_init_fail')
|
|
||||||
} else if (newValue.code == 10552) { //todo 10552之后还会发送消息吗?
|
|
||||||
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
testLogList.push({
|
|
||||||
type: 'error',
|
|
||||||
log: `${new Date().toLocaleString()}:存在已经初始化步骤,执行自动关闭,请重新发起检测!`
|
|
||||||
})
|
|
||||||
// emit('update:testStatus', 'recheck')
|
|
||||||
emit('update:testStatus', 'test_init_fail')
|
|
||||||
} else {
|
|
||||||
switch (newValue.requestId) {
|
|
||||||
case 'server_error':
|
|
||||||
if (newValue.operateCode === 'server_error' && count === 0) {
|
|
||||||
ElMessageBox.alert('源连接失败!', '初始化失败', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源连接失败!`})
|
|
||||||
emit('update:testStatus', 'test_init_fail')
|
|
||||||
count++
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'formal_real': // 正式测试
|
|
||||||
switch (newValue.operateCode) {
|
|
||||||
case "stop_timeout":
|
|
||||||
ElMessageBox.alert(`暂停时间已过10分钟,本次检测已失效,请重新发起检测!`, '暂停时间过长', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
emit('update:testStatus', 'pause_timeout')
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'error_flow_end':
|
|
||||||
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '初始化失败', {
|
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
})
|
})
|
||||||
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源连接失败!`})
|
||||||
emit('update:testStatus', 'test_init_fail')
|
emit('update:testStatus', 'test_init_fail')
|
||||||
break
|
count++
|
||||||
case 'socket_timeout':
|
}
|
||||||
switch (newValue.operateCode) {
|
} else if (newValue.code == 10524) {
|
||||||
case "VOLTAGE":
|
ElMessageBox.alert('获取源控制权失败!', '初始化失败', {
|
||||||
// todo 超时处理 页面按钮更新
|
confirmButtonText: '确定',
|
||||||
ElMessageBox.alert('连接超时!', '连接超时', {
|
type: 'error',
|
||||||
|
})
|
||||||
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:获取源控制权失败!`})
|
||||||
|
emit('update:testStatus', 'test_init_fail')
|
||||||
|
} else if (newValue.code == 10525) {
|
||||||
|
ElMessageBox.alert('重置源失败!', '初始化失败', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:重置源失败!`})
|
||||||
|
emit('update:testStatus', 'test_init_fail')
|
||||||
|
} else if (newValue.code == 10527) {
|
||||||
|
ElMessageBox.alert('源未进行初始化!', '初始化失败', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源未进行初始化!`})
|
||||||
|
emit('update:testStatus', 'test_init_fail')
|
||||||
|
} else if (newValue.code == 10528) {
|
||||||
|
ElMessageBox.alert('目标源有误(该用户已控制其他源,在关闭前无法操作新的源)!', '初始化失败', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:目标源有误(该用户已控制其他源,在关闭前无法操作新的源)!`})
|
||||||
|
emit('update:testStatus', 'test_init_fail')
|
||||||
|
} else if (newValue.code == 10529) {
|
||||||
|
ElMessageBox.alert('源状态有误,无法响应报文(例如源处于输出状态,无法响应初始化报文)!', '初始化失败', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源状态有误,无法响应报文(例如源处于输出状态,无法响应初始化报文)!`})
|
||||||
|
emit('update:testStatus', 'test_init_fail')
|
||||||
|
} else if (newValue.code == 10550) {
|
||||||
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:${newValue.data}设备连接异常!`})
|
||||||
|
emit('update:testStatus', 'test_init_fail')
|
||||||
|
} else if (newValue.code == 10551) {
|
||||||
|
ElMessageBox.alert(`${newValue.data}设备触发报告异常!`, '初始化失败', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:${newValue.data}设备触发报告异常!`})
|
||||||
|
emit('update:testStatus', 'test_init_fail')
|
||||||
|
} else if (newValue.code == 10552) { //todo 10552之后还会发送消息吗?
|
||||||
|
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
testLogList.push({
|
||||||
|
type: 'error',
|
||||||
|
log: `${new Date().toLocaleString()}:存在已经初始化步骤,执行自动关闭,请重新发起检测!`
|
||||||
|
})
|
||||||
|
// emit('update:testStatus', 'recheck')
|
||||||
|
emit('update:testStatus', 'test_init_fail')
|
||||||
|
} else {
|
||||||
|
switch (newValue.requestId) {
|
||||||
|
case 'server_error':
|
||||||
|
if (newValue.operateCode === 'server_error' && count === 0) {
|
||||||
|
ElMessageBox.alert('源连接失败!', '初始化失败', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
})
|
})
|
||||||
emit('update:testStatus', 'connect_timeout')
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源连接失败!`})
|
||||||
break;
|
emit('update:testStatus', 'test_init_fail')
|
||||||
}
|
count++
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
|
case 'formal_real': // 正式测试
|
||||||
|
switch (newValue.operateCode) {
|
||||||
|
case "stop_timeout":
|
||||||
|
ElMessageBox.alert(`暂停时间已过10分钟,本次检测已失效,请重新发起检测!`, '暂停时间过长', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
emit('update:testStatus', 'pause_timeout')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'error_flow_end':
|
||||||
|
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '初始化失败', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
emit('update:testStatus', 'test_init_fail')
|
||||||
|
break
|
||||||
|
case 'socket_timeout':
|
||||||
|
switch (newValue.operateCode) {
|
||||||
|
case "VOLTAGE":
|
||||||
|
// todo 超时处理 页面按钮更新
|
||||||
|
ElMessageBox.alert('连接超时!', '连接超时', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
emit('update:testStatus', 'connect_timeout')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'connect':
|
case 'connect':
|
||||||
switch (newValue.operateCode) {
|
switch (newValue.operateCode) {
|
||||||
case "Source":
|
case "Source":
|
||||||
@@ -505,146 +506,157 @@ watch(webMsgSend, function (newValue, oldValue) {
|
|||||||
}
|
}
|
||||||
emit('update:testStatus', 'test_init_fail')
|
emit('update:testStatus', 'test_init_fail')
|
||||||
break;
|
break;
|
||||||
case 'yjc_ytxjy':
|
case 'yjc_ytxjy':
|
||||||
switch (newValue.operateCode) {
|
switch (newValue.operateCode) {
|
||||||
case 'INIT_GATHER':
|
case 'INIT_GATHER':
|
||||||
if (newValue.code == 10200) {
|
if (newValue.code == 10200) {
|
||||||
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:源初始化成功!`})
|
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:源初始化成功!`})
|
||||||
percentage.value = 1
|
percentage.value = 1
|
||||||
}
|
}
|
||||||
if (newValue.code == -1) {
|
if (newValue.code == -1) {
|
||||||
ElMessageBox.alert('源未知异常!', '初始化失败', {
|
ElMessageBox.alert('源未知异常!', '初始化失败', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
})
|
})
|
||||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源未知异常!`})
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源未知异常!`})
|
||||||
emit('update:testStatus', 'test_init_fail')
|
emit('update:testStatus', 'test_init_fail')
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'yjc_sbtxjy':
|
case 'yjc_sbtxjy':
|
||||||
switch (newValue.operateCode) {
|
switch (newValue.operateCode) {
|
||||||
case 'INIT_GATHER$01':
|
case 'INIT_GATHER$01':
|
||||||
if (newValue.code == 25001) {
|
if (newValue.code == 25001) {
|
||||||
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:设备通讯校验成功!`})
|
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:设备通讯校验成功!`})
|
||||||
percentage.value = 2
|
percentage.value = 2
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
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()}:协议校验成功!`})
|
||||||
timeDifference.value = +new Date().getTime() - startData.value.getTime();
|
timeDifference.value = +new Date().getTime() - startData.value.getTime();
|
||||||
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
|
||||||
|
//startTimer()
|
||||||
|
|
||||||
activeIndex = getNextActiveIndex() + 2
|
emit('update:testStatus', 'process')
|
||||||
//startTimer()
|
} else if (newValue.code == 10200) {
|
||||||
|
let data = JSON.parse(newValue.data)
|
||||||
emit('update:testStatus', 'process')
|
ElMessageBox.alert(`脚本与icd校验失败!icd名称:${data['icdType']} -> 校验项:${data['dataType']}`, '初始化失败', {
|
||||||
}
|
confirmButtonText: '确定',
|
||||||
break;
|
type: 'error',
|
||||||
}
|
})
|
||||||
break;
|
testLogList.push({
|
||||||
case 'preStopTest':
|
type: 'error',
|
||||||
if (newValue.operateCode == 'stop') {
|
log: `${new Date().toLocaleString()}:脚本与icd校验失败!icd名称:${newValue.data.icdType} -> 校验项:${newValue.data.dataType}`
|
||||||
ElMessage.success('暂停成功')
|
})
|
||||||
emit('update:testStatus', 'paused')
|
emit('update:testStatus', 'test_init_fail')
|
||||||
pauseSuccessCallback()
|
}
|
||||||
}
|
break;
|
||||||
break;
|
}
|
||||||
// case 'Pause_Fail':
|
break;
|
||||||
// ElMessage.error('暂停失败')
|
case 'preStopTest':
|
||||||
// break;
|
if (newValue.operateCode == 'stop') {
|
||||||
case 'Resume_Success':
|
ElMessage.success('暂停成功')
|
||||||
ElMessage.success('开始继续检测')
|
emit('update:testStatus', 'paused')
|
||||||
emit('update:testStatus', 'process')
|
pauseSuccessCallback()
|
||||||
handleResumeTest()
|
}
|
||||||
break;
|
break;
|
||||||
// case 'Resume_Fail':
|
// case 'Pause_Fail':
|
||||||
// ElMessage.error('无法继续检测')
|
// ElMessage.error('暂停失败')
|
||||||
// break;
|
// break;
|
||||||
case 'FREQ_Start':
|
case 'Resume_Success':
|
||||||
handleStartItem('FREQ', newValue.desc)
|
ElMessage.success('开始继续检测')
|
||||||
break;
|
emit('update:testStatus', 'process')
|
||||||
case 'FREQ_End':
|
handleResumeTest()
|
||||||
handleEndItem('FREQ', newValue.desc, newValue.data)
|
break;
|
||||||
break;
|
// case 'Resume_Fail':
|
||||||
case 'V_Start':
|
// ElMessage.error('无法继续检测')
|
||||||
handleStartItem('V', newValue.desc)
|
// break;
|
||||||
break;
|
case 'FREQ_Start':
|
||||||
case 'V_End':
|
handleStartItem('FREQ', newValue.desc)
|
||||||
handleEndItem('V', newValue.desc, newValue.data)
|
break;
|
||||||
break;
|
case 'FREQ_End':
|
||||||
case 'HV_Start':
|
handleEndItem('FREQ', newValue.desc, newValue.data)
|
||||||
handleStartItem('HV', newValue.desc)
|
break;
|
||||||
break;
|
case 'V_Start':
|
||||||
case 'HV_End':
|
handleStartItem('V', newValue.desc)
|
||||||
handleEndItem('HV', newValue.desc, newValue.data)
|
break;
|
||||||
break;
|
case 'V_End':
|
||||||
case 'HI_Start':
|
handleEndItem('V', newValue.desc, newValue.data)
|
||||||
handleStartItem('HI', newValue.desc)
|
break;
|
||||||
break;
|
case 'HV_Start':
|
||||||
case 'HI_End':
|
handleStartItem('HV', newValue.desc)
|
||||||
handleEndItem('HI', newValue.desc, newValue.data)
|
break;
|
||||||
break;
|
case 'HV_End':
|
||||||
case 'HP_Start':
|
handleEndItem('HV', newValue.desc, newValue.data)
|
||||||
handleStartItem('HP', newValue.desc)
|
break;
|
||||||
break;
|
case 'HI_Start':
|
||||||
case 'HP_End':
|
handleStartItem('HI', newValue.desc)
|
||||||
handleEndItem('HP', newValue.desc, newValue.data)
|
break;
|
||||||
break;
|
case 'HI_End':
|
||||||
case 'HSV_Start':
|
handleEndItem('HI', newValue.desc, newValue.data)
|
||||||
handleStartItem('HSV', newValue.desc)
|
break;
|
||||||
break;
|
case 'HP_Start':
|
||||||
case 'HSV_End':
|
handleStartItem('HP', newValue.desc)
|
||||||
handleEndItem('HSV', newValue.desc, newValue.data)
|
break;
|
||||||
break;
|
case 'HP_End':
|
||||||
case 'HSI_Start':
|
handleEndItem('HP', newValue.desc, newValue.data)
|
||||||
handleStartItem('HSI', newValue.desc)
|
break;
|
||||||
break;
|
case 'HSV_Start':
|
||||||
case 'HSI_End':
|
handleStartItem('HSV', newValue.desc)
|
||||||
handleEndItem('HSI', newValue.desc, newValue.data)
|
break;
|
||||||
break;
|
case 'HSV_End':
|
||||||
case 'VOLTAGE_Start':
|
handleEndItem('HSV', newValue.desc, newValue.data)
|
||||||
handleStartItem('VOLTAGE', newValue.desc)
|
break;
|
||||||
break;
|
case 'HSI_Start':
|
||||||
case 'VOLTAGE_End':
|
handleStartItem('HSI', newValue.desc)
|
||||||
handleEndItem('VOLTAGE', newValue.desc, newValue.data)
|
break;
|
||||||
break;
|
case 'HSI_End':
|
||||||
case 'I_Start':
|
handleEndItem('HSI', newValue.desc, newValue.data)
|
||||||
handleStartItem('I', newValue.desc)
|
break;
|
||||||
break;
|
case 'VOLTAGE_Start':
|
||||||
case 'I_End':
|
handleStartItem('VOLTAGE', newValue.desc)
|
||||||
handleEndItem('I', newValue.desc, newValue.data)
|
break;
|
||||||
break;
|
case 'VOLTAGE_End':
|
||||||
case 'IMBV_Start':
|
handleEndItem('VOLTAGE', newValue.desc, newValue.data)
|
||||||
handleStartItem('IMBV', newValue.desc)
|
break;
|
||||||
break;
|
case 'I_Start':
|
||||||
case 'IMBV_End':
|
handleStartItem('I', newValue.desc)
|
||||||
handleEndItem('IMBV', newValue.desc, newValue.data)
|
break;
|
||||||
break;
|
case 'I_End':
|
||||||
case 'IMBA_Start':
|
handleEndItem('I', newValue.desc, newValue.data)
|
||||||
handleStartItem('IMBA', newValue.desc)
|
break;
|
||||||
break;
|
case 'IMBV_Start':
|
||||||
case 'IMBA_End':
|
handleStartItem('IMBV', newValue.desc)
|
||||||
handleEndItem('IMBA', newValue.desc, newValue.data)
|
break;
|
||||||
break;
|
case 'IMBV_End':
|
||||||
case 'F_Start':
|
handleEndItem('IMBV', newValue.desc, newValue.data)
|
||||||
handleStartItem('F', newValue.desc)
|
break;
|
||||||
break;
|
case 'IMBA_Start':
|
||||||
case 'F_End':
|
handleStartItem('IMBA', newValue.desc)
|
||||||
handleEndItem('F', newValue.desc, newValue.data)
|
break;
|
||||||
break;
|
case 'IMBA_End':
|
||||||
case 'Quit':
|
handleEndItem('IMBA', newValue.desc, newValue.data)
|
||||||
console.log('检测结束')
|
break;
|
||||||
break;
|
case 'F_Start':
|
||||||
|
handleStartItem('F', newValue.desc)
|
||||||
|
break;
|
||||||
|
case 'F_End':
|
||||||
|
handleEndItem('F', newValue.desc, newValue.data)
|
||||||
|
break;
|
||||||
|
case 'Quit':
|
||||||
|
console.log('检测结束')
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user