This commit is contained in:
caozehui
2025-02-25 14:13:59 +08:00
parent da58ffb621
commit 6300eb2f43
2 changed files with 73 additions and 64 deletions

View File

@@ -20,7 +20,7 @@
<template #footer>
<div>
<el-button type="primary" :icon="DArrowRight" v-if="stepsActiveIndex < stepsTotalNum && ActiveStatue != 'success'" @click="nextStep">跳过</el-button>
<!-- <el-button type="primary" :icon="DArrowRight" v-if="stepsActiveIndex < stepsTotalNum && ActiveStatue != 'success'" @click="nextStep">跳过</el-button>-->
<el-button type="primary" :icon="VideoPlay" v-if="ActiveStatue === 'waiting'" @click="handleSubmit">开始检测</el-button>
<el-button type="primary"
v-if="ActiveStatue !== 'waiting' && ActiveStatue !== 'error' && ActiveStatue !== 'test_init_fail' && ActiveStatue !== 'connect_timeout' && ActiveStatue!=='pause_timeout'"
@@ -70,7 +70,6 @@ import preTest from './preTest.vue'
import timeTest from './timeTest.vue'
import factorTest from './factorTest.vue'
import test from './test.vue'
import {Device} from '@/api/device/interface/device';
import socketClient from '@/utils/webSocketClient';
import {useCheckStore} from "@/stores/modules/check";
import {pauseTest, resumeTest, startPreTest} from '@/api/socket/socket'
@@ -211,21 +210,21 @@ const handleSubmit = () => {
break;
case 4:
if (TestStatus.value == "waiting") {
startPreTest({
userPageId: "cdf",
devIds: deviceIds,
planId: planId,
operateType: '2' // '1'为预检测、2为正式检测
}).then(res => {
console.log(res)
if (res.code === 'A001014') {
ElMessageBox.alert('装置配置异常', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TestStatus.value = 'test_init_fail'
}
})
startPreTest({
userPageId: "cdf",
devIds: deviceIds,
planId: planId,
operateType: '2' // '1'为预检测、2为正式检测
}).then(res => {
console.log(res)
if (res.code === 'A001014') {
ElMessageBox.alert('装置配置异常', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TestStatus.value = 'test_init_fail'
}
})
TestStatus.value = 'start'
} else if (TestStatus.value == 'paused') {
// 发送继续指令
@@ -234,7 +233,7 @@ const handleSubmit = () => {
// 发送重新检测指令
sendReCheck()
}
// else if (TestStatus.value == 'success') {
// else if (TestStatus.value == 'success') {
// handleClose()
// }
break;
@@ -290,7 +289,7 @@ watch(ActiveStatue, function (newValue, oldValue) {
nextStepText.value = '结束测试'
}
if (newValue === 'success' && nextStepText.value === '下一步') {
nextStep()
nextStep() // 实现自动点击,进入下一个测试内容
handleSubmit()
}
})
@@ -299,13 +298,18 @@ const sendPause = () => {
console.log('发起暂停请求')
TestStatus.value = 'paused_ing'
pauseTest()
setTimeout(() => {
pauseTest().then(res => {
Object.assign(webMsgSend.value, {
requestId: 'preStopTest',
operateCode: 'stop'
})
}, 5000)
})
// setTimeout(() => {
// Object.assign(webMsgSend.value, {
// requestId: 'preStopTest',
// operateCode: 'stop'
// })
// }, 5000)
}
const sendResume = () => {
console.log('发起继续检测请求')