From ff90f51cf1c439c927d59b7ff34e8aaff24a90aa Mon Sep 17 00:00:00 2001 From: sjl <1716605279@qq.com> Date: Fri, 5 Dec 2025 11:02:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=AF=E5=90=A6=E9=9C=80=E8=A6=81=E7=9B=B8?= =?UTF-8?q?=E5=BA=8F=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/home/components/comparePreTest.vue | 86 +++++++++++++------ .../home/components/compareTestPopup.vue | 35 ++++++-- 2 files changed, 88 insertions(+), 33 deletions(-) diff --git a/frontend/src/views/home/components/comparePreTest.vue b/frontend/src/views/home/components/comparePreTest.vue index f155a1e..267a973 100644 --- a/frontend/src/views/home/components/comparePreTest.vue +++ b/frontend/src/views/home/components/comparePreTest.vue @@ -16,7 +16,7 @@ - + @@ -52,7 +52,7 @@

- +

@@ -84,6 +84,28 @@ import { ElMessage, ElMessageBox, StepProps } from 'element-plus' import { computed, PropType, ref, toRef, watch } from 'vue' import RealTimeData from './realTimeDataAlign.vue' +const props = defineProps({ + testStatus: { + type: String, + default: 'wait' + }, + webMsgSend: { + type: Object, + default: () => ({}) + }, + mapping: { + type: Object as PropType>>, + default: () => ({}) + }, + onlyWave: { + type: Boolean, + default: false + }, + xiangXuIsShow:{ + type: Boolean, + default: false + } +}) const realTimeDataRef = ref() @@ -122,10 +144,13 @@ const isShowDialog = ref(false) const collapseActiveName = ref('1') const activeIndex = ref(0) const activeTotalNum = computed(() => { - let count = 4; // 基础步骤数:设备通讯校验、模型一致性校验、相序校验、最终状态 - if (props.onlyWave) { + let count = 3; // 基础步骤数:设备通讯校验、模型一致性校验、最终状态 + if (!props.onlyWave) { count++; // 添加数据对齐验证步骤 } + if(props.xiangXuIsShow){//添加相序校验 + count++; + } return count; }); const step1 = ref('wait') @@ -150,35 +175,18 @@ const detectionOptions = ref([ { id: 2, name: "数据对齐验证", - selected: true, + selected: !props.onlyWave, }, { id: 3, name: "相序校验", - selected: true, + selected: props.xiangXuIsShow, }, ]); const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process'>('finish'); -const props = defineProps({ - testStatus: { - type: String, - default: 'wait' - }, - webMsgSend: { - type: Object, - default: () => ({}) - }, - mapping: { - type: Object as PropType>>, - default: () => ({}) - }, - onlyWave: { - type: Boolean, - default: false - } -}) + const testStatus = toRef(props, 'testStatus'); @@ -332,6 +340,11 @@ watch(webMsgSend, function (newValue, oldValue) { if (newValue.code == 25001) { //最终成功 step2.value = 'success' step3.value = 'process' + if(props.onlyWave === true && props.xiangXuIsShow === false )//只有录波,相序不选 + { + step5.value = 'success' + ts.value = 'success' + } activeIndex.value = 2 } if (newValue.code == 25003) { //最终失败 @@ -374,6 +387,11 @@ watch(webMsgSend, function (newValue, oldValue) { isShowDialog.value = true step3.value = 'success' step4.value = 'process' + if(props.onlyWave === false && props.xiangXuIsShow === false )//相序不选 + { + step5.value = 'success' + ts.value = 'success' + } activeIndex.value = 3 testDataStructure.value = newValue.data } @@ -514,18 +532,30 @@ watch(webMsgSend, function (newValue, oldValue) { // }) watch(activeIndex, function (newValue, oldValue) { - if(props.onlyWave === true) + + if(props.onlyWave === true && props.xiangXuIsShow === false ) { - if (Number(collapseActiveName.value) < activeTotalNum.value - 2) { + if (Number(collapseActiveName.value) < activeTotalNum.value) { + if(newValue == 2){ + collapseActiveName.value = '2' + }else{ + collapseActiveName.value = (newValue + 1).toString() + } + } + } + else if(props.onlyWave === true && props.xiangXuIsShow === true ) + { + if (Number(collapseActiveName.value) < activeTotalNum.value) { if(newValue == 2){ collapseActiveName.value = '4' }else{ collapseActiveName.value = (newValue + 1).toString() } } - } else + } + else { - if (Number(collapseActiveName.value) < activeTotalNum.value) { + if (Number(collapseActiveName.value) < activeTotalNum.value - 1) { collapseActiveName.value = (newValue + 1).toString() } diff --git a/frontend/src/views/home/components/compareTestPopup.vue b/frontend/src/views/home/components/compareTestPopup.vue index 8bafebf..6586d87 100644 --- a/frontend/src/views/home/components/compareTestPopup.vue +++ b/frontend/src/views/home/components/compareTestPopup.vue @@ -58,6 +58,7 @@ :webMsgSend="webMsgSend" :mapping="channelMapping" :onlyWave="onlyWave" + :xiangXuIsShow="xiangXuIsShow" /> @@ -170,6 +171,9 @@ const preTestRef = ref | null>(null) const testRef: any = ref(null) const windowWidth = ref(window.innerWidth) const computedDialogWidth = ref(0) + +const xiangXuIsShow = ref(true)//预检测是否展示相序检测 + // 监听窗口大小变化 const handleResize = () => { windowWidth.value = window.innerWidth @@ -342,7 +346,8 @@ const handleSubmitAgain = async () => { standardDevIds: standardDevIds.value, pairs: pairs.value, testItemList: [checkStore.selectTestItems.preTest, false, checkStore.selectTestItems.test], - userId: userStore.userInfo.id + userId: userStore.userInfo.id, + phaseCheck: xiangXuIsShow.value ? 1 : 0, }) preTestStatus.value = 'start' @@ -350,6 +355,26 @@ const handleSubmitAgain = async () => { //开始检测 const handleSubmitFast = async () => { + + try { + await ElMessageBox.confirm('是否需要进行相序检测?', '确认检测', { + confirmButtonText: '是', + cancelButtonText: '否', + distinguishCancelAndClose: true, // 区分取消和关闭操作 + type: 'warning' + }); + xiangXuIsShow.value = true; + } catch (action) { + // 区分用户点击关闭按钮和其他情况 + if (action === 'cancel') { + // 用户点击了"否"按钮 + xiangXuIsShow.value = false; + } else { + // 用户点击了关闭按钮或按了ESC键,中断流程 + return; // 直接返回,不继续执行后续代码 + } + } + if (channelPairingRef.value) { const res = await channelPairingRef.value.handleNext() @@ -390,7 +415,8 @@ const handleSubmitFast = async () => { pairs: pairs.value, testItemList: [checkStore.selectTestItems.preTest, false, checkStore.selectTestItems.test], - userId: userStore.userInfo.id + userId: userStore.userInfo.id, + phaseCheck: xiangXuIsShow.value ? 1 : 0, }) preTestStatus.value = 'start' if (checkStore.selectTestItems.test) { @@ -414,7 +440,8 @@ const handleSubmitFast = async () => { pairs: pairs.value, testItemList: [checkStore.selectTestItems.preTest, false, checkStore.selectTestItems.test], - userId: userStore.userInfo.id + userId: userStore.userInfo.id, + phaseCheck: xiangXuIsShow.value ? 1 : 0, }) } TestStatus.value = 'start' @@ -508,8 +535,6 @@ const sendPause = () => { pauseTest() } const sendResume = () => { - - resumeTest({ userPageId: JwtUtil.getLoginName(), devIds: checkStore.devices.map(item => item.deviceId),