From d53972584ce03e4d615889f3cce7259f6de49ac6 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Tue, 4 Jul 2023 11:12:12 +0800 Subject: [PATCH] =?UTF-8?q?mock=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/PlatformApi.ts | 22 ++++++++++++++++++++ src/drawApp/graphics/PlatformInteraction.ts | 23 +++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/api/PlatformApi.ts diff --git a/src/api/PlatformApi.ts b/src/api/PlatformApi.ts new file mode 100644 index 0000000..3a21e7e --- /dev/null +++ b/src/api/PlatformApi.ts @@ -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); +} diff --git a/src/drawApp/graphics/PlatformInteraction.ts b/src/drawApp/graphics/PlatformInteraction.ts index 8c5c543..2bb22c1 100644 --- a/src/drawApp/graphics/PlatformInteraction.ts +++ b/src/drawApp/graphics/PlatformInteraction.ts @@ -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 { + // console.log(res, '---res--'); + // }) + // .catch((err) => { + // console.log(err, '---err---'); + // }); }; removeHoldrConfig.handler = () => { platform.states.upHold = false;