From 4cc5330ec9a8fb4f5b131143702b4543b4b6a473 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 25 Jun 2024 09:45:26 +0800 Subject: [PATCH] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 8e62b39f347cbf06cccdc9ee9fed43c0cee6b077 Author: joylink_zhaoerwei Date: Tue Jun 25 09:16:17 2024 +0800 继电器状态图显示调整+spks生成调整 --- .../dialogs/CiCjQdListStateDialog.vue | 12 ++++-- .../RelayCabinetLayout/RelayCabinetLayout.vue | 42 +++++++++++++++---- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/src/components/draw-app/dialogs/CiCjQdListStateDialog.vue b/src/components/draw-app/dialogs/CiCjQdListStateDialog.vue index e60c5fd..1350f71 100644 --- a/src/components/draw-app/dialogs/CiCjQdListStateDialog.vue +++ b/src/components/draw-app/dialogs/CiCjQdListStateDialog.vue @@ -119,7 +119,10 @@ let ciQdList = sceneCiCjQdListMap.get( ) as relayCabinetGraphicData.CiQd; const dialogWidth = computed(() => { - return setCellMessage.value.cols * 134 + 85; + if (setCellMessage.value.cols * 134 + 85 <= 1157) { + return setCellMessage.value.cols * 134 + 85; + } + return 1157; }); watch( @@ -143,8 +146,11 @@ watch( ); onMounted(() => { - setCellMessage.value.rows = ciCjList.dsCount; - setCellMessage.value.cols = ciCjList.cjList.length; + setCellMessage.value.rows = Math.max(ciCjList.dsCount, ciQdList.dsCount); + setCellMessage.value.cols = Math.max( + ciCjList.cjList.length, + ciQdList.qdList.length + ); tabList.value[0].ListMap = updateCiCjListMap(); tabList.value[1].ListMap = updateCiQdListMap(); }); diff --git a/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue b/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue index 6e1061a..276b51e 100644 --- a/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue +++ b/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue @@ -279,9 +279,14 @@ import { ShowCodeType, } from './GeneraterRelayLayoutConfig'; import { generateRelayLayout, GenerateRelaysCongig } from './GeneraterDevice'; -import { getPublishMapInfoById, pageQuery } from 'src/api/PublishApi'; +import { + getPublishMapInfoById, + getPublishMapInfoByName, + pageQuery, +} from 'src/api/PublishApi'; import { ciCjMap, CjData, PostionType } from './GeneraterCiCjConfig'; import { ciQdMap, QdData } from './GeneraterCiQdConfig'; +import { ibpGraphicData } from 'src/protos/ibpGraphics'; const $q = useQuasar(); const route = useRoute(); @@ -533,6 +538,7 @@ async function openGeneraterRelayLayoutDialog() { let storage: graphicData.RtssGraphicStorage; const stationMap = new Map(); +let hasSPKS = false; async function onChoosePublishId() { const response = await getPublishMapInfoById( +generaterRelayLayout.value.publishId @@ -555,6 +561,31 @@ async function onChoosePublishId() { screenDoorGroup.unshift(config.trainGroupAmount); }); changeScreenDoorGroup.value = screenDoorGroup; + if (storage.ibpBoxs.length) { + checkIbpSpks(storage.ibpBoxs[0].refIbpMapCode).then((has) => { + if (has) { + hasSPKS = true; + } + }); + } +} + +async function checkIbpSpks(refIbpMapCode: string) { + const { proto } = await getPublishMapInfoByName({ + name: refIbpMapCode, + detail: true, + }); + if (proto) { + const storage = ibpGraphicData.IBPGraphicStorage.deserialize( + toUint8Array(proto) + ); + for (let i = 0; i < storage.ibpKeys.length; i++) { + if (storage.ibpKeys[i].code.includes('SPKS')) { + return true; + } + } + return false; + } } const myForm = ref(null); @@ -692,12 +723,9 @@ function oneClickGeneraterRelayLayout() { } } //有画ibpBox且对应的ibp图中有相关spks按钮 - for (let i = 0; i < storage.ibpBoxs.length; i++) { - if (station.common.id == storage.ibpBoxs[i].refStationId) { - hasEMP_MKX_SPKS.hasSPKS = true; - handleDeviceCombinations.push(deviceCombinations[1]); - break; - } + if (hasSPKS) { + hasEMP_MKX_SPKS.hasSPKS = true; + handleDeviceCombinations.push(deviceCombinations[1]); } creatDeviceRelateRelays( handleDeviceCombinations,