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 + ); +}