Compare commits

..

No commits in common. "e25d68155696b6261d4f31f176c56dbe5ec7151d" and "06d4c4322cfbb9d743ece86056de9e52957e7bca" have entirely different histories.

2 changed files with 2 additions and 46 deletions

View File

@ -191,7 +191,7 @@ 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';
import { removeTrain, cancelTrainConn } from 'src/api/Simulation';
import { cancelTrainConn } from 'src/api/Simulation';
import { errorNotify, successNotify } from 'src/utils/CommonNotify';
interface KeyType {
@ -634,10 +634,6 @@ const options = [
label: '取消连接',
value: 4,
},
{
label: '清除列车',
value: 5,
},
];
function doTrainOperation(option: { label: string; value: number }) {
@ -649,8 +645,6 @@ function doTrainOperation(option: { label: string; value: number }) {
openTccDialog();
} else if (option.value == 4) {
cancelTrainLink();
} else if (option.value == 5) {
clearTrain();
}
}
@ -714,28 +708,6 @@ function openTccDialog() {
trainInfo.value?.trainControlMapId as number
);
}
function clearTrain() {
if (!lineStore.selectedGraphics) return;
const train = lineStore.selectedGraphics[0] as Train;
Dialog.create({
title: '确认',
message: `确认清除【${trainInfo.value?.id}】列车吗?`,
cancel: true,
}).onOk(async () => {
removeTrain({
simulationId: lineStore.simulationId as string,
mapId: lineStore.mapId as number,
trainId: train.code,
})
.then(() => {
successNotify('移除列车成功!');
})
.catch((err) => {
errorNotify('移除列车失败!', err);
});
});
}
</script>
<style lang="scss" scoped>
.q-item {

View File

@ -16,7 +16,6 @@ import { successNotify, errorNotify } from '../../utils/CommonNotify';
import { Dialog } from 'quasar';
import SetTrainParam from 'src/components/draw-app/dialogs/SetTrainParam.vue';
import SetTrainLink from 'src/components/draw-app/dialogs/SetTrainLink.vue';
import { useTccStore } from 'src/stores/tcc-store';
export class TrainState extends GraphicStateBase implements ITrainState {
constructor(proto?: state.TrainMapState) {
let states;
@ -709,20 +708,11 @@ const CancelLink: MenuItemOptions = {
const removeTrainConfig: MenuItemOptions = {
name: '清除列车',
};
const DrivingCabConfig: MenuItemOptions = {
name: '列车驾驶台',
};
const TrainOperateMenu: ContextMenu = ContextMenu.init({
name: '列车操作菜单',
groups: [
{
items: [
TrainParam,
TrainLink,
CancelLink,
DrivingCabConfig,
removeTrainConfig,
],
items: [TrainParam, TrainLink, CancelLink, removeTrainConfig],
},
],
});
@ -827,12 +817,6 @@ export class TrainOperateInteraction extends GraphicInteractionPlugin<Train> {
});
});
};
DrivingCabConfig.handler = () => {
useTccStore().setTccParam(
parseInt(train.states.id),
train.states.trainControlMapId
);
};
TrainOperateMenu.open(e.global);
}