连锁编号映射数据调整

This commit is contained in:
fan 2024-05-28 13:19:56 +08:00
parent cb7037dcee
commit f63c639dc1
4 changed files with 197 additions and 7 deletions

@ -1 +1 @@
Subproject commit 16d15c8515368725a811c9349c95ffdafb4dd991
Subproject commit fed626ac4b0d1b2696026438d32fe812ebd00ac2

View File

@ -167,7 +167,7 @@
<q-tab-panel name="esbButton">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in carWashingOptions">
<template :key="item.id" v-for="item in esbButtonOptions">
<q-input
outlined
class="q-mt-sm"
@ -181,7 +181,7 @@
<q-tab-panel name="holdButton">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in carWashingOptions">
<template :key="item.id" v-for="item in holdButtonOptions">
<q-input
outlined
class="q-mt-sm"
@ -195,7 +195,7 @@
<q-tab-panel name="unattengedButton">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in carWashingOptions">
<template :key="item.id" v-for="item in unattengedButtonOptions">
<q-input
outlined
class="q-mt-sm"
@ -228,6 +228,9 @@ import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor';
import { CarWashing } from 'src/graphics/carWashing/CarWashing';
import { loadLianSuoData, setLianSuoData } from 'src/drawApp/commonApp';
import { graphicData } from 'src/protos/stationLayoutGraphics';
import { EsbButton } from 'src/graphics/esbButton/EsbButton';
import { HoldButton } from 'src/graphics/holdButton/HoldButton';
import { UnattengedButton } from 'src/graphics/unattengedButton/UnattengedButton';
const drawStore = useDrawStore();
const stationOptions = ref<{ id: number; name: string; index: number }[]>([]);
@ -291,6 +294,16 @@ onMounted(() => {
lianSuoData.carWashing.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
lianSuoData.esbButtons.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
lianSuoData.holdButtons.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
lianSuoData.unattengedButtons.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
stationUpdateData();
stationUpdateData();
turnoutUpdateData();
screenDoorUpdateData();
@ -300,6 +313,9 @@ onMounted(() => {
spksSwitchUpdateData();
garageDoorUpdateData();
carWashingUpdateData();
esbButtonUpdateData();
holdButtonUpdateData();
unattengedButtonUpdateData();
tab.value = 'station';
});
@ -502,6 +518,88 @@ function carWashingUpdateData() {
carWashingOptions.value = list;
});
}
function esbButtonUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const esbs = drawApp.queryStore.queryByType<EsbButton>(EsbButton.Type);
esbs.forEach((esb) => {
let name = esb.datas.code;
if (esb.datas.refStand) {
const stand = drawApp.queryStore.queryById<Platform>(esb.datas.refStand);
name = name + '-' + stand.datas.code;
if (stand.datas.refStation) {
const station = drawApp.queryStore.queryById<Station>(
stand.datas.refStation
);
name = name + '-' + station.datas.stationName;
}
}
const index = lianSuoMapData.get(esb.datas.id) || 0;
list.push({
id: esb.datas.id,
name: name,
index: index,
});
esbButtonOptions.value = list;
});
}
function holdButtonUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const holdButtons = drawApp.queryStore.queryByType<HoldButton>(
HoldButton.Type
);
holdButtons.forEach((holdButton) => {
let name = holdButton.datas.code;
if (holdButton.datas.refStand) {
const stand = drawApp.queryStore.queryById<Platform>(
holdButton.datas.refStand
);
name = name + '-' + stand.datas.code;
if (stand.datas.refStation) {
const station = drawApp.queryStore.queryById<Station>(
stand.datas.refStation
);
name = name + '-' + station.datas.stationName;
}
}
const index = lianSuoMapData.get(holdButton.datas.id) || 0;
list.push({
id: holdButton.datas.id,
name: name,
index: index,
});
holdButtonOptions.value = list;
});
}
function unattengedButtonUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const unattengedButtons = drawApp.queryStore.queryByType<UnattengedButton>(
UnattengedButton.Type
);
unattengedButtons.forEach((unattengedButton) => {
let name = unattengedButton.datas.code;
if (unattengedButton.datas.refStand) {
const stand = drawApp.queryStore.queryById<Platform>(
unattengedButton.datas.refStand
);
name = name + '-' + stand.datas.code;
if (stand.datas.refStation) {
const station = drawApp.queryStore.queryById<Station>(
stand.datas.refStation
);
name = name + '-' + station.datas.stationName;
}
}
const index = lianSuoMapData.get(unattengedButton.datas.id) || 0;
list.push({
id: unattengedButton.datas.id,
name: name,
index: index,
});
console.log('1111111111', list);
unattengedButtonOptions.value = list;
});
}
function tabUpdate() {
switch (tab.value) {
@ -529,9 +627,18 @@ function tabUpdate() {
case 'garageDoor':
garageDoorUpdateData();
break;
case ' carWashing':
case 'carWashing':
carWashingUpdateData();
break;
case 'esbButton':
esbButtonUpdateData();
break;
case 'holdButton':
holdButtonUpdateData();
break;
case 'unattengedButton':
unattengedButtonUpdateData();
break;
}
}
function dialogHide() {
@ -581,6 +688,21 @@ function dialogHide() {
new graphicData.LianSuoIndexData({ id: cw.id, index: cw.index })
);
});
esbButtonOptions.value.forEach((eb) => {
newLianSuoData.esbButtons.push(
new graphicData.LianSuoIndexData({ id: eb.id, index: eb.index })
);
});
holdButtonOptions.value.forEach((hb) => {
newLianSuoData.holdButtons.push(
new graphicData.LianSuoIndexData({ id: hb.id, index: hb.index })
);
});
unattengedButtonOptions.value.forEach((ub) => {
newLianSuoData.unattengedButtons.push(
new graphicData.LianSuoIndexData({ id: ub.id, index: ub.index })
);
});
setLianSuoData(newLianSuoData);
}
</script>

View File

@ -45,7 +45,6 @@ export class UnattengedButton extends JlGraphic {
return this.getDatas<IUnattengedButtonData>();
}
doRepaint(): void {
console.log('111111111')
const codeGraph = this.codeGraph;
codeGraph.text = this.datas.code;
codeGraph.style.fill = unattengedButtonConsts.codeColor;

View File

@ -9389,9 +9389,12 @@ export namespace graphicData {
spksSwitchs?: LianSuoIndexData[];
garageDoors?: LianSuoIndexData[];
carWashing?: LianSuoIndexData[];
esbButtons?: LianSuoIndexData[];
holdButtons?: LianSuoIndexData[];
unattengedButtons?: LianSuoIndexData[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2, 3, 4, 5, 6, 7, 8, 9], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("stations" in data && data.stations != undefined) {
this.stations = data.stations;
@ -9420,6 +9423,15 @@ export namespace graphicData {
if ("carWashing" in data && data.carWashing != undefined) {
this.carWashing = data.carWashing;
}
if ("esbButtons" in data && data.esbButtons != undefined) {
this.esbButtons = data.esbButtons;
}
if ("holdButtons" in data && data.holdButtons != undefined) {
this.holdButtons = data.holdButtons;
}
if ("unattengedButtons" in data && data.unattengedButtons != undefined) {
this.unattengedButtons = data.unattengedButtons;
}
}
}
get stations() {
@ -9476,6 +9488,24 @@ export namespace graphicData {
set carWashing(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 9, value);
}
get esbButtons() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 10) as LianSuoIndexData[];
}
set esbButtons(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 10, value);
}
get holdButtons() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 11) as LianSuoIndexData[];
}
set holdButtons(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 11, value);
}
get unattengedButtons() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 12) as LianSuoIndexData[];
}
set unattengedButtons(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 12, value);
}
static fromObject(data: {
stations?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
switchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
@ -9486,6 +9516,9 @@ export namespace graphicData {
spksSwitchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
garageDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
carWashing?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
esbButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
holdButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
unattengedButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
}): LianSuoData {
const message = new LianSuoData({});
if (data.stations != null) {
@ -9515,6 +9548,15 @@ export namespace graphicData {
if (data.carWashing != null) {
message.carWashing = data.carWashing.map(item => LianSuoIndexData.fromObject(item));
}
if (data.esbButtons != null) {
message.esbButtons = data.esbButtons.map(item => LianSuoIndexData.fromObject(item));
}
if (data.holdButtons != null) {
message.holdButtons = data.holdButtons.map(item => LianSuoIndexData.fromObject(item));
}
if (data.unattengedButtons != null) {
message.unattengedButtons = data.unattengedButtons.map(item => LianSuoIndexData.fromObject(item));
}
return message;
}
toObject() {
@ -9528,6 +9570,9 @@ export namespace graphicData {
spksSwitchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
garageDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
carWashing?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
esbButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
holdButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
unattengedButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
} = {};
if (this.stations != null) {
data.stations = this.stations.map((item: LianSuoIndexData) => item.toObject());
@ -9556,6 +9601,15 @@ export namespace graphicData {
if (this.carWashing != null) {
data.carWashing = this.carWashing.map((item: LianSuoIndexData) => item.toObject());
}
if (this.esbButtons != null) {
data.esbButtons = this.esbButtons.map((item: LianSuoIndexData) => item.toObject());
}
if (this.holdButtons != null) {
data.holdButtons = this.holdButtons.map((item: LianSuoIndexData) => item.toObject());
}
if (this.unattengedButtons != null) {
data.unattengedButtons = this.unattengedButtons.map((item: LianSuoIndexData) => item.toObject());
}
return data;
}
serialize(): Uint8Array;
@ -9580,6 +9634,12 @@ export namespace graphicData {
writer.writeRepeatedMessage(8, this.garageDoors, (item: LianSuoIndexData) => item.serialize(writer));
if (this.carWashing.length)
writer.writeRepeatedMessage(9, this.carWashing, (item: LianSuoIndexData) => item.serialize(writer));
if (this.esbButtons.length)
writer.writeRepeatedMessage(10, this.esbButtons, (item: LianSuoIndexData) => item.serialize(writer));
if (this.holdButtons.length)
writer.writeRepeatedMessage(11, this.holdButtons, (item: LianSuoIndexData) => item.serialize(writer));
if (this.unattengedButtons.length)
writer.writeRepeatedMessage(12, this.unattengedButtons, (item: LianSuoIndexData) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@ -9616,6 +9676,15 @@ export namespace graphicData {
case 9:
reader.readMessage(message.carWashing, () => pb_1.Message.addToRepeatedWrapperField(message, 9, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 10:
reader.readMessage(message.esbButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 10, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 11:
reader.readMessage(message.holdButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 11, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 12:
reader.readMessage(message.unattengedButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 12, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
default: reader.skipField();
}
}