2025-08-05 10:37:40 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<el-tabs type="border-card">
|
|
|
|
|
|
<el-tab-pane label="预检测项目">
|
|
|
|
|
|
<div class="form-grid">
|
|
|
|
|
|
<el-checkbox v-for="(item, index) in detectionOptions" v-model="item.selected" :key="index"
|
|
|
|
|
|
:label="item.name" disabled></el-checkbox>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
</el-tabs>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="test-dialog">
|
|
|
|
|
|
<div class="dialog-left">
|
|
|
|
|
|
<el-steps direction="vertical" :active="activeIndex" :process-status="currentStepStatus"
|
|
|
|
|
|
finish-status="success">
|
|
|
|
|
|
<el-step :status="step1" title="设备通讯校验"/>
|
|
|
|
|
|
<el-step :status="step2" title="协议校验"/>
|
|
|
|
|
|
<el-step :status="step3" title="模型一致性校验"/>
|
|
|
|
|
|
<el-step :status="step4" title="实时数据对齐验证"/>
|
|
|
|
|
|
<el-step :status="step5" title="相序校验"/>
|
|
|
|
|
|
<!-- <el-step :status="step6" title="遥控录波功能验证"/> -->
|
|
|
|
|
|
<el-step :status="step6" :title="ts === 'error'? '检测失败':ts === 'process'? '检测中':ts === 'success'? '检测成功':'待检测'"/>
|
|
|
|
|
|
</el-steps>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="dialog-right">
|
|
|
|
|
|
<el-collapse v-model="collapseActiveName" accordion>
|
|
|
|
|
|
<el-collapse-item title="设备通讯校验" name="1">
|
|
|
|
|
|
<div class="div-log">
|
|
|
|
|
|
<p v-for="(item, index) in step1InitLog" :key="index"
|
|
|
|
|
|
:style="{ color: item.type === 'error' ? '#F56C6C' : 'var(--el-text-color-regular)' }">
|
|
|
|
|
|
{{ item.log }} <br/>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-collapse-item>
|
|
|
|
|
|
<el-collapse-item title="协议校验" name="2">
|
|
|
|
|
|
<div class="div-log">
|
|
|
|
|
|
<p v-for="(item, index) in step2InitLog" :key="index"
|
|
|
|
|
|
:style="{ color: item.type === 'error' ? '#F56C6C' : 'var(--el-text-color-regular)' }">
|
|
|
|
|
|
{{ item.log }} <br/>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-collapse-item>
|
|
|
|
|
|
<el-collapse-item title="模型一致性校验" name="3">
|
|
|
|
|
|
<div class="div-log">
|
|
|
|
|
|
<p v-for="(item, index) in step3InitLog" :key="index"
|
|
|
|
|
|
:style="{ color: item.type === 'error' ? '#F56C6C' : 'var(--el-text-color-regular)' }">
|
|
|
|
|
|
{{ item.log }} <br/>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-collapse-item>
|
|
|
|
|
|
<el-collapse-item name="4">
|
|
|
|
|
|
<template #title>
|
|
|
|
|
|
实时数据对齐验证
|
|
|
|
|
|
<el-icon class="title-icon" @click="openDialog"><InfoFilled/></el-icon>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<div class="div-log">
|
|
|
|
|
|
<p v-for="(item, index) in step4InitLog" :key="index"
|
|
|
|
|
|
:style="{ color: item.type === 'error' ? '#F56C6C' : 'var(--el-text-color-regular)' }">
|
|
|
|
|
|
{{ item.log }}
|
|
|
|
|
|
<br/>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-collapse-item>
|
|
|
|
|
|
<el-collapse-item title="相序校验" name="5">
|
|
|
|
|
|
<div class="div-log">
|
|
|
|
|
|
<p v-for="(item, index) in step5InitLog" :key="index"
|
|
|
|
|
|
:style="{ color: item.type === 'error' ? '#F56C6C' : 'var(--el-text-color-regular)' }">
|
|
|
|
|
|
{{ item.log }} <br/>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-collapse-item>
|
|
|
|
|
|
<!-- <el-collapse-item title="遥控录波功能验证" name="3">
|
|
|
|
|
|
<div class="div-log">
|
|
|
|
|
|
<p v-for="(item, index) in step3InitLog" :key="index"
|
|
|
|
|
|
:style="{ color: item.type === 'error' ? '#F56C6C' : 'var(--el-text-color-regular)' }">
|
|
|
|
|
|
{{ item.log.split('&&')[0] }}
|
|
|
|
|
|
<br v-if="item.log.includes('&&')"/>
|
|
|
|
|
|
{{ item.log.split('&&')[1] }}
|
|
|
|
|
|
|
|
|
|
|
|
<br v-if="item.log.includes('&&')"/>
|
|
|
|
|
|
{{ item.log.split('&&')[2] }}
|
|
|
|
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-collapse-item> -->
|
|
|
|
|
|
</el-collapse>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-08-08 13:18:01 +08:00
|
|
|
|
<RealTimeData ref="realTimeDataRef" />
|
2025-08-05 10:37:40 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<script lang="tsx" setup name="preTest">
|
|
|
|
|
|
import {ElMessage, ElMessageBox, StepProps} from "element-plus";
|
2025-08-08 13:18:01 +08:00
|
|
|
|
import {defineExpose, PropType, ref, toRef, watch} from 'vue';
|
2025-08-05 10:37:40 +08:00
|
|
|
|
import RealTimeData from './realTimeDataAlign.vue'
|
|
|
|
|
|
|
|
|
|
|
|
const realTimeDataRef = ref()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const step1InitLog = ref([
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '暂无数据,等待检测开始',
|
|
|
|
|
|
},
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
const step2InitLog = ref([
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '暂无数据,等待检测开始',
|
|
|
|
|
|
},
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
const step3InitLog = ref([
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '暂无数据,等待检测开始',
|
|
|
|
|
|
},
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
const step4InitLog = ref([
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '暂无数据,等待检测开始',
|
|
|
|
|
|
},
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
const step5InitLog = ref([
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '暂无数据,等待检测开始',
|
|
|
|
|
|
},
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const collapseActiveName = ref('1')
|
|
|
|
|
|
const activeIndex = ref(0)
|
|
|
|
|
|
const activeTotalNum = ref(5)
|
|
|
|
|
|
const step1 = ref<StepProps['status']>('wait')
|
|
|
|
|
|
const step2 = ref<StepProps['status']>('wait')
|
|
|
|
|
|
const step3 = ref<StepProps['status']>('wait')
|
|
|
|
|
|
const step4 = ref<StepProps['status']>('wait')
|
|
|
|
|
|
const step5 = ref<StepProps['status']>('wait')
|
|
|
|
|
|
const step6 = ref<StepProps['status']>('wait')
|
|
|
|
|
|
|
|
|
|
|
|
//定义与预检测配置数组
|
|
|
|
|
|
const detectionOptions = ref([
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 0,
|
|
|
|
|
|
name: "设备通讯校验",
|
|
|
|
|
|
selected: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 1,
|
|
|
|
|
|
name: "协议校验",
|
|
|
|
|
|
selected: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 2,
|
|
|
|
|
|
name: "模型一致性校验",
|
|
|
|
|
|
selected: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 3,
|
|
|
|
|
|
name: "实时数据对齐验证",
|
|
|
|
|
|
selected: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 4,
|
|
|
|
|
|
name: "相序校验",
|
|
|
|
|
|
selected: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process'>('finish');
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
|
testStatus: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: 'wait'
|
|
|
|
|
|
},
|
|
|
|
|
|
webMsgSend: {
|
|
|
|
|
|
type: Object,
|
|
|
|
|
|
default: () => ({})
|
2025-08-08 13:18:01 +08:00
|
|
|
|
},
|
|
|
|
|
|
mapping: {
|
|
|
|
|
|
type: Object as PropType<Record<string, Record<string, string>>>,
|
|
|
|
|
|
default: () => ({})
|
2025-08-05 10:37:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const testStatus = toRef(props, 'testStatus');
|
|
|
|
|
|
const webMsgSend = toRef(props, 'webMsgSend');
|
|
|
|
|
|
const ts = ref('');
|
|
|
|
|
|
|
|
|
|
|
|
watch(webMsgSend, function (newValue, oldValue) {
|
2025-08-08 13:18:01 +08:00
|
|
|
|
console.log('newValue.requestId', newValue.requestId)
|
|
|
|
|
|
console.log('testStatus.value', testStatus.value)
|
2025-08-05 10:37:40 +08:00
|
|
|
|
if (testStatus.value !== 'waiting') {
|
2025-08-08 13:18:01 +08:00
|
|
|
|
console.log('newValue.requestId', newValue.requestId)
|
2025-08-05 10:37:40 +08:00
|
|
|
|
switch (newValue.requestId) {
|
|
|
|
|
|
case 'yjc_sbtxjy':
|
|
|
|
|
|
switch (newValue.operateCode) {
|
|
|
|
|
|
case 'INIT_GATHER$01':
|
|
|
|
|
|
if (newValue.code == 10200) {
|
|
|
|
|
|
step1InitLog.value.push({
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: newValue.data + '设备通讯校验成功!',
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
} else if (newValue.code == 10201) {
|
|
|
|
|
|
step1.value = 'process'
|
|
|
|
|
|
step1InitLog.value = [{
|
|
|
|
|
|
type: 'wait',
|
|
|
|
|
|
log: '正在进行设备通讯校验.....',
|
|
|
|
|
|
}];
|
|
|
|
|
|
} else if (newValue.code == 10550) {
|
|
|
|
|
|
step1InitLog.value.push({
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
log: newValue.data + '设备连接异常!',
|
|
|
|
|
|
})
|
|
|
|
|
|
step1.value = 'error'
|
|
|
|
|
|
// ts.value = 'error'
|
|
|
|
|
|
// step6.value = 'error'
|
|
|
|
|
|
} else if (newValue.code == 10551) {
|
|
|
|
|
|
step1InitLog.value.push({
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
log: newValue.data + '设备触发报告异常!',
|
|
|
|
|
|
})
|
|
|
|
|
|
step1.value = 'error'
|
|
|
|
|
|
ts.value = 'error'
|
|
|
|
|
|
step6.value = 'error'
|
|
|
|
|
|
} else if (newValue.code == 10552) {
|
|
|
|
|
|
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
|
2025-08-08 13:18:01 +08:00
|
|
|
|
step1InitLog.value = [{
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'wait',
|
|
|
|
|
|
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
|
|
|
|
|
|
}];
|
|
|
|
|
|
step1.value = 'error'
|
|
|
|
|
|
ts.value = 'error'
|
|
|
|
|
|
step6.value = 'error'
|
|
|
|
|
|
} else if (newValue.code == 25001) {
|
|
|
|
|
|
activeIndex.value = 1
|
|
|
|
|
|
step1.value = 'success'
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2.value = 'process'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'yjc_xyjy':
|
|
|
|
|
|
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) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'error',
|
|
|
|
|
|
log: newValue.data + '设备触发报告异常!',
|
|
|
|
|
|
})
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
ts.value = 'error'
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
} else if (newValue.code == 10552) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2InitLog.value = [{
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'wait',
|
|
|
|
|
|
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
|
|
|
|
|
|
}];
|
|
|
|
|
|
ts.value = 'error'
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'INIT_GATHER$02':
|
|
|
|
|
|
if (newValue.code == 10200) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '实时数据协议校验:' + newValue.data + '通讯协议校验成功!',
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
} else if (newValue.code == 10201) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2.value = 'process'
|
|
|
|
|
|
step2InitLog.value = [{
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'wait',
|
|
|
|
|
|
log: '正在进行通讯协议校验.....',
|
|
|
|
|
|
}];
|
|
|
|
|
|
} else if (newValue.code == 10550) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'error',
|
|
|
|
|
|
log: newValue.data + '设备连接异常!',
|
|
|
|
|
|
})
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
// ts.value = 'error'
|
|
|
|
|
|
// step5.value = 'error'
|
|
|
|
|
|
} else if (newValue.code == 10551) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'error',
|
|
|
|
|
|
log: newValue.data + '设备触发报告异常!',
|
|
|
|
|
|
})
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
ts.value = 'error'
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
} else if (newValue.code == 10552) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2InitLog.value = [{
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'wait',
|
|
|
|
|
|
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
|
|
|
|
|
|
}];
|
|
|
|
|
|
ts.value = 'error'
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'INIT_GATHER$03':
|
|
|
|
|
|
if (newValue.code == 10200) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '暂态数据协议校验:' + newValue.data + '通讯协议校验成功!',
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
} else if (newValue.code == 10201) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2.value = 'process'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
} else if (newValue.code == 10550) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'error',
|
|
|
|
|
|
log: newValue.data + '设备连接异常!',
|
|
|
|
|
|
})
|
|
|
|
|
|
step3.value = 'error'
|
|
|
|
|
|
// ts.value = 'error'
|
|
|
|
|
|
// step5.value = 'error'
|
|
|
|
|
|
} else if (newValue.code == 10551) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'error',
|
|
|
|
|
|
log: newValue.data + '设备触发报告异常!',
|
|
|
|
|
|
})
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
ts.value = 'error'
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
} else if (newValue.code == 10552) {
|
|
|
|
|
|
//ElMessage.error("当前步骤已经初始化,执行自动关闭,请重新发起检测!")
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2.value = 'error'
|
|
|
|
|
|
step2InitLog.value = [{
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'wait',
|
|
|
|
|
|
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
|
|
|
|
|
|
}];
|
|
|
|
|
|
ts.value = 'error'
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'VERIFY_MAPPING$01':
|
|
|
|
|
|
if (newValue.code == 25001) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
activeIndex.value = 2
|
|
|
|
|
|
step2.value = 'success'
|
|
|
|
|
|
step3.value = 'process'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
} else if (newValue.code == 10200) {
|
|
|
|
|
|
let data = JSON.parse(newValue.data)
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'error',
|
|
|
|
|
|
log: `脚本与icd检验失败! icd名称:${data['icdType']} -> 校验项:${data['dataType']}`,
|
|
|
|
|
|
})
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
ts.value = 'error'
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
} else if (newValue.code == 10500) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'error',
|
|
|
|
|
|
log: `装置中未找到该icd!`,
|
|
|
|
|
|
})
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step2.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
ts.value = 'error'
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2025-08-06 15:18:27 +08:00
|
|
|
|
case 'YJC_mxyzxjy':
|
|
|
|
|
|
switch (newValue.operateCode){
|
|
|
|
|
|
case 'DATA_REQUEST$02':
|
|
|
|
|
|
if (newValue.code == 10200) {
|
|
|
|
|
|
step3InitLog.value.push({
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '模型一致性检验成功!',
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
if (newValue.code == 25001) {
|
|
|
|
|
|
step3.value = 'success'
|
|
|
|
|
|
step4.value = 'process'
|
|
|
|
|
|
activeIndex.value = 3
|
|
|
|
|
|
}else if (newValue.code == 25004) {
|
|
|
|
|
|
step3.value = 'error'
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'YJC_sssjdqjy':
|
|
|
|
|
|
switch (newValue.operateCode){
|
|
|
|
|
|
case 'OPER_GATHER':
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2025-08-05 10:37:40 +08:00
|
|
|
|
case 'YJC_xujy':
|
|
|
|
|
|
switch (newValue.operateCode) {
|
|
|
|
|
|
case 'OPER_GATHER':
|
|
|
|
|
|
if (newValue.code == 10200) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step5InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '源参数下发成功,等待校验中.....',
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
} else if (newValue.code == 10201) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step5.value = 'process'
|
|
|
|
|
|
step5InitLog.value = [{
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'wait',
|
|
|
|
|
|
log: '源参数下发中.....',
|
|
|
|
|
|
}];
|
|
|
|
|
|
} else if (newValue.code == 10552) {
|
|
|
|
|
|
ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
|
|
|
|
|
|
step5.value = 'error'
|
2025-08-06 15:18:27 +08:00
|
|
|
|
ts.value = 'error'
|
|
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
} else if (newValue.code == 10520) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step5.value = 'error'
|
|
|
|
|
|
step5InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'error',
|
|
|
|
|
|
log: '解析报文异常',
|
|
|
|
|
|
})
|
|
|
|
|
|
ts.value = 'error'
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'DATA_REQUEST$02':
|
|
|
|
|
|
if (newValue.code == 10200) {
|
|
|
|
|
|
let type = 'info'
|
|
|
|
|
|
if (newValue.data.includes('不合格')) {
|
|
|
|
|
|
type = 'error'
|
|
|
|
|
|
}
|
|
|
|
|
|
newValue.data.split('<br/>')
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step5InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: type,
|
|
|
|
|
|
log: newValue.data,
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
} else if (newValue.code == 10201) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step5.value = 'process'
|
|
|
|
|
|
step5InitLog.value = [{
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'wait',
|
|
|
|
|
|
log: '获取数据相序校验数据!',
|
|
|
|
|
|
}];
|
|
|
|
|
|
} else if (newValue.code == 25003) {
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step5.value = 'error'
|
|
|
|
|
|
step5InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'error',
|
|
|
|
|
|
log: '相序校验未通过!',
|
|
|
|
|
|
})
|
|
|
|
|
|
ts.value = 'error'
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
} else if (newValue.code == 25001) {
|
|
|
|
|
|
step5.value = 'success'
|
2025-08-06 15:18:27 +08:00
|
|
|
|
step6.value = 'success'
|
|
|
|
|
|
step5InitLog.value.push({
|
2025-08-05 10:37:40 +08:00
|
|
|
|
type: 'wait',
|
|
|
|
|
|
log: '相序校验成功!',
|
|
|
|
|
|
})
|
|
|
|
|
|
ts.value = 'success'
|
|
|
|
|
|
}
|
|
|
|
|
|
activeIndex.value = 5
|
|
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'quit':
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'connect':
|
|
|
|
|
|
switch (newValue.operateCode) {
|
|
|
|
|
|
case "Source":
|
|
|
|
|
|
step1.value = 'error'
|
|
|
|
|
|
step1InitLog.value = [{
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
log: '源服务端连接失败!',
|
|
|
|
|
|
}];
|
|
|
|
|
|
ts.value = 'error'
|
2025-08-08 13:18:01 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case "Dev":
|
|
|
|
|
|
step2.value = 'error'
|
|
|
|
|
|
step2InitLog.value = [{
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
log: '设备服务端连接失败!',
|
|
|
|
|
|
}];
|
|
|
|
|
|
ts.value = 'error'
|
2025-08-08 13:18:01 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'unknown_operate':
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'error_flow_end':
|
|
|
|
|
|
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
|
|
|
|
|
ts.value = 'error'
|
2025-08-08 13:18:01 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case 'socket_timeout':
|
|
|
|
|
|
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
|
|
|
|
|
ts.value = 'error'
|
2025-08-08 13:18:01 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case 'server_error':
|
|
|
|
|
|
ElMessageBox.alert('服务端主动关闭连接!', '初始化失败', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
|
|
|
|
|
ts.value = 'error'
|
2025-08-08 13:18:01 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case 'device_error':
|
|
|
|
|
|
ElMessageBox.alert('设备主动关闭连接!', '初始化失败', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
|
|
|
|
|
ts.value = 'error'
|
2025-08-08 13:18:01 +08:00
|
|
|
|
step6.value = 'error'
|
2025-08-05 10:37:40 +08:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
watch(activeIndex, function (newValue, oldValue) {
|
|
|
|
|
|
if (newValue <= activeTotalNum.value - 2) {
|
|
|
|
|
|
collapseActiveName.value = (newValue + 1).toString()
|
|
|
|
|
|
} else {
|
|
|
|
|
|
collapseActiveName.value = (newValue - 1).toString()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
//监听goods_sn的变化
|
|
|
|
|
|
watch(testStatus, function (newValue, oldValue) {
|
|
|
|
|
|
ts.value = props.testStatus;
|
|
|
|
|
|
if (ts.value === 'start') {
|
|
|
|
|
|
ts.value = 'process'
|
|
|
|
|
|
} else if (ts.value === 'waiting') {
|
|
|
|
|
|
activeIndex.value = 0
|
|
|
|
|
|
step1InitLog.value = [
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '暂无数据,等待检测开始',
|
|
|
|
|
|
},
|
|
|
|
|
|
]
|
|
|
|
|
|
step1.value = 'finish'
|
|
|
|
|
|
step2.value = 'wait'
|
|
|
|
|
|
step3.value = 'wait'
|
|
|
|
|
|
step4.value = 'wait'
|
|
|
|
|
|
step5.value = 'wait'
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['update:testStatus']);
|
|
|
|
|
|
//监听sn
|
|
|
|
|
|
watch(ts, function (newValue, oldValue) {
|
|
|
|
|
|
//修改父组件
|
|
|
|
|
|
emit('update:testStatus', ts.value)
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 定义一个初始化参数的方法
|
|
|
|
|
|
function initializeParameters() {
|
|
|
|
|
|
activeIndex.value = 0
|
|
|
|
|
|
step1.value = 'process'
|
|
|
|
|
|
step2.value = 'wait'
|
|
|
|
|
|
step3.value = 'wait'
|
|
|
|
|
|
step4.value = 'wait'
|
|
|
|
|
|
step5.value = 'wait'
|
|
|
|
|
|
|
|
|
|
|
|
step1InitLog.value = [
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '暂无数据,等待检测开始',
|
|
|
|
|
|
},
|
|
|
|
|
|
]
|
|
|
|
|
|
step2InitLog.value = [
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '暂无数据,等待检测开始',
|
|
|
|
|
|
},
|
|
|
|
|
|
]
|
|
|
|
|
|
step3InitLog.value = [
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '暂无数据,等待检测开始',
|
|
|
|
|
|
},
|
|
|
|
|
|
]
|
|
|
|
|
|
step4InitLog.value = [
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '暂无数据,等待检测开始',
|
|
|
|
|
|
},
|
|
|
|
|
|
]
|
|
|
|
|
|
step5InitLog.value = [
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
log: '暂无数据,等待检测开始',
|
|
|
|
|
|
},
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const openDialog = () => {
|
2025-08-08 13:18:01 +08:00
|
|
|
|
realTimeDataRef.value.open(props.mapping)
|
2025-08-05 10:37:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
|
|
initializeParameters,
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.title-icon {
|
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.test-dialog {
|
|
|
|
|
|
height: 350px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
|
/* 横向排列 */
|
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dialog-left {
|
|
|
|
|
|
width: 15%;
|
|
|
|
|
|
margin-left: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dialog-right {
|
|
|
|
|
|
margin-left: 20px;
|
|
|
|
|
|
width: 80%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dialog-right :deep(.el-collapse-item__header) {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.div-log {
|
|
|
|
|
|
height: 145px;
|
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
padding-left: 10px;
|
|
|
|
|
|
|
|
|
|
|
|
p {
|
|
|
|
|
|
margin: 5px 0;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|