西安01组件拆分

This commit is contained in:
dong 2022-12-05 17:01:49 +08:00
parent 39b4b0b49a
commit b0e8ac00fa
13 changed files with 1881 additions and 1050 deletions

View File

@ -109,12 +109,12 @@ class Theme {
} }
// 加载行调菜单组件 // 加载行调菜单组件
loadDispatchWorkMenuComponent(code) { loadDispatchWorkMenuComponent(code) {
if (code == '02' || code == '16') { if (['02', '10', '16'].includes(code)) {
return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/menus/dispatchWorkMenu`).default); return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/menus/dispatchWorkMenu`).default);
} }
} }
loadLocalWorkMenuComponent(code) { loadLocalWorkMenuComponent(code) {
if (code == '02' || code == '16') { if (['02', '10', '16'].includes(code)) {
return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/menus/localWorkMenu`).default); return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/menus/localWorkMenu`).default);
} }
} }

View File

@ -0,0 +1,499 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" :work="'dispatchWork'" />
<menu-switch ref="menuSwitch" :selected="selected" :work="'dispatchWork'" />
<menu-signal ref="menuSignal" :selected="selected" :work="'dispatchWork'" />
<menu-section ref="menuSection" :selected="selected" :work="'dispatchWork'" />
<menu-train ref="menuTrain" :selected="selected" :work="'dispatchWork'" />
<menu-station ref="menuStation" :selected="selected" :work="'dispatchWork'" />
<menu-station-turn-back ref="menuStationTurnBack" :selected="selected" :work="'dispatchWork'" />
<passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" pop-class="xian-01__systerm" />
<passive-Timeout ref="passiveTimeout" />
<pop-menu ref="popMenu" :menu="menu" pop-class="preview_new_pop" />
</div>
</template>
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
import { mapGetters } from 'vuex';
import MenuSignal from './menuSignal';
import MenuStationStand from './menuStationStand';
import MenuSwitch from './menuSwitch';
import MenuSection from './menuSection';
import MenuTrain from './menuTrain';
import MenuStation from './menuStation';
import MenuBar from './dispatchWorkMenuBar';
import MenuStationTurnBack from './menuStationTurnBack';
import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout';
import PopMenu from '@/components/PopMenu';
export default {
name: 'DispatchWorkMenu',
components: {
MenuBar,
MenuSignal,
MenuSwitch,
MenuSection,
MenuStationStand,
MenuStation,
MenuTrain,
PassiveAlarm,
MenuStationTurnBack,
PassiveContorl,
PassiveTimeout,
PopMenu
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: []
};
},
computed: {
...mapGetters('config', [
'width'
]),
isShowBar() {
return this.$store.state.training.prdType && this.$store.state.training.prdType !== '07';
}
},
watch: {
isShowBar(val) {
val && this.$store.dispatch('config/updateMenuBar');
},
'$store.state.menuOperation.menuCount': function (val) {
// && this.$store.state.training.prdType == '02'
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.popDoShow(this.$store.state.menuOperation.menuPosition);
} else {
this.popDoClose();
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('config/updateMenuBar');
const _that = this;
window.onclick = function (e) {
if (!_that.$store.state.training.trainingStart) {
_that.$refs.menuBar && _that.$refs.menuBar.blankClickClose();
}
_that.$refs.menuStationStand.doClose();
_that.$refs.menuSwitch.doClose();
_that.$refs.menuSignal.doClose();
_that.$refs.menuSection.doClose();
_that.$refs.menuTrain.doClose();
_that.$refs.menuStation.doClose();
_that.$refs.menuStationTurnBack.doClose();
};
});
},
beforeDestroy() {
window.onclick = function (e) {};
},
methods:{
popClickEvent() {
const self = this;
window.onclick = function (e) {
self.popDoClose();
};
},
popDoShow(point) {
this.popClickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
initMenu() {
this.menuNormal = [];
if (this.$store.state.training.prdType == '02') {
this.$store.state.map.map.stationList.forEach(station => {
if (station.relStationCodeList && station.relStationCodeList.length) {
const node = {
label: station.name,
children: []
};
const relStationCodeList = [...station.relStationCodeList];
relStationCodeList.push(station.code);
relStationCodeList.sort((a, b) => {
const stationA = this.$store.getters['map/getDeviceByCode'](a);
const stationB = this.$store.getters['map/getDeviceByCode'](b);
return stationA.kmRange - stationB.kmRange;
});
relStationCodeList.forEach(item => {
const next = this.$store.getters['map/getDeviceByCode'](item);
node.children.push({
code: next.code,
label: next.name,
handler: this.mapLocation
});
});
this.menuNormal.push(node);
}
});
} else if (this.$store.state.training.prdType == '01') {
const roleDeviceCode = this.$store.state.training.roleDeviceCode;
const displayList = this.$store.state.map.map.displayList;
const display = displayList.find(each=>{
return each.stationCodeList.includes(roleDeviceCode);
});
if (display) {
const codeList = [...display.switchStationCodeList];
let relStationCodeList = [];
let ciStaionCode = '';
codeList.sort((a, b) => {
const stationA = this.$store.getters['map/getDeviceByCode'](a);
const stationB = this.$store.getters['map/getDeviceByCode'](b);
if (stationA.relStationCodeList && stationA.relStationCodeList.length > 0 && relStationCodeList.length <= 0) {
relStationCodeList = [...stationA.relStationCodeList];
ciStaionCode = stationA.code;
relStationCodeList.push(stationA.code);
}
return stationA.kmRange - stationB.kmRange;
});
const ciStaion = this.$store.getters['map/getDeviceByCode'](ciStaionCode);
const currentNode = {label: ciStaion.name, children: []};
codeList.forEach(code=>{
let node;
const station = this.$store.getters['map/getDeviceByCode'](code);
if (station.depot) {
return;
}
if (relStationCodeList.includes(code)) {
currentNode.children.push({label: station.name, code: station.code, handler: this.mapLocation});
if (currentNode.children.length == relStationCodeList.length) {
this.menuNormal.push(currentNode);
}
} else {
node = {label: station.name, code: station.code, handler: this.mapLocation};
this.menuNormal.push(node);
}
});
}
}
this.menu = [...this.menuNormal];
},
popDoClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
mapLocation(item) {
if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.popDoClose();
}
}
}
};
</script>
<style>
.menus {
position: absolute;
top: 0;
}
.menus .pop-menu {
background: #F0F0F0;
}
.menus .pop-menu span {
color: #000;
}
.menus .pop-menu .is-disabled span {
color: #B4B3B8;
}
.xian-01__systerm {
overflow: hidden !important;
}
.xian-01__systerm.pop-menu{
padding: 0;
padding-left: 20px;
}
.xian-01__systerm.pop-menu .container{
border-left: 1px solid #ccc;
}
.xian-01__systerm.pop-menu .dsp-block {
display: block;
text-align: left;
width: 100%;
border-radius: unset;
border: 1px solid transparent;
color: #000;
padding: 6px 6px;
border-left: 1px solid #bdbcbc;
}
.xian-01__systerm .el-dialog {
background: rgba(100, 100, 100, 0.3);
border: 2px solid rgb(144, 144, 144, 0.8);
border-radius: 6px;
color: #000;
font-size: 14px;
}
.xian-01__systerm .el-dialog .el-dialog__header {
padding: 5px;
height: 26px;
}
.xian-01__systerm .el-dialog .el-dialog__footer {
background: #F0F0F0;
opacity: 1;
}
.xian-01__systerm .el-dialog .el-dialog__body {
padding-top: 10px;
padding-bottom: 10px;
padding-left: 5px;
padding-right: 5px;
margin: 0px 5px 5px;
border: 2px solid rgba(120, 121, 123, 0.5);
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
background: #F0F0F0;
opacity: 1;
}
.xian-01__systerm .el-dialog .el-dialog__title {
position: absolute;
top: 4px;
color: #000;
border-radius: 4px;
padding: 0px 2px;
height: 20px;
line-height: 20px
}
.xian-01__systerm .el-dialog .el-dialog__title::before {
content: '';
position: absolute;
top: 0;
left: 0;
-webkit-filter: blur(10px);
filter: blur(10px);
height: 20px;
width: -webkit-fill-available;
background: rgba(128, 128, 128, 0.8);
z-index: -1;
}
.xian-01__systerm .el-dialog .el-dialog__headerbtn {
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid #fff;
border-radius: 4px;
top: 4px;
right: 5px;
line-height: 16px;
}
.xian-01__systerm .el-dialog .el-dialog__headerbtn .el-icon-close:before {
font-size: 16px;
}
.xian-01__systerm .el-dialog .el-dialog__headerbtn .el-dialog__close {
color: #fff;
}
.xian-01__systerm .el-dialog .el-button {
height: 32px;
line-height: 32px;
padding: 0px;
width: 80px;
border: 2px outset #E2E2E2;
border-radius: 0px !important;
color: #000;
background: #F0F0F0;
}
.xian-01__systerm .el-dialog .el-button:focus span {
border: 1px dashed gray;
}
.xian-01__systerm .el-dialog .el-button:active {
border: 2px inset #E2E2E2;
}
.xian-01__systerm .el-dialog .el-button:disabled {
border: 2px inset #E2E2E2;
}
.xian-01__systerm .el-dialog .el-button:disabled span {
border: 0px;
}
.xian-01__systerm .el-dialog .el-input {
border: 2px inset #E9E9E9;
}
.xian-01__systerm .el-dialog .el-input .el-input__inner {
color: #000;
background: #fff !important;
border: 0px;
border-radius: 0px !important;
box-sizing: border-box;
}
.xian-01__systerm .el-dialog .el-input.is-disabled .el-input__inner {
background: #F0F0F0 !important;
}
.xian-01__systerm .el-dialog .el-textarea {
border: 2px inset #E9E9E9;
border-radius: 0px;
}
.xian-01__systerm .el-dialog .el-textarea .el-textarea__inner {
color: #000;
background: #fff !important;
border: 0px;
border-radius: 0px !important;
box-sizing: border-box;
}
.xian-01__systerm .el-dialog .el-textarea.is-disabled .el-textarea__inner {
background: #F0F0F0 !important;
}
.xian-01__systerm .el-dialog .el-table {
border: 2px inset #E9E9E9;
color: #000 !important;
}
.xian-01__systerm .el-dialog .el-table .cell {
line-height: unset !important;
}
.xian-01__systerm .el-dialog .el-table th.is-leaf {
background: #F0F0F0 !important;
border-right: 1px solid #BDBDBD !important;
border-bottom: 1px solid #BDBDBD !important;
color: #000 !important;
height: 20px !important;
padding: 0px;
}
.xian-01__systerm .el-dialog .el-table tr td {
height: 20px !important;
padding: 0px;
}
.xian-01__systerm .el-dialog .el-table .el-table__empty-text {
top: 15px !important;
}
.xian-01__systerm .el-dialog .current-row>td {
background: #3399FF !important;
color: #fff !important;
}
.xian-01__systerm .el-dialog .el-checkbox__inner {
border: 1px inset #dcdfe6 !important;
}
.xian-01__systerm .el-dialog .el-checkbox__label {
color: #000 !important;
}
.xian-01__systerm .el-dialog .el-checkbox.is-disabled .el-checkbox__inner {
background: #E6E6E6 !important;
}
.xian-01__systerm .el-dialog .el-checkbox.is-disabled .el-checkbox__label {
color: #C5C9CC !important;
}
.xian-01__systerm .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner {
background: #fff !important;
border: 1px inset #dcdfe6 !important;
}
.xian-01__systerm .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner::after {
position: absolute;
-webkit-box-sizing: content-box;
box-sizing: content-box;
content: "";
border: 1px solid #000;
border-left: 0;
border-top: 0;
height: 7px;
left: 4px;
top: 1px;
}
.xian-01__systerm .el-dialog .el-radio__inner {
border: 1px inset #dcdfe6 !important;
}
.xian-01__systerm .el-dialog .el-radio__label {
color: #000 !important;
}
.xian-01__systerm .el-dialog .el-radio__input.is-checked .el-radio__inner {
background: #fff !important;
border: 1px inset #dcdfe6 !important;
}
.xian-01__systerm .el-dialog .el-radio__input.is-checked .el-radio__inner::after {
width: 4px;
height: 4px;
border-radius: 100%;
background-color: #000 !important;
position: absolute;
left: 50%;
top: 50%;
}
.xian-01__systerm .el-dialog .el-radio.is-disabled .el-radio__inner {
background: #E6E6E6 !important;
}
.xian-01__systerm .el-dialog .el-radio.is-disabled .el-radio__label {
color: #C5C9CC !important;
}
.xian-01__systerm .el-dialog .base-label {
background: rgb(240 240 240);
position: relative;
}
.xian-01__systerm .el-dialog .el-form-item label {
font-weight: normal !important;
color: #000 !important;
}
.xian-01__systerm .el-dialog .context {
height: 100px;
border: 2px inset #E2E2E2;
overflow-y: scroll;
}
.xian-01__systerm .el-dialog .table {
margin-top: 10px;
}
.xian-01__systerm .el-dialog .notice {
margin-left: 62px;
line-height: 30px;
}
.xian-01__systerm .el-dialog .button-group {
margin-top: 10px;
}
</style>

View File

@ -0,0 +1,418 @@
<template>
<div id="menuBarXian01">
<menu-bar ref="menuBar" :menu-normal="menuNormal" style="width:100%" />
<!--<div class="deviceStatus">-->
<!--<div class="holdTrainStatus">H</div>-->
<!--<div class="jumpStopStatus">S</div>-->
<!--</div>-->
<station-control-convert ref="stationControlConvert" @warningInfoDoShow="warningInfoDoShow" />
<password-box ref="passwordBox" @setLoginResult="getLoginResult" />
<view-train-id ref="viewTrainId" />
<view-name ref="viewName" />
<view-device ref="viewDevice" />
<train-add ref="trainAdd" />
<train-transtalet ref="trainTranstalet" />
<train-delete ref="trainDelete" />
<manage-user ref="manageUser" />
<help-about ref="helpAbout" />
<warning-info ref="warningInfo" />
<!-- <delete-runplan-line ref="deleteRunplanLine" /> -->
<!-- <add-runplan-line ref="addRunplanLine" /> -->
</div>
</template>
<script>
import MenuBar from '@/jmapNew/theme/components/menus/menuBarNew';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler.js';
import StationControlConvert from './menuDialog/stationControlConvert';
import WarningInfo from './menuDialog/warningInfo';
import TrainAdd from './menuDialog/trainAdd';
// import AddRunplanLine from './menuDialog/addRunplanLine';
import TrainTranstalet from './menuDialog/trainTranstalet';
import TrainDelete from './menuDialog/trainDelete';
import PasswordBox from './menuDialog/passwordBox';
import ViewTrainId from './menuDialog/viewTrainId';
import ViewName from './menuDialog/viewName';
import ViewDevice from './menuDialog/viewDevice';
import ManageUser from './menuDialog/manageUser';
import HelpAbout from './menuDialog/helpAbout';
// import DeleteRunplanLine from './menuDialog/deleteRunplanLine';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'DispatchWorkMenuBarXian01',
components: {
MenuBar,
StationControlConvert,
PasswordBox,
ViewTrainId,
ViewName,
ViewDevice,
TrainAdd,
// AddRunplanLine,
TrainTranstalet,
TrainDelete,
ManageUser,
HelpAbout,
WarningInfo
// DeleteRunplanLine
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menuNormal: [
{
title: this.$t('menu.menuBar.system'),
operate: OperationEvent.Command.mBar.system,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.view'),
operate: OperationEvent.Command.mBar.check,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.refresh'),
operate: OperationEvent.Command.mBar.fresh,
click: this.refresh,
children: [
]
},
{
title: this.$t('menu.menuBar.display'),
operate: OperationEvent.Command.mBar.view,
children: [
{
title: this.$t('menu.menuBar.setTrainIdDisplay'),
click: this.setTrainIdDisplay,
operate: OperationEvent.Command.view.setTrainIdDisplay
},
{
title: this.$t('menu.menuBar.setNameDisplay'),
click: this.setNameDisplay,
operate: OperationEvent.Command.view.setNameDisplay
},
{
title: this.$t('menu.menuBar.setDeviceDisplay'),
click: this.setDeviceDisplay,
operate: OperationEvent.Command.view.setDeviceDisplay
}
]
},
{
title: this.$t('menu.menuBar.stationMapSwitch'),
operate: '',
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.planCarOperation'),
operate: OperationEvent.Command.mBar.planTrain,
children: [
{
title: this.$t('menu.menuBar.addPlanCar'),
click: this.addPlanTrain,
operate: OperationEvent.Command.planTrain.addPlanTrain
},
{
title: this.$t('menu.menuBar.panPlanCar'),
click: this.translatPlanTrain,
operate: OperationEvent.Command.planTrain.translatPlanTrain
},
{
title: this.$t('menu.menuBar.deletePlanCar'),
click: this.delPlanTrain,
operate: OperationEvent.Command.planTrain.delPlanTrain
}
]
},
{
title: this.$t('menu.menuBar.trainNumberMaintenance'),
operate: '',
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.controlModeSwitch'),
operate: OperationEvent.Command.mBar.remoteControl,
children: [
{
title: this.$t('menu.menuBar.toStationControl'),
click: this.turnToStationControl,
operate: OperationEvent.StationControl.requestStationControl.mbar,
force: true
},
{
title: this.$t('menu.menuBar.forcedStationControl'),
click: this.mandatoryStationControl,
operate: OperationEvent.StationControl.forcedStationControl.password,
force: true
},
{
title: this.$t('menu.menuBar.toCentralControl'),
click: this.conterStationControl,
operate: OperationEvent.StationControl.requestCentralControl.mbar
}
]
},
{
title: this.$t('menu.menuBar.requestOperationArea'),
operate: OperationEvent.Command.mBar.requestZone,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.schedulingLog'),
operate: '',
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.systemAnalysis'),
operate: '',
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.userManage'),
operate: OperationEvent.Command.mBar.userManage,
children: [
{
title: this.$t('menu.menuBar.userManage'),
click: this.userManage,
operate: OperationEvent.Command.manage.userManage
}
]
},
{
title: this.$t('menu.menuBar.historyQuery'),
operate: OperationEvent.Command.mBar.historyQuery,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.help'),
operate: OperationEvent.Command.mBar.help,
children: [
{
title: this.$t('menu.menuBar.about'),
click: this.about,
operate: OperationEvent.Command.help.about
}
]
}
]
};
},
methods: {
//
turnToStationControl(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControlConvert.doShow(operate);
}
});
},
//
mandatoryStationControl(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.passwordBox.doShow(operate);
}
});
},
//
conterStationControl(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControlConvert.doShow(operate);
}
});
},
//
setTrainIdDisplay(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.viewTrainId.doShow(operate);
}
});
},
//
setNameDisplay(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.viewName.doShow(operate);
}
});
},
//
setDeviceDisplay(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.viewDevice.doShow(operate);
}
});
},
//
addPlanTrain(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (this.$route.query.lineCode == '10') {
this.$refs.trainAdd.doShow(operate);
} else {
// this.$refs.addRunplanLine.doShow(operate);
this.$refs.trainAdd.doShow(operate);
}
}
});
},
//
translatPlanTrain(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainTranstalet.doShow(operate);
}
});
},
//
delPlanTrain(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDelete.doShow(operate);
// this.$refs.deleteRunplanLine.doShow(operate);
}
});
},
//
userManage(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.manageUser.doShow(operate);
}
});
},
//
about(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.helpAbout.doShow(operate);
}
});
},
//
refresh() {
EventBus.$emit('refresh');
},
getLoginResult(operate) {
/** 密码校验*/
if (operate.operation == OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation) {
if (operate.success) {
/** 校验成功*/
this.$refs.stationControlConvert.doShow({ operation: OperationEvent.StationControl.forcedStationControl.mbar.operation });
}
}
},
blankClickClose() {
this.$refs.menuBar.doClose();
},
warningInfoDoShow(info) {
this.$refs.warningInfo.doShow(info);
},
undeveloped() {
this.$refs.menuBar.doClose();
this.$alert(this.$t('menu.menuBar.implemented'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
callback: action => {
}
});
}
}
};
</script>
<style scoped rel="stylesheet/scss" lang="scss">
.deviceStatus{
display: inline-block;
font-size: 0;
height: 40px;
background: #f0f0f0;
width: 300px;
}
.holdTrainStatus,.jumpStopStatus{
color: #fff;
display: inline-block;
width: 30px;
height: 30px;
text-align: center;
background: #ccc;
font-size:14px;
}
#menuBarXian01{
line-height:30px;
}
#menuBarXian01 #menuBar .menu-li-block .label{
padding: 0px 30px 0px 5px !important;
}
</style>

View File

@ -1,13 +1,13 @@
<template> <template>
<div class="menus" :style="{width: width + 'px'}"> <div class="menus" :style="{width: width + 'px'}">
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" /> <menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" /> <menu-station-stand ref="menuStationStand" :selected="selected" :work="'localWork'" />
<menu-switch ref="menuSwitch" :selected="selected" /> <menu-switch ref="menuSwitch" :selected="selected" :work="'localWork'" />
<menu-signal ref="menuSignal" :selected="selected" /> <menu-signal ref="menuSignal" :selected="selected" :work="'localWork'" />
<menu-section ref="menuSection" :selected="selected" /> <menu-section ref="menuSection" :selected="selected" :work="'localWork'" />
<menu-train ref="menuTrain" :selected="selected" /> <menu-train ref="menuTrain" :selected="selected" :work="'localWork'" />
<menu-station ref="menuStation" :selected="selected" /> <menu-station ref="menuStation" :selected="selected" :work="'localWork'" />
<menu-station-turn-back ref="menuStationTurnBack" :selected="selected" /> <menu-station-turn-back ref="menuStationTurnBack" :selected="selected" :work="'localWork'" />
<passive-alarm ref="passiveAlarm" /> <passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" pop-class="xian-01__systerm" /> <passive-contorl ref="passiveControl" pop-class="xian-01__systerm" />
<passive-Timeout ref="passiveTimeout" /> <passive-Timeout ref="passiveTimeout" />
@ -24,7 +24,7 @@ import MenuSwitch from './menuSwitch';
import MenuSection from './menuSection'; import MenuSection from './menuSection';
import MenuTrain from './menuTrain'; import MenuTrain from './menuTrain';
import MenuStation from './menuStation'; import MenuStation from './menuStation';
import MenuBar from './menuBar'; import MenuBar from './localWorkMenuBar';
import MenuStationTurnBack from './menuStationTurnBack'; import MenuStationTurnBack from './menuStationTurnBack';
import PassiveAlarm from './passiveDialog/alarm'; import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control'; import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
@ -32,7 +32,7 @@ import PassiveTimeout from './passiveDialog/timeout';
import PopMenu from '@/components/PopMenu'; import PopMenu from '@/components/PopMenu';
export default { export default {
name: 'Menus', name: 'LocalWorkMenu',
components: { components: {
MenuBar, MenuBar,
MenuSignal, MenuSignal,

View File

@ -0,0 +1,375 @@
<template>
<div id="menuBarXian01">
<menu-bar ref="menuBar" :menu-normal="menuNormal" style="width:100%" />
<!--<div class="deviceStatus">-->
<!--<div class="holdTrainStatus">H</div>-->
<!--<div class="jumpStopStatus">S</div>-->
<!--</div>-->
<station-control-convert ref="stationControlConvert" @warningInfoDoShow="warningInfoDoShow" />
<password-box ref="passwordBox" @setLoginResult="getLoginResult" />
<view-train-id ref="viewTrainId" />
<view-name ref="viewName" />
<view-device ref="viewDevice" />
<!-- <train-add ref="trainAdd" />
<train-transtalet ref="trainTranstalet" />
<train-delete ref="trainDelete" /> -->
<manage-user ref="manageUser" />
<help-about ref="helpAbout" />
<warning-info ref="warningInfo" />
<!-- <delete-runplan-line ref="deleteRunplanLine" /> -->
<!-- <add-runplan-line ref="addRunplanLine" /> -->
</div>
</template>
<script>
import MenuBar from '@/jmapNew/theme/components/menus/menuBarNew';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler.js';
import StationControlConvert from './menuDialog/stationControlConvert';
import WarningInfo from './menuDialog/warningInfo';
// import TrainAdd from './menuDialog/trainAdd';
// import AddRunplanLine from './menuDialog/addRunplanLine';
// import TrainTranstalet from './menuDialog/trainTranstalet';
// import TrainDelete from './menuDialog/trainDelete';
import PasswordBox from './menuDialog/passwordBox';
import ViewTrainId from './menuDialog/viewTrainId';
import ViewName from './menuDialog/viewName';
import ViewDevice from './menuDialog/viewDevice';
import ManageUser from './menuDialog/manageUser';
import HelpAbout from './menuDialog/helpAbout';
// import DeleteRunplanLine from './menuDialog/deleteRunplanLine';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'LocalWorkMenuBarXian01',
components: {
MenuBar,
StationControlConvert,
PasswordBox,
ViewTrainId,
ViewName,
ViewDevice,
// TrainAdd,
// AddRunplanLine,
// TrainTranstalet,
// TrainDelete,
ManageUser,
HelpAbout,
WarningInfo
// DeleteRunplanLine
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menuNormal: [
{
title: this.$t('menu.menuBar.system'),
operate: OperationEvent.Command.mBar.system,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.view'),
operate: OperationEvent.Command.mBar.check,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.refresh'),
operate: OperationEvent.Command.mBar.fresh,
click: this.refresh,
children: [
]
},
{
title: this.$t('menu.menuBar.display'),
operate: OperationEvent.Command.mBar.view,
children: [
{
title: this.$t('menu.menuBar.setTrainIdDisplay'),
click: this.setTrainIdDisplay,
operate: OperationEvent.Command.view.setTrainIdDisplay
},
{
title: this.$t('menu.menuBar.setNameDisplay'),
click: this.setNameDisplay,
operate: OperationEvent.Command.view.setNameDisplay
},
{
title: this.$t('menu.menuBar.setDeviceDisplay'),
click: this.setDeviceDisplay,
operate: OperationEvent.Command.view.setDeviceDisplay
}
]
},
{
title: this.$t('menu.menuBar.stationMapSwitch'),
operate: '',
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.controlModeSwitch'),
operate: OperationEvent.Command.mBar.remoteControl,
children: [
{
title: this.$t('menu.menuBar.toStationControl'),
click: this.turnToStationControl,
operate: OperationEvent.StationControl.requestStationControl.mbar
},
{
title: this.$t('menu.menuBar.forcedStationControl'),
click: this.mandatoryStationControl,
operate: OperationEvent.StationControl.forcedStationControl.password
},
{
title: this.$t('menu.menuBar.toCentralControl'),
click: this.conterStationControl,
operate: OperationEvent.StationControl.requestCentralControl.mbar,
force: true
}
]
},
{
title: this.$t('menu.menuBar.requestOperationArea'),
operate: OperationEvent.Command.mBar.requestZone,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.historyQuery'),
operate: OperationEvent.Command.mBar.historyQuery,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.userManage'),
operate: OperationEvent.Command.mBar.userManage,
children: [
{
title: this.$t('menu.menuBar.userManage'),
click: this.userManage,
operate: OperationEvent.Command.manage.userManage
}
]
},
{
title: this.$t('menu.menuBar.help'),
operate: OperationEvent.Command.mBar.help,
children: [
{
title: this.$t('menu.menuBar.about'),
click: this.about,
operate: OperationEvent.Command.help.about
}
]
}
]
};
},
methods: {
//
turnToStationControl(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControlConvert.doShow(operate);
}
});
},
//
mandatoryStationControl(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.passwordBox.doShow(operate);
}
});
},
//
conterStationControl(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControlConvert.doShow(operate);
}
});
},
//
setTrainIdDisplay(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.viewTrainId.doShow(operate);
}
});
},
//
setNameDisplay(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.viewName.doShow(operate);
}
});
},
//
setDeviceDisplay(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.viewDevice.doShow(operate);
}
});
},
//
// addPlanTrain(order) {
// const operate = {
// operation: order.operation
// };
// this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// if (this.$route.query.lineCode == '10') {
// this.$refs.trainAdd.doShow(operate);
// } else {
// // this.$refs.addRunplanLine.doShow(operate);
// this.$refs.trainAdd.doShow(operate);
// }
// }
// });
// },
//
// translatPlanTrain(order) {
// const operate = {
// operation: order.operation
// };
// this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.trainTranstalet.doShow(operate);
// }
// });
// },
//
// delPlanTrain(order) {
// const operate = {
// operation: order.operation
// };
// this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.trainDelete.doShow(operate);
// // this.$refs.deleteRunplanLine.doShow(operate);
// }
// });
// },
//
userManage(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.manageUser.doShow(operate);
}
});
},
//
about(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.helpAbout.doShow(operate);
}
});
},
//
refresh() {
EventBus.$emit('refresh');
},
getLoginResult(operate) {
/** 密码校验*/
if (operate.operation == OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation) {
if (operate.success) {
/** 校验成功*/
this.$refs.stationControlConvert.doShow({ operation: OperationEvent.StationControl.forcedStationControl.mbar.operation });
}
}
},
blankClickClose() {
this.$refs.menuBar.doClose();
},
warningInfoDoShow(info) {
this.$refs.warningInfo.doShow(info);
},
undeveloped() {
this.$refs.menuBar.doClose();
this.$alert(this.$t('menu.menuBar.implemented'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
callback: action => {
}
});
}
}
};
</script>
<style scoped rel="stylesheet/scss" lang="scss">
.deviceStatus{
display: inline-block;
font-size: 0;
height: 40px;
background: #f0f0f0;
width: 300px;
}
.holdTrainStatus,.jumpStopStatus{
color: #fff;
display: inline-block;
width: 30px;
height: 30px;
text-align: center;
background: #ccc;
font-size:14px;
}
#menuBarXian01{
line-height:30px;
}
#menuBarXian01 #menuBar .menu-li-block .label{
padding: 0px 30px 0px 5px !important;
}
</style>

View File

@ -1,529 +0,0 @@
<template>
<div id="menuBarXian01">
<menu-bar ref="menuBar" :menu-normal="menuNormal" style="width:100%" />
<!--<div class="deviceStatus">-->
<!--<div class="holdTrainStatus">H</div>-->
<!--<div class="jumpStopStatus">S</div>-->
<!--</div>-->
<station-control-convert ref="stationControlConvert" @warningInfoDoShow="warningInfoDoShow" />
<password-box ref="passwordBox" @setLoginResult="getLoginResult" />
<view-train-id ref="viewTrainId" />
<view-name ref="viewName" />
<view-device ref="viewDevice" />
<train-add ref="trainAdd" />
<train-transtalet ref="trainTranstalet" />
<train-delete ref="trainDelete" />
<manage-user ref="manageUser" />
<help-about ref="helpAbout" />
<warning-info ref="warningInfo" />
<!-- <delete-runplan-line ref="deleteRunplanLine" /> -->
<!-- <add-runplan-line ref="addRunplanLine" /> -->
</div>
</template>
<script>
import MenuBar from '@/jmapNew/theme/components/menus/menuBar';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler.js';
import StationControlConvert from './menuDialog/stationControlConvert';
import WarningInfo from './menuDialog/warningInfo';
import TrainAdd from './menuDialog/trainAdd';
// import AddRunplanLine from './menuDialog/addRunplanLine';
import TrainTranstalet from './menuDialog/trainTranstalet';
import TrainDelete from './menuDialog/trainDelete';
import PasswordBox from './menuDialog/passwordBox';
import ViewTrainId from './menuDialog/viewTrainId';
import ViewName from './menuDialog/viewName';
import ViewDevice from './menuDialog/viewDevice';
import ManageUser from './menuDialog/manageUser';
import HelpAbout from './menuDialog/helpAbout';
// import DeleteRunplanLine from './menuDialog/deleteRunplanLine';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'MenuBarXian01',
components: {
MenuBar,
StationControlConvert,
PasswordBox,
ViewTrainId,
ViewName,
ViewDevice,
TrainAdd,
// AddRunplanLine,
TrainTranstalet,
TrainDelete,
ManageUser,
HelpAbout,
WarningInfo
// DeleteRunplanLine
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menuNormal: {
Local: [
{
title: this.$t('menu.menuBar.system'),
operate: OperationEvent.Command.mBar.system,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.view'),
operate: OperationEvent.Command.mBar.check,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.refresh'),
operate: OperationEvent.Command.mBar.fresh,
click: this.refresh,
children: [
]
},
{
title: this.$t('menu.menuBar.display'),
operate: OperationEvent.Command.mBar.view,
children: [
{
title: this.$t('menu.menuBar.setTrainIdDisplay'),
click: this.setTrainIdDisplay,
operate: OperationEvent.Command.view.setTrainIdDisplay
},
{
title: this.$t('menu.menuBar.setNameDisplay'),
click: this.setNameDisplay,
operate: OperationEvent.Command.view.setNameDisplay
},
{
title: this.$t('menu.menuBar.setDeviceDisplay'),
click: this.setDeviceDisplay,
operate: OperationEvent.Command.view.setDeviceDisplay
}
]
},
{
title: this.$t('menu.menuBar.stationMapSwitch'),
operate: '',
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.controlModeSwitch'),
operate: OperationEvent.Command.mBar.remoteControl,
children: [
{
title: this.$t('menu.menuBar.toStationControl'),
click: this.turnToStationControl,
operate: OperationEvent.StationControl.requestStationControl.mbar
},
{
title: this.$t('menu.menuBar.forcedStationControl'),
click: this.mandatoryStationControl,
operate: OperationEvent.StationControl.forcedStationControl.password
},
{
title: this.$t('menu.menuBar.toCentralControl'),
click: this.conterStationControl,
operate: OperationEvent.StationControl.requestCentralControl.mbar,
force: true
}
]
},
{
title: this.$t('menu.menuBar.requestOperationArea'),
operate: OperationEvent.Command.mBar.requestZone,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.historyQuery'),
operate: OperationEvent.Command.mBar.historyQuery,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.userManage'),
operate: OperationEvent.Command.mBar.userManage,
children: [
{
title: this.$t('menu.menuBar.userManage'),
click: this.userManage,
operate: OperationEvent.Command.manage.userManage
}
]
},
{
title: this.$t('menu.menuBar.help'),
operate: OperationEvent.Command.mBar.help,
children: [
{
title: this.$t('menu.menuBar.about'),
click: this.about,
operate: OperationEvent.Command.help.about
}
]
}
],
Center: [
{
title: this.$t('menu.menuBar.system'),
operate: OperationEvent.Command.mBar.system,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.view'),
operate: OperationEvent.Command.mBar.check,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.refresh'),
operate: OperationEvent.Command.mBar.fresh,
click: this.refresh,
children: [
]
},
{
title: this.$t('menu.menuBar.display'),
operate: OperationEvent.Command.mBar.view,
children: [
{
title: this.$t('menu.menuBar.setTrainIdDisplay'),
click: this.setTrainIdDisplay,
operate: OperationEvent.Command.view.setTrainIdDisplay
},
{
title: this.$t('menu.menuBar.setNameDisplay'),
click: this.setNameDisplay,
operate: OperationEvent.Command.view.setNameDisplay
},
{
title: this.$t('menu.menuBar.setDeviceDisplay'),
click: this.setDeviceDisplay,
operate: OperationEvent.Command.view.setDeviceDisplay
}
]
},
{
title: this.$t('menu.menuBar.stationMapSwitch'),
operate: '',
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.planCarOperation'),
operate: OperationEvent.Command.mBar.planTrain,
children: [
{
title: this.$t('menu.menuBar.addPlanCar'),
click: this.addPlanTrain,
operate: OperationEvent.Command.planTrain.addPlanTrain
},
{
title: this.$t('menu.menuBar.panPlanCar'),
click: this.translatPlanTrain,
operate: OperationEvent.Command.planTrain.translatPlanTrain
},
{
title: this.$t('menu.menuBar.deletePlanCar'),
click: this.delPlanTrain,
operate: OperationEvent.Command.planTrain.delPlanTrain
}
]
},
{
title: this.$t('menu.menuBar.trainNumberMaintenance'),
operate: '',
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.controlModeSwitch'),
operate: OperationEvent.Command.mBar.remoteControl,
children: [
{
title: this.$t('menu.menuBar.toStationControl'),
click: this.turnToStationControl,
operate: OperationEvent.StationControl.requestStationControl.mbar,
force: true
},
{
title: this.$t('menu.menuBar.forcedStationControl'),
click: this.mandatoryStationControl,
operate: OperationEvent.StationControl.forcedStationControl.password,
force: true
},
{
title: this.$t('menu.menuBar.toCentralControl'),
click: this.conterStationControl,
operate: OperationEvent.StationControl.requestCentralControl.mbar
}
]
},
{
title: this.$t('menu.menuBar.requestOperationArea'),
operate: OperationEvent.Command.mBar.requestZone,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.schedulingLog'),
operate: '',
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.systemAnalysis'),
operate: '',
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.userManage'),
operate: OperationEvent.Command.mBar.userManage,
children: [
{
title: this.$t('menu.menuBar.userManage'),
click: this.userManage,
operate: OperationEvent.Command.manage.userManage
}
]
},
{
title: this.$t('menu.menuBar.historyQuery'),
operate: OperationEvent.Command.mBar.historyQuery,
click: this.undeveloped,
children: [
]
},
{
title: this.$t('menu.menuBar.help'),
operate: OperationEvent.Command.mBar.help,
children: [
{
title: this.$t('menu.menuBar.about'),
click: this.about,
operate: OperationEvent.Command.help.about
}
]
}
]
}
};
},
methods: {
//
turnToStationControl(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControlConvert.doShow(operate);
}
});
},
//
mandatoryStationControl(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.passwordBox.doShow(operate);
}
});
},
//
conterStationControl(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControlConvert.doShow(operate);
}
});
},
//
setTrainIdDisplay(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.viewTrainId.doShow(operate);
}
});
},
//
setNameDisplay(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.viewName.doShow(operate);
}
});
},
//
setDeviceDisplay(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.viewDevice.doShow(operate);
}
});
},
//
addPlanTrain(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (this.$route.query.lineCode == '10') {
this.$refs.trainAdd.doShow(operate);
} else {
// this.$refs.addRunplanLine.doShow(operate);
this.$refs.trainAdd.doShow(operate);
}
}
});
},
//
translatPlanTrain(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainTranstalet.doShow(operate);
}
});
},
//
delPlanTrain(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDelete.doShow(operate);
// this.$refs.deleteRunplanLine.doShow(operate);
}
});
},
//
userManage(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.manageUser.doShow(operate);
}
});
},
//
about(order) {
const operate = {
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.helpAbout.doShow(operate);
}
});
},
//
refresh() {
EventBus.$emit('refresh');
},
getLoginResult(operate) {
/** 密码校验*/
if (operate.operation == OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation) {
if (operate.success) {
/** 校验成功*/
this.$refs.stationControlConvert.doShow({ operation: OperationEvent.StationControl.forcedStationControl.mbar.operation });
}
}
},
blankClickClose() {
this.$refs.menuBar.doClose();
},
warningInfoDoShow(info) {
this.$refs.warningInfo.doShow(info);
},
undeveloped() {
this.$refs.menuBar.doClose();
this.$alert(this.$t('menu.menuBar.implemented'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
callback: action => {
}
});
}
}
};
</script>
<style scoped rel="stylesheet/scss" lang="scss">
.deviceStatus{
display: inline-block;
font-size: 0;
height: 40px;
background: #f0f0f0;
width: 300px;
}
.holdTrainStatus,.jumpStopStatus{
color: #fff;
display: inline-block;
width: 30px;
height: 30px;
text-align: center;
background: #ccc;
font-size:14px;
}
#menuBarXian01{
line-height:30px;
}
#menuBarXian01 #menuBar .menu-li-block .label{
padding: 0px 30px 0px 5px !important;
}
</style>

View File

@ -44,77 +44,103 @@ export default {
default() { default() {
return null; return null;
} }
},
work: {
type: String,
default() {
return '';
}
} }
}, },
data() { data() {
return { return {
menu: [], menu: [],
menuNormal: { menuNormal: [
Local: [ {
{ label: '区段封锁',
label: '区段封锁', handler: this.lock,
handler: this.lock, cmdType: CMD.Section.CMD_SECTION_BLOCK,
cmdType: CMD.Section.CMD_SECTION_BLOCK isDisabled: (section, work) => {
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.blockade === 1;
} else {
return section.blockade === 1;
}
}, },
{ isShow: (section, work) => ['01', '02', '03'].includes(section.type)
label: '区段解封', },
handler: this.unlock, {
cmdType: CMD.Section.CMD_SECTION_UNBLOCK label: '区段解封',
handler: this.unlock,
cmdType: CMD.Section.CMD_SECTION_UNBLOCK,
isDisabled: (section, work) => {
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.blockade !== 1;
} else {
return section.blockade !== 1;
}
}, },
{ isShow: (section, work) => ['01', '02', '03'].includes(section.type)
label: '故障解锁', },
handler: this.fault, {
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK label: '故障解锁',
handler: this.fault,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
isShow: (section, work) => ['01', '02', '03'].includes(section.type)
},
{
label: '设置限速',
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
isDisabled: (section, work) => {
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.speedUpLimit !== -1;
} else {
return section.speedUpLimit !== -1;
}
}, },
{ isShow: (section, work) => section.type === '02'
label: '设置限速', },
handler: this.setSpeed, {
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED label: '取消限速',
handler: this.cancelSpeed,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED,
isDisabled: (section, work) => {
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.speedUpLimit === -1;
} else {
return section.speedUpLimit === -1;
}
}, },
{ isShow: (section, work) => section.type === '02'
label: '取消限速', },
handler: this.cancelSpeed, {
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED label: '区段切除',
} handler: this.split,
], cmdType: CMD.Section.CMD_SECTION_CUT_OFF,
Center: [ isDisabled: (section, work) => {
{ if (work === 'localWork') {
label: '故障解锁', return false;
handler: this.fault, } else {
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK return section.cutOff === 1;
}
}, },
{ isShow: (section, work) => ['01', '02', '03'].includes(section.type)
label: '区段切除', },
handler: this.split, {
cmdType: CMD.Section.CMD_SECTION_CUT_OFF label: '区段激活',
handler: this.active,
cmdType: CMD.Section.CMD_SECTION_ACTIVE,
isDisabled: (section, work) => {
if (work === 'localWork') {
return false;
} else {
return section.cutOff !== 1;
}
}, },
{ isShow: (section, work) => ['01', '02', '03'].includes(section.type)
label: '区段激活', }
handler: this.active, ],
cmdType: CMD.Section.CMD_SECTION_ACTIVE
},
{
label: '区段封锁',
handler: this.lock,
cmdType: CMD.Section.CMD_SECTION_BLOCK
},
{
label: '区段解封',
handler: this.unlock,
cmdType: CMD.Section.CMD_SECTION_UNBLOCK
},
{
label: '设置限速',
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
},
{
label: '取消限速',
handler: this.cancelSpeed,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED
}
]
},
menuForce: [ menuForce: [
{ {
label: '设置故障', label: '设置故障',
@ -160,7 +186,7 @@ export default {
mounted() { mounted() {
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
if (isDev) { if (isDev) {
this.menuNormal.Center.push({ this.menuNormal.push({
label: '新建计划车', label: '新建计划车',
handler: this.addPlanTrain, handler: this.addPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan cmdType: CMD.Section.CMD_Train_Init_Plan
@ -172,6 +198,12 @@ export default {
// //
if (this.selected.type != '04') { if (this.selected.type != '04') {
// this.menu = MenuContextHandler.covert(this.menuNormal); // this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});
} else { } else {
this.menu = []; this.menu = [];
} }

View File

@ -50,157 +50,138 @@ export default {
default() { default() {
return null; return null;
} }
},
work: {
type: String,
default() {
return '';
}
} }
}, },
data() { data() {
return { return {
menu: [], menu: [],
menuNormal: { menuNormal: [
Local: [ {
{ label: '进路选排',
label: '进路选排', handler: this.arrangementRoute,
handler: this.arrangementRoute, cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE },
}, {
{ label: '进路取消',
label: '进路取消', handler: this.cancelTrainRoute,
handler: this.cancelTrainRoute, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE },
}, {
{ label: '信号封锁',
label: '信号封锁', handler: this.lock,
handler: this.lock, cmdType: CMD.Signal.CMD_SIGNAL_BLOCK,
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK isDisabled: (signal, work) => {
}, if (work === 'localWork') {
{ return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.blockade === 1;
label: '信号解封', } else {
handler: this.unlock, return signal.blockade === 1;
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK }
},
{
label: '信号关灯',
handler: this.signalClose,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
},
{
label: '信号重开',
handler: this.reopenSignal,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
},
{
label: '引导进路办理',
handler: this.guide,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
},
{
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: '设置联锁自动触发',
handler: this.setAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER
},
{
label: '取消联锁自动触发',
handler: this.cancelAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER
},
{
label: '进路交人工控',
handler: this.humanControl,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
},
{
label: '进路交ATS自动控',
handler: this.atsAutoControl,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
},
{
label: '查询进路状态',
handler: this.detail,
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
} }
], },
Center: [ {
{ label: '信号解封',
label: '进路选排', handler: this.unlock,
handler: this.arrangementRoute, cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE isDisabled: (signal, work) => {
}, if (work === 'localWork') {
{ return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.blockade !== 1;
label: '进路取消', } else {
handler: this.cancelTrainRoute, return signal.blockade !== 1;
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE }
},
{
label: '信号封锁',
handler: this.lock,
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
},
{
label: '信号解封',
handler: this.unlock,
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
},
{
label: '信号关灯',
handler: this.signalClose,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
},
{
label: '信号重开',
handler: this.reopenSignal,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
},
{
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: '设置联锁自动触发',
handler: this.setAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER
},
{
label: '取消联锁自动触发',
handler: this.cancelAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER
},
{
label: '进路引导',
handler: this.guide,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
},
{
label: '进路交人工控',
handler: this.humanControl,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
},
{
label: '进路交ATS自动控',
handler: this.atsAutoControl,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
},
{
label: '查询进路状态',
handler: this.detail,
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
} }
] },
}, {
label: '信号关灯',
handler: this.signalClose,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
},
{
label: '信号重开',
handler: this.reopenSignal,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
},
{
label: '引导进路办理',
handler: this.guide,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
isShow: (signal, work) => work === 'localWork'
},
{
label: '设置联锁自动进路',
handler: this.setAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO,
isDisabled: (signal, work) => {
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.fleetMode !== 0;
} else {
return false;
}
}
},
{
label: '取消联锁自动进路',
handler: this.cancelAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO,
isDisabled: (signal, work) => {
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.fleetMode !== 1;
} else {
return false;
}
}
},
{
label: '设置联锁自动触发',
handler: this.setAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER,
isDisabled: (signal, work) => {
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.ciControl === 1 || !signal.canSetCi;
} else {
return false;
}
}
},
{
label: '取消联锁自动触发',
handler: this.cancelAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER,
isDisabled: (signal, work) => {
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.ciControl !== 1;
} else {
return false;
}
}
},
{
label: '进路交人工控',
handler: this.humanControl,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
},
{
label: '进路交ATS自动控',
handler: this.atsAutoControl,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
},
{
label: '查询进路状态',
handler: this.detail,
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
},
{
label: '进路引导',
handler: this.guide,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
isShow: (signal, work) => work === 'dispatchWork'
}
],
menuForce: [ menuForce: [
{ {
label: '设置故障', label: '设置故障',
@ -262,6 +243,12 @@ export default {
methods: { methods: {
initMenu() { initMenu() {
// this.menu = MenuContextHandler.covert(this.menuNormal); // this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});
// //
const ciAutoMenuItem = this.menu.find( item => item.cmdType === CMD.Signal.CMD_SIGNAL_SET_CI_AUTO); const ciAutoMenuItem = this.menu.find( item => item.cmdType === CMD.Signal.CMD_SIGNAL_SET_CI_AUTO);
const ciAutoTriggerMenuItem = this.menu.find( item => item.cmdType === CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER); const ciAutoTriggerMenuItem = this.menu.find( item => item.cmdType === CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER);

View File

@ -39,62 +39,71 @@ export default {
default() { default() {
return null; return null;
} }
},
work: {
type: String,
default() {
return '';
}
} }
}, },
data() { data() {
return { return {
menu: [], menu: [],
menuNormal: { menuNormal: [
Local: [ {
{ label: '上电解锁',
label: '上电解锁', handler: this.powerUnLock,
handler: this.powerUnLock, cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK,
cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK isShow: (station, work) => work === 'localWork'
}, },
{ {
label: '全站设置联锁自动触发', label: '全站设置联锁自动触发',
handler: this.setAutoTrigger, handler: this.setAutoTrigger,
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER,
}, isShow: (station, work) => work === 'localWork'
{ },
label: '全站取消联锁自动触发', {
handler: this.cancelAutoTrigger, label: '全站取消联锁自动触发',
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER handler: this.cancelAutoTrigger,
}, cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER,
{ isShow: (station, work) => work === 'localWork'
label: '所有进路交ATS自动控', },
handler: this.atsAutoControlALL, {
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING label: '所有进路交ATS自动控',
}, handler: this.atsAutoControlALL,
{ cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
label: '所有进路交人工控', isShow: (station, work) => work === 'localWork'
handler: this.humanControlALL, },
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING {
} label: '所有进路交人工控',
// { handler: this.humanControlALL,
// label: '', cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING,
// handler: this.execKeyOperationTest, isShow: (station, work) => work === 'localWork'
// cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST, },
// } // {
], // label: '',
Center: [ // handler: this.execKeyOperationTest,
{ // cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST,
label: '所有进路交人工控', // }
handler: this.humanControlALL, {
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING label: '所有进路交人工控',
}, handler: this.humanControlALL,
{ cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING,
label: '所有进路交ATS自动控', isShow: (station, work) => work === 'dispatchWork'
handler: this.atsAutoControlALL, },
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING {
} label: '所有进路交ATS自动控',
// { handler: this.atsAutoControlALL,
// label: '', cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
// handler: this.execKeyOperationTest, isShow: (station, work) => work === 'dispatchWork'
// cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST }
// } // {
] // label: '',
}, // handler: this.execKeyOperationTest,
// cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST
// }
],
menuForce: [ menuForce: [
// { // {
// label: 'ZC', // label: 'ZC',
@ -141,6 +150,12 @@ export default {
initMenu() { initMenu() {
// //
// this.menu = MenuContextHandler.covert(this.menuNormal); // this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
this.menu.push(menuItem);
});
// //
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {

View File

@ -50,92 +50,113 @@ export default {
default() { default() {
return null; return null;
} }
},
work: {
type: String,
default() {
return '';
}
} }
}, },
data() { data() {
return { return {
menu: [], menu: [],
menuNormal: { menuNormal: [
Local: [ {
{ label: '设置扣车',
label: '设置扣车', handler: this.setDetainTrain,
handler: this.setDetainTrain, cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN isDisabled: stand => this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.stationHoldTrain === 1,
}, isShow: (stand, work) => work === 'localWork'
{ },
label: '取消扣车', {
handler: this.cancelDetainTrain, label: '取消扣车',
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN handler: this.cancelDetainTrain,
}, cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
{ isDisabled: stand => this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.stationHoldTrain !== 1,
label: '强制取消扣车', isShow: (stand, work) => work === 'localWork'
handler: this.cancelDetainTrainForce, },
cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN {
}, label: '强制取消扣车',
{ handler: this.cancelDetainTrainForce,
label: '查询站台状态', cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN,
handler: this.detail, isDisabled: (stand, work) => {
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode;
} else {
return false;
}
} }
], },
Center: [ {
{ label: '查询站台状态',
label: '设置扣车', handler: this.detail,
handler: this.setDetainTrain, cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS,
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN isDisabled: (stand, work) => {
}, if (work === 'localWork') {
{ return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode;
label: '取消扣车', } else {
handler: this.cancelDetainTrain, return false;
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.cancelDetainTrainForce,
cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN
},
{
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.earlyDeparture,
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART
},
{
label: '设置折返策略',
handler: this.setBackStrategy,
cmdType:CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY
},
{
label: '查询站台状态',
handler: this.detail,
cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
} }
] },
}, {
label: '设置扣车',
handler: this.setDetainTrain,
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '取消扣车',
handler: this.cancelDetainTrain,
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '全线取消扣车',
handler: this.cancelDetainTrainAll,
cmdType: CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN,
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '设置跳停',
handler: this.setJumpStop,
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP,
isDisabled: stand => stand.allSkip !== 0,
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '取消跳停',
handler: this.cancelJumpStop,
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP,
isDisabled: stand => stand.allSkip !== 1 && stand.assignSkip !== 1,
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '设置停站时间',
handler: this.setStopTime,
cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME,
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '设置运行等级',
handler: this.setRunLevel,
cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME,
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '设置提前发车',
handler: this.earlyDeparture,
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART,
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '设置折返策略',
handler: this.setBackStrategy,
cmdType:CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
isShow: (stand, work) => work === 'dispatchWork'
}
],
menuForce: [ menuForce: [
{ {
label: '设置故障', label: '设置故障',
@ -175,6 +196,12 @@ export default {
initMenu() { initMenu() {
// //
// this.menu = MenuContextHandler.covert(this.menuNormal); // this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});
if (this.operatemode === OperateMode.ADMIN) { if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce]; this.menu = [...this.menu, ...this.menuForce];
} }

View File

@ -27,27 +27,24 @@ export default {
default() { default() {
return null; return null;
} }
},
work: {
type: String,
default() {
return '';
}
} }
}, },
data() { data() {
return { return {
menu: [], menu: [],
menuNormal: { menuNormal: [
Local: [ {
{ label: '设置折返策略',
label: '设置折返策略', handler: this.setBackStrategy,
handler: this.setBackStrategy, cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY
cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY }
} ],
],
Center: [
{
label: '设置折返策略',
handler: this.setBackStrategy,
cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY
}
]
},
menuForce: [ menuForce: [
] ]
}; };
@ -74,6 +71,12 @@ export default {
initMenu() { initMenu() {
// //
// this.menu = MenuContextHandler.covert(this.menuNormal); // this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});
// //
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {

View File

@ -40,122 +40,102 @@ export default {
default() { default() {
return null; return null;
} }
},
work: {
type: String,
default() {
return '';
}
} }
}, },
data() { data() {
return { return {
menu: [], menu: [],
menuNormal: { menuNormal: [
Local: [ {
{ label: '道岔单锁',
label: '道岔单锁', handler: this.lock,
handler: this.lock, cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK isDisabled: (switchDevice, work) => {
}, if (work === 'localWork') {
{ return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.singleLock === 1;
label: '道岔单解', } else {
handler: this.unlock, return switchDevice.singleLock === 1;
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK }
},
{
label: '道岔封锁',
handler: this.block,
cmdType:CMD.Switch.CMD_SWITCH_BLOCK
},
{
label: '道岔解封',
handler: this.unblock,
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
},
{
label: '道岔转动',
handler: this.switchTurnout,
cmdType:CMD.Switch.CMD_SWITCH_TURN
},
{
label: '道岔故障解锁',
handler: this.fault,
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
},
{
label: '计轴预复位',
handler: this.axlePreReset,
cmdType:CMD.Switch.CMD_SWITCH_AXLE_PRE_RESET
},
{
label: '区段切除',
handler: this.split,
cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF
},
{
label: '区段激活',
handler: this.active,
cmdType:CMD.Switch.CMD_SWITCH_ACTIVE
},
{
label: '道岔设置限速',
handler: this.setSpeed,
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
},
{
label: '道岔取消限速',
handler: this.cancelSpeed,
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
} }
], },
Center: [ {
{ label: '道岔单解',
label: '道岔单锁', handler: this.unlock,
handler: this.lock, cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK isDisabled: (switchDevice, work) => {
}, if (work === 'localWork') {
{ return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.singleLock !== 1;
label: '道岔单解', } else {
handler: this.unlock, return switchDevice.singleLock !== 1;
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK }
},
{
label: '道岔封锁',
handler: this.block,
cmdType:CMD.Switch.CMD_SWITCH_BLOCK
},
{
label: '道岔解封',
handler: this.unblock,
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
},
{
label: '道岔转动',
handler: this.switchTurnout,
cmdType:CMD.Switch.CMD_SWITCH_TURN
},
{
label: '道岔故障解锁',
handler: this.fault,
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
},
{
label: '区段切除',
handler: this.split,
cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF
},
{
label: '区段激活',
handler: this.active,
cmdType:CMD.Switch.CMD_SWITCH_ACTIVE
},
{
label: '道岔设置限速',
handler: this.setSpeed,
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
},
{
label: '道岔取消限速',
handler: this.cancelSpeed,
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
} }
] },
}, {
label: '道岔封锁',
handler: this.block,
cmdType:CMD.Switch.CMD_SWITCH_BLOCK,
isDisabled: (switchDevice, work) => {
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.blockade === 1;
} else {
return switchDevice.blockade === 1;
}
}
},
{
label: '道岔解封',
handler: this.unblock,
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK,
isDisabled: (switchDevice, work) => {
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.blockade !== 1;
} else {
return switchDevice.blockade !== 1;
}
}
},
{
label: '道岔转动',
handler: this.switchTurnout,
cmdType:CMD.Switch.CMD_SWITCH_TURN
},
{
label: '道岔故障解锁',
handler: this.fault,
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
},
{
label: '计轴预复位',
handler: this.axlePreReset,
cmdType:CMD.Switch.CMD_SWITCH_AXLE_PRE_RESET
},
{
label: '区段切除',
handler: this.split,
cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF
},
{
label: '区段激活',
handler: this.active,
cmdType:CMD.Switch.CMD_SWITCH_ACTIVE
},
{
label: '道岔设置限速',
handler: this.setSpeed,
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
},
{
label: '道岔取消限速',
handler: this.cancelSpeed,
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
}
],
menuForce: [ menuForce: [
{ {
label: '设置故障', label: '设置故障',
@ -201,6 +181,12 @@ export default {
initMenu() { initMenu() {
// //
// this.menu = MenuContextHandler.covert(this.menuNormal); // this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});
if (this.operatemode === OperateMode.ADMIN) { if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce]; this.menu = [...this.menu, ...this.menuForce];
} }

View File

@ -57,61 +57,73 @@ export default {
default() { default() {
return null; return null;
} }
},
work: {
type: String,
default() {
return '';
}
} }
}, },
data() { data() {
return { return {
menu: [], menu: [],
menuNormal: { menuNormal: [
Local: [], {
Center: [ label: '添加列车识别号',
{ handler: this.undeveloped,
label: '添加列车识别号', cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE,
handler: this.undeveloped, isShow: (train, work) => work === 'dispatchWork'
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE },
}, {
{ label: '删除列车识别号',
label: '删除列车识别号', handler: this.undeveloped,
handler: this.undeveloped, cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE isShow: (train, work) => work === 'dispatchWork'
}, },
{ {
label: '修改列车识别号', label: '修改列车识别号',
handler: this.editTrainId, handler: this.editTrainId,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE,
}, isShow: (train, work) => work === 'dispatchWork'
{ },
label: '修改车组号', {
handler: this.undeveloped, label: '修改车组号',
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE handler: this.undeveloped,
}, cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE,
{ isShow: (train, work) => work === 'dispatchWork'
label: '移动列车识别号', },
handler: this.undeveloped, {
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE label: '移动列车识别号',
}, handler: this.undeveloped,
{ cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE,
label: '交换列车识别号', isShow: (train, work) => work === 'dispatchWork'
handler: this.undeveloped, },
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE {
}, label: '交换列车识别号',
{ handler: this.undeveloped,
label: '标记ATP切除', cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE,
handler: this.undeveloped, isShow: (train, work) => work === 'dispatchWork'
cmdType: CMD.TrainWindow.CMD_TRAIN_TAG_ATP_CUT },
}, {
{ label: '标记ATP切除',
label: '标记ATP激活', handler: this.undeveloped,
handler: this.undeveloped, cmdType: CMD.TrainWindow.CMD_TRAIN_TAG_ATP_CUT,
cmdType: CMD.TrainWindow.CMD_TRAIN_TAG_ATP_RECOVER isShow: (train, work) => work === 'dispatchWork'
}, },
{ {
label: '查看列车详细运行信息', label: '标记ATP激活',
handler: this.undeveloped, handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_INFO cmdType: CMD.TrainWindow.CMD_TRAIN_TAG_ATP_RECOVER,
} isShow: (train, work) => work === 'dispatchWork'
] },
}, {
label: '查看列车详细运行信息',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_INFO,
isShow: (train, work) => work === 'dispatchWork'
}
],
menuForce: [ menuForce: [
{ {
label: '设置故障', label: '设置故障',
@ -233,6 +245,12 @@ export default {
initMenu() { initMenu() {
// //
// this.menu = MenuContextHandler.covert(this.menuNormal); // this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});
if (this.operatemode === OperateMode.ADMIN) { if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce]; this.menu = [...this.menu, ...this.menuForce];
} else { } else {