代码调整

This commit is contained in:
dong 2023-10-26 09:56:51 +08:00
parent a027d373f7
commit 8eaeb2e1c1

View File

@ -149,15 +149,19 @@ export class TurnoutOperationPlugin extends GraphicInteractionPlugin<Turnout> {
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('添加列车成功!');
})