mock测试
This commit is contained in:
parent
e149b0764a
commit
d53972584c
22
src/api/PlatformApi.ts
Normal file
22
src/api/PlatformApi.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { api } from 'src/boot/axios';
|
||||
|
||||
const PublishUriBase = '/mock/platform/status/3';
|
||||
|
||||
export function mockApi(data: {
|
||||
emergstop?: boolean;
|
||||
trainberth?: boolean;
|
||||
close?: boolean;
|
||||
upHold?: boolean;
|
||||
downHold?: boolean;
|
||||
upOccHold?: boolean;
|
||||
downOccHold?: boolean;
|
||||
psdOpen?: boolean;
|
||||
psdCut?: boolean;
|
||||
upSkipstop?: boolean;
|
||||
downSkipstop?: boolean;
|
||||
upTrainSkipstop?: boolean;
|
||||
downTrainSkipstop?: boolean;
|
||||
id?: string;
|
||||
}) {
|
||||
return api.post(`${PublishUriBase}`, data);
|
||||
}
|
@ -15,6 +15,7 @@ import {
|
||||
JlGraphic,
|
||||
} from 'src/jl-graphic';
|
||||
import { DisplayObject, FederatedMouseEvent } from 'pixi.js';
|
||||
// import { mockApi } from 'src/api/PlatformApi';
|
||||
|
||||
export class PlatformData extends GraphicDataBase implements IPlatformData {
|
||||
constructor(data?: graphicData.Platform) {
|
||||
@ -296,6 +297,28 @@ export class PlatformOperateInteraction extends GraphicInteractionPlugin<Platfor
|
||||
platform.states.upHold = true;
|
||||
platform.states.upOccHold = true;
|
||||
platform.doRepaint();
|
||||
// mockApi({
|
||||
// emergstop: false,
|
||||
// trainberth: false,
|
||||
// close: false,
|
||||
// upHold: false,
|
||||
// upOccHold: false,
|
||||
// downOccHold: false,
|
||||
// psdOpen: false,
|
||||
// psdCut: false,
|
||||
// upSkipstop: false,
|
||||
// downSkipstop: false,
|
||||
// upTrainSkipstop: false,
|
||||
// downTrainSkipstop: false,
|
||||
// downHold: true,
|
||||
// id: platform.id,
|
||||
// })
|
||||
// .then((res) => {
|
||||
// console.log(res, '---res--');
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log(err, '---err---');
|
||||
// });
|
||||
};
|
||||
removeHoldrConfig.handler = () => {
|
||||
platform.states.upHold = false;
|
||||
|
Loading…
Reference in New Issue
Block a user