车站增加是否车辆段

This commit is contained in:
joylink_zhaoerwei 2023-12-21 14:08:11 +08:00
parent 938559a0a9
commit d94ae6b975
4 changed files with 37 additions and 0 deletions

View File

@ -60,6 +60,12 @@
emit-value emit-value
@update:model-value="onUpdate" @update:model-value="onUpdate"
/> />
<q-toggle
v-model="stationModel.depots"
label="是否车辆段"
emit-value
@update:model-value="onUpdate"
/>
</q-form> </q-form>
</template> </template>

View File

@ -74,6 +74,12 @@ export class StationData extends GraphicDataBase implements IStationData {
set manageStations(v: number[]) { set manageStations(v: number[]) {
this.data.manageStations = v; this.data.manageStations = v;
} }
get depots(): boolean {
return this.data.depots;
}
set depots(v: boolean) {
this.data.depots = v;
}
clone(): StationData { clone(): StationData {
return new StationData(this.data.cloneMessage()); return new StationData(this.data.cloneMessage());
} }

View File

@ -25,6 +25,8 @@ export interface IStationData extends GraphicData {
set name(v: string); set name(v: string);
get manageStations(): number[]; //集中站管理的车站 get manageStations(): number[]; //集中站管理的车站
set manageStations(v: number[]); set manageStations(v: number[]);
get depots(): boolean; //是否车辆段
set depots(v: boolean);
clone(): IStationData; clone(): IStationData;
copyFrom(data: IStationData): void; copyFrom(data: IStationData): void;
eq(other: IStationData): boolean; eq(other: IStationData): boolean;

View File

@ -2382,6 +2382,7 @@ export namespace graphicData {
kilometerSystem?: KilometerSystem; kilometerSystem?: KilometerSystem;
name?: string; name?: string;
manageStations?: number[]; manageStations?: number[];
depots?: boolean;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [8], this.#one_of_decls); 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) { if ("manageStations" in data && data.manageStations != undefined) {
this.manageStations = data.manageStations; this.manageStations = data.manageStations;
} }
if ("depots" in data && data.depots != undefined) {
this.depots = data.depots;
}
} }
} }
get common() { get common() {
@ -2457,6 +2461,12 @@ export namespace graphicData {
set manageStations(value: number[]) { set manageStations(value: number[]) {
pb_1.Message.setField(this, 8, value); 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: { static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>; common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string; code?: string;
@ -2465,6 +2475,7 @@ export namespace graphicData {
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>; kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
name?: string; name?: string;
manageStations?: number[]; manageStations?: number[];
depots?: boolean;
}): Station { }): Station {
const message = new Station({}); const message = new Station({});
if (data.common != null) { if (data.common != null) {
@ -2488,6 +2499,9 @@ export namespace graphicData {
if (data.manageStations != null) { if (data.manageStations != null) {
message.manageStations = data.manageStations; message.manageStations = data.manageStations;
} }
if (data.depots != null) {
message.depots = data.depots;
}
return message; return message;
} }
toObject() { toObject() {
@ -2499,6 +2513,7 @@ export namespace graphicData {
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>; kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
name?: string; name?: string;
manageStations?: number[]; manageStations?: number[];
depots?: boolean;
} = {}; } = {};
if (this.common != null) { if (this.common != null) {
data.common = this.common.toObject(); data.common = this.common.toObject();
@ -2521,6 +2536,9 @@ export namespace graphicData {
if (this.manageStations != null) { if (this.manageStations != null) {
data.manageStations = this.manageStations; data.manageStations = this.manageStations;
} }
if (this.depots != null) {
data.depots = this.depots;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -2541,6 +2559,8 @@ export namespace graphicData {
writer.writeString(7, this.name); writer.writeString(7, this.name);
if (this.manageStations.length) if (this.manageStations.length)
writer.writePackedUint32(8, this.manageStations); writer.writePackedUint32(8, this.manageStations);
if (this.depots != false)
writer.writeBool(9, this.depots);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -2571,6 +2591,9 @@ export namespace graphicData {
case 8: case 8:
message.manageStations = reader.readPackedUint32(); message.manageStations = reader.readPackedUint32();
break; break;
case 9:
message.depots = reader.readBool();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }