From 8eaeb2e1c1a86593c2ac54ac59ea894342c8038b Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Thu, 26 Oct 2023 09:56:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/graphics/TurnoutInteraction.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/drawApp/graphics/TurnoutInteraction.ts b/src/drawApp/graphics/TurnoutInteraction.ts index 4f17343..807eb8f 100644 --- a/src/drawApp/graphics/TurnoutInteraction.ts +++ b/src/drawApp/graphics/TurnoutInteraction.ts @@ -149,15 +149,19 @@ export class TurnoutOperationPlugin extends GraphicInteractionPlugin { componentProps: { dev: turnout, kmLength: d }, cancel: true, persistent: true, - }).onOk((data: { offset: number; dir: 1 | 0 }) => { - addTrain({ + }).onOk((data: { offset: number; dir: 1 | 0; trainLength: string }) => { + const params = { simulationId, mapId, up: !!data.dir, id: turnout.datas.id, devicePort: port, headOffset: data.offset, - }) + }; + if (data.trainLength) { + Object.assign(params, { trainLength: +data.trainLength }); + } + addTrain(params) .then(() => { successNotify('添加列车成功!'); })