diff --git a/package.json b/package.json index 6229762..cd255e8 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "echarts": "^5.4.3", "google-protobuf": "^3.21.2", "jl-graphic": "git+https://git.code.tencent.com/jl-framework/graphic-pixi.git#v0.1.8", - "rt-graphic-component": "git+https://git.code.tencent.com/jl-framework/rt-graphic-component.git#5eecd80", + "rt-graphic-component": "git+https://git.code.tencent.com/jl-framework/rt-graphic-component.git#c7eb525", "js-base64": "^3.7.5", "pinia": "^2.0.11", "quasar": "^2.6.0", diff --git a/src/components/draw-app/properties/TurnoutProperty.vue b/src/components/draw-app/properties/TurnoutProperty.vue index 550161f..c47acfc 100644 --- a/src/components/draw-app/properties/TurnoutProperty.vue +++ b/src/components/draw-app/properties/TurnoutProperty.vue @@ -101,6 +101,12 @@ import { useFormData } from 'src/components/DrawAppFormUtils'; import AddCentralizedStationDialog from '../dialogs/AddCentralizedStationDialog.vue'; import { Station } from 'src/graphics/station/Station'; +enum DevicePort { + A = 0, + B = 1, + C = 2, +} + const drawStore = useDrawStore(); const $q = useQuasar(); @@ -157,9 +163,9 @@ const sectionRelations = computed(() => { ); return sectionRelations.map( (relation) => - `${relation.getRelationParam(turnout).param}: ${ + `${DevicePort[relation.getRelationParam(turnout).param]}: ${ relation.getOtherGraphic
(turnout).datas.code - }(${relation.getOtherRelationParam(turnout).param})` + }(${DevicePort[relation.getOtherRelationParam(turnout).param]})` ); }); @@ -173,9 +179,9 @@ const turnoutRelations = computed(() => { ); return turnoutRelations.map( (relation) => - `${relation.getRelationParam(turnout).param}: ${ + `${DevicePort[relation.getRelationParam(turnout).param]}: ${ relation.getOtherGraphic(turnout).datas.code - }(${relation.getOtherRelationParam(turnout).param})` + }(${DevicePort[relation.getOtherRelationParam(turnout).param]})` ); }); diff --git a/src/drawApp/commonApp.ts b/src/drawApp/commonApp.ts index dba288e..63b4d46 100644 --- a/src/drawApp/commonApp.ts +++ b/src/drawApp/commonApp.ts @@ -62,6 +62,7 @@ import { Turnout, TurnoutTemplate, TurnoutDraw, + handleData, } from 'src/graphics/turnout/Turnout'; import { TurnoutData, TurnoutStates } from './graphics/TurnoutInteraction'; import { Section, SectionTemplate } from 'src/graphics/section/Section'; @@ -187,7 +188,12 @@ export function initCommonDrawApp(app: IDrawApp) { new SignalDraw(app, new SignalTemplate(new SignalData(), new SignalState())); new TurnoutDraw( app, - new TurnoutTemplate(new TurnoutData(), new TurnoutStates(), StyleType.GP) + new TurnoutTemplate( + new TurnoutData(), + new TurnoutStates(), + StyleType.GP, + handleData + ) ); new TrainWindowDraw(app, new TrainWindowTemplate(new TrainWindowData())); new OneClickGenerateDraw(app, new OneClickGenerateTemplate()); diff --git a/src/drawApp/lineScene.ts b/src/drawApp/lineScene.ts index b9e3eb1..f5bcde7 100644 --- a/src/drawApp/lineScene.ts +++ b/src/drawApp/lineScene.ts @@ -49,7 +49,11 @@ import { TurnoutOperationPlugin, TurnoutStates, } from './graphics/TurnoutInteraction'; -import { Turnout, TurnoutTemplate } from 'src/graphics/turnout/Turnout'; +import { + Turnout, + TurnoutTemplate, + handleData, +} from 'src/graphics/turnout/Turnout'; import { SectionData, SectionOperateInteraction, @@ -237,7 +241,12 @@ export function initLineScene(lineApp: IGraphicApp, sceneName: string) { new PlatformTemplate(new PlatformData(), new PlatformState(), StyleType.GP), new ScreenDoorTemplate(new ScreenDoorData(), new ScreenDoorState()), new StationTemplate(new StationData(), new StationState(), StyleType.GP), - new TurnoutTemplate(new TurnoutData(), new TurnoutStates(), StyleType.GP), + new TurnoutTemplate( + new TurnoutData(), + new TurnoutStates(), + StyleType.GP, + handleData + ), new SectionTemplate(new SectionData(), new SectionStates()), new AxleCountingTemplate(new AxleCountingData()), new TrainWindowTemplate(new TrainWindowData()), diff --git a/src/graphics/turnout/Turnout.ts b/src/graphics/turnout/Turnout.ts index 6b6b952..20f822d 100644 --- a/src/graphics/turnout/Turnout.ts +++ b/src/graphics/turnout/Turnout.ts @@ -7,6 +7,8 @@ import { import { TurnoutTemplate } from 'rt-graphic-component/components/packages/Turnout/common/TurnoutTemplate'; import { IGPTurnoutState as ITurnoutState } from 'rt-graphic-component/components/packages/Turnout/GPTurnout'; import { TurnoutDraw } from 'rt-graphic-component/components/packages/Turnout/common/TurnoutDrawAssistant'; +import { IRelatedRef } from 'rt-graphic-component/components/common/common'; +import { graphicData } from 'src/protos/stationLayoutGraphics'; export { Turnout, TurnoutTemplate, TurnoutDraw, TurnoutConsts }; export type { ITurnoutState, ITurnoutData, TurnoutSection }; @@ -16,3 +18,12 @@ export enum TurnoutPort { B = 1, C = 2, } + +function handleTurnoutRefDeviceData(data: IRelatedRef) { + const protoData = new graphicData.RelatedRef(data); + return protoData; +} + +export const handleData = { + handleRefDeviceData: handleTurnoutRefDeviceData, +};