diff --git a/src/components/draw-app/dialogs/SectionSplitDialog.vue b/src/components/draw-app/dialogs/SectionSplitDialog.vue index fc22bb9..972961d 100644 --- a/src/components/draw-app/dialogs/SectionSplitDialog.vue +++ b/src/components/draw-app/dialogs/SectionSplitDialog.vue @@ -2,7 +2,7 @@ import { useDialogPluginComponent } from 'quasar'; import { ref } from 'vue'; -const num = ref(3); +const num = ref(); const dir = ref('ltr'); const dirOptions = [ { label: '从左至右', value: 'ltr' }, diff --git a/src/components/draw-app/properties/PlatformProperty.vue b/src/components/draw-app/properties/PlatformProperty.vue index 9d66640..c08d498 100644 --- a/src/components/draw-app/properties/PlatformProperty.vue +++ b/src/components/draw-app/properties/PlatformProperty.vue @@ -67,16 +67,20 @@ enum showSelect { 否 = 'false', 向上 = 'up', 向下 = 'down', - 上行 = 'upLink', - 下行 = 'downLink', +} +enum showUp { + 上行 = 'true', + 下行 = 'false', } enum showSelectData { true = '是', false = '否', up = '向上', down = '向下', - upLink = '上行', - downLink = '下行', +} +enum showUpData { + true = '上行', + false = '下行', } drawStore.$subscribe; @@ -87,7 +91,7 @@ watch( platformModel.copyFrom(val.saveData() as PlatformData); hasDoor.value = (showSelectData as never)[platformModel.hasdoor + '']; direction.value = (showSelectData as never)[platformModel.direction]; - upAndDown.value = (showSelectData as never)[platformModel.upAndDown]; + upAndDown.value = (showUpData as never)[platformModel.up + '']; if (platformModel.refStation) { const refStation = val.queryStore.queryById( platformModel.refStation @@ -104,7 +108,7 @@ onMounted(() => { platformModel.copyFrom(platform.saveData()); hasDoor.value = (showSelectData as never)[platformModel.hasdoor + '']; direction.value = (showSelectData as never)[platformModel.direction]; - upAndDown.value = (showSelectData as never)[platformModel.upAndDown]; + upAndDown.value = (showUpData as never)[platformModel.up + '']; if (platformModel.refStation) { const refStation = platform.queryStore.queryById( platformModel.refStation @@ -117,7 +121,7 @@ onMounted(() => { function onUpdate() { platformModel.hasdoor = JSON.parse((showSelect as never)[hasDoor.value]); platformModel.direction = (showSelect as never)[direction.value]; - platformModel.upAndDown = (showSelect as never)[upAndDown.value]; + platformModel.up = JSON.parse((showUp as never)[upAndDown.value]); const platform = drawStore.selectedGraphic as Platform; if (platform) { drawStore.getDrawApp().updateGraphicAndRecord(platform, platformModel); diff --git a/src/components/errrorMessageBox.vue b/src/components/errrorMessageBox.vue index ebe8383..057c780 100644 --- a/src/components/errrorMessageBox.vue +++ b/src/components/errrorMessageBox.vue @@ -57,7 +57,7 @@ import { onMounted, ref, watch } from 'vue'; import { queryAlarmInfoById } from 'src/api/DecisionInfo'; import { useQuasar } from 'quasar'; -const bgColor = 'yellow'; +let bgColor = ref('yellow'); const dialogWidth = window.screen.width * 0.4; const lineNetStore = useLineNetStore(); @@ -65,6 +65,7 @@ watch( () => lineNetStore.alarmInfo, (val) => { if (val.length) { + bgColor.value = 'orange'; search(); updata(); } diff --git a/src/drawApp/graphics/PlatformInteraction.ts b/src/drawApp/graphics/PlatformInteraction.ts index e7d9787..00543ee 100644 --- a/src/drawApp/graphics/PlatformInteraction.ts +++ b/src/drawApp/graphics/PlatformInteraction.ts @@ -53,11 +53,11 @@ export class PlatformData extends GraphicDataBase implements IPlatformData { set direction(v: string) { this.data.direction = v; } - get upAndDown(): string { - return this.data.upAndDown; + get up(): boolean { + return this.data.up; } - set upAndDown(v: string) { - this.data.upAndDown = v; + set up(v: boolean) { + this.data.up = v; } get refStation(): string { return this.data.refStation; diff --git a/src/graphics/platform/Platform.ts b/src/graphics/platform/Platform.ts index a753306..325b9f4 100644 --- a/src/graphics/platform/Platform.ts +++ b/src/graphics/platform/Platform.ts @@ -17,8 +17,8 @@ export interface IPlatformData extends GraphicData { set hasdoor(v: boolean); get direction(): string; // 屏蔽门上下 set direction(v: string); - get upAndDown(): string; // 站台上下行 - set upAndDown(v: string); + get up(): boolean; // 站台上下行 + set up(v: boolean); get refStation(): string; // 关联的车站 set refStation(v: string); clone(): IPlatformData; diff --git a/src/graphics/station/Station.ts b/src/graphics/station/Station.ts index 70b5f08..cd7cb26 100644 --- a/src/graphics/station/Station.ts +++ b/src/graphics/station/Station.ts @@ -173,8 +173,9 @@ export class Station extends JlGraphic { const kilometerGraph = this.kilometerGraph; const controlGraphic = this.controlGraphic; controlGraphic.clear(); - codeGraph.text = - `${this.datas?.name}(${this.datas?.code})` || '车站Station'; + codeGraph.text = this.datas?.code + ? `${this.datas?.name}(${this.datas?.code})` + : `${this.datas?.name}`; codeGraph.style.fill = stationConsts.codeColor; codeGraph.setVectorFontSize(stationConsts.codeFontSize); codeGraph.anchor.set(0.5); diff --git a/src/graphics/trainWindow/TrainWindowDrawAssistant.ts b/src/graphics/trainWindow/TrainWindowDrawAssistant.ts index ffa95e2..7f37b90 100644 --- a/src/graphics/trainWindow/TrainWindowDrawAssistant.ts +++ b/src/graphics/trainWindow/TrainWindowDrawAssistant.ts @@ -19,6 +19,7 @@ import { import { Section, SectionType } from '../section/Section'; import { LogicSection } from '../logicSection/LogicSection'; import { Platform } from '../platform/Platform'; +import { Turnout } from '../turnout/Turnout'; function graphicsOverlap( x1: number, @@ -135,13 +136,19 @@ export class TrainWindowDraw extends GraphicDrawAssistant< trainWindow.loadData(this.graphicTemplate.datas); if (section.type == 'LogicSection') { trainWindow.datas.refDeviceId = [section.id]; + trainWindow.position.set( + x, + ps.y - direction * TrainWindowConsts.offsetSection + ); } else { - trainWindow.datas.refDeviceId = (section as Section).datas.children; + const refTurnout = (section as Section).datas.children; + trainWindow.datas.refDeviceId = refTurnout; + const turnout = this.app.queryStore.queryById(refTurnout[0]); + trainWindow.position.set( + x, + turnout.y - direction * TrainWindowConsts.offsetSection + ); } - trainWindow.position.set( - x, - ps.y - direction * TrainWindowConsts.offsetSection - ); trainWindow.id = GraphicIdGenerator.next(); this.storeGraphic(trainWindow); const platforms = this.app.queryStore.queryByType(Platform.Type); @@ -188,7 +195,7 @@ export class TrainWindowDraw extends GraphicDrawAssistant< ); this.app.deleteGraphics(...trainWindowAll); turnoutSections.forEach((section) => { - const ps = section.localToCanvasPoint(section.getStartPoint()); + const ps = section.datas.points[0] as Point; let direction = 1; if (ps.y > height.y) { direction = -1; diff --git a/src/pages/DecisionInfoManage.vue b/src/pages/DecisionInfoManage.vue index eef57df..69ef074 100644 --- a/src/pages/DecisionInfoManage.vue +++ b/src/pages/DecisionInfoManage.vue @@ -215,7 +215,7 @@ async function onRequest(props: any) { let response = await alarmInfoPageQuery({ current: page, size: rowsPerPage, - alertType: filter.alertType, + alertType: (saveAlertTypeData as never)[filter.alertType], }); const pageData = response; pagination.value.rowsNumber = pageData.total; diff --git a/src/pages/MonitorPage.vue b/src/pages/MonitorPage.vue index 58ccc52..acea3bb 100644 --- a/src/pages/MonitorPage.vue +++ b/src/pages/MonitorPage.vue @@ -66,6 +66,9 @@ function onResize() { //报警信息弹框 const audio = ref(); +const $q = useQuasar(); +const dialogInstance = ref(); + watch( () => lineNetStore.alarmInfo, (val) => { @@ -78,15 +81,18 @@ watch( }, { deep: true } ); -const $q = useQuasar(); + function playAlarmMusic() { audio.value.play(); } + function alarm() { lineNetStore.alarmDialog = true; - $q.dialog({ component: errrorMessageBox }).onCancel(() => { - lineNetStore.alarmDialog = false; - }); + dialogInstance.value = $q + .dialog({ component: errrorMessageBox }) + .onCancel(() => { + lineNetStore.alarmDialog = false; + }); } onMounted(() => { @@ -100,5 +106,8 @@ onMounted(() => { onUnmounted(() => { lineNetStore.destroy(); + if (dialogInstance.value) { + dialogInstance.value.hide(); + } }); diff --git a/src/protos/device_info.ts b/src/protos/device_info.ts index 5207d19..91ab5c8 100644 --- a/src/protos/device_info.ts +++ b/src/protos/device_info.ts @@ -15,6 +15,7 @@ export namespace state { kilometerSystem?: dependency_1.graphicData.KilometerSystem[]; convertKilometer?: number[]; physicalSectionId?: string; + destinationCode?: string; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 4, 5], this.#one_of_decls); @@ -37,6 +38,9 @@ export namespace state { if ("physicalSectionId" in data && data.physicalSectionId != undefined) { this.physicalSectionId = data.physicalSectionId; } + if ("destinationCode" in data && data.destinationCode != undefined) { + this.destinationCode = data.destinationCode; + } } } get id() { @@ -75,6 +79,12 @@ export namespace state { set physicalSectionId(value: string) { pb_1.Message.setField(this, 6, value); } + get destinationCode() { + return pb_1.Message.getFieldWithDefault(this, 7, "") as string; + } + set destinationCode(value: string) { + pb_1.Message.setField(this, 7, value); + } static fromObject(data: { id?: string; code?: string; @@ -82,6 +92,7 @@ export namespace state { kilometerSystem?: ReturnType[]; convertKilometer?: number[]; physicalSectionId?: string; + destinationCode?: string; }): Section { const message = new Section({}); if (data.id != null) { @@ -102,6 +113,9 @@ export namespace state { if (data.physicalSectionId != null) { message.physicalSectionId = data.physicalSectionId; } + if (data.destinationCode != null) { + message.destinationCode = data.destinationCode; + } return message; } toObject() { @@ -112,6 +126,7 @@ export namespace state { kilometerSystem?: ReturnType[]; convertKilometer?: number[]; physicalSectionId?: string; + destinationCode?: string; } = {}; if (this.id != null) { data.id = this.id; @@ -131,6 +146,9 @@ export namespace state { if (this.physicalSectionId != null) { data.physicalSectionId = this.physicalSectionId; } + if (this.destinationCode != null) { + data.destinationCode = this.destinationCode; + } return data; } serialize(): Uint8Array; @@ -149,6 +167,8 @@ export namespace state { writer.writePackedInt64(5, this.convertKilometer); if (this.physicalSectionId.length) writer.writeString(6, this.physicalSectionId); + if (this.destinationCode.length) + writer.writeString(7, this.destinationCode); if (!w) return writer.getResultBuffer(); } @@ -176,6 +196,9 @@ export namespace state { case 6: message.physicalSectionId = reader.readString(); break; + case 7: + message.destinationCode = reader.readString(); + break; default: reader.skipField(); } } diff --git a/src/protos/stationLayoutGraphics.ts b/src/protos/stationLayoutGraphics.ts index 46d02a2..ea0be4e 100644 --- a/src/protos/stationLayoutGraphics.ts +++ b/src/protos/stationLayoutGraphics.ts @@ -1706,8 +1706,8 @@ export namespace graphicData { code?: string; hasdoor?: boolean; direction?: string; - upAndDown?: string; refStation?: string; + up?: boolean; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -1724,12 +1724,12 @@ export namespace graphicData { if ("direction" in data && data.direction != undefined) { this.direction = data.direction; } - if ("upAndDown" in data && data.upAndDown != undefined) { - this.upAndDown = data.upAndDown; - } if ("refStation" in data && data.refStation != undefined) { this.refStation = data.refStation; } + if ("up" in data && data.up != undefined) { + this.up = data.up; + } } } get common() { @@ -1759,25 +1759,25 @@ export namespace graphicData { set direction(value: string) { pb_1.Message.setField(this, 4, value); } - get upAndDown() { - return pb_1.Message.getFieldWithDefault(this, 5, "") as string; - } - set upAndDown(value: string) { - pb_1.Message.setField(this, 5, value); - } get refStation() { return pb_1.Message.getFieldWithDefault(this, 6, "") as string; } set refStation(value: string) { pb_1.Message.setField(this, 6, value); } + get up() { + return pb_1.Message.getFieldWithDefault(this, 7, false) as boolean; + } + set up(value: boolean) { + pb_1.Message.setField(this, 7, value); + } static fromObject(data: { common?: ReturnType; code?: string; hasdoor?: boolean; direction?: string; - upAndDown?: string; refStation?: string; + up?: boolean; }): Platform { const message = new Platform({}); if (data.common != null) { @@ -1792,12 +1792,12 @@ export namespace graphicData { if (data.direction != null) { message.direction = data.direction; } - if (data.upAndDown != null) { - message.upAndDown = data.upAndDown; - } if (data.refStation != null) { message.refStation = data.refStation; } + if (data.up != null) { + message.up = data.up; + } return message; } toObject() { @@ -1806,8 +1806,8 @@ export namespace graphicData { code?: string; hasdoor?: boolean; direction?: string; - upAndDown?: string; refStation?: string; + up?: boolean; } = {}; if (this.common != null) { data.common = this.common.toObject(); @@ -1821,12 +1821,12 @@ export namespace graphicData { if (this.direction != null) { data.direction = this.direction; } - if (this.upAndDown != null) { - data.upAndDown = this.upAndDown; - } if (this.refStation != null) { data.refStation = this.refStation; } + if (this.up != null) { + data.up = this.up; + } return data; } serialize(): Uint8Array; @@ -1841,10 +1841,10 @@ export namespace graphicData { writer.writeBool(3, this.hasdoor); if (this.direction.length) writer.writeString(4, this.direction); - if (this.upAndDown.length) - writer.writeString(5, this.upAndDown); if (this.refStation.length) writer.writeString(6, this.refStation); + if (this.up != false) + writer.writeBool(7, this.up); if (!w) return writer.getResultBuffer(); } @@ -1866,12 +1866,12 @@ export namespace graphicData { case 4: message.direction = reader.readString(); break; - case 5: - message.upAndDown = reader.readString(); - break; case 6: message.refStation = reader.readString(); break; + case 7: + message.up = reader.readBool(); + break; default: reader.skipField(); } } diff --git a/xian-ncc-da-message b/xian-ncc-da-message index bdcbbf2..4f27cc3 160000 --- a/xian-ncc-da-message +++ b/xian-ncc-da-message @@ -1 +1 @@ -Subproject commit bdcbbf2c048dbf70cdd92b25f0012c676ccd9b04 +Subproject commit 4f27cc3670bcb4071706bb0e66d6fdfd817e27a4