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

@@ -473,25 +473,25 @@ watch(webMsgSend, function (newValue, oldValue) {
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',
// }) })
// testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源通讯失败!`}) testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源通讯失败!`})
// break; break;
// case "Dev": case "Dev":
// 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()}:设备通讯失败!`})
// break; break;
// } }
// 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':
@@ -914,6 +914,11 @@ const setErrorCheckItem = (scriptType: string, devices: CheckData.DeviceCheckRes
type: 'warning', type: 'warning',
log: `${new Date().toLocaleString()} ${devices[i].deviceName}连接超时`, log: `${new Date().toLocaleString()} ${devices[i].deviceName}连接超时`,
}) })
ElMessageBox.alert('连接超时!', '连接超时', {
confirmButtonText: '确定',
type: 'error',
})
emit('update:testStatus', 'connect_timeout')
} }
} }
} }
@@ -933,28 +938,28 @@ function getErrorCheckItem(scriptType: string) {
const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: CheckData.DeviceCheckResult[] = []) => { const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: CheckData.DeviceCheckResult[] = []) => {
let scriptType = scriptData.filter(item => item.code === scriptCode)[0]?.id let scriptType = scriptData.filter(item => item.code === scriptCode)[0]?.id
devices = [ // devices = [
{ // {
chnResult: [1, 1, 1, 1], // chnResult: [1, 1, 1, 1],
deviceId: "3250a0ff180845cc8885da4ff628261e", // deviceId: "3250a0ff180845cc8885da4ff628261e",
deviceName: "测试装置-0122-02" // deviceName: "测试装置-0122-02"
}, // },
// { // {
// chnResult: [1, 1, 1, 1], // chnResult: [1, 1, 1, 1],
// deviceId: "df23a4178d194467a432ddf45e835e48", // deviceId: "df23a4178d194467a432ddf45e835e48",
// deviceName: "240003" // deviceName: "240003"
// }, // },
// { // {
// chnResult: [1, 1, 1, 1], // chnResult: [1, 1, 1, 1],
// deviceId: "ae5a7628260349c0a5e7c86c81fbd417", // deviceId: "ae5a7628260349c0a5e7c86c81fbd417",
// deviceName: "240004" // deviceName: "240004"
// } // },
// { // {
// chnResult: [1, 1, 1, 1], // chnResult: [1, 1, 1, 1],
// deviceId: "461813a4f30f4a34a1a273ecd0379458", // deviceId: "461813a4f30f4a34a1a273ecd0379458",
// deviceName: "25011407" // deviceName: "25011407"
// } // }
] // ]
let temp = null let temp = null
if (isStart) { if (isStart) {
temp = getLoadingResult(scriptType) temp = getLoadingResult(scriptType)
@@ -1335,7 +1340,7 @@ const handleResumeTest = () => {
type: 'info', type: 'info',
log: `${new Date().toLocaleString()}:继续检测`, log: `${new Date().toLocaleString()}:继续检测`,
}) })
startTimer() //startTimer()
resumeTimeCount() resumeTimeCount()
console.log('开始继续检测') console.log('开始继续检测')
}; };

View File

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