代码提交
This commit is contained in:
@@ -22,6 +22,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="handleSubmitFast">一键检测开始</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="(stepsActiveIndex <= stepsTotalNum - 1) && (ActiveStatue !== 'success' &&ActiveStatue !== 'test_init' && ActiveStatue !=='paused_ing' && ActiveStatue !=='paused' && ActiveStatue !== 'waiting' && ActiveStatue !== 'error' && ActiveStatue !== 'test_init_fail' && ActiveStatue !== 'connect_timeout' && ActiveStatue!=='pause_timeout')"-->
|
<!-- v-if="(stepsActiveIndex <= stepsTotalNum - 1) && (ActiveStatue !== 'success' &&ActiveStatue !== 'test_init' && ActiveStatue !=='paused_ing' && ActiveStatue !=='paused' && ActiveStatue !== 'waiting' && ActiveStatue !== 'error' && ActiveStatue !== 'test_init_fail' && ActiveStatue !== 'connect_timeout' && ActiveStatue!=='pause_timeout')"-->
|
||||||
@@ -198,6 +199,85 @@ const open = (title: string) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleSubmitFast = () => {
|
||||||
|
let deviceIds = checkStore.devices.map((item) => item.deviceId)
|
||||||
|
let planId = checkStore.plan.id
|
||||||
|
|
||||||
|
if (!dataSocket.socketServe.connected) {
|
||||||
|
ElMessage.error('webSocket连接中断!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log("handleSubmit",stepsActive.value,TestStatus.value)
|
||||||
|
switch (stepsActive.value) {
|
||||||
|
case 1:
|
||||||
|
startPreTest({
|
||||||
|
userPageId: "cdf",
|
||||||
|
devIds: deviceIds,
|
||||||
|
planId: planId,
|
||||||
|
operateType: '10', // '1'为预检测、‘2‘为正式检测、'8'为不合格项复检
|
||||||
|
userId:userStore.userInfo.id,
|
||||||
|
temperature:checkStore.temperature,
|
||||||
|
humidity:checkStore.humidity
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code === 'A001014') {
|
||||||
|
ElMessageBox.alert('装置配置异常', '检测失败', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
preTestStatus.value = 'error'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
preTestStatus.value = 'start'
|
||||||
|
// setTimeout(() => {
|
||||||
|
// preTestStatus.value = 'success'
|
||||||
|
// }, 5000)
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
timeTestStatus.value = 'start'
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
// 调用系数校准组件的handleSubmit方法
|
||||||
|
channelsTestStatus.value = 'start'
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
if (TestStatus.value == "waiting") {
|
||||||
|
startPreTest({
|
||||||
|
userPageId: "cdf",
|
||||||
|
devIds: deviceIds,
|
||||||
|
planId: planId,
|
||||||
|
operateType: checkStore.reCheckType ==1 ?'2':'8', // '1'为预检测、‘2‘为正式检测、'8'为不合格项复检
|
||||||
|
userId:userStore.userInfo.id,
|
||||||
|
temperature:checkStore.temperature,
|
||||||
|
humidity:checkStore.humidity
|
||||||
|
}).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') {
|
||||||
|
// 发送继续指令
|
||||||
|
sendResume()
|
||||||
|
}
|
||||||
|
// else if (TestStatus.value == 'recheck') {
|
||||||
|
// // 发送重新检测指令
|
||||||
|
// sendReCheck()
|
||||||
|
// }
|
||||||
|
// else if (TestStatus.value == 'success') {
|
||||||
|
// handleClose()
|
||||||
|
// }
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// let loading;
|
// let loading;
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
let deviceIds = checkStore.devices.map((item) => item.deviceId)
|
let deviceIds = checkStore.devices.map((item) => item.deviceId)
|
||||||
|
|||||||
Reference in New Issue
Block a user