diff --git a/bj-rtss-message b/bj-rtss-message index 6a27f93..a8fa6fe 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit 6a27f93fe968b98b5b83badb16abbca12bc8b633 +Subproject commit a8fa6fec188ad3df19952e298a1f846d581ca200 diff --git a/src/components/draw-app/properties/EsbButtonProperty.vue b/src/components/draw-app/properties/EsbButtonProperty.vue index 0ec3c31..f85733c 100644 --- a/src/components/draw-app/properties/EsbButtonProperty.vue +++ b/src/components/draw-app/properties/EsbButtonProperty.vue @@ -15,14 +15,16 @@ @blur="onUpdate" label="名称" /> - + style="margin-top: 10px" + v-model="esbButtonModel.refStand" + :options="platformList" + :map-options="true" + :emit-value="true" + @update:model-value="onUpdate" + label="关联站台" + > @@ -30,11 +32,26 @@ import { EsbButtonData } from 'src/drawApp/graphics/EsbButtonInteraction'; import { useFormData } from 'src/components/DrawAppFormUtils'; import { useDrawStore } from 'src/stores/draw-store'; +import { onMounted, reactive } from 'vue'; +import { Platform } from 'src/graphics/platform/Platform'; const drawStore = useDrawStore(); +const platformList: { label: string; value: string }[] = reactive([]); const { data: esbButtonModel, onUpdate } = useFormData( new EsbButtonData(), drawStore.getDrawApp() ); + +onMounted(() => { + const platforms = drawStore + .getDrawApp() + .queryStore.queryByType(Platform.Type); + platforms.forEach((p) => { + platformList.push({ + value: p.id, + label: `${p.datas.code}[${p.datas.index}]`, + }); + }); +}); diff --git a/src/components/draw-app/properties/SpksSwitchProperty.vue b/src/components/draw-app/properties/SpksSwitchProperty.vue index ce0646d..7980e33 100644 --- a/src/components/draw-app/properties/SpksSwitchProperty.vue +++ b/src/components/draw-app/properties/SpksSwitchProperty.vue @@ -21,14 +21,16 @@ @blur="onUpdate" label="名称" /> - + v-model="spksSwitchModel.refStand" + :options="platformList" + :map-options="true" + :emit-value="true" + @update:model-value="onUpdate" + label="关联站台" + > { const sections = drawStore @@ -67,5 +71,14 @@ onMounted(() => { label: `${se.datas.code}[${se.datas.index}]`, }); }); + const platforms = drawStore + .getDrawApp() + .queryStore.queryByType(Platform.Type); + platforms.forEach((p) => { + platformList.push({ + value: p.id, + label: `${p.datas.code}[${p.datas.index}]`, + }); + }); }); diff --git a/src/drawApp/graphics/EsbButtonInteraction.ts b/src/drawApp/graphics/EsbButtonInteraction.ts index 7bacd58..05de6f6 100644 --- a/src/drawApp/graphics/EsbButtonInteraction.ts +++ b/src/drawApp/graphics/EsbButtonInteraction.ts @@ -2,7 +2,7 @@ import * as pb_1 from 'google-protobuf'; import { DisplayObject, FederatedMouseEvent } from 'pixi.js'; import { EsbButton, IEsbButton } from 'src/graphics/esbButton/EsbButton'; import { - GraphicApp, + IGraphicApp, GraphicInteractionPlugin, JlGraphic, } from 'src/jl-graphic'; @@ -46,10 +46,10 @@ export class EsbButtonData extends GraphicDataBase implements IEsbButton { set index(v: number) { this.data.index = v; } - get refStand(): number { + get refStand(): string { return this.data.refStand; } - set refStand(v: number) { + set refStand(v: string) { this.data.refStand = v; } clone(): EsbButtonData { @@ -76,11 +76,11 @@ const EsbButtonEditMenu: ContextMenu = ContextMenu.init({ }); export class DrawEsbButtonInteraction extends GraphicInteractionPlugin { static Name = 'esb_button_draw_right_menu'; - constructor(app: GraphicApp) { + constructor(app: IGraphicApp) { super(DrawEsbButtonInteraction.Name, app); app.registerMenu(EsbButtonEditMenu); } - static init(app: GraphicApp) { + static init(app: IGraphicApp) { return new DrawEsbButtonInteraction(app); } filter(...grahpics: JlGraphic[]): EsbButton[] | undefined { diff --git a/src/drawApp/graphics/GatedBoxInteraction.ts b/src/drawApp/graphics/GatedBoxInteraction.ts index ecf2f6f..2c4106a 100644 --- a/src/drawApp/graphics/GatedBoxInteraction.ts +++ b/src/drawApp/graphics/GatedBoxInteraction.ts @@ -2,7 +2,7 @@ import * as pb_1 from 'google-protobuf'; import { DisplayObject, FederatedMouseEvent } from 'pixi.js'; import { GatedBox, IGatedBox } from 'src/graphics/gatedBox/GatedBox'; import { - GraphicApp, + IGraphicApp, GraphicInteractionPlugin, JlGraphic, } from 'src/jl-graphic'; @@ -70,11 +70,11 @@ const GatedBoxEditMenu: ContextMenu = ContextMenu.init({ }); export class DrawGatedBoxInteraction extends GraphicInteractionPlugin { static Name = 'gated_box_draw_right_menu'; - constructor(app: GraphicApp) { + constructor(app: IGraphicApp) { super(DrawGatedBoxInteraction.Name, app); app.registerMenu(GatedBoxEditMenu); } - static init(app: GraphicApp) { + static init(app: IGraphicApp) { return new DrawGatedBoxInteraction(app); } filter(...grahpics: JlGraphic[]): GatedBox[] | undefined { diff --git a/src/drawApp/graphics/SpksSwitchInteraction.ts b/src/drawApp/graphics/SpksSwitchInteraction.ts index 7488186..789998b 100644 --- a/src/drawApp/graphics/SpksSwitchInteraction.ts +++ b/src/drawApp/graphics/SpksSwitchInteraction.ts @@ -46,10 +46,10 @@ export class SpksSwitchData extends GraphicDataBase implements ISpksSwitch { set index(v: number) { this.data.index = v; } - get refStand(): number { + get refStand(): string { return this.data.refStand; } - set refStand(v: number) { + set refStand(v: string) { this.data.refStand = v; } get refSections(): string[] { diff --git a/src/graphics/arrow/ArrowDrawAssistant.ts b/src/graphics/arrow/ArrowDrawAssistant.ts index d024e49..1607a3c 100644 --- a/src/graphics/arrow/ArrowDrawAssistant.ts +++ b/src/graphics/arrow/ArrowDrawAssistant.ts @@ -156,7 +156,7 @@ function onEditPointCreate(g: ILineGraphic, dp: DraggablePoint): void { } export class ArrowPointEditPlugin extends GraphicInteractionPlugin { - static Name = 'SectionPointDrag'; + static Name = 'ArrowPointDrag'; drawAssistant: ArrowDraw; constructor(app: IGraphicApp, da: ArrowDraw) { @@ -170,8 +170,8 @@ export class ArrowPointEditPlugin extends GraphicInteractionPlugin { return grahpics.filter((g) => g.type == Arrow.Type) as Arrow[]; } bind(g: Arrow): void { - g.lineGraphic.eventMode = 'static'; - g.lineGraphic.cursor = 'pointer'; + g.eventMode = 'static'; + g.cursor = 'pointer'; g.hitArea = new ArrowGraphicHitArea(g); g.transformSave = true; g.on('selected', this.onSelected, this); diff --git a/src/graphics/esbButton/EsbButton.ts b/src/graphics/esbButton/EsbButton.ts index 47c0fec..6301202 100644 --- a/src/graphics/esbButton/EsbButton.ts +++ b/src/graphics/esbButton/EsbButton.ts @@ -13,8 +13,8 @@ export interface IEsbButton extends GraphicData { set flip(v: boolean); get index(): number; set index(v: number); - get refStand(): number; - set refStand(v: number); + get refStand(): string; + set refStand(v: string); clone(): IEsbButton; copyFrom(data: IEsbButton): void; eq(other: IEsbButton): boolean; diff --git a/src/graphics/spksSwitch/SpksSwitch.ts b/src/graphics/spksSwitch/SpksSwitch.ts index abb4c45..8de27ae 100644 --- a/src/graphics/spksSwitch/SpksSwitch.ts +++ b/src/graphics/spksSwitch/SpksSwitch.ts @@ -13,8 +13,8 @@ export interface ISpksSwitch extends GraphicData { set flip(v: boolean); get index(): number; set index(v: number); - get refStand(): number; - set refStand(v: number); + get refStand(): string; + set refStand(v: string); get refSections(): string[]; set refSections(v: string[]); clone(): ISpksSwitch; diff --git a/src/jl-graphic/app/JlGraphicApp.ts b/src/jl-graphic/app/JlGraphicApp.ts index ec2a04f..1ab9bfc 100644 --- a/src/jl-graphic/app/JlGraphicApp.ts +++ b/src/jl-graphic/app/JlGraphicApp.ts @@ -652,10 +652,8 @@ abstract class GraphicSceneBase } private async load(): Promise { - console.log(this._options.dataLoader, '====='); if (this._options.dataLoader) { const storage = await this._options.dataLoader(); - console.log(storage, 'storage'); if (storage.canvasProperty) { this.canvas.update(storage.canvasProperty); console.log(this.canvas, 'canvas'); diff --git a/src/layouts/IBPDrawLayout.vue b/src/layouts/IBPDrawLayout.vue index 1f93d14..f01daa7 100644 --- a/src/layouts/IBPDrawLayout.vue +++ b/src/layouts/IBPDrawLayout.vue @@ -167,7 +167,7 @@ function backConfirm() { -
+
diff --git a/src/protos/stationLayoutGraphics.ts b/src/protos/stationLayoutGraphics.ts index 5799eb3..52b0e57 100644 --- a/src/protos/stationLayoutGraphics.ts +++ b/src/protos/stationLayoutGraphics.ts @@ -4952,8 +4952,8 @@ export namespace graphicData { code?: string; flip?: boolean; index?: number; - refStand?: number; refSections?: string[]; + refStand?: string; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6], this.#one_of_decls); @@ -4970,12 +4970,12 @@ export namespace graphicData { if ("index" in data && data.index != undefined) { this.index = data.index; } - if ("refStand" in data && data.refStand != undefined) { - this.refStand = data.refStand; - } if ("refSections" in data && data.refSections != undefined) { this.refSections = data.refSections; } + if ("refStand" in data && data.refStand != undefined) { + this.refStand = data.refStand; + } } } get common() { @@ -5005,25 +5005,25 @@ export namespace graphicData { set index(value: number) { pb_1.Message.setField(this, 4, value); } - get refStand() { - return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; - } - set refStand(value: number) { - pb_1.Message.setField(this, 5, value); - } get refSections() { return pb_1.Message.getFieldWithDefault(this, 6, []) as string[]; } set refSections(value: string[]) { pb_1.Message.setField(this, 6, value); } + get refStand() { + return pb_1.Message.getFieldWithDefault(this, 7, "") as string; + } + set refStand(value: string) { + pb_1.Message.setField(this, 7, value); + } static fromObject(data: { common?: ReturnType; code?: string; flip?: boolean; index?: number; - refStand?: number; refSections?: string[]; + refStand?: string; }): SpksSwitch { const message = new SpksSwitch({}); if (data.common != null) { @@ -5038,12 +5038,12 @@ export namespace graphicData { if (data.index != null) { message.index = data.index; } - if (data.refStand != null) { - message.refStand = data.refStand; - } if (data.refSections != null) { message.refSections = data.refSections; } + if (data.refStand != null) { + message.refStand = data.refStand; + } return message; } toObject() { @@ -5052,8 +5052,8 @@ export namespace graphicData { code?: string; flip?: boolean; index?: number; - refStand?: number; refSections?: string[]; + refStand?: string; } = {}; if (this.common != null) { data.common = this.common.toObject(); @@ -5067,12 +5067,12 @@ export namespace graphicData { if (this.index != null) { data.index = this.index; } - if (this.refStand != null) { - data.refStand = this.refStand; - } if (this.refSections != null) { data.refSections = this.refSections; } + if (this.refStand != null) { + data.refStand = this.refStand; + } return data; } serialize(): Uint8Array; @@ -5087,10 +5087,10 @@ export namespace graphicData { writer.writeBool(3, this.flip); if (this.index != 0) writer.writeInt32(4, this.index); - if (this.refStand != 0) - writer.writeInt32(5, this.refStand); if (this.refSections.length) writer.writeRepeatedString(6, this.refSections); + if (this.refStand.length) + writer.writeString(7, this.refStand); if (!w) return writer.getResultBuffer(); } @@ -5112,12 +5112,12 @@ export namespace graphicData { case 4: message.index = reader.readInt32(); break; - case 5: - message.refStand = reader.readInt32(); - break; case 6: pb_1.Message.addToRepeatedField(message, 6, reader.readString()); break; + case 7: + message.refStand = reader.readString(); + break; default: reader.skipField(); } } @@ -5137,7 +5137,7 @@ export namespace graphicData { code?: string; flip?: boolean; index?: number; - refStand?: number; + refStand?: string; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -5187,17 +5187,17 @@ export namespace graphicData { pb_1.Message.setField(this, 4, value); } get refStand() { - return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; } - set refStand(value: number) { - pb_1.Message.setField(this, 5, value); + set refStand(value: string) { + pb_1.Message.setField(this, 6, value); } static fromObject(data: { common?: ReturnType; code?: string; flip?: boolean; index?: number; - refStand?: number; + refStand?: string; }): EsbButton { const message = new EsbButton({}); if (data.common != null) { @@ -5223,7 +5223,7 @@ export namespace graphicData { code?: string; flip?: boolean; index?: number; - refStand?: number; + refStand?: string; } = {}; if (this.common != null) { data.common = this.common.toObject(); @@ -5254,8 +5254,8 @@ export namespace graphicData { writer.writeBool(3, this.flip); if (this.index != 0) writer.writeInt32(4, this.index); - if (this.refStand != 0) - writer.writeInt32(5, this.refStand); + if (this.refStand.length) + writer.writeString(6, this.refStand); if (!w) return writer.getResultBuffer(); } @@ -5277,8 +5277,8 @@ export namespace graphicData { case 4: message.index = reader.readInt32(); break; - case 5: - message.refStand = reader.readInt32(); + case 6: + message.refStand = reader.readString(); break; default: reader.skipField(); }