代码调整
This commit is contained in:
parent
a027d373f7
commit
8eaeb2e1c1
@ -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('添加列车成功!');
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user