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,