This commit is contained in:
joylink_cuiweidong 2021-01-27 15:40:18 +08:00
commit 68fc7c255f
8 changed files with 57 additions and 63 deletions

View File

@ -1,8 +1,8 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<menu-bar v-if="$store.state.training.prdType === '01' || $store.state.training.prdType === '02'" ref="menuBar" :selected="selected" :loginActive="loginActive" :isIgnoreLogin="isIgnoreLogin" @login="login" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-train ref="menuTrain" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-signal ref="menuSignal" :selected="selected" />
<menu-switch ref="menuSwitch" :selected="selected" />
<menu-section ref="menuSection" :selected="selected" />

View File

@ -220,10 +220,10 @@
<script>
import { mapGetters } from 'vuex';
import { deepAssign } from '@/utils/index';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { TrainingMode, MouseEvent } from '@/scripts/ConstDic';
import { EventBus } from '@/scripts/event-bus';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import BanIcon from '@/assets/ban-heb.png';
export default {
@ -352,8 +352,8 @@ export default {
}
},
'selected': function (val) {
EventBus.$emit('sendMsg', {}); //
this.initMenus();//
this.pushTempData([]); //
this.selectedObj = this.selected;
this.rightClickDialogVisible = false;
if (this.selectedObj._type && (val._event == MouseEvent.Left || (val._event == MouseEvent.Right && this.$store.state.training.prdType === '01'))) {
@ -397,8 +397,8 @@ export default {
mounted() {
this.initMenus();
this.handleBasicMenu();
EventBus.$on('sendMsg', msg => {
this.pushTempData([{name:msg}]);
EventBus.$on('sendMsg', ({message = ''}) => {
this.tempData = [{name: message}];
})
},
methods: {
@ -540,11 +540,12 @@ export default {
this.oldDevice = section;
this.initCentralizedStationList(this.switchParamList);
this.pushTempData([this.selectedObj]);
this.param = {
switchCode: this.selectedObj.code,
sectionCode: section.code
};
};
EventBus.$emit('sendMsg', {message: this.selectedObj.name});
},
handleSingalMenu() {
this.deviceHighLight(this.oldDevice, false);
@ -556,10 +557,11 @@ export default {
this.oldClickObj = deepAssign({}, this.selectedObj);
this.initCentralizedStationList(this.signalParamList);
this.pushTempData([this.selectedObj]);
this.param = {
signalCode: this.selectedObj.code
};
};
EventBus.$emit('sendMsg', {message: this.selectedObj.name});
},
handleSectionMenu() {
this.deviceHighLight(this.oldDevice, false);
@ -567,10 +569,11 @@ export default {
this.oldClickObj = deepAssign({}, this.selectedObj);
this.initCentralizedStationList(this.sectionParamList);
this.pushTempData([this.selectedObj]);
this.param = {
sectionCode: this.selectedObj.code
};
};
EventBus.$emit('sendMsg', {message: this.selectedObj.name});
},
handleBasicMenu() {
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode);
@ -581,17 +584,19 @@ export default {
this.oldClickObj = null; //
this.initCentralizedStationList(this.basicParamList, station);
this.pushTempData(station ? [station] : []);
this.param = {
stationCode: this.$store.state.map.showCentralizedStationCode,
stationCodes: [this.$store.state.map.showCentralizedStationCode]
};
};
EventBus.$emit('sendMsg', { message: station? station.name: '' });
},
handleStationMenu() {
this.initCentralizedStationList(this.stationParamList);
this.pushTempData([this.selectedObj]);
this.param = { stationCode: this.selectedObj.code };
this.param = { stationCode: this.selectedObj.code };
EventBus.$emit('sendMsg', {message: this.selectedObj.name});
},
handleStandMenu() {
if (this.$store.state.training.prdType === '02') {
@ -604,20 +609,21 @@ export default {
const data = Object.assign(this.selectedObj);
const station = this.$store.getters['map/getDeviceByCode'](this.selectedObj.stationCode);
data.name = `${station.name} ${data.right ? '上行' : '下行'}`;
this.pushTempData([data]);
this.param = {
standCode: this.selectedObj.code
};
this.param = { standCode: this.selectedObj.code };
EventBus.$emit('sendMsg', {message: data.name});
},
handleRouteMenu() { //
this.initCentralizedStationList(this.routeParamList);
if (this.selectedObj._event === MouseEvent.Right) {
this.rightClickDialogVisible = true;
}
this.pushTempData(this.selectRouteList);
this.param = {
routeCode: this.route.code
};
this.param = { routeCode: this.route.code };
this.tempData = [];
this.selectRouteList.forEach(el => {
this.tempData.push(el);
});
},
//
checkSignal() {
@ -698,8 +704,9 @@ export default {
this.rightClickDialogVisible = false;
this.paramIndex = row.next ? index : -1;
if (row.next) {
this.pushTempData([row]);
}
EventBus.$emit('sendMsg', {message: row.name});
}
const step = {};
if (this.tempData.length) {
this.operate = row.operate.operation;
@ -718,7 +725,6 @@ export default {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
console.error(error);
EventBus.$emit('sendMsg', {message: '命令执行失败!'});
});
}
@ -727,13 +733,14 @@ export default {
const step = {
operation: OperationEvent.Command.commandHaerbin.confirm.operation,
param: this.param
};
};
if (!this.securityCommand) {
step.over = true;
step.cmdType = this.cmdType;
}
EventBus.$emit('sendMsg', ``);
EventBus.$emit('sendMsg', {});
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid && this.securityCommand) {
this.secondConfirm = true;
@ -747,17 +754,17 @@ export default {
this.handleClose();
}
}).catch((error) => {
console.error(error);
EventBus.$emit('sendMsg', {message: `${this.cmdType.label}失败`});
this.doClose();
this.handleClose();
EventBus.$emit('sendMsg', {message: `${this.cmdType.label}失败`});
});
},
clickCr1Confirm() {
clearTimeout(this.timer);
const step = {
operation: OperationEvent.Command.commandHaerbin.confrimCr1.operation
};
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.cr1Confrim = true;
@ -767,8 +774,8 @@ export default {
}, 10000);
}
}).catch((error) => {
EventBus.$emit('sendMsg', {message: '命令执行失败!'});
this.doClose();
EventBus.$emit('sendMsg', {message: '命令执行失败!'});
});
},
clickCr2Confirm() {
@ -777,7 +784,8 @@ export default {
over: true,
cmdType: this.cmdType,
operation: OperationEvent.Command.commandHaerbin.confrimCr2.operation
};
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
EventBus.$emit('sendMsg', {message: `${this.cmdType.label}成功`});
@ -796,6 +804,7 @@ export default {
this.rightClickDialogVisible = false;
},
cancle() {
EventBus.$emit('sendMsg', {});
if (this.$store.state.training.mode != TrainingMode.TEACH) {
clearTimeout(this.timer);
this.doClose();
@ -812,7 +821,8 @@ export default {
this.cr1Confrim = false;
if (this.oldClickObj) {
this.deviceHighLight(this.oldClickObj, false);
}
}
this.param = {};
this.canCommand = true; //
this.oldClickObj = null; //
@ -846,12 +856,6 @@ export default {
// });
}
},
pushTempData(list) {
this.tempData = [];
list.forEach(el => {
this.tempData.push(el);
});
},
changeShowMode(flag) {
if (this.$store.state.training.prdType === '01') {
this.trainModel = {};
@ -884,7 +888,7 @@ export default {
EventBus.$emit('sendMsg', {message: '命令执行失败!'});
});
} else {
this.$refs.noticeInfo.doShow('请输入正确的车次号');
EventBus.$emit('sendMsg', {message: '请输入正确的车次号'});
}
},
stationToCommand() {
@ -913,7 +917,6 @@ export default {
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.isAllowCommand = false;
// this.securityCommand = row.securityCommand || row.next;
} else if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
@ -1326,7 +1329,6 @@ export default {
margin-top: 10px;
padding: 10px;
}
.station_updateStatus{}
.station_command{
float: right;
}

View File

@ -12,14 +12,16 @@ import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import LoadSpareTrain from '@/jmapNew/theme/components/menus/dialog/loadSpareTrain';
export default {
name: 'SectionMenu',
components: {
PopMenu,
SetFault
SetFault,
LoadSpareTrain
},
props: {
selected: {

View File

@ -9,6 +9,7 @@
import PopMenu from '@/components/PopMenu';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';

View File

@ -1,28 +1,25 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="haerbin-01__systerm" />
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" />
<set-fault ref="setFault" pop-class="haerbin-01__systerm" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { DeviceMenu } from '@/scripts/ConstDic';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'StationMenu',
components: {
PopMenu,
SetFault,
NoticeInfo
SetFault
},
props: {
selected: {

View File

@ -1,26 +1,23 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="haerbin-01__systerm" />
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" />
<set-fault ref="setFault" pop-class="haerbin-01__systerm" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'StationStandMenu',
components: {
PopMenu,
NoticeInfo,
SetFault
},
props: {

View File

@ -1,7 +1,6 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="haerbin-01__systerm" />
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" />
<switch-hook-lock ref="switchHookLock" pop-class="haerbin-01__systerm" />
<set-fault ref="setFault" pop-class="haerbin-01__systerm" />
</div>
@ -10,20 +9,17 @@
<script>
import PopMenu from '@/components/PopMenu';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import SwitchHookLock from '@/jmapNew/theme/components/menus/dialog/switchHookLock';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SwitchMenu',
components: {
PopMenu,
NoticeInfo,
SetFault,
SwitchHookLock
},

View File

@ -204,7 +204,6 @@ export default {
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},