From 9261a95f788e4800b5beee647e4b3a48f14650e0 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 19 Mar 2024 14:20:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E5=8F=B0=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/TrainModelApi.ts | 3 +- .../draw-app/dialogs/AddTrainDialog.vue | 2 + src/components/line-app/infos/TrainInfo.vue | 15 + src/drawApp/graphics/TccHandleInteraction.ts | 47 +- src/drawApp/graphics/TccKeyInteraction.ts | 85 ++- src/drawApp/graphics/TrainInteraction.ts | 3 + src/drawApp/pslScene.ts | 2 +- src/drawApp/tccApp.ts | 7 +- src/drawApp/tccScene.ts | 22 +- src/graphics/train/Train.ts | 1 + src/layouts/LineLayout.vue | 42 +- src/pages/PublishManage.vue | 1 + src/pages/TrainModelManage.vue | 31 + src/protos/device_state.ts | 589 +++++++++++++++++- src/protos/request.ts | 543 ++++++++++++++++ src/protos/stationLayoutGraphics.ts | 23 + src/stores/tcc-store.ts | 8 +- 17 files changed, 1369 insertions(+), 55 deletions(-) diff --git a/src/api/TrainModelApi.ts b/src/api/TrainModelApi.ts index 9c17c0b..c0929ba 100644 --- a/src/api/TrainModelApi.ts +++ b/src/api/TrainModelApi.ts @@ -56,7 +56,8 @@ export interface TrainCreateParams { total_length: number; train_model: number; train_sets: string; - trainConfigData?: TrainConfigData + trainConfigData?: TrainConfigData; + trainControlMapId: number; } /** diff --git a/src/components/draw-app/dialogs/AddTrainDialog.vue b/src/components/draw-app/dialogs/AddTrainDialog.vue index 4d2bc8f..3f76693 100644 --- a/src/components/draw-app/dialogs/AddTrainDialog.vue +++ b/src/components/draw-app/dialogs/AddTrainDialog.vue @@ -163,6 +163,7 @@ function onCreate() { wheelDiameter: wheelDiameter.value, trainLength: trainConfig.value.total_length, configTrain: trainConfig.value.trainConfigData as TrainConfigData, + trainControlMapId: trainConfig.value.trainControlMapId, trainEndsA: { radarCheckSpeedDiff: 0, radarCheckTime: 0, @@ -208,6 +209,7 @@ const trainConfig = ref({ total_length: 0, train_model: 0, train_sets: '', + trainControlMapId: 0, }); function setConfigVal(val: TrainConfigItem | null) { trainConfig.value = val || null; diff --git a/src/components/line-app/infos/TrainInfo.vue b/src/components/line-app/infos/TrainInfo.vue index c652ee9..5d06c13 100644 --- a/src/components/line-app/infos/TrainInfo.vue +++ b/src/components/line-app/infos/TrainInfo.vue @@ -190,6 +190,7 @@ import SetTrainParam from 'src/components/draw-app/dialogs/SetTrainParam.vue'; import { Dialog } from 'quasar'; import { state } from 'src/protos/device_state'; import SetTrainLink from 'src/components/draw-app/dialogs/SetTrainLink.vue'; +import { useTccStore } from 'src/stores/tcc-store'; interface KeyType { label: string; @@ -607,6 +608,10 @@ const options = [ label: '列车连接', value: 2, }, + { + label: '列车驾驶台', + value: 3, + }, ]; function doTrainOperation(option: { label: string; value: number }) { @@ -614,6 +619,8 @@ function doTrainOperation(option: { label: string; value: number }) { setTrain(); } else if (option.value == 2) { linkTrain(); + } else if (option.value == 3) { + openTccDialog(); } } @@ -649,6 +656,14 @@ function setTrain() { persistent: true, }); } + +function openTccDialog() { + const trainId = trainInfo.value?.id ? +trainInfo.value?.id : 0; + useTccStore().setTccParam( + trainId, + trainInfo.value?.trainControlMapId as number + ); +}