This commit is contained in:
zyy 2020-06-28 13:27:24 +08:00
commit 621a077e86
10 changed files with 47 additions and 72 deletions

View File

@ -110,6 +110,8 @@ import ManageUser from './menuDialog/manageUser';
import HelpAbout from './menuDialog/helpAbout'; import HelpAbout from './menuDialog/helpAbout';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import { State2SimulationMap } from '@/scripts/cmdPlugin/Config';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default { export default {
name: 'MenuBar', name: 'MenuBar',
@ -141,7 +143,7 @@ export default {
valid: true, valid: true,
menu: [], menu: [],
menuNormal: { menuNormal: {
local: [ Local: [
{ {
title: '系统', title: '系统',
operate: OperationEvent.Command.mBar.system, operate: OperationEvent.Command.mBar.system,
@ -386,7 +388,7 @@ export default {
] ]
} }
], ],
central: [ Center: [
{ {
title: '系统', title: '系统',
operate: OperationEvent.Command.mBar.system, operate: OperationEvent.Command.mBar.system,
@ -699,8 +701,10 @@ export default {
return list; return list;
}, },
initMenu(menu) { initMenu(menu) {
if (this.menu[2]) { const type = State2SimulationMap[this.$store.state.training.prdType];
this.menu[2].children = this.initStationList(); this.menu = MenuContextHandler.menuBarConvert(this.menuNormal[type], this.$store.state.training.operatemode);
if (this.menu[3]) {
this.menu[3].children = this.initStationList();
} }
this.clickEvent(); this.clickEvent();
this.closeMenu(true); this.closeMenu(true);

View File

@ -1,5 +1,5 @@
<template> <template>
<div v-if="isShowBtn" menuButtonclass="menu menuButton" style="height: 45px;" :style="{left: point.x+'px', bottom: point.y+'px' }"> <div v-if="isShowBtn" id="menuButtons_box" class="menu menuButton" style="height:45px;" :style="{left: point.x+'px', bottom: point.y+'px' }">
<button <button
:id="Signal.arrangementRoute.button.domId" :id="Signal.arrangementRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}" :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"

View File

@ -105,6 +105,16 @@ export default {
handler: this.atsAutoControl, handler: this.atsAutoControl,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
}, },
{
label: '设置联锁自动进路',
handler: this.setAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
},
{
label: '取消联锁自动进路',
handler: this.cancelAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
},
{ {
label: '设置联锁自动触发', label: '设置联锁自动触发',
handler: this.setAutoTrigger, handler: this.setAutoTrigger,
@ -349,6 +359,22 @@ export default {
} }
}); });
}, },
//
setAutoInterlock() {
commitOperate(menuOperate.Signal.setAutoInterlock, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
}
});
},
//
cancelAutoInterlock() {
commitOperate(menuOperate.Signal.cancelAutoInterlock, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
}
});
},
// //
singalPassModel(selectType) { singalPassModel(selectType) {
commitOperate(menuOperate.Signal.setAutoInterlock, {signalCode:selectType.code}, 3).then(({valid, operate})=>{ commitOperate(menuOperate.Signal.setAutoInterlock, {signalCode:selectType.code}, 3).then(({valid, operate})=>{

View File

@ -1,7 +1,7 @@
<template> <template>
<el-dialog <el-dialog
v-dialogDrag v-dialogDrag
class="foshan-01__systerm cmd-notice" class="fuzhou-01__systerm cmd-notice"
title="操作命令提示" title="操作命令提示"
:visible.sync="show" :visible.sync="show"
width="400px" width="400px"
@ -18,7 +18,7 @@
</template> </template>
<script> <script>
import { OperationEvent } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default { export default {
name: 'CmdNotice', name: 'CmdNotice',
data() { data() {
@ -40,20 +40,18 @@ export default {
}, },
watch: { watch: {
'$store.state.socket.msgHead': function (elem) { '$store.state.socket.msgHead': function (elem) {
if (elem && (elem.hasOwnProperty('success') || elem.hasOwnProperty('timeout'))) { if (elem && elem.type == 'resp' && (elem.timeout || !elem.agree)) {
const operate = this.$store.state.training.operate;
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode); const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode); const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
const newOperate = { const newOperate = {
type: operate.type,
name: station.name name: station.name
}; };
if (elem.timeout) { if (elem.timeout) {
newOperate['msg'] = '请求超时'; newOperate['msg'] = this.$t('menu.passiveDialog.requestTimedOut');
this.doShow(newOperate); this.doShow(newOperate);
} else if (!elem.success) { } else if (!elem.agree) {
newOperate['msg'] = '请求拒绝'; newOperate['msg'] = this.$t('menu.passiveDialog.requestRejection');
this.doShow(newOperate); this.doShow(newOperate);
} }
} }
@ -83,11 +81,10 @@ export default {
}, },
cancel() { cancel() {
const operate = { const operate = {
operation: this.operate.type,
operation: OperationEvent.Command.close.notice.operation operation: OperationEvent.Command.close.notice.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -96,10 +93,9 @@ export default {
}, },
commit() { commit() {
const operate = { const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.notice.operation operation: OperationEvent.Command.close.notice.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) { if (valid) {
this.doClose(); this.doClose();

View File

@ -84,7 +84,7 @@ export default {
operation: OperationEvent.Command.close.notice.operation operation: OperationEvent.Command.close.notice.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -95,7 +95,7 @@ export default {
const operate = { const operate = {
operation: OperationEvent.Command.close.notice.operation operation: OperationEvent.Command.close.notice.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) { if (valid) {
this.doClose(); this.doClose();

View File

@ -60,7 +60,6 @@ class Handler {
command = CommandHandler.getCommand(cmdType, wholeParam); command = CommandHandler.getCommand(cmdType, wholeParam);
if (command && command.isError) { if (command && command.isError) {
this.operations.pop(); this.operations.pop();
store.dispatch('training/setTempStep', null);
command = null; command = null;
} else if (command && command.isOver) { } else if (command && command.isOver) {
this.clear(); this.clear();

View File

@ -1,14 +1,10 @@
import store from '@/store/index_APP_TARGET';
import LangStorage from '@/utils/lang';
import Handler from './Handler.js'; import Handler from './Handler.js';
import { TrainingMode } from '@/scripts/ConstDic'; import { TrainingMode } from '@/scripts/ConstDic';
import { Message } from 'element-ui';
class ValidateHandler { class ValidateHandler {
vaildate(mode, operate) { vaildate(mode, operate) {
switch (mode) { switch (mode) {
case TrainingMode.EDIT: // 编辑制作模式
return this.vaildate_edit(operate);
case TrainingMode.PRACTICE: // 练习模式 case TrainingMode.PRACTICE: // 练习模式
return this.vaildate_tips(operate); return this.vaildate_tips(operate);
case TrainingMode.TEACH: // 教学模式 case TrainingMode.TEACH: // 教学模式
@ -18,22 +14,6 @@ class ValidateHandler {
return true; return true;
} }
vaildate_edit(operate) {
let vaild = true;
if (Handler.getOperateBreakStatus()) {
const tip = LangStorage.getLang() == 'en' ? 'Please enter a hint and click next' : '请输入提示并点击下一步';
Message.error(tip);
Handler.pop();
vaild = false;
}
if (Handler.getTrainingStart()) {
store.dispatch('training/setTempStep', operate);
}
return vaild;
}
vaildate_tips(operate) { vaildate_tips(operate) {
let valid = true; let valid = true;
if (Handler.getTrainingStart()) { if (Handler.getTrainingStart()) {

View File

@ -20,7 +20,6 @@ OperateConverter.prototype = {
if (command && command.error) { if (command && command.error) {
// 命令错误,可以回退或清空(暂用回退) // 命令错误,可以回退或清空(暂用回退)
OperateHandler.operates.pop(); OperateHandler.operates.pop();
store.dispatch('training/setTempStep', null);
command = null; command = null;
} else if (command && command.over) { } else if (command && command.over) {
// 清空操作组 // 清空操作组

View File

@ -4,8 +4,6 @@ import OperateConverter from '@/scripts/plugin/OperateConvert2Command';
import { TrainingMode } from '@/scripts/ConstDic'; import { TrainingMode } from '@/scripts/ConstDic';
import { getConverter } from '@/scripts/plugin/Converter/manager'; import { getConverter } from '@/scripts/plugin/Converter/manager';
import { sendTrainingNextStep } from '@/api/jmap/training'; import { sendTrainingNextStep } from '@/api/jmap/training';
import { Message } from 'element-ui';
import LangStorage from '@/utils/lang';
var OperateHandler = function () { var OperateHandler = function () {
}; };
@ -67,19 +65,7 @@ OperateHandler.prototype = {
let valid = true; let valid = true;
const mode = this.getTrainingMode(); const mode = this.getTrainingMode();
if (TrainingMode.EDIT === mode) { if (TrainingMode.TEACH === mode || TrainingMode.PRACTICE === mode) {
// 编辑制作模式
if (this.getOperateBreakStatus()) {
valid = false;
const tip = LangStorage.getLang() == 'en' ? 'Please enter a hint and click next' : '请输入提示并点击下一步';
Message.error(tip);
this.operates.pop();
return valid;
}
if (this.getTrainingStart()) {
store.dispatch('training/setTempStep', operate);
}
} else if (TrainingMode.TEACH === mode || TrainingMode.PRACTICE === mode) {
// 教学模式/练习模式 // 教学模式/练习模式
if (this.getTrainingStart()) { if (this.getTrainingStart()) {
valid = this.judge(operate); valid = this.judge(operate);

View File

@ -21,7 +21,6 @@ const training = {
offsetStationCode: '', // 偏移到车站 offsetStationCode: '', // 偏移到车站
rezoomCount: 0, // 车站变更标识 rezoomCount: 0, // 车站变更标识
steps: [], // 实训步骤数据 steps: [], // 实训步骤数据
tempStep: {}, // 临时步骤数据(编辑模式)
order: -1, // 实训进行到第几步 order: -1, // 实训进行到第几步
orderCount: 0, // 步骤变更标识 orderCount: 0, // 步骤变更标识
operateErrMsg: '', // 操作错误提示信息 operateErrMsg: '', // 操作错误提示信息
@ -39,9 +38,6 @@ const training = {
}, },
getters: { getters: {
tempStep: (state) => {
return state.tempStep;
},
steps: (state) => { steps: (state) => {
return state.steps; return state.steps;
}, },
@ -152,10 +148,6 @@ const training = {
state.orderCount += 1; state.orderCount += 1;
} }
}, },
setTempStep: (state, step) => {
state.tempStep = step;
},
setOperateErrMsg: (state, errMsg) => { setOperateErrMsg: (state, errMsg) => {
state.operateErrMsg = errMsg; state.operateErrMsg = errMsg;
}, },
@ -508,13 +500,6 @@ const training = {
commit('updateMapState', deviceStatus); commit('updateMapState', deviceStatus);
}, },
/**
* 设置临时步骤数据
*/
setTempStep: ({ commit }, step) => {
commit('setTempStep', step);
},
/** /**
* 开始教学模式 * 开始教学模式
*/ */