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

View File

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

View File

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