From 9eba288eea62208c262ac517c969f368b4f8d735 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Wed, 8 Nov 2023 17:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/common.ts | 42 +++++++++++++++++++ src/drawApp/commonApp.ts | 25 +---------- src/drawApp/graphics/ScreenDoorInteraction.ts | 4 +- src/drawApp/jkApp.ts | 2 +- src/drawApp/thApp.ts | 2 +- 5 files changed, 47 insertions(+), 28 deletions(-) create mode 100644 src/drawApp/common.ts diff --git a/src/drawApp/common.ts b/src/drawApp/common.ts new file mode 100644 index 0000000..b408e0a --- /dev/null +++ b/src/drawApp/common.ts @@ -0,0 +1,42 @@ +import { AxleCounting } from 'src/graphics/axleCounting/AxleCounting'; +import { Curvature } from 'src/graphics/curvature/Curvature'; +import { CurvatureKiloMarker } from 'src/graphics/curvatureKiloMarker/CurvatureKiloMarker'; +import { EsbButton } from 'src/graphics/esbButton/EsbButton'; +import { GatedBox } from 'src/graphics/gatedBox/GatedBox'; +import { Link } from 'src/graphics/link/Link'; +import { Platform } from 'src/graphics/platform/Platform'; +import { ScreenDoor } from 'src/graphics/screenDoor/ScreenDoor'; +import { Section } from 'src/graphics/section/Section'; +import { Separator } from 'src/graphics/separator/Separator'; +import { Signal } from 'src/graphics/signal/Signal'; +import { Slope } from 'src/graphics/slope/Slope'; +import { SlopeKiloMarker } from 'src/graphics/slopeKiloMarker/SlopeKiloMarker'; +import { SpksSwitch } from 'src/graphics/spksSwitch/SpksSwitch'; +import { Station } from 'src/graphics/station/Station'; +import { StopPosition } from 'src/graphics/stopPosition/StopPosition'; +import { TrainWindow } from 'src/graphics/trainWindow/TrainWindow'; +import { Transponder } from 'src/graphics/transponder/Transponder'; +import { Turnout } from 'src/graphics/turnout/Turnout'; + +export const drawCommonLayerList = [ + // 图层列表 默认显示的图层defaultShow: true + { label: '区段', value: Section.Type, defaultShow: true }, + { label: '区段检测点', value: AxleCounting.Type, defaultShow: true }, + { label: '站台', value: Platform.Type, defaultShow: true }, + { label: '屏蔽门', value: ScreenDoor.Type, defaultShow: true }, + { label: '车站', value: Station.Type, defaultShow: true }, + { label: '道岔', value: Turnout.Type, defaultShow: true }, + { label: '信号机', value: Signal.Type, defaultShow: true }, + { label: '分隔符', value: Separator.Type, defaultShow: true }, + { label: '停车位置标', value: StopPosition.Type, defaultShow: true }, + { label: 'Spks开关', value: SpksSwitch.Type, defaultShow: true }, + { label: '门控箱', value: GatedBox.Type, defaultShow: true }, + { label: '紧急关闭按钮', value: EsbButton.Type, defaultShow: true }, + { label: '应答器', value: Transponder.Type, defaultShow: true }, + { label: '车次窗', value: TrainWindow.Type, defaultShow: true }, + { label: 'Link', value: Link.Type, defaultShow: false }, + { label: '坡度公里标', value: SlopeKiloMarker.Type, defaultShow: true }, + { label: '坡度', value: Slope.Type, defaultShow: true }, + { label: '曲度公里标', value: CurvatureKiloMarker.Type, defaultShow: true }, + { label: '曲度', value: Curvature.Type, defaultShow: true }, +]; diff --git a/src/drawApp/commonApp.ts b/src/drawApp/commonApp.ts index b0576ae..4a8f03d 100644 --- a/src/drawApp/commonApp.ts +++ b/src/drawApp/commonApp.ts @@ -99,7 +99,7 @@ import { SlopeData } from './graphics/SlopeInteraction'; import { Slope, SlopeTemplate } from 'src/graphics/slope/Slope'; import { useLineStore } from 'src/stores/line-store'; import { LinkData } from './graphics/LinkInteraction'; -import { Link, LinkTemplate } from 'src/graphics/link/Link'; +import { LinkTemplate } from 'src/graphics/link/Link'; import { LinkDraw } from 'src/graphics/link/LinkDrawAssistant'; import { CurvatureKiloMarker, @@ -144,29 +144,6 @@ export const DefaultCanvasMenu = new ContextMenu({ ], }); -export const drawCommonLayerList = [ - // 图层列表 默认显示的图层defaultShow: true - { label: '区段', value: Section.Type, defaultShow: true }, - { label: '区段检测点', value: AxleCounting.Type, defaultShow: true }, - { label: '站台', value: Platform.Type, defaultShow: true }, - { label: '屏蔽门', value: ScreenDoor.Type, defaultShow: true }, - { label: '车站', value: Station.Type, defaultShow: true }, - { label: '道岔', value: Turnout.Type, defaultShow: true }, - { label: '信号机', value: Signal.Type, defaultShow: true }, - { label: '分隔符', value: Separator.Type, defaultShow: true }, - { label: '停车位置标', value: StopPosition.Type, defaultShow: true }, - { label: 'Spks开关', value: SpksSwitch.Type, defaultShow: true }, - { label: '门控箱', value: GatedBox.Type, defaultShow: true }, - { label: '紧急关闭按钮', value: EsbButton.Type, defaultShow: true }, - { label: '应答器', value: Transponder.Type, defaultShow: true }, - { label: '车次窗', value: TrainWindow.Type, defaultShow: true }, - { label: 'Link', value: Link.Type, defaultShow: false }, - { label: '坡度公里标', value: SlopeKiloMarker.Type, defaultShow: true }, - { label: '坡度', value: Slope.Type, defaultShow: true }, - { label: '曲度公里标', value: CurvatureKiloMarker.Type, defaultShow: true }, - { label: '曲度', value: Curvature.Type, defaultShow: true }, -]; - export function initCommonDrawApp(app: IDrawApp) { new PlatformDraw( app, diff --git a/src/drawApp/graphics/ScreenDoorInteraction.ts b/src/drawApp/graphics/ScreenDoorInteraction.ts index 7e05803..6556fea 100644 --- a/src/drawApp/graphics/ScreenDoorInteraction.ts +++ b/src/drawApp/graphics/ScreenDoorInteraction.ts @@ -13,7 +13,7 @@ import { IGraphicScene, JlGraphic, } from 'src/jl-graphic'; -//import { loadScreenDoorConfig } from '../commonApp'; +import { loadScreenDoorConfig } from '../commonApp'; export class ScreenDoorData extends GraphicDataBase implements IScreenDoorData { constructor(data?: graphicData.ScreenDoor) { @@ -44,7 +44,7 @@ export class ScreenDoorData extends GraphicDataBase implements IScreenDoorData { this.data.refPlatformId = v; } get sonDoorAmount(): number { - return 30; + return loadScreenDoorConfig()?.sonDoorAmount || 30; } clone(): ScreenDoorData { diff --git a/src/drawApp/jkApp.ts b/src/drawApp/jkApp.ts index deb2525..a5b420a 100644 --- a/src/drawApp/jkApp.ts +++ b/src/drawApp/jkApp.ts @@ -32,12 +32,12 @@ import { LogicSectionData } from './graphics/LogicSectionInteraction'; import { LinkData } from './graphics/LinkInteraction'; import { Link, LinkTemplate } from 'src/graphics/link/Link'; import { - drawCommonLayerList, initCommonDrawApp, saveCommonDrawDatas, loadCommonDrawDatas, saveDrawToServer, } from './commonApp'; +import { drawCommonLayerList } from './common'; import { Notify } from 'quasar'; import { generateCalculateLink } from 'src/api/GenerateApi'; import { SignalDraw } from 'src/graphics/signal/SignalDrawAssistant'; diff --git a/src/drawApp/thApp.ts b/src/drawApp/thApp.ts index 72f4fce..6449d22 100644 --- a/src/drawApp/thApp.ts +++ b/src/drawApp/thApp.ts @@ -23,12 +23,12 @@ import { } from 'src/graphics/trackLogicSection/TrackLogicSection'; import { TrackLogicSectionData } from './graphics/TrackLogicSectionInteraction'; import { - drawCommonLayerList, initCommonDrawApp, saveCommonDrawDatas, loadCommonDrawDatas, saveDrawToServer, } from './commonApp'; +import { drawCommonLayerList } from './common'; import { SignalDraw } from 'src/graphics/signal/SignalDrawAssistant'; import { SignalTemplate, Signal } from 'src/graphics/signal/Signal'; import { SignalData, SignalState } from './graphics/SignalInteraction';