代码调整
This commit is contained in:
parent
cbaf4c4d1f
commit
107c861004
@ -14,13 +14,14 @@ import {
|
||||
} from 'src/jl-graphic';
|
||||
import { useLineStore } from 'src/stores/line-store';
|
||||
import { SectionGraphicHitArea } from 'src/graphics/section/SectionDrawAssistant';
|
||||
import { Dialog } from 'quasar';
|
||||
import { Dialog, Notify } from 'quasar';
|
||||
import AddTrainDialog from '../../components/draw-app/dialogs/AddTrainDialog.vue';
|
||||
import { addTrain } from 'src/api/Simulation';
|
||||
import { successNotify, errorNotify } from '../../utils/CommonNotify';
|
||||
import { successNotify } from '../../utils/CommonNotify';
|
||||
import { MenuItemOptions } from 'src/jl-graphic/ui/Menu';
|
||||
import { ContextMenu } from 'src/jl-graphic/ui/ContextMenu';
|
||||
import { AxleCounting } from 'src/graphics/axleCounting/AxleCounting';
|
||||
import { ApiError } from 'src/boot/axios';
|
||||
|
||||
export class SectionData extends GraphicDataBase implements ISectionData {
|
||||
constructor(data?: graphicData.Section) {
|
||||
@ -219,7 +220,11 @@ export class SectionOperateInteraction extends GraphicInteractionPlugin<Section>
|
||||
successNotify('添加列车成功!');
|
||||
})
|
||||
.catch((err) => {
|
||||
errorNotify('添加列车失败!', err);
|
||||
const error = err as ApiError;
|
||||
Notify.create({
|
||||
type: 'negative',
|
||||
message: `添加列车失败!: ${error.title}`,
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -23,12 +23,13 @@ import { ContextMenu } from 'src/jl-graphic/ui/ContextMenu';
|
||||
import { MenuItemOptions } from 'src/jl-graphic/ui/Menu';
|
||||
import { useLineStore } from 'src/stores/line-store';
|
||||
import { setSwitchPosition } from 'src/api/Simulation';
|
||||
import { Dialog } from 'quasar';
|
||||
import { Dialog, Notify } from 'quasar';
|
||||
import AddTrainDialog from '../../components/draw-app/dialogs/AddTrainDialog.vue';
|
||||
import { addTrain } from 'src/api/Simulation';
|
||||
import { errorNotify, successNotify } from 'src/utils/CommonNotify';
|
||||
import { successNotify } from 'src/utils/CommonNotify';
|
||||
import { AxleCounting } from 'src/graphics/axleCounting/AxleCounting';
|
||||
import { request } from 'src/protos/request';
|
||||
import { ApiError } from 'src/boot/axios';
|
||||
|
||||
function getDefaultEndPoint() {
|
||||
return {
|
||||
@ -166,7 +167,11 @@ export class TurnoutOperationPlugin extends GraphicInteractionPlugin<Turnout> {
|
||||
successNotify('添加列车成功!');
|
||||
})
|
||||
.catch((err) => {
|
||||
errorNotify('添加列车失败!', err);
|
||||
const error = err as ApiError;
|
||||
Notify.create({
|
||||
type: 'negative',
|
||||
message: `添加列车失败!: ${error.title}`,
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user