From 8073286da78025933dba1f67bf78cfb153b1b7be Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Thu, 22 Aug 2024 08:45:24 +0800 Subject: [PATCH] merge --- rts-sim-testing-message | 2 +- .../draw-app/dialogs/KmChainData.vue | 161 +++++++++++++++ .../draw-app/properties/KmChainDataConfig.vue | 194 ++++++++++++++++++ src/drawApp/commonApp.ts | 58 +++++- src/layouts/DrawLayout.vue | 25 +++ src/stores/draw-store.ts | 7 + 6 files changed, 435 insertions(+), 12 deletions(-) create mode 100644 src/components/draw-app/dialogs/KmChainData.vue create mode 100644 src/components/draw-app/properties/KmChainDataConfig.vue diff --git a/rts-sim-testing-message b/rts-sim-testing-message index b7336a5..939b7a2 160000 --- a/rts-sim-testing-message +++ b/rts-sim-testing-message @@ -1 +1 @@ -Subproject commit b7336a5bbe670add791fd42ebcfe21bf58df6bc4 +Subproject commit 939b7a2604a29cb3d486199cc9491af49f81a2f3 diff --git a/src/components/draw-app/dialogs/KmChainData.vue b/src/components/draw-app/dialogs/KmChainData.vue new file mode 100644 index 0000000..d16a82d --- /dev/null +++ b/src/components/draw-app/dialogs/KmChainData.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/src/components/draw-app/properties/KmChainDataConfig.vue b/src/components/draw-app/properties/KmChainDataConfig.vue new file mode 100644 index 0000000..7dd27a8 --- /dev/null +++ b/src/components/draw-app/properties/KmChainDataConfig.vue @@ -0,0 +1,194 @@ + + + diff --git a/src/drawApp/commonApp.ts b/src/drawApp/commonApp.ts index 67f0494..5ae9926 100644 --- a/src/drawApp/commonApp.ts +++ b/src/drawApp/commonApp.ts @@ -91,10 +91,22 @@ import { SpksSwitchData, DrawSpksSwitchInteraction, } from './graphics/SpksSwitchInteraction'; -import { HoldButton, HoldButtonTemplate } from 'src/graphics/holdButton/HoldButton'; -import { DrawHoldButtonInteraction, HoldButtonData } from './graphics/HoldButtonInteraction'; -import { UnattengedButton, UnattengedButtonTemplate } from 'src/graphics/unattengedButton/UnattengedButton'; -import { UnattengedButtonData, DrawUnattengedButtonInteraction } from './graphics/UnattengedButtonInteraction'; +import { + HoldButton, + HoldButtonTemplate, +} from 'src/graphics/holdButton/HoldButton'; +import { + DrawHoldButtonInteraction, + HoldButtonData, +} from './graphics/HoldButtonInteraction'; +import { + UnattengedButton, + UnattengedButtonTemplate, +} from 'src/graphics/unattengedButton/UnattengedButton'; +import { + UnattengedButtonData, + DrawUnattengedButtonInteraction, +} from './graphics/UnattengedButtonInteraction'; import { GatedBox, GatedBoxTemplate } from 'src/graphics/gatedBox/GatedBox'; import { GatedBoxData, @@ -235,7 +247,10 @@ export function initCommonDrawApp(app: IDrawApp) { new StopPositionDraw(app, new StopPositionTemplate(new StopPositionData())); new SpksSwitchDraw(app, new SpksSwitchTemplate(new SpksSwitchData())); new HoldButtonDraw(app, new HoldButtonTemplate(new HoldButtonData())); - new UnattengedButtonDraw(app, new UnattengedButtonTemplate(new UnattengedButtonData())); + new UnattengedButtonDraw( + app, + new UnattengedButtonTemplate(new UnattengedButtonData()) + ); new GatedBoxDraw(app, new GatedBoxTemplate(new GatedBoxData())); // new EsbButtonDraw( // app, @@ -307,6 +322,7 @@ export function initCommonDrawApp(app: IDrawApp) { kilometerConvertList = []; sectionCodePointList = []; otherLineList = []; + kmChainDataList = []; }); // KeyA 用于区段复制--控制生成的区段位置 const graphicCopyPlugin = app.app.graphicCopyPlugin; @@ -362,10 +378,10 @@ export function initCommonDrawApp(app: IDrawApp) { prev.localToCanvasPoint(prev.getStartPoint()), mousePos ) > - distance2( - cur.localToCanvasPoint(cur.getStartPoint()), - mousePos - )) + distance2( + cur.localToCanvasPoint(cur.getStartPoint()), + mousePos + )) ? cur : prev; }); @@ -415,6 +431,7 @@ export function loadCommonDrawDatas( lianSuoData = storage.lianSuoData; } kilometerConvertList = storage.kilometerConvertList; + kmChainDataList = storage.kilometerMarkCalibrations; sectionCodePointList = storage.sectionCodePointList; otherLineList = storage.otherLineList; refDevicesList = storage.stationRelateDeviceList; @@ -459,10 +476,10 @@ export function loadCommonDrawDatas( }); storage.holdButtons.forEach((holdButton) => { datas.push(new HoldButtonData(holdButton)); - }) + }); storage.unattengedButtons.forEach((unattengedButton) => { datas.push(new UnattengedButtonData(unattengedButton)); - }) + }); storage.gateBoxs.forEach((gatedBox) => { datas.push(new GatedBoxData(gatedBox)); }); @@ -721,6 +738,7 @@ export function saveCommonDrawDatas(app: IDrawApp) { storage.otherLineList = otherLineList; storage.stationRelateDeviceList = refDevicesList; storage.lianSuoData = lianSuoData; + storage.kilometerMarkCalibrations = kmChainDataList; // if (storage.generateAxleCountingConfig?.bbConnect) { // storage.generateAxleCountingConfig.newbbConnect = // storage.generateAxleCountingConfig.bbConnect.map((item) => +item); @@ -815,6 +833,24 @@ export function editKilometerConvert(row: graphicData.KilometerConvert) { export function deleteKilometerConvert(index: number) { kilometerConvertList.splice(index, 1); } +//公里标设计-实测数据增删改查 +let kmChainDataList: graphicData.KilometerMarkCalibration[] = []; +export function loadKmChainDataList() { + return kmChainDataList; +} +export function createKmChainData(row: graphicData.KilometerMarkCalibration) { + kmChainDataList.push(row); +} +export function editKmChainData(row: graphicData.KilometerMarkCalibration) { + const drawStore = useDrawStore(); + const findIndex = drawStore.editKmChainDataIndex; + if (findIndex >= 0) { + kmChainDataList.splice(findIndex, 1, row); + } +} +export function deleteKmChainData(index: number) { + kmChainDataList.splice(index, 1); +} // 公里标转换趋势 export const sameTrendOptions = [ { label: '相反', value: false }, diff --git a/src/layouts/DrawLayout.vue b/src/layouts/DrawLayout.vue index feec5a4..1f9888f 100644 --- a/src/layouts/DrawLayout.vue +++ b/src/layouts/DrawLayout.vue @@ -87,6 +87,9 @@ + @@ -249,7 +252,9 @@ import { graphicData } from 'src/protos/stationLayoutGraphics'; import KilometerConvertList from 'src/components/draw-app/dialogs/KilometerConvertList.vue'; import LoadTransponderData from 'src/components/draw-app/dialogs/LoadTransponderData.vue'; import LianSuoBianHao from 'src/components/draw-app/dialogs/LianSuoBianHao.vue'; +import KmChainData from 'src/components/draw-app/dialogs/KmChainData.vue'; import KilometerConvertConfig from 'src/components/draw-app/properties/KilometerConvertConfig.vue'; +import KmChainDataConfig from 'src/components/draw-app/properties/KmChainDataconfig.vue'; import SectionCodePointList from 'src/components/draw-app/dialogs/SectionCodePointList.vue'; import SectionCodePointConfig from 'src/components/draw-app/properties/SectionCodePointConfig.vue'; import StationRelateDeviceConfig from 'src/components/draw-app/properties/StationRelateDeviceConfig.vue'; @@ -415,6 +420,10 @@ const dataManageConfig = [ label: '联锁编号映射数据', click: lianSuoBianHao, }, + { + label: '公里标长短链数据', + click: kmChainData, + }, ]; onMounted(() => { @@ -1115,6 +1124,10 @@ onUnmounted(() => { if (otherLineDialog.value) { otherLineDialog.value.hide(); } + drawStore.setEditKmChainDataIndex(-1); + if (kmChainDataDialog.value) { + kmChainDataDialog.value.hide(); + } drawStore.setEditOtherLineIndex(-1); drawStore.destroy(); drawStore.setCategoryType(null); @@ -1208,6 +1221,18 @@ function lianSuoBianHao() { }); } +let kmChainDataDialog = ref(); +function kmChainData() { + if (kmChainDataDialog.value) return; + kmChainDataDialog.value = $q + .dialog({ + component: KmChainData, + }) + .onCancel(() => { + kmChainDataDialog.value = null; + }); +} + let relateDeviceDialogInstance: DialogChainObject | null = null; const relateDeviceConfigEdit = ref>(); diff --git a/src/stores/draw-store.ts b/src/stores/draw-store.ts index e7bcd16..7355a59 100644 --- a/src/stores/draw-store.ts +++ b/src/stores/draw-store.ts @@ -35,6 +35,7 @@ export const useDrawStore = defineStore('draw', { editKilometerConvertIndex: -1, editSectionCodePointIndex: -1, editOtherLineIndex: -1, + editKmChainDataIndex: -1, table: undefined as QTable | undefined, showRelateDeviceConfig: false, showDirectionConfig: '' as string, @@ -98,6 +99,9 @@ export const useDrawStore = defineStore('draw', { showEditOtherLine: (state) => { return state.editOtherLineIndex >= 0; }, + showEditKmChainData: (state) => { + return state.editKmChainDataIndex >= 0; + }, }, actions: { getDrawApp(): IDrawApp { @@ -186,5 +190,8 @@ export const useDrawStore = defineStore('draw', { setDirectionConfigVisible(visible: string) { this.showDirectionConfig = visible; }, + setEditKmChainDataIndex(index: number) { + this.editKmChainDataIndex = index; + }, }, });