diff --git a/frontend/src/stores/modules/check.ts b/frontend/src/stores/modules/check.ts index 02e89ed..ca7b745 100644 --- a/frontend/src/stores/modules/check.ts +++ b/frontend/src/stores/modules/check.ts @@ -15,6 +15,7 @@ export const useCheckStore = defineStore(CHECK_STORE_KEY, { temperature: 0, humidity: 0, chnNumList: [],//连线数据 + nodesConnectable: true,//设置是能可以连线 }), getters: {}, actions: { @@ -59,6 +60,9 @@ export const useCheckStore = defineStore(CHECK_STORE_KEY, { setChnNum(chnNumList: string[]) { this.chnNumList = chnNumList }, + setNodesConnectable(nodesConnectable: boolean) { + this.nodesConnectable = nodesConnectable + }, } }); \ No newline at end of file diff --git a/frontend/src/views/home/components/RemoveableEdge.vue b/frontend/src/views/home/components/RemoveableEdge.vue index 2036442..552b3f6 100644 --- a/frontend/src/views/home/components/RemoveableEdge.vue +++ b/frontend/src/views/home/components/RemoveableEdge.vue @@ -1,85 +1,88 @@ diff --git a/frontend/src/views/home/components/channelPairing.vue b/frontend/src/views/home/components/channelPairing.vue index e8cff00..4c9cff1 100644 --- a/frontend/src/views/home/components/channelPairing.vue +++ b/frontend/src/views/home/components/channelPairing.vue @@ -15,6 +15,8 @@ :fit-view="true" :min-zoom="1" :max-zoom="1" + :nodesConnectable="checkStore.nodesConnectable" + :elements-selectable="false" auto-connect @connect="handleConnect" @@ -67,10 +69,12 @@ const prop = defineProps({ planIdKey: { type: String, default: '' - } + }, + }) // 计算对话框高度 const dialogHeight = ref(600) + // 初始化 VueFlow,注册自定义连线类型 const { edges, setViewport } = useVueFlow({ edgeTypes: { @@ -93,7 +97,7 @@ const createLabel = (text: string, type: string) => { flexDirection: 'column', alignItems: 'center', fontSize: '15px', - textAlign: 'center', + // textAlign: 'center', border: '1px solid #ccc', borderRadius: '8px', padding: '8px', @@ -108,8 +112,9 @@ const createLabel = (text: string, type: string) => { color: '#526ade' } }), - h('div', null, '设备名称:' + text), - h('div', null, '设备类型:' + type) + h('div', { style: { textAlign: 'left' } }, ['设备名称:' + text, h('br'), '设备类型:' + type]) + // h('div', null, '设备名称:' + text), + // h('div', null, '设备类型:' + type) ] ) as any } @@ -357,13 +362,13 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP const deviceChannelGroups: { deviceId: string; centerY: number }[] = [] const standardChannelGroups: any[] = [] - const deviceWidth = 150 + const deviceWidth = 100 const inputChannelX = 350 const outputChannelX = 1020 const standardWidth = 1170 - const yPosition = ref(25) - const yPosition2 = ref(25) + const yPosition = ref(75) + const yPosition2 = ref(75) // 添加被检通道 Object.entries(channelCounts).forEach(([deviceId, count]) => { @@ -375,6 +380,7 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP data: { label: createLabel3(`被检通道${i}`) }, position: { x: inputChannelX, y: yPosition.value }, sourcePosition: 'right', + style: { width: '150px', border: 'none', boxShadow: 'none' } }) @@ -456,7 +462,7 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP data: { label: createLabel(device.name, device.deviceType) }, position: { x: deviceWidth, y: centerY }, class: 'no-handle-node', - style: { width: '200px', border: 'none', boxShadow: 'none' } + style: { width: '250px', border: 'none', boxShadow: 'none' } }) } }) @@ -468,9 +474,9 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP newNodes.push({ id: device.id, data: { label: createLabel(device.name, device.deviceType) }, - position: { x: standardWidth, y: centerY }, + position: { x: standardWidth, y: centerY + 25 }, class: 'no-handle-node', - style: { width: '200px', border: 'none', boxShadow: 'none' } + style: { width: '250px', border: 'none', boxShadow: 'none' } }) } }) diff --git a/frontend/src/views/home/components/compareTest.vue b/frontend/src/views/home/components/compareTest.vue index 47b22db..0ef9f12 100644 --- a/frontend/src/views/home/components/compareTest.vue +++ b/frontend/src/views/home/components/compareTest.vue @@ -284,9 +284,7 @@ watch(testStatus, function (newValue, oldValue) { // 开始计时 startTimeCount() showTestLog() - setTimeout(() => { - initCheckResult(CheckData.ChnCheckResultEnum.LOADING) - }, 500) + //startTimer() // todo 可移除 startData.value = new Date() timeDifference.value = 0 @@ -476,6 +474,11 @@ const startTimeCount = () => { timeView.value = secondToTime(timeCount.value) }, 1000) } + nextTick(() => { + setTimeout(() => { + initCheckResult(CheckData.ChnCheckResultEnum.LOADING) + }, 500) + }) } // 停止计时 diff --git a/frontend/src/views/home/components/compareTestPopup.vue b/frontend/src/views/home/components/compareTestPopup.vue index 6a396ef..b38035f 100644 --- a/frontend/src/views/home/components/compareTestPopup.vue +++ b/frontend/src/views/home/components/compareTestPopup.vue @@ -39,9 +39,13 @@ - + { 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 @@ -340,6 +346,8 @@ const handleSubmitFast = async () => { devIds.value = res.devIdsArray standardDevIds.value = res.standardDevIdsArray pairs.value = res.pair + checkStore.setNodesConnectable(false) + // nodesConnectable.value = false } if (!dataSocket.socketServe.connected) { ElMessage.error('webSocket连接中断!') diff --git a/frontend/src/views/home/components/deviceConnectionPopup.vue b/frontend/src/views/home/components/deviceConnectionPopup.vue index 14b1b13..e098798 100644 --- a/frontend/src/views/home/components/deviceConnectionPopup.vue +++ b/frontend/src/views/home/components/deviceConnectionPopup.vue @@ -206,6 +206,7 @@ const open = async ( standardDev: StandardDevice.ResPqStandardDevice[], fatherPlanId: string ) => { + CompareTestVisible.value = false selectTestItemPopupRef.value?.open() devIdList.value = device pqStandardDevList.value = standardDev @@ -484,6 +485,7 @@ defineExpose({ open })