From 816b0a682460a591d9af51c2edc7a752ae10be9b Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 5 Sep 2023 17:04:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BA=E6=AE=B5=E8=BE=B9=E7=95=8C=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=9A=84=E8=AE=A1=E8=BD=B4=E5=85=B3=E8=81=94=E5=85=B3?= =?UTF-8?q?=E7=B3=BB=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../draw-app/properties/AxleCountingProperty.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/draw-app/properties/AxleCountingProperty.vue b/src/components/draw-app/properties/AxleCountingProperty.vue index a7420b2..e826d6c 100644 --- a/src/components/draw-app/properties/AxleCountingProperty.vue +++ b/src/components/draw-app/properties/AxleCountingProperty.vue @@ -243,13 +243,15 @@ function oneClickAxleCounting() { axleCounting.id = GraphicIdGenerator.next(); const offsetX = i == 0 ? -40 : 40; axleCounting.position.set(select.x + offsetX, select.y + 30); - const refIndex = i == 0 ? 1 : 0; - const ref = select.datas.axleCountingRef[refIndex]; - const refSection = select.queryStore.queryById(ref.id); - axleCounting.datas.axleCountingRef = [ - select.datas.axleCountingRef[refIndex], - ]; - axleCounting.datas.code = `${refSection.code}-${ref.devicePort}`; + const ref = select.datas.axleCountingRef; + for (let j = 0; j < 2; j++) { + if (ref[j].devicePort == i) { + const refSection = select.queryStore.queryById(ref[j].id) as Section; + axleCounting.datas.axleCountingRef = [select.datas.axleCountingRef[j]]; + axleCounting.datas.code = `${refSection.datas.code}-${ref[j].devicePort}`; + break; + } + } const app = drawStore.getDrawApp(); app.addGraphicAndRecord(axleCounting); axleCounting.loadRelations();