调整临时限速配置

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,9 +9,10 @@
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',
@ -29,37 +30,26 @@ export default {
}, },
data() { data() {
return { return {
menu: [{ menu: [],
label: '取消全线临时限速',
handler: this.cancelSpeed,
disabledCallback: '',
auth: { station: true, center: false }
}],
menuNormal: { menuNormal: {
local: [ Local: [
{ {
label: '取消全线临时限速', label: '取消全线临时限速',
handler: this.cancelSpeed, handler: this.cancelSpeed,
disabledCallback: MenuDisabledState.Section.cancelSpeed, cmdType: CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED
auth: { station: true, center: false }
} }
], ],
central: [ Center: [
{ {
label: '取消全线临时限速', label: '取消全线临时限速',
handler: this.cancelSpeed, handler: this.cancelSpeed,
disabledCallback: MenuDisabledState.Section.cancelSpeed, cmdType: CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED
auth: { station: false, center: true }
} }
] ]
} }
}; };
}, },
computed: { computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [ ...mapGetters('menuOperation', [
'buttonOperation' 'buttonOperation'
]) ])
@ -82,9 +72,7 @@ export default {
}, },
initMenu() { initMenu() {
// //
if (this.operatemode === OperateMode.ADMIN) { this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [...this.menu];
}
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();
@ -100,17 +88,8 @@ export default {
}, },
// //
cancelSpeed() { cancelSpeed() {
const operate = { commitOperate(menuOperate.LimitControl.cancelSpeed, {}, 0).then(({valid, 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) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.cancelAllLimit.doShow(operate, this.selected); this.$refs.cancelAllLimit.doShow(operate, this.selected);
} }
}); });

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 {