This commit is contained in:
caozehui
2025-01-07 19:47:38 +08:00
parent 5ac6bbf04b
commit edda224847
4 changed files with 471 additions and 447 deletions

View File

@@ -100,7 +100,7 @@
<template #default="scope"> <template #default="scope">
<el-tooltip effect="dark" placement="bottom"> <el-tooltip effect="dark" placement="bottom">
<template #content> <template #content>
最大误差{{ scope.row.maxError }} {{ unit }}<br/> 最大误差 {{ maxErrorView }}<br/>
误差值{{ scope.row.tError }} {{ unit }} 误差值{{ scope.row.tError }} {{ unit }}
</template> </template>
<el-tag type="success" v-if="scope.row.isDataT === 1">符合</el-tag> <el-tag type="success" v-if="scope.row.isDataT === 1">符合</el-tag>

View File

@@ -90,7 +90,7 @@
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
import {dialogBig} from '@/utils/elementBind' import {dialogBig} from '@/utils/elementBind'
import {reactive, ref, watch} from 'vue' import {nextTick, reactive, ref, watch} from 'vue'
import DataCheckResultTable from './dataCheckResultTable.vue' import DataCheckResultTable from './dataCheckResultTable.vue'
import DataCheckRawDataTable from './dataCheckRawDataTable.vue' import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
import {CheckData} from "@/api/check/interface"; import {CheckData} from "@/api/check/interface";
@@ -249,6 +249,9 @@ const defaultOperate = () => {
currentDesc.value = node.sourceDesc currentDesc.value = node.sourceDesc
checkIndex.value = node.index checkIndex.value = node.index
defaultExpandedKeys = [node.index] defaultExpandedKeys = [node.index]
// nextTick(() => {
// treeRef.value?.setCurrentKey(node.index);
// });
} else { } else {
currentScriptTypeName.value = '' currentScriptTypeName.value = ''
currentDesc.value = '' currentDesc.value = ''

View File

@@ -43,7 +43,7 @@
<el-button <el-button
type="warning" type="warning"
v-if="testStatus=='paused' && percentage < 100" v-if="testStatus=='paused' && percentage < 100"
:icon="Refresh" :icon="VideoPlay"
@click="emit('sendResume')" @click="emit('sendResume')"
>继续检测 >继续检测
</el-button> </el-button>
@@ -136,7 +136,7 @@
<dataCheckSingleChannelSingleTestPopup ref="dataCheckSingleChannelSingleTestPopupRef"/> <dataCheckSingleChannelSingleTestPopup ref="dataCheckSingleChannelSingleTestPopupRef"/>
</template> </template>
<script lang="tsx" setup name="test"> <script lang="tsx" setup name="test">
import {Check, Failed, InfoFilled, Loading, Refresh, RefreshLeft, VideoPause} from '@element-plus/icons-vue' import {Check, Failed, InfoFilled, Loading, Refresh, RefreshLeft, VideoPause, VideoPlay} from '@element-plus/icons-vue'
import resultPopup from './resultPopup.vue' import resultPopup from './resultPopup.vue'
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue' import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
import {computed, reactive, ref, toRef, watch} from "vue"; import {computed, reactive, ref, toRef, watch} from "vue";
@@ -297,7 +297,7 @@ watch(testStatus, function (newValue, oldValue) {
percentage.value = 0 percentage.value = 0
} }
emit('update:testStatus', 'test_init') emit('update:testStatus', 'test_init')
startTimer() // todo 可移除 //startTimer() // todo 可移除
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化开始!`}) testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化开始!`})
} }
}) })
@@ -340,25 +340,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':
@@ -386,7 +386,7 @@ watch(webMsgSend, function (newValue, oldValue) {
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化成功!`}) testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化成功!`})
activeIndex = getNextActiveIndex() + 2 activeIndex = getNextActiveIndex() + 2
startTimer() //startTimer()
emit('update:testStatus', 'process') emit('update:testStatus', 'process')
} }
@@ -419,7 +419,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('FREQ') activeIndex = getNextActiveIndex('FREQ')
startTimer() //startTimer()
} }
break; break;
case 'V_Start': case 'V_Start':
@@ -432,7 +432,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('V') activeIndex = getNextActiveIndex('V')
startTimer() //startTimer()
} }
break; break;
case 'HV_Start': case 'HV_Start':
@@ -445,7 +445,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HV') activeIndex = getNextActiveIndex('HV')
startTimer() //startTimer()
} }
break; break;
case 'HI_Start': case 'HI_Start':
@@ -458,7 +458,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HI') activeIndex = getNextActiveIndex('HI')
startTimer() //startTimer()
} }
break; break;
case 'HP_Start': case 'HP_Start':
@@ -471,7 +471,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HP') activeIndex = getNextActiveIndex('HP')
startTimer() //startTimer()
} }
break; break;
case 'HSV_Start': case 'HSV_Start':
@@ -484,7 +484,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HSV') activeIndex = getNextActiveIndex('HSV')
startTimer() //startTimer()
} }
break; break;
case 'HSI_Start': case 'HSI_Start':
@@ -497,7 +497,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HSI') activeIndex = getNextActiveIndex('HSI')
startTimer() //startTimer()
} }
break; break;
case 'VOLTAGE_Start': case 'VOLTAGE_Start':
@@ -510,7 +510,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('VOLTAGE') activeIndex = getNextActiveIndex('VOLTAGE')
startTimer() //startTimer()
} }
break; break;
case 'I_Start': case 'I_Start':
@@ -523,7 +523,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('I') activeIndex = getNextActiveIndex('I')
startTimer() //startTimer()
} }
break; break;
case 'IMBV_Start': case 'IMBV_Start':
@@ -536,7 +536,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('IMBV') activeIndex = getNextActiveIndex('IMBV')
startTimer() //startTimer()
} }
break; break;
case 'IMBA_Start': case 'IMBA_Start':
@@ -549,7 +549,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('IMBA') activeIndex = getNextActiveIndex('IMBA')
startTimer() //startTimer()
} }
break; break;
case 'F_Start': case 'F_Start':
@@ -562,7 +562,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('F') activeIndex = getNextActiveIndex('F')
startTimer() //startTimer()
} }
break; break;
case 'Quit': case 'Quit':
@@ -796,11 +796,11 @@ const setErrorCheckItem = (scriptType: string, devices: any) => {
const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: any = null) => { const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: any = null) => {
let scriptType = scriptData.filter(item => item.code === scriptCode)[0]?.id let scriptType = scriptData.filter(item => item.code === scriptCode)[0]?.id
devices = [{ // devices = [{
chnResult: [2, 2], // chnResult: [2, 2],
deviceId: "80b4b4f52a4c4064a18319525f8ac13c", // deviceId: "80b4b4f52a4c4064a18319525f8ac13c",
deviceName: "240002" // deviceName: "240002"
}] // }]
setErrorCheckItem(scriptType, devices) setErrorCheckItem(scriptType, devices)
let temp = null let temp = null
if (isStart) { if (isStart) {
@@ -1126,7 +1126,7 @@ const handleResumeTest = () => {
type: 'info', type: 'info',
log: `${new Date().toLocaleString()}:继续检测`, log: `${new Date().toLocaleString()}:继续检测`,
}) })
startTimer() //startTimer()
console.log('开始继续检测') console.log('开始继续检测')
}; };

View File

@@ -1,5 +1,6 @@
<template> <template>
<el-dialog :title="dialogTitle" :model-value="dialogVisible" :before-close="beforeClose" @close="handleCancel" width="1200px" height="1000px" draggable> <el-dialog :title="dialogTitle" :model-value="dialogVisible" :before-close="beforeClose" @close="handleCancel" width="1200px" height="1000px"
draggable>
<div class="steps-container"> <div class="steps-container">
<!-- simple --> <!-- simple -->
@@ -17,17 +18,30 @@
<preTest ref="preTestRef" v-if="stepsActiveIndex === 0" v-model:testStatus="preTestStatus" :webMsgSend="webMsgSend"></preTest> <preTest ref="preTestRef" v-if="stepsActiveIndex === 0" v-model:testStatus="preTestStatus" :webMsgSend="webMsgSend"></preTest>
<timeTest v-if="stepsActiveIndex === 1 && isTimeCheck" v-model:testStatus="timeTestStatus"></timeTest> <timeTest v-if="stepsActiveIndex === 1 && isTimeCheck" v-model:testStatus="timeTestStatus"></timeTest>
<!-- <channelsTest v-if="stepsActiveIndex === 2" v-model:testStatus="channelsTestStatus"></channelsTest> --> <!-- <channelsTest v-if="stepsActiveIndex === 2" v-model:testStatus="channelsTestStatus"></channelsTest> -->
<test ref="testRef" v-if="stepsActiveIndex >= 2" v-model:testStatus="TestStatus" :webMsgSend="webMsgSend" @update:webMsgSend="webMsgSend=$event" @sendPause="sendPause" @sendResume="sendResume" @sendReCheck="sendReCheck"></test> <test ref="testRef" v-if="stepsActiveIndex >= 2" v-model:testStatus="TestStatus" :webMsgSend="webMsgSend" @update:webMsgSend="webMsgSend=$event"
@sendPause="sendPause" @sendResume="sendResume" @sendReCheck="sendReCheck"></test>
<template #footer> <template #footer>
<div> <div>
<!-- <el-button @click="handleCancel"> </el-button> --> <!-- <el-button @click="handleCancel"> </el-button> -->
<el-button type="primary" :icon="DArrowRight" v-if="stepsActiveIndex < 2 && ActiveStatue != 'success'" :disabled="skipDisabled" @click="nextStep">跳过</el-button> <el-button type="primary" :icon="DArrowRight" v-if="stepsActiveIndex < 2 && ActiveStatue != 'success'" :disabled="skipDisabled"
@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="danger" :icon="Close" v-if="ActiveStatue === 'process'" @click="handleSubmit" disabled>检测中</el-button> <el-button type="primary" v-if="ActiveStatue === 'process'" @click="handleSubmit" disabled>
<el-button type="danger" :icon="Close" v-if="ActiveStatue === 'paused'" @click="handleSubmit">继续检测</el-button> <el-icon class="loading-box" style="color: #fff;margin-right: 8px;">
<component :is="Refresh"/>
</el-icon>
检测中
</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 === 'error'" @click="handleSubmit">重新检测</el-button>
<el-button type="primary" :icon="Refresh" v-if="ActiveStatue === 'test_init'" disabled>初始化中</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"/>
</el-icon>
初始化中
</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==='test_init_fail'||ActiveStatue==='connect_timeout'" @click="nextStep">
{{ nextStepText }} {{ nextStepText }}
@@ -55,7 +69,7 @@
SuccessFilled, SuccessFilled,
UploadFilled, UploadFilled,
VideoPlay, VideoPlay,
RefreshLeft RefreshLeft, Loading
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import preTest from './preTest.vue' import preTest from './preTest.vue'
import timeTest from './timeTest.vue' import timeTest from './timeTest.vue'
@@ -213,8 +227,6 @@ const detectionOptions = ref([
}); });
} }
let loading; let loading;
@@ -312,8 +324,6 @@ const detectionOptions = ref([
} }
}; };
@@ -344,20 +354,17 @@ const detectionOptions = ref([
skipDisabled.value = false skipDisabled.value = false
} }
if(newValue === 'success' && stepsActiveIndex.value === stepsTotalNum.value - 2) if (newValue === 'success' && stepsActiveIndex.value === stepsTotalNum.value - 2) {
{
stepsActiveIndex.value++; stepsActiveIndex.value++;
stepsActiveIndex.value++; stepsActiveIndex.value++;
nextStepText.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++;
nextStepText.value = '初始化失败' nextStepText.value = '初始化失败'
} }
if(newValue === 'connect_timeout' && stepsActiveIndex.value === stepsTotalNum.value - 2) if (newValue === 'connect_timeout' && stepsActiveIndex.value === stepsTotalNum.value - 2) {
{
stepsActiveIndex.value++; stepsActiveIndex.value++;
stepsActiveIndex.value++; stepsActiveIndex.value++;
nextStepText.value = '连接超时' nextStepText.value = '连接超时'
@@ -403,27 +410,30 @@ const detectionOptions = ref([
const getIcon = (index: number) => { const getIcon = (index: number) => {
if (stepsActiveIndex.value > index) return SuccessFilled; if (stepsActiveIndex.value > index) return SuccessFilled;
switch (index) { switch (index) {
case 0: return h(<svg-icon name="preTest"></svg-icon>); case 0:
case 1: return UploadFilled; return h(<svg-icon name="preTest"></svg-icon>);
case 2: return Odometer; case 1:
case 3: return Coin; return UploadFilled;
case 4: return Key; case 2:
default: return null; return Odometer;
case 3:
return Coin;
case 4:
return Key;
default:
return null;
} }
}; };
const nextStep = () => { const nextStep = () => {
if(stepsActiveIndex.value < stepsTotalNum.value ) if (stepsActiveIndex.value < stepsTotalNum.value) {
{
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)
{
//emit('update:visible', false); // 关闭对话框 //emit('update:visible', false); // 关闭对话框
clearData() clearData()
dialogVisible.value = false; dialogVisible.value = false;
@@ -440,10 +450,10 @@ const getIcon = (index: number) => {
skipDisabled.value = false skipDisabled.value = false
nextStepText.value = "下一步" nextStepText.value = "下一步"
} }
const beforeClose = (done: () => void) => { const beforeClose = (done: () => void) => {
console.log(stepsActiveIndex.value, stepsTotalNum.value) console.log(stepsActiveIndex.value, stepsTotalNum.value)
if(stepsActiveIndex.value < stepsTotalNum.value) if (stepsActiveIndex.value < stepsTotalNum.value) {
{
ElMessageBox.confirm( ElMessageBox.confirm(
'检测未完成,是否退出当前检测流程?', '检测未完成,是否退出当前检测流程?',
'提示', '提示',
@@ -459,9 +469,7 @@ const getIcon = (index: number) => {
//emit('update:visible', false); // 关闭对话框 //emit('update:visible', false); // 关闭对话框
dialogVisible.value = false; dialogVisible.value = false;
}) })
} } else {
else
{
clearData() clearData()
//emit('update:visible', false); // 关闭对话框 //emit('update:visible', false); // 关闭对话框
dialogVisible.value = false; dialogVisible.value = false;
@@ -481,7 +489,6 @@ const getIcon = (index: number) => {
}; };
// // 当 props.visible 改变时,更新 formData // // 当 props.visible 改变时,更新 formData
// watch(() => props.visible, (newVal) => { // watch(() => props.visible, (newVal) => {
// if (!newVal) { // if (!newVal) {
@@ -499,6 +506,7 @@ const getIcon = (index: number) => {
:deep(.dialog-big .el-dialog__body) { :deep(.dialog-big .el-dialog__body) {
max-height: 840px !important; max-height: 840px !important;
} }
// :deep(.dialog-big){ // :deep(.dialog-big){
// max-height: 840px !important; // max-height: 840px !important;
// } // }
@@ -532,6 +540,19 @@ const getIcon = (index: number) => {
line-height: 1; /* 调整行高以确保底部对齐 */ line-height: 1; /* 调整行高以确保底部对齐 */
} }
.loading-box {
animation: loading 1.5s linear infinite;
}
@keyframes loading {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
// :deep(.test-head-steps){ // :deep(.test-head-steps){
// height: 100px; // height: 100px;
// margin-bottom: 20px; // margin-bottom: 20px;