From d94ae6b975e0ef8a30912e110e8b589a4754c7f9 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 21 Dec 2023 14:08:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E7=AB=99=E5=A2=9E=E5=8A=A0=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E8=BD=A6=E8=BE=86=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../draw-app/properties/StationProperty.vue | 6 +++++ src/drawApp/graphics/StationInteraction.ts | 6 +++++ src/graphics/station/Station.ts | 2 ++ src/protos/stationLayoutGraphics.ts | 23 +++++++++++++++++++ 4 files changed, 37 insertions(+) diff --git a/src/components/draw-app/properties/StationProperty.vue b/src/components/draw-app/properties/StationProperty.vue index 91c546c..0ba7b2a 100644 --- a/src/components/draw-app/properties/StationProperty.vue +++ b/src/components/draw-app/properties/StationProperty.vue @@ -60,6 +60,12 @@ emit-value @update:model-value="onUpdate" /> + diff --git a/src/drawApp/graphics/StationInteraction.ts b/src/drawApp/graphics/StationInteraction.ts index b72d1b7..7442d84 100644 --- a/src/drawApp/graphics/StationInteraction.ts +++ b/src/drawApp/graphics/StationInteraction.ts @@ -74,6 +74,12 @@ export class StationData extends GraphicDataBase implements IStationData { set manageStations(v: number[]) { this.data.manageStations = v; } + get depots(): boolean { + return this.data.depots; + } + set depots(v: boolean) { + this.data.depots = v; + } clone(): StationData { return new StationData(this.data.cloneMessage()); } diff --git a/src/graphics/station/Station.ts b/src/graphics/station/Station.ts index 3952e05..12b2394 100644 --- a/src/graphics/station/Station.ts +++ b/src/graphics/station/Station.ts @@ -25,6 +25,8 @@ export interface IStationData extends GraphicData { set name(v: string); get manageStations(): number[]; //集中站管理的车站 set manageStations(v: number[]); + get depots(): boolean; //是否车辆段 + set depots(v: boolean); clone(): IStationData; copyFrom(data: IStationData): void; eq(other: IStationData): boolean; diff --git a/src/protos/stationLayoutGraphics.ts b/src/protos/stationLayoutGraphics.ts index da9274c..fcb12d2 100644 --- a/src/protos/stationLayoutGraphics.ts +++ b/src/protos/stationLayoutGraphics.ts @@ -2382,6 +2382,7 @@ export namespace graphicData { kilometerSystem?: KilometerSystem; name?: string; manageStations?: number[]; + depots?: boolean; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [8], this.#one_of_decls); @@ -2407,6 +2408,9 @@ export namespace graphicData { if ("manageStations" in data && data.manageStations != undefined) { this.manageStations = data.manageStations; } + if ("depots" in data && data.depots != undefined) { + this.depots = data.depots; + } } } get common() { @@ -2457,6 +2461,12 @@ export namespace graphicData { set manageStations(value: number[]) { pb_1.Message.setField(this, 8, value); } + get depots() { + return pb_1.Message.getFieldWithDefault(this, 9, false) as boolean; + } + set depots(value: boolean) { + pb_1.Message.setField(this, 9, value); + } static fromObject(data: { common?: ReturnType; code?: string; @@ -2465,6 +2475,7 @@ export namespace graphicData { kilometerSystem?: ReturnType; name?: string; manageStations?: number[]; + depots?: boolean; }): Station { const message = new Station({}); if (data.common != null) { @@ -2488,6 +2499,9 @@ export namespace graphicData { if (data.manageStations != null) { message.manageStations = data.manageStations; } + if (data.depots != null) { + message.depots = data.depots; + } return message; } toObject() { @@ -2499,6 +2513,7 @@ export namespace graphicData { kilometerSystem?: ReturnType; name?: string; manageStations?: number[]; + depots?: boolean; } = {}; if (this.common != null) { data.common = this.common.toObject(); @@ -2521,6 +2536,9 @@ export namespace graphicData { if (this.manageStations != null) { data.manageStations = this.manageStations; } + if (this.depots != null) { + data.depots = this.depots; + } return data; } serialize(): Uint8Array; @@ -2541,6 +2559,8 @@ export namespace graphicData { writer.writeString(7, this.name); if (this.manageStations.length) writer.writePackedUint32(8, this.manageStations); + if (this.depots != false) + writer.writeBool(9, this.depots); if (!w) return writer.getResultBuffer(); } @@ -2571,6 +2591,9 @@ export namespace graphicData { case 8: message.manageStations = reader.readPackedUint32(); break; + case 9: + message.depots = reader.readBool(); + break; default: reader.skipField(); } }