调整临时限速配置

This commit is contained in:
zyy 2020-06-18 18:13:28 +08:00
parent 003bf13395
commit 0da6a64af7
6 changed files with 100 additions and 110 deletions

View File

@ -100,7 +100,6 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { TrainingMode, OperationEvent } from '@/scripts/ConstDic'; import { TrainingMode, OperationEvent } from '@/scripts/ConstDic';
import { menuBarConvert, SystemType } from './utils/menuItemStatus';
import StationControl from './menuDialog/stationControl'; import StationControl from './menuDialog/stationControl';
import DetainTrainContorl from './menuDialog/detainTrainContorl'; import DetainTrainContorl from './menuDialog/detainTrainContorl';
import DetainTrainContorlUpDown from './menuDialog/detainTrainContorlUpDown'; import DetainTrainContorlUpDown from './menuDialog/detainTrainContorlUpDown';
@ -700,7 +699,6 @@ export default {
return list; return list;
}, },
initMenu(menu) { initMenu(menu) {
this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode);
if (this.menu[2]) { if (this.menu[2]) {
this.menu[2].children = this.initStationList(); this.menu[2].children = this.initStationList();
} }

View File

@ -9,112 +9,91 @@
import PopMenu from '@/components/PopMenu'; import PopMenu from '@/components/PopMenu';
import CancelAllLimit from './dialog/cancelAllLimit'; import CancelAllLimit from './dialog/cancelAllLimit';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic'; import { DeviceMenu } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { MenuDisabledState } from './utils/menuItemStatus'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
export default { export default {
name: 'MenuLimit', name: 'MenuLimit',
components: { components: {
PopMenu, PopMenu,
CancelAllLimit CancelAllLimit
}, },
props: { props: {
selected: { selected: {
type: Object, type: Object,
default() { default() {
return null; return null;
} }
} }
}, },
data() { data() {
return { return {
menu: [{ menu: [],
label: '取消全线临时限速', menuNormal: {
handler: this.cancelSpeed, Local: [
disabledCallback: '', {
auth: { station: true, center: false } label: '取消全线临时限速',
}], handler: this.cancelSpeed,
menuNormal: { cmdType: CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED
local: [ }
{ ],
label: '取消全线临时限速', Center: [
handler: this.cancelSpeed, {
disabledCallback: MenuDisabledState.Section.cancelSpeed, label: '取消全线临时限速',
auth: { station: true, center: false } handler: this.cancelSpeed,
} cmdType: CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED
], }
central: [ ]
{ }
label: '取消全线临时限速', };
handler: this.cancelSpeed, },
disabledCallback: MenuDisabledState.Section.cancelSpeed, computed: {
auth: { station: false, center: true } ...mapGetters('menuOperation', [
} 'buttonOperation'
] ])
} },
}; watch: {
}, '$store.state.menuOperation.menuCount': function (val) {
computed: { if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.LimitControl) && !this.buttonOperation) {
...mapGetters('training', [ this.doShow(this.$store.state.menuOperation.menuPosition);
'mode', } else {
'operatemode' this.doClose();
]), }
...mapGetters('menuOperation', [ }
'buttonOperation' },
]) methods: {
}, clickEvent() {
watch: { const self = this;
'$store.state.menuOperation.menuCount': function (val) { window.onclick = function (e) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.LimitControl) && !this.buttonOperation) { self.doClose();
this.doShow(this.$store.state.menuOperation.menuPosition); };
} else { },
this.doClose(); initMenu() {
} //
} this.menu = MenuContextHandler.covert(this.menuNormal);
}, },
methods: { doShow(point) {
clickEvent() { this.clickEvent();
const self = this; this.initMenu();
window.onclick = function (e) { if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
self.doClose(); this.$refs.popMenu.resetShowPosition(point);
}; }
}, },
initMenu() { doClose() {
// if (this.$refs && this.$refs.popMenu) {
if (this.operatemode === OperateMode.ADMIN) { this.$refs.popMenu.close();
this.menu = [...this.menu]; }
} },
}, //
doShow(point) { cancelSpeed() {
this.clickEvent(); commitOperate(menuOperate.LimitControl.cancelSpeed, {}, 0).then(({valid, operate})=>{
this.initMenu(); if (valid) {
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { this.$refs.cancelAllLimit.doShow(operate, this.selected);
this.$refs.popMenu.resetShowPosition(point); }
} });
}, }
doClose() { }
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
cancelSpeed() {
const operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.LimitControl.type,
label: MapDeviceType.LimitControl.label,
operation: OperationEvent.LimitControl.CancelAllLimit.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.cancelAllLimit.doShow(operate, this.selected);
}
});
}
}
}; };
</script> </script>

View File

@ -330,6 +330,12 @@ export const menuOperate = {
cmdType: CMD.TrainWindow.CMD_TRAIN_SET_MANUAL cmdType: CMD.TrainWindow.CMD_TRAIN_SET_MANUAL
} }
}, },
LimitControl: {
cancelSpeed: {
operation: OperationEvent.LimitControl.CancelAllLimit.menu.operation,
cmdType: CMD.Fault.CMD_CANCEL_ALL_LIMIT_SPEED
}
},
Common: { Common: {
setFault: { setFault: {
operation: OperationEvent.MixinCommand.stoppage.menu.operation, operation: OperationEvent.MixinCommand.stoppage.menu.operation,

View File

@ -147,7 +147,8 @@ export default {
{ label: '站台', value: 'Stand' }, { label: '站台', value: 'Stand' },
{ label: '车站', value: 'Station' }, { label: '车站', value: 'Station' },
{ label: '控制模式', value: 'ControlConvertMenu' }, { label: '控制模式', value: 'ControlConvertMenu' },
{ label: '车次窗', value: 'TrainWindow' } { label: '车次窗', value: 'TrainWindow' },
{ label: '全线限速', value: 'LimitControl' }
], ],
QuestionTypeList: [ QuestionTypeList: [
{ label: '选择题', value: 'select' }, { label: '选择题', value: 'select' },

View File

@ -255,6 +255,6 @@ export default {
CMD_CANCEL_FAULT: {value: 'Cancel_Fault', label: '取消故障'} CMD_CANCEL_FAULT: {value: 'Cancel_Fault', label: '取消故障'}
}, },
LimitControl: { LimitControl: {
CMD_CANCEL_ALL_LIMIT_SPEED: {value: 'Cancel_All_Limit_Speed', label: '取消全线临时限速'}
} }
}; };

View File

@ -23,6 +23,8 @@ class MenuContextHandler {
control = store.getters['map/getStationCodeByTrain'](selected); control = store.getters['map/getStationCodeByTrain'](selected);
} else if (selected._type == 'TrainWindow') { } else if (selected._type == 'TrainWindow') {
control = store.getters['map/getDeviceTrainWindowCodeByStationCode'](selected.code); control = store.getters['map/getDeviceTrainWindowCodeByStationCode'](selected.code);
} else if (selected._type == 'LimitControl') {
return true;
} else { } else {
control = store.getters['map/getDeviceStationCodeByStationCode'](selected.stationCode); control = store.getters['map/getDeviceStationCodeByStationCode'](selected.stationCode);
} }
@ -81,9 +83,13 @@ class MenuContextHandler {
return; return;
} }
const data = CommandHandler.getDefinition(elem.cmdType); const data = CommandHandler.getDefinition(elem.cmdType);
if (data) { if (data) {
// 判断指令是否显示 // 判断指令是否显示
if (data.simulationRole.toUpperCase() == type.toUpperCase() && data.controlMode.indexOf(status) > -1) { if (data.operateObject == 'LimitControl') {
elem.show = true;
elem.disabled = false;
} else if (data.simulationRole.toUpperCase() == type.toUpperCase() && data.controlMode.indexOf(status) > -1) {
elem.show = true; elem.show = true;
elem.disabled = this.checkDisabled(data, selected); elem.disabled = this.checkDisabled(data, selected);
} else { } else {