修改通道配置页面

This commit is contained in:
guanj
2025-08-26 20:52:24 +08:00
parent 8b4c22e959
commit 4a6db824ba
4 changed files with 594 additions and 35 deletions

View File

@@ -17,7 +17,11 @@
process-status="finish"
finish-status="success"
>
<!-- <el-step title="通道配对" /> -->
<el-step
title="通道配对"
:icon="stepsActive > 0 || stepsActiveIndex > stepsTotalNum - 1 ? SuccessFilled : Switch"
@click="handleStepClick(0)"
/>
<el-step
v-if="preTestSelected"
title="预检测"
@@ -34,7 +38,11 @@
<el-step title="检测完成" :icon="stepsActiveIndex > stepsTotalNum - 1 ? SuccessFilled : Key" />
</el-steps>
</div>
<keep-alive>
<ChannelPairing v-if="stepsActiveView == 0" ref="channelPairingRef" :devIdList="prop.devIdList"
:pqStandardDevList="prop.pqStandardDevList"
:planIdKey="prop.planIdKey" />
</keep-alive>
<keep-alive>
<ComparePreTest
v-if="preTestSelected && stepsActiveView == 1"
@@ -126,7 +134,7 @@ import {
Coin,
Edit,
Key,
Odometer,
Switch,
Refresh,
Right,
SuccessFilled,
@@ -135,23 +143,24 @@ import {
VideoPlay
} from '@element-plus/icons-vue'
import ComparePreTest from './comparePreTest.vue'
import ChannelPairing from './channelPairing.vue'
import { Device } from '@/api/device/interface/device'
import CompareTest from './compareTest.vue'
import socketClient from '@/utils/webSocketClient'
import { useCheckStore } from '@/stores/modules/check'
import { pauseTest, resumeTest, startPreTest, contrastTest } from '@/api/socket/socket'
import { useUserStore } from '@/stores/modules/user'
import { JwtUtil } from '@/utils/jwtUtil'
// import {JwtUtil} from "@/utils/check";
import { StandardDevice } from '@/api/device/interface/standardDevice'
const userStore = useUserStore()
const checkStore = useCheckStore()
const nextStepText = ref('下一步')
const dialogVisible = ref(false)
const channelPairingRef = ref()
const showSteps = ref(false)
const stepsTotalNum = ref(-1) //步骤总数
const stepsActiveIndex = ref(1) //当前正在执行的步骤索引
const stepsActiveIndex = ref(0) //当前正在执行的步骤索引
const stepsActiveView = ref(1) //当前正在执行的步骤在(预处理、守时校验、系数校准、正式检测)中的排序,仅用于页面显示
const stepsActive = ref(-1) //当前正在执行的步骤在(预处理、守时校验、系数校准、正式检测)中的排序,实际记录步骤的状态,用于切换步骤
const ActiveStatue = ref('waiting') //当前步骤状态
@@ -164,6 +173,20 @@ const showComponent = ref(true)
const preTestRef = ref<InstanceType<typeof ComparePreTest> | null>(null)
const testRef: any = ref(null)
const prop = defineProps({
devIdList: {
type: Array as any,
default: []
},
pqStandardDevList: {
type: Array as any,
default: []
},
planIdKey: {
type: String,
default: ''
}
})
const dataSocket = reactive({
socketServe: socketClient.Instance
})
@@ -178,7 +201,7 @@ const initOperate = () => {
TestStatus.value = 'waiting'
stepsActiveIndex.value = 1
stepsActiveIndex.value = 0
showComponent.value = true
// 初始化勾选的检测内容
preTestSelected.value = checkStore.selectTestItems.preTest
@@ -193,13 +216,13 @@ const initOperate = () => {
stepsTotalNum.value = count + 1
if (preTestSelected.value) {
stepsActiveView.value = 1
stepsActive.value = 1
stepsActiveView.value = 0
stepsActive.value = 0
return
}
if (testSelected.value) {
stepsActiveView.value = 2
stepsActive.value = 2
stepsActiveView.value = 0
stepsActive.value = 0
return
}
}
@@ -224,6 +247,7 @@ const open = async (
if (checkStore.selectTestItems.preTest && !checkStore.selectTestItems.test) {
testAgain.value = true
}
dialogTitle.value = title
channelMapping.value = mapping
planId.value = plan
loginName.value = login
@@ -259,12 +283,6 @@ const open = async (
//预检测-重新检测
const handleSubmitAgain = async () => {
console.log(
'🚀 ~ handleSubmitAgain ~ stepsActive.value:',
stepsActiveIndex.value,
stepsActiveView.value,
stepsActive.value
)
if (checkStore.selectTestItems.preTest) {
stepsActiveIndex.value = 1
stepsActiveView.value = 1
@@ -311,10 +329,31 @@ const handleSubmitAgain = async () => {
//开始检测
const handleSubmitFast = async () => {
if (channelPairingRef.value) {
const res = await channelPairingRef.value.handleNext()
console.log('🚀 ~ handleSubmitFast ~ res:', res)
if (!res) return
dialogTitle.value = res.title
channelMapping.value = res.mapping
planId.value = res.plan
loginName.value = res.login
devIds.value = res.devIdsArray
standardDevIds.value = res.standardDevIdsArray
pairs.value = res.pair
}
if (!dataSocket.socketServe.connected) {
ElMessage.error('webSocket连接中断')
return
}
if (checkStore.selectTestItems.preTest) {
stepsActiveIndex.value = 1
stepsActiveView.value = 1
stepsActive.value = 1
} else {
stepsActiveIndex.value = 1
stepsActiveView.value = 2
stepsActive.value = 2
}
switch (stepsActive.value) {
case 1:
@@ -534,6 +573,8 @@ const nextStep = () => {
}
const handleStepClick = (step: number) => {
console.log('🚀 ~ handleStepClick ~ step > stepsActive.value:', step, stepsActive.value)
if (step > stepsActive.value) {
return
} else {