312 lines
11 KiB
Vue
312 lines
11 KiB
Vue
<template>
|
|
<div>
|
|
<pop-menu ref="popMenu" :menu="menu" />
|
|
<stand-control ref="standControl" />
|
|
<stand-jump-stop-control ref="standJumpStopControl" />
|
|
<stand-detail ref="standDetail" />
|
|
<stand-run-level ref="standRunLevel" />
|
|
<stand-stop-time ref="standStopTime" />
|
|
<stand-back-strategy ref="standBackStrategy" />
|
|
<stand-detain-train-all ref="standDetainTrainAll" />
|
|
<notice-info ref="noticeInfo" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import PopMenu from '@/components/PopMenu';
|
|
import StandControl from './dialog/standControl';
|
|
import StandJumpStopControl from './dialog/standJumpStopControl';
|
|
import StandBackStrategy from './dialog/standBackStrategy';
|
|
import StandDetail from './dialog/standDetail';
|
|
import StandRunLevel from './dialog/standRunLevel';
|
|
import StandStopTime from './dialog/standStopTime';
|
|
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
|
import StandDetainTrainAll from './dialog/standDetainTrainAll';
|
|
import { mapGetters } from 'vuex';
|
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
|
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
|
import {menuOperate, commitOperate} from './utils/menuOperate';
|
|
|
|
export default {
|
|
name: 'StationStandMenu',
|
|
components: {
|
|
PopMenu,
|
|
StandControl,
|
|
StandJumpStopControl,
|
|
StandDetail,
|
|
StandRunLevel,
|
|
NoticeInfo,
|
|
StandBackStrategy,
|
|
StandStopTime,
|
|
StandDetainTrainAll
|
|
},
|
|
props: {
|
|
selected: {
|
|
type: Object,
|
|
default() {
|
|
return null;
|
|
}
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
menu: [],
|
|
menuNormal: {
|
|
Local: [
|
|
{
|
|
label: '设置扣车',
|
|
handler: this.setDetainTrain,
|
|
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
|
|
},
|
|
{
|
|
label: '取消扣车',
|
|
handler: this.cancelDetainTrain,
|
|
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
|
|
},
|
|
{
|
|
label: '全线取消扣车',
|
|
handler: this.cancelDetainTrainAll,
|
|
cmdType:CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN
|
|
},
|
|
{
|
|
label: '设置提前发车',
|
|
handler: this.earlyDeparture,
|
|
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART
|
|
},
|
|
{
|
|
label: '查询站台状态',
|
|
handler: this.detail,
|
|
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS
|
|
}
|
|
|
|
],
|
|
Center: [
|
|
{
|
|
label: '设置扣车',
|
|
handler: this.setDetainTrain,
|
|
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
|
|
},
|
|
{
|
|
label: '取消扣车',
|
|
handler: this.cancelDetainTrain,
|
|
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
|
|
},
|
|
{
|
|
label: '全线取消扣车',
|
|
handler: this.cancelDetainTrainAll,
|
|
cmdType:CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN
|
|
},
|
|
{
|
|
label: '设置提前发车',
|
|
handler: this.earlyDeparture,
|
|
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART
|
|
},
|
|
{
|
|
label: '设置跳停',
|
|
handler: this.setJumpStop,
|
|
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP
|
|
},
|
|
{
|
|
label: '取消跳停',
|
|
handler: this.cancelJumpStop,
|
|
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
|
|
},
|
|
{
|
|
label: '设置停站时间',
|
|
handler: this.setStopTime,
|
|
cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME
|
|
},
|
|
{
|
|
label: '设置运行等级',
|
|
handler: this.setRunLevel,
|
|
cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME
|
|
},
|
|
{
|
|
label: '查询站台状态',
|
|
handler: this.detail,
|
|
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS
|
|
}
|
|
|
|
// 全线取消跳停
|
|
]
|
|
},
|
|
menuForce: [
|
|
{
|
|
label: '设置故障',
|
|
handler: this.setStoppage,
|
|
cmdType:CMD.Stand.CMD_STAND_ADD_FAULT
|
|
},
|
|
{
|
|
label: '取消故障',
|
|
handler: this.cancelStoppage,
|
|
cmdType:CMD.Stand.CMD_STAND_REMOVE_FAULT
|
|
}
|
|
]
|
|
};
|
|
},
|
|
computed: {
|
|
...mapGetters('training', [
|
|
'mode',
|
|
'operatemode'
|
|
]),
|
|
...mapGetters('menuOperation', [
|
|
'buttonOperation'
|
|
])
|
|
},
|
|
watch: {
|
|
'$store.state.menuOperation.menuCount': function (val) {
|
|
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) {
|
|
this.doShow(this.$store.state.menuOperation.menuPosition);
|
|
} else {
|
|
this.doClose();
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
clickEvent() {
|
|
const self = this;
|
|
window.onclick = function (e) {
|
|
self.doClose();
|
|
};
|
|
},
|
|
initMenu() {
|
|
// 编辑模式菜单列表
|
|
this.menu = MenuContextHandler.covert(this.menuNormal);
|
|
|
|
// 故障模式菜单列表
|
|
if (this.operatemode === OperateMode.FAULT) {
|
|
this.menu = this.menuForce;
|
|
}
|
|
},
|
|
doShow(point) {
|
|
this.clickEvent();
|
|
this.initMenu();
|
|
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
|
this.$refs.popMenu.resetShowPosition(point);
|
|
}
|
|
},
|
|
doClose() {
|
|
if (this.$refs && this.$refs.popMenu) {
|
|
this.$refs.popMenu.close();
|
|
}
|
|
},
|
|
// 设置故障
|
|
setStoppage() {
|
|
const step = {
|
|
start: true,
|
|
code: `${this.selected.code}`,
|
|
operation: OperationEvent.StationStand.stoppage.menu.operation,
|
|
cmdType: CMD.Stand.CMD_STAND_ADD_FAULT,
|
|
param: {
|
|
standCode: `${this.selected.code}`
|
|
}
|
|
};
|
|
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
|
if (valid) {
|
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
|
} else {
|
|
this.$refs.noticeInfo.doShow(step);
|
|
}
|
|
}).catch(() => {
|
|
this.$refs.noticeInfo.doShow(step);
|
|
});
|
|
},
|
|
// 取消故障
|
|
cancelStoppage() {
|
|
const step = {
|
|
start: true,
|
|
code: `${this.selected.code}`,
|
|
operation: OperationEvent.StationStand.cancelStoppage.menu.operation,
|
|
cmdType: CMD.Stand.CMD_STAND_REMOVE_FAULT,
|
|
param: {
|
|
standCode: `${this.selected.code}`
|
|
}
|
|
};
|
|
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
|
if (valid) {
|
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
|
} else {
|
|
this.$refs.noticeInfo.doShow(step);
|
|
}
|
|
}).catch(() => {
|
|
this.$refs.noticeInfo.doShow(step);
|
|
});
|
|
},
|
|
// 设置扣车
|
|
setDetainTrain() {
|
|
commitOperate(menuOperate.StationStand.setDetainTrain, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
|
if (valid) {
|
|
this.$refs.standControl.doShow(operate, this.selected);
|
|
}
|
|
});
|
|
},
|
|
// 取消扣车
|
|
cancelDetainTrain() {
|
|
commitOperate(menuOperate.StationStand.cancelDetainTrain, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
|
if (valid) {
|
|
this.$refs.standControl.doShow(operate, this.selected);
|
|
}
|
|
});
|
|
},
|
|
// 设置跳停
|
|
setJumpStop() {
|
|
commitOperate(menuOperate.StationStand.setJumpStop, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
|
if (valid) {
|
|
this.$refs.standJumpStopControl.doShow(operate, this.selected);
|
|
}
|
|
});
|
|
},
|
|
// 取消跳停
|
|
cancelJumpStop() {
|
|
commitOperate(menuOperate.StationStand.cancelJumpStop, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
|
if (valid) {
|
|
this.$refs.standJumpStopControl.doShow(operate, this.selected);
|
|
}
|
|
});
|
|
},
|
|
// 设置停站时间
|
|
setStopTime() {
|
|
commitOperate(menuOperate.StationStand.setStopTime, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
|
if (valid) {
|
|
this.$refs.standStopTime.doShow(operate, this.selected, []);
|
|
}
|
|
});
|
|
},
|
|
// 设置运行等级
|
|
setRunLevel() {
|
|
commitOperate(menuOperate.StationStand.setRunLevel, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
|
if (valid) {
|
|
this.$refs.standRunLevel.doShow(operate, this.selected, []);
|
|
}
|
|
});
|
|
},
|
|
// 设置提前发车
|
|
earlyDeparture() {
|
|
commitOperate(menuOperate.StationStand.earlyDeparture, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
|
if (valid) {
|
|
this.$refs.standControl.doShow(operate, this.selected);
|
|
}
|
|
});
|
|
},
|
|
// 全线取消扣车
|
|
cancelDetainTrainAll() {
|
|
commitOperate(menuOperate.StationStand.cancelDetainTrainAll, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
|
if (valid) {
|
|
this.$refs.standDetainTrainAll.doShow(operate, this.selected);
|
|
}
|
|
});
|
|
},
|
|
// 查询站台状态
|
|
detail() {
|
|
commitOperate(menuOperate.StationStand.detail, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
|
if (valid) {
|
|
this.$refs.standDetail.doShow(operate, this.selected, []);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
};
|
|
</script>
|