预检测失败处理、正式检测-只检测某一个大项,日志bug

This commit is contained in:
caozehui
2025-01-09 14:45:43 +08:00
parent 839777ea4d
commit cffbfe1380
3 changed files with 71 additions and 68 deletions

View File

@@ -62,8 +62,9 @@
</template>
<script lang="tsx" setup name="preTest">
import {ElMessage} from "element-plus";
import {ElMessage, ElMessageBox} from "element-plus";
import {defineExpose} from 'vue';
const step1InitLog = ref([
{
type: 'info',
@@ -222,9 +223,6 @@ const props = defineProps({
})
const testStatus = toRef(props, 'testStatus');
const webMsgSend = toRef(props, 'webMsgSend');
const ts = ref('');
@@ -265,8 +263,6 @@ watch(webMsgSend,function (newValue,oldValue){
break;
}
break;
case 'yjc_sbtxjy':
@@ -478,8 +474,7 @@ watch(webMsgSend,function (newValue,oldValue){
type: 'wait',
log: '获取数据相序校验数据!',
}];
}
else if (newValue.code == 25001) {
} else if (newValue.code == 25001) {
step4.value = 'success'
step5.value = 'success'
step4InitLog.value.push({
@@ -517,6 +512,13 @@ watch(webMsgSend,function (newValue,oldValue){
break;
case 'unknown_operate':
break;
case 'error_flow_end':
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', {
confirmButtonText: '确定',
type: 'error',
})
ts.value = 'error'
break;
}
@@ -560,8 +562,6 @@ watch(ts, function (newValue, oldValue) {
})
// 定义一个初始化参数的方法
function initializeParameters() {
activeIndex.value = 0
@@ -599,9 +599,6 @@ function initializeParameters() {
}
defineExpose({
initializeParameters,
});

View File

@@ -33,7 +33,7 @@
<el-button
type="primary"
:icon="RefreshLeft"
v-if="testStatus === 'error'"
v-if="testStatus === 'test_recheck'"
@click="emit('sendReCheck')">重新检测
</el-button>

View File

@@ -35,7 +35,7 @@
检测中
</el-button>
<el-button type="warning" :icon="VideoPlay" v-if="ActiveStatue === 'paused'" @click="handleSubmit">继续检测</el-button>
<el-button type="primary" :icon="RefreshLeft" v-if="ActiveStatue === 'error'" @click="handleSubmit">重新检测</el-button>
<el-button type="primary" :icon="RefreshLeft" v-if="ActiveStatue === 'test_recheck'" @click="handleSubmit">重新检测</el-button>
<el-button type="primary" v-if="ActiveStatue === 'test_init'" disabled>
<el-icon class="loading-box" style="color: #fff;margin-right: 8px;">
<component :is="Refresh"/>
@@ -43,7 +43,8 @@
初始化中
</el-button>
<el-button :type="ActiveStatue==='success'?'primary':'danger'" :icon="Right"
v-if="ActiveStatue === 'success'||ActiveStatue==='test_init_fail'||ActiveStatue==='connect_timeout'" @click="nextStep">
v-if="ActiveStatue === 'success'||ActiveStatue==='error'||ActiveStatue==='test_init_fail'||ActiveStatue==='connect_timeout'"
@click="nextStep">
{{ nextStepText }}
</el-button>
</div>
@@ -312,7 +313,7 @@ const handleSubmit = () => {
// }
// })
} else if (TestStatus.value == 'error') {
} else if (TestStatus.value == 'test_recheck') {
// 发送重新检测指令
sendReCheck()
@@ -359,6 +360,11 @@ watch(ActiveStatue, function (newValue, oldValue) {
stepsActiveIndex.value++;
nextStepText.value = '检测完成'
}
if (newValue === 'error' && stepsActiveIndex.value === stepsTotalNum.value - 3) {
stepsActiveIndex.value++;
stepsActiveIndex.value++;
nextStepText.value = '检测失败'
}
if (newValue === 'test_init_fail' && stepsActiveIndex.value === stepsTotalNum.value - 2) {
stepsActiveIndex.value++;
stepsActiveIndex.value++;
@@ -426,14 +432,14 @@ const getIcon = (index: number) => {
};
const nextStep = () => {
if (stepsActiveIndex.value < stepsTotalNum.value) {
if (stepsActiveIndex.value < stepsTotalNum.value && ActiveStatue.value != 'error') {
stepsActiveIndex.value++
if (!isTimeCheck.value) {//不具备守时检测,预检测后直接跳正式检测
stepsActiveIndex.value++
}
ActiveStatue.value = 'waiting'
} else if (stepsActiveIndex.value === stepsTotalNum.value) {
} else if (stepsActiveIndex.value === stepsTotalNum.value || ActiveStatue.value === 'error') {
//emit('update:visible', false); // 关闭对话框
clearData()
dialogVisible.value = false;