xian_02拆分

This commit is contained in:
dong 2022-12-07 18:37:44 +08:00
parent 825d1a1e15
commit 9b1dac9b2b
13 changed files with 1530 additions and 797 deletions

View File

@ -1,6 +1,6 @@
<template>
<div class="container">
<li v-if="option.children && option.children.length" class="menu-item" :class="popClass" @mouseenter="enter($vnode.key)" @mouseleave="leave">
<li v-if="option.children && option.children.length && checkVisible(option)" class="menu-item" :class="popClass" @mouseenter="enter($vnode.key)" @mouseleave="leave">
<div ref="flexBox" class="flex-box">
<el-button type="text" class="item" :disabled="checkDisabled(option)">
<el-link v-if="option.tipsType" :type="option.tipsType" :underline="false">{{ option.label }}</el-link>
@ -11,7 +11,7 @@
<ul v-if="isPopup" ref="popup" class="menu" :style="{display: isShow? 'block': 'table', marginLeft: marginLeft+'px'}">
<div class="menu-pop pop-menu">
<div v-show="isShow" class="arrow el-icon-arrow-down" />
<pop-menu-item v-for="(el, i) in option.children" :key="i" :option="el" :pop-class="popClass" :allowedColor="allowedColor" :disabledColor="disabledColor" @close="close" />
<pop-menu-item v-for="(el, i) in option.children" :key="i" :option="el" :pop-class="popClass" :allowed-color="allowedColor" :disabled-color="disabledColor" @close="close" />
<div v-show="isShow" class="arrow el-icon-arrow-up" />
</div>
</ul>
@ -52,14 +52,14 @@ export default {
type: Boolean,
default: false
},
disabledColor: {
type: String,
default: '#000',
},
allowedColor: {
type: String,
default: '#ccc'
}
disabledColor: {
type: String,
default: '#000'
},
allowedColor: {
type: String,
default: '#ccc'
}
},
data() {
return {

View File

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

View File

@ -64,6 +64,7 @@ import { mapGetters } from 'vuex';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteDetail',
@ -127,7 +128,8 @@ export default {
commit() {
const operate = {
over: true,
operation: OperationEvent.Signal.detail.menu.operation
operation: OperationEvent.Signal.detail.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
};
this.loading = true;

View File

@ -0,0 +1,550 @@
<template>
<div class="xian-02__menus" :style="{width: width + 'px'}">
<!-- <menu-axle-reset ref="menuAxleReset" :selected="selected" /> -->
<menu-cancel ref="menuCancel" />
<!-- <menu-auto-trun-route ref="menuAutoTrunRoute" :selected="selected" /> -->
<!-- <menu-station-control ref="menuStationControl" :selected="selected" /> -->
<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-limit ref="menuLimit" :selected="selected" /> -->
<passive-contorl ref="passiveControl" :work="'dispatchWork'" />
<menu-request ref="menuRequest" />
<menu-station-stand ref="menuStationStand" :selected="selected" :work="'dispatchWork'" @popMenuStationStand="popMenuStationStand" @totalMenuEvent="totalMenuEvent" />
<pop-station-stand ref="popStationStand" :selected="selected" :work="'dispatchWork'" @closeMenuStationStand="closeMenuStationStand" />
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import MenuSignal from './menuSignal';
// import MenuAxleReset from './menuAxleReset';
// import MenuAutoTrunRoute from './menuAutoTrunRoute';
// import MenuStationControl from './menuStationControl';
import MenuSwitch from './menuSwitch';
import MenuSection from './menuSection';
import MenuTrain from './menuTrain';
import MenuStation from './menuStation';
// import MenuLimit from './menuLimit';
import MenuCancel from './menuCancel';
import PassiveContorl from './passiveDialog/control';
import MenuStationStand from './menuStationStand';
import PopStationStand from './popStationStand';
import MenuRequest from './menuRequest';
export default {
name: 'Menus',
components: {
// MenuAxleReset,
// MenuAutoTrunRoute,
MenuSignal,
MenuSwitch,
MenuSection,
// MenuStationControl,
MenuStation,
MenuTrain,
// MenuLimit,
MenuStationStand,
MenuCancel,
PassiveContorl,
PopStationStand,
MenuRequest
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
computed: {
...mapGetters('config', [
'width'
])
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('config/updateMenuBar');
});
},
methods: {
popMenuStationStand(param) {
this.$refs.popStationStand.doShow(param.position, param.type);
},
closeMenuStationStand() {
this.$refs.menuStationStand.doClose();
},
totalMenuEvent(param) {
this.$refs.menuCancel.doShow(param);
}
}
};
</script>
<style>
.xian-02__menus .pop-menu {
background: #78e2ad;
padding: 0;
}
.xian-02__menus .pop-menu .el-popover{
background: #78e2ad;
}
.xian-02__menus .pop-menu span {
color: #000;
}
.xian-02__menus .pop-menu .is-disabled span {
color: #B4B3B8;
}
.xian-02__system {
overflow: hidden !important;
}
.xian-02__pop_tip_station{
padding: 0 !important;
margin-left: 1px !important;
background: #78e2ad !important;
border: 1px solid transparent;
border-radius: 0;
}
.xian-02__pop_tip_station:hover{
border: 1px solid #6B736A;
}
.xian-02__system .el-dialog {
background: #9da5ff;
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
border: 1px solid #9da5ff;
border-radius: 6px;
font-size: 13px !important;
color: #000;
}
.xian-02__system .el-dialog span {
font-size: 13px !important;
line-height: 22px;
}
.xian-02__system .el-dialog .el-dialog__footer {
background: #5F9EA0;
opacity: 1;
}
.xian-02__system .el-dialog .el-dialog__body {
padding: 20px;
margin: 0px 3px 3px;
border: 2px solid rgba(120, 121, 123, 0.5);
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
background: #5F9EA0;
opacity: 1;
}
.xian-02__system .station-stand .el-dialog__body {
background: #000;
color: #E8E8E8;
}
.xian-02__menus .stand-stop-time .el-dialog__body {
padding: 20px;
margin: 0px 3px 3px;
border: 2px solid rgba(120, 121, 123, 0.5);
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
background: #5F9EA0;
opacity: 1;
}
.xian-02__system .el-dialog .el-dialog__title {
font-size: 18px;
color: #fff;
}
.xian-02__system .el-dialog .el-dialog__header {
padding: 2px 1px;
}
.xian-02__system .el-dialog .el-dialog__headerbtn {
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid #fff;
border-radius: 4px;
top: 2px;
right: 3px;
line-height: 16px;
}
.xian-02__system .el-dialog .el-dialog__headerbtn .el-icon-close:before {
font-size: 16px;
}
.xian-02__system .el-dialog .el-dialog__headerbtn .el-dialog__close {
color: #fff;
}
.xian-02__system .el-dialog .el-button {
height: 24px;
line-height: 22px;
padding: 0px;
width: 80px;
border: 2px outset #B7D4D5;
border-radius: 0 !important;
color: #000;
background: #5F9EA0;
}
.xian-02__system .el-dialog .expand {
width: 120px;
}
.xian-02__system .el-dialog .el-button:focus span {
border: 1px dashed #315253;
}
.xian-02__system .el-dialog .el-button:active {
border: 2px inset #B7D4D5;
}
.xian-02__system .el-dialog .el-button:disabled {
border: 2px inset #B7D4D5;
}
.xian-02__system .el-dialog .el-button:disabled span {
border: 0px;
}
.xian-02__system .el-select-dropdown__item {
background: #5F9EA0;
}
.xian-02__system .el-select-dropdown__list {
background: #5F9EA0;
}
.xian-02__select-option .el-select-dropdown__item{
background: #5F9EA0;
}
.xian-02__select-option .el-scrollbar__wrap {
background-color: #5F9EA0;
overflow: hidden;
overflow-y: scroll;
}
.xian-02__select-option{
border-style: solid;
border-width: 1px;
border-color: #335658 #99C1C3 #99C1C3 #335658;
border-radius: 0;
background:#5F9EA0;
}
.xian-02__select-option .el-scrollbar{
border-style: solid;
border-width: 1px;
border-color: #467576 #A0C6C7 #A0C6C7 #467576;
border-radius: 0;
}
.xian-02__select-option .el-select-dropdown__item.selected{
color: #fff;
}
.xian-02__select-option .el-select-dropdown__item{
color: #000;
}
.xian-02__system .el-dialog .el-transfer-panel{
border-style: solid;
border-width: 1px;
border-color: #467576 #A0C6C7 #A0C6C7 #467576;
border-radius: 0;
background: #5F9EA0;
}
.xian-02__system .el-dialog .el-transfer .el-button{
width: 40px;
}
.xian-02__system .el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span {
color: #000;
}
.xian-02__system .el-dialog .el-transfer-panel .el-transfer-panel__header {
background: #5F9EA0;
border-bottom: 1px solid #467576;
}
.xian-02__system .el-dialog .el-transfer-panel .el-transfer-panel__empty {
color: #5F9EA0;
}
.xian-02__system .el-dialog .el-input {
border-style:solid;
border-width: 1px;
border-color: #335658 #99C1C3 #99C1C3 #335658;
height: 22px !important;
line-height: 22px !important;
background: #5F9EA0;
}
.xian-02__system .el-dialog .el-input__inner {
color: #000;
background: #5F9EA0 !important;
border-style:solid;
border-width: 1px;
border-color: #467576 #A0C6C7 #A0C6C7 #467576;
border-radius: 0px !important;
box-sizing: border-box;
height: 22px !important;
line-height: 22px !important;
}
/*.xian-02__system .el-dialog .el-input.is-disabled .el-input__inner {*/
/*background: #F0F0F0 !important;*/
/*}*/
.xian-02__system .el-dialog .el-textarea {
border-style:solid;
border-width: 1px;
border-color: #335658 #99C1C3 #99C1C3 #335658;
border-radius: 0;
}
.xian-02__system .el-dialog .el-textarea .el-textarea__inner {
color: #000;
background: #5F9EA0 !important;
border-style:solid;
border-width: 1px;
border-color: #467576 #A0C6C7 #A0C6C7 #467576;
border-radius: 0px !important;
box-sizing: border-box;
}
.xian-02__system .el-dialog .el-textarea.is-disabled .el-textarea__inner {
background: #F0F0F0 !important;
}
.xian-02__system .el-dialog .el-table--border th.gutter {
background: #EBEADB !important;
}
.xian-02__system .el-dialog .el-table {
border: 2px inset #E9E9E9;
color: #000 !important;
}
.xian-02__system .el-dialog .el-table .cell {
height: 22px;
line-height: 22px;
}
.xian-02__system .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-02__system .el-dialog .el-table tr td {
height: 20px !important;
padding: 0px;
}
.xian-02__system .el-dialog .el-table .el-table__empty-text {
top: 15px !important;
}
.xian-02__system .el-dialog .current-row>td {
background: #3399FF !important;
color: #fff !important;
}
.xian-02__system .el-dialog .el-checkbox__inner {
border: 1px inset #dcdfe6 !important;
}
.xian-02__system .el-dialog .el-checkbox__label {
color: #000 !important;
}
.xian-02__system .el-dialog .el-checkbox.is-disabled .el-checkbox__inner {
background: #E6E6E6 !important;
}
.xian-02__system .el-dialog .el-checkbox.is-disabled .el-checkbox__label {
color: #C5C9CC !important;
}
.xian-02__system .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner {
background: #fff !important;
border: 1px inset #dcdfe6 !important;
}
.xian-02__system .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-02__system .el-dialog .el-radio__inner {
border: 1px inset #dcdfe6 !important;
}
.xian-02__system .el-dialog .el-radio__label {
color: #000 !important;
}
.xian-02__system .el-dialog .el-radio__input.is-checked .el-radio__inner {
background: #fff !important;
border: 1px inset #dcdfe6 !important;
}
.xian-02__system .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-02__system .el-dialog .el-radio.is-disabled .el-radio__inner {
background: #E6E6E6 !important;
}
.xian-02__system .el-dialog .el-radio.is-disabled .el-radio__label {
color: #C5C9CC !important;
}
.xian-02__system .el-dialog .base-label {
background: #5F9EA0;
position: relative;
left: -15px;
top: -18px;
}
.xian-02__system .el-dialog .el-form-item label {
font-weight: normal !important;
color: #000 !important;
}
.xian-02__system .el-dialog .context {
height: 100px;
border: 2px inset #E2E2E2;
overflow-y: scroll;
}
.xian-02__system .el-dialog .table {
margin-top: 10px;
}
.xian-02__system .el-dialog .notice {
margin-left: 62px;
line-height: 30px;
}
.xian-02__system .el-dialog .button-group {
margin-top: 20px;
}
.xian-02__system.request_box .content-box .el-table__body-wrapper .el-table__row{
background: #000;
height: 30px;
color: #518E86;
}
.xian-02__system.request_box .content-box .el-table__body-wrapper .el-table__row.hover-row td{
background: #d5ecf7;
}
.xian-02__system.request_box .content-box .el-table__body-wrapper .el-table__row.current-row td{
background: #d5ecf7;
}
.xian-02__system .el-select .el-input__suffix {
display: flex;
justify-self: center;
align-items: center;
}
.xian-02__system .el-select .is-focus .el-input__suffix {
display: flex;
justify-self: center;
align-items: center;
}
.xian-02__system .el-scrollbar__thumb {
border-style:solid;
border-width: 1px;
border-color: #335658 #99C1C3 #99C1C3 #335658;
background: #518E86;
}
.xian-02__system.train-updatePlan .el-dialog__body,
.xian-02__system.train-alertor .el-dialog__body,
.xian-02__system.train-runLevel .el-dialog__body {
color: #000!important;
}
.xian-02__system.train-runLevel .train-run-level-radio_box .el-radio__inner{
border-radius: 0;
transform: rotate(45deg);
width: 12px;
border: none!important;
height: 12px;
background: #508F86;
border-color: #9ABFB2 #284743 #284743 #9ABFB2 !important;
border-width: 2px!important;
border-style: solid!important;
}
.xian-02__system.train-runLevel .train-run-level-radio_box .is-checked .el-radio__inner{
background: #DEF003!important;
border-color: #284743 #9ABFB2 #9ABFB2 #284743 !important;
border-width: 2px!important;
border-style: solid!important;
}
.xian-02__system.train-runLevel .train-run-level-radio_box .is-checked .el-radio__inner::after{
width: 0px!important;
height: 0px!important;
}
.xian-02__system.train-updatePlan .el-dialog .el-transfer-panel {
width: 45%;
float: left;
}
.xian-02__system.train-updatePlan .el-dialog .el-transfer{
overflow: hidden;
height: 190px;
padding: 10px;
padding-top: 0;
}
.xian-02__system.train-updatePlan .el-dialog .el-transfer__buttons {
width: 10%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
float: left;
padding: 0;
height: 100%;
}
.xian-02__system.train-updatePlan .el-dialog .el-transfer__buttons .el-button {
margin: 0;
margin-bottom: 10px;
}
.xian-02__system.train-updatePlan .el-dialog .el-transfer-panel .el-transfer-panel__header {
height: 0;
overflow: hidden;
border: 0;
}
.xian-02__system.train-updatePlan .el-dialog .el-transfer-panel__item .el-checkbox__input {
display: none;
}
.xian-02__system.train-updatePlan .el-dialog .el-transfer-panel .el-transfer-panel__list,
.xian-02__system.train-updatePlan .el-dialog .el-transfer-panel .el-transfer-panel__body{
height: 165px;
overflow: auto;
}
.xian-02__system.train-updatePlan .el-dialog .el-transfer-panel__item.is-checked {
background: gray;
}
.xian-02__system.train-updatePlan .el-dialog .el-transfer-panel__list {
overflow: auto;
}
.xian-02__system.train-updatePlan .el-dialog .el-transfer-panel__item{
width: 100%;
margin: 0;
padding-left: 3px;
height: 22px;
}
.xian-02__system.train-updatePlan .el-dialog .el-transfer-panel__item .el-checkbox__label {
padding: 0;
}
</style>

View File

@ -4,16 +4,16 @@
<menu-cancel ref="menuCancel" />
<!-- <menu-auto-trun-route ref="menuAutoTrunRoute" :selected="selected" /> -->
<!-- <menu-station-control ref="menuStationControl" :selected="selected" /> -->
<menu-switch ref="menuSwitch" :selected="selected" />
<menu-signal ref="menuSignal" :selected="selected" />
<menu-section ref="menuSection" :selected="selected" />
<menu-train ref="menuTrain" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" />
<menu-switch ref="menuSwitch" :selected="selected" :work="'localWork'" />
<menu-signal ref="menuSignal" :selected="selected" :work="'localWork'" />
<menu-section ref="menuSection" :selected="selected" :work="'localWork'" />
<menu-train ref="menuTrain" :selected="selected" :work="'localWork'" />
<menu-station ref="menuStation" :selected="selected" :work="'localWork'" />
<!-- <menu-limit ref="menuLimit" :selected="selected" /> -->
<passive-contorl ref="passiveControl" />
<passive-contorl ref="passiveControl" :work="'localWork'" />
<menu-request ref="menuRequest" />
<menu-station-stand ref="menuStationStand" :selected="selected" @popMenuStationStand="popMenuStationStand" @totalMenuEvent="totalMenuEvent" />
<pop-station-stand ref="popStationStand" :selected="selected" @closeMenuStationStand="closeMenuStationStand" />
<menu-station-stand ref="menuStationStand" :selected="selected" :work="'localWork'" @popMenuStationStand="popMenuStationStand" @totalMenuEvent="totalMenuEvent" />
<pop-station-stand ref="popStationStand" :selected="selected" :work="'localWork'" @closeMenuStationStand="closeMenuStationStand" />
</div>
</template>

View File

@ -1,6 +1,6 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-class="xian-02__pop_tip_station" :tip-msg="topTip" disabledColor="#aaa"/>
<pop-menu ref="popMenu" :menu="menu" pop-class="xian-02__pop_tip_station" :tip-msg="topTip" disabled-color="#aaa" />
<section-control ref="sectionControl" pop-class="xian-02__system" />
<section-un-lock ref="sectionUnLock" />
<speed-limit-control ref="speedLimitControl" pop-class="xian-02__system" />
@ -30,6 +30,7 @@ import LoadSpareTrain from '@/jmapNew/theme/components/menus/dialog/loadSpareTra
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import SpeedLimit from './menuDialog/speedLimit';
import SpeedLimitConfirm from './menuDialog/speedLimitConfirm';
import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'SectionMenu',
@ -51,90 +52,126 @@ export default {
default() {
return null;
}
},
work: {
type: String,
default() {
return '';
}
}
},
data() {
return {
topTip: '',
menu: [],
menuNormal: {
Local: [
{
label: '区段故障解锁',
handler: this.fault,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
}
// {
// label: '',
// handler: this.active,
// cmdType: CMD.Section.CMD_SECTION_ACTIVE
// },
// {
// label: '',
// handler: this.split,
// cmdType: CMD.Section.CMD_SECTION_CUT_OFF
// }
// {
// label: '',
// handler: this.lock,
// cmdType: CMD.Section.CMD_SECTION_BLOCK
// },
// {
// label: '',
// handler: this.unlock,
// cmdType: CMD.Section.CMD_SECTION_UNBLOCK
// }
],
Center: [
{
label: '区段封锁',
handler: this.lock,
cmdType: CMD.Section.CMD_SECTION_BLOCK
menuNormal: [
{
label: '区段故障解锁',
handler: this.fault,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
isDisabled: (section, work) => {
return false;
},
{
label: '区段解封',
handler: this.unlock,
cmdType: CMD.Section.CMD_SECTION_UNBLOCK
isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work === 'localWork'
},
// {
// label: '',
// handler: this.active,
// cmdType: CMD.Section.CMD_SECTION_ACTIVE
// },
// {
// label: '',
// handler: this.split,
// cmdType: CMD.Section.CMD_SECTION_CUT_OFF
// }
// {
// label: '',
// handler: this.lock,
// cmdType: CMD.Section.CMD_SECTION_BLOCK
// },
// {
// label: '',
// handler: this.unlock,
// cmdType: CMD.Section.CMD_SECTION_UNBLOCK
// }
// ],
// Center: [
{
label: '区段封锁',
handler: this.lock,
cmdType: CMD.Section.CMD_SECTION_BLOCK,
isDisabled: (section, work) => {
if (work === 'localWork') {
return section.blockade === 1;
} else {
return section.blockade === 1;
}
},
{
// disabled
label: '设备标签',
disabled: true,
children: [
{
label: '创建设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '查看设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '更改设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '删除设备标签',
disabled: true,
handler: this.undeveloped
}
]
isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work === 'dispatchWork'
},
{
label: '区段解封',
handler: this.unlock,
cmdType: CMD.Section.CMD_SECTION_UNBLOCK,
isDisabled: (section, work) => {
if (work === 'localWork') {
return section.blockade !== 1;
} else {
return section.blockade !== 1;
}
},
{
label: '设置临时限速',
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work === 'dispatchWork'
},
{
// disabled
label: '设备标签',
disabled: true,
children: [
{
label: '创建设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '查看设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '更改设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '删除设备标签',
disabled: true,
handler: this.undeveloped
}
],
isDisabled: (section, work) => {
return true;
},
{
label: '帮助',
disabled: true,
handler: this.undeveloped
}
]
},
isShow: (section, work) => work === 'dispatchWork'
},
{
label: '设置临时限速',
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
isDisabled: (section, work) => {
return false;
},
isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work === 'dispatchWork'
},
{
label: '帮助',
disabled: true,
handler: this.undeveloped,
isDisabled: (section, work) => {
return true;
},
isShow: (section, work) => work === 'dispatchWork'
}
],
menuForce: [
{
label: '设置故障',
@ -180,7 +217,7 @@ export default {
mounted() {
const isDev = process.env.NODE_ENV === 'development';
if (isDev) {
this.menuNormal.Center.push({
this.menuNormal.push({
label: '新建计划车',
handler: this.addPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan
@ -199,6 +236,13 @@ export default {
if (this.selected.type != '04') {
// this.menu = this.menuNormal.Center;
// this.menu = MenuContextHandler.covert2(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
const status = judgeStationControl(this.selected.belongStation, this.selected.stationCode, this.work);
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});
} else {
this.menu = [];
}
@ -310,9 +354,9 @@ export default {
setSpeed() {
commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{
if (valid) {
// 使
// 使
// this.$refs.speedLimit.doShow(operate, this.selected);
this.$refs.speedLimitControl.doShow(operate, this.selected);
this.$refs.speedLimitControl.doShow(operate, this.selected);
}
});
},

View File

@ -1,6 +1,6 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" :tip-msg="topTip" disabledColor="#aaa" pop-class="xian-02__pop_tip_station" />
<pop-menu ref="popMenu" :menu="menu" :tip-msg="topTip" disabled-color="#aaa" pop-class="xian-02__pop_tip_station" />
<route-detail ref="routeDetail" />
<notice-info ref="noticeInfo" pop-class="xian-02__system" />
<set-fault ref="setFault" pop-class="xian-02__system" />
@ -17,6 +17,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'SignalMenu',
@ -32,152 +33,136 @@ export default {
default() {
return null;
}
},
work: {
type: String,
default() {
return '';
}
}
},
data() {
return {
topTip: '',
menu: [],
menuNormal: {
Local: [
{
label: '始端/终端选择',
handler: this.arrangementRoute,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
},
{
label: '取消进路',
handler: this.cancelTrainRoute,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
},
{
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.lock,
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
},
{
label: '终端信号解封',
handler: this.unlock,
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
},
{
label: '引导信号',
handler: this.guideSignal,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
},
// disabled
{
label: '设备标签',
disabled: true,
children: [
{
label: '创建设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '查看设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '更改设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '删除设备标签',
disabled: true,
handler: this.undeveloped
}
]
},
{
label: '帮助',
handler: this.detail,
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
menuNormal: [
{
label: '始端/终端选择',
handler: this.arrangementRoute,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
isDisabled: (signal, work) => {
if (work === 'localWork') {
return signal.lock === 1;
} else {
return signal.lock === 1;
}
}
],
Center: [
{
label: '始端/终端选择',
handler: this.arrangementRoute,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
},
{
label: '取消进路',
handler: this.cancelTrainRoute,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
},
{
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.lock,
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
},
{
label: '终端信号解封',
handler: this.unlock,
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
},
{
label: '引导信号',
handler: this.guideSignal,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
},
{
// disabled
label: '设备标签',
disabled: true,
children: [
{
label: '创建设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '查看设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '更改设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '删除设备标签',
disabled: true,
handler: this.undeveloped
}
]
},
{
label: '帮助',
handler: this.detail,
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
},
{
label: '取消进路',
handler: this.cancelTrainRoute,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
isDisabled: (signal, work) => {
if (work === 'localWork') {
return signal.lock !== 1;
} else {
return signal.lock !== 1;
}
}
]
},
},
{
label: '开放自动进路',
handler: this.setAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO,
isDisabled: (signal, work) => {
if (work === 'localWork') {
return signal.fleetMode === 1;
} else {
return signal.fleetMode === 1;
}
}
},
{
label: '关闭自动进路',
handler: this.cancelAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO,
isDisabled: (signal, work) => {
if (work === 'localWork') {
return signal.fleetMode !== 1;
} else {
return signal.fleetMode !== 1;
}
}
},
{
label: '终端信号封锁',
handler: this.lock,
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK,
isDisabled: (signal, work) => {
if (work === 'localWork') {
return signal.blockade === 1;
} else {
return signal.blockade === 1;
}
}
},
{
label: '终端信号解封',
handler: this.unlock,
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK,
isDisabled: (signal, work) => {
if (work === 'localWork') {
return signal.blockade !== 1;
} else {
return signal.blockade !== 1;
}
}
},
{
label: '引导信号',
handler: this.guideSignal,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
isDisabled: (signal, work) => {
return false;
}
},
// disabled
{
label: '设备标签',
disabled: true,
isDisabled: (signal, work) => true,
children: [
{
label: '创建设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '查看设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '更改设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '删除设备标签',
disabled: true,
handler: this.undeveloped
}
]
},
{
label: '帮助',
handler: this.detail,
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL,
isDisabled: (signal, work) => {
return false;
}
}
],
menuEnabled: [
{
label: '使能',
@ -208,11 +193,7 @@ export default {
handler: this.triggerFaultManagement,
cmdType: CMD.Fault.CMD_TRIGGER_FAULT
}
],
prdType2ControlModeMap: {
'01': 'Local',
'02': 'Center'
}
]
};
},
computed: {
@ -227,9 +208,6 @@ export default {
'routeList',
'routeData'
]),
prdType() {
return this.$store.state.training.prdType;
},
group() {
return this.$route.query.group;
}
@ -245,9 +223,9 @@ export default {
}
},
'$store.state.menuOperation.leftClickCount': function (val) {
// const control = MenuContextHandler.getStationControl(this.selected);
const controlMode = this.prdType2ControlModeMap[this.prdType];
if (this.selected._type === 'Signal' && control.controlMode == controlMode) {
// const control = MenuContextHandler.getStationControl(this.selected);
const centralStation = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode);
if (this.selected._type === 'Signal' && this.selected.controlMode == centralStation.controlMode) {
this.arrangementRoute();
}
}
@ -260,7 +238,14 @@ export default {
};
},
initMenu() {
this.menu = MenuContextHandler.covert2(this.menuNormal);
// this.menu = MenuContextHandler.covert2(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work);
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});
// this.menu = this.menuNormal.Center;
//
if (this.operatemode === OperateMode.FAULT) {

View File

@ -32,165 +32,188 @@ export default {
default() {
return null;
}
},
work: {
type: String,
default() {
return '';
}
}
},
data() {
return {
topTip: '车站 (CP)',
menu: [],
menuNormal: {
Local: [
{
label: '本地控制许可',
children: [
{
label: '请求',
handler: this.setStationControl,
cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL
},
// {
// label: '',
// handler: this.undeveloped
// },
{
label: '取消',
handler: this.setCenterControl,
cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL
},
// /** */
// CMD_CM_EMERGENCY_STATION_CONTROL: {value:'CM_Emergency_Station_Control', label: ''},
{
label: '紧急本地控制',
handler: this.setEmergencyControl,
cmdType: CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL
menuNormal: [
{
label: '本地控制许可',
children: [
{
label: '请求',
handler: this.setStationControl,
cmdType: this.work === 'localWork' ? CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL : CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL,
isDisabled: (station, work) => {
if (work === 'localWork') {
return station.controlMode !== 'Center';
} else {
return station.controlMode === 'Center';
}
}
]
},
{
// disabled
label: '授权',
disabled: true,
handler: this.undeveloped,
isShow: (station, work) => false
},
{
label: '取消',
handler: this.setCenterControl,
cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL,
isDisabled: (station, work) => {
if (work === 'localWork') {
return station.controlMode === 'Center';
} else {
return station.controlMode !== 'Center';
}
},
isShow: (station, work) => {
return work === 'localWork';
}
},
// /** */
// CMD_CM_EMERGENCY_STATION_CONTROL: {value:'CM_Emergency_Station_Control', label: ''},
{
label: '紧急本地控制',
handler: this.setEmergencyControl,
cmdType: CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL,
isDisabled: (station, work) => {
return station.controlMode === 'Emergency';
},
isShow: (station, work) => {
return work === 'localWork';
}
}
]
},
{
label: '进路模式',
children: [
{
label: '自动',
handler: this.atsAutoControlALL,
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
isDisabled: (station, work) => {
return false;
}
},
{
label: '人工',
handler: this.humanControlALL,
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING,
isDisabled: (station, work) => {
return false;
}
}
],
isShow: (station, work) => {
return work === 'dispatchWork';
}
],
Center: [
{
label: '本地控制许可',
children: [
{
label: '请求',
handler: this.setStationControl,
cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL
},
{
// disabled
label: '授权',
disabled: true,
handler: this.undeveloped
},
{
// disabled
label: '取消',
disabled: true,
handler: this.undeveloped
},
{
// disabled
label: '紧急本地控制',
disabled: true,
handler: this.undeveloped
}
]
},
{
label: '进路模式',
children: [
{
label: '自动',
handler: this.atsAutoControlALL,
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING
},
{
label: '人工',
handler: this.humanControlALL,
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING
}
]
},
{
// disabled
label: '通信',
disabled: true,
children: [
{
label: '本地',
disabled: true,
handler: this.undeveloped
},
{
label: '重新连接',
disabled: true,
handler: this.undeveloped
}
]
},
// {
// label: '',
// children: [
// {
// label: '线',
// handler: this.setPriorityStrategy
// },
// {
// label: '线',
// handler: this.setLineStrategy
// },
// {
// label: '线',
// handler: this.setLateralStrategy
// }
// ]
// },
{
// disabled
label: '设备标签',
disabled: true,
children: [
{
label: '创建设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '查看设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '更改设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '删除设备标签',
disabled: true,
handler: this.undeveloped
}
]
},
{
// disabled
label: '取消验证',
disabled: true,
children: [
{
label: '取消验证',
disabled: true,
handler: this.undeveloped
},
{
label: '恢复验证',
disabled: true,
handler: this.undeveloped
}
]
}
]
},
},
{
// disabled
label: '通信',
disabled: true,
children: [
{
label: '本地',
disabled: true,
handler: this.undeveloped,
isDisabled: (station, work) => true
},
{
label: '重新连接',
disabled: true,
handler: this.undeveloped,
isDisabled: (station, work) => true
}
],
isDisabled: (station, work) => true,
isShow: (station, work) => work === 'dispatchWork'
},
// {
// label: '',
// children: [
// {
// label: '线',
// handler: this.setPriorityStrategy
// },
// {
// label: '线',
// handler: this.setLineStrategy
// },
// {
// label: '线',
// handler: this.setLateralStrategy
// }
// ]
// },
{
// disabled
label: '设备标签',
disabled: true,
children: [
{
label: '创建设备标签',
disabled: true,
handler: this.undeveloped,
isDisabled: (station, work) => true
},
{
label: '查看设备标签',
disabled: true,
handler: this.undeveloped,
isDisabled: (station, work) => true
},
{
label: '更改设备标签',
disabled: true,
handler: this.undeveloped,
isDisabled: (station, work) => true
},
{
label: '删除设备标签',
disabled: true,
handler: this.undeveloped,
isDisabled: (station, work) => true
}
],
isDisabled: (station, work) => true,
isShow: (station, work) => work === 'dispatchWork'
},
{
// disabled
label: '取消验证',
disabled: true,
children: [
{
label: '取消验证',
disabled: true,
handler: this.undeveloped,
isDisabled: (station, work) => true
},
{
label: '恢复验证',
disabled: true,
handler: this.undeveloped,
isDisabled: (station, work) => true
}
],
isDisabled: (station, work) => true,
isShow: (station, work) => work === 'dispatchWork'
}
],
menuForce: [
{
label: '设置ZC故障',
@ -246,6 +269,22 @@ export default {
// this.menu = [...this.menuNormal.Center];
//
// this.menu = MenuContextHandler.covert(this.menuNormal);
const selected = this.selected;
const work = this.work;
function setDisabledShow(item) {
if (item.children) {
item.children.forEach(ii => {
setDisabledShow(ii);
});
}
item.disabled = item.isDisabled ? item.isDisabled(selected, work) : false;
item.show = item.isShow ? item.isShow(selected, work) : true;
}
this.menu = [];
this.menuNormal.forEach(menuItem => {
setDisabledShow(menuItem);
this.menu.push(menuItem);
});
if (this.selected.reentry) {
const menuAdd = {
label: '折返模式',

View File

@ -1,6 +1,6 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" disabledColor="#aaa"/>
<pop-menu ref="popMenu" :menu="menu" disabled-color="#aaa" />
<station-control ref="stationControl" />
</div>
</template>
@ -25,15 +25,18 @@ export default {
default() {
return null;
}
},
work: {
type: String,
default() {
return '';
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [],
Center: []
},
menuNormal: [],
menuForce: [
]
};
@ -66,6 +69,12 @@ export default {
initMenu() {
//
// 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) {
this.menu = this.menuForce;

View File

@ -1,6 +1,6 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-class="xian-02__pop_tip_station" :tip-msg="topTip" disabledColor="#aaa" />
<pop-menu ref="popMenu" :menu="menu" pop-class="xian-02__pop_tip_station" :tip-msg="topTip" disabled-color="#aaa" />
<switch-control ref="switchControl" pop-class="xian-02__system" />
<section-un-lock ref="sectionUnLock" pop-class="xian-02__system" />
<speed-limit-control ref="speedLimitControl" pop-class="xian-02__system" />
@ -24,6 +24,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'SwitchMenu',
@ -42,100 +43,108 @@ export default {
default() {
return null;
}
},
work: {
type: String,
default() {
return '';
}
}
},
data() {
return {
topTip: '',
menu: [],
menuNormal: {
Local: [
{
label: '道岔定位',
handler: this.locate,
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
},
{
label: '道岔反位',
handler: this.reverse,
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
},
{
label: '道岔单锁',
handler: this.lock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
},
{
label: '道岔单解',
handler: this.unlock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
menuNormal: [
{
label: '道岔定位',
handler: this.locate,
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION,
isDisabled: (station, work) => {
if (work === 'localWork') {
return station.normalPosition === 1;
} else {
return station.normalPosition === 1;
}
}
// {
// label: '',
// handler: this.block,
// cmdType: CMD.Switch.CMD_SWITCH_BLOCK
// },
// {
// label: '',
// handler: this.unblock,
// cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
// }
],
Center: [
{
label: '道岔定位',
handler: this.locate,
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
},
{
label: '道岔反位',
handler: this.reverse,
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
},
{
label: '道岔单锁',
handler: this.lock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
},
{
label: '道岔单解',
handler: this.unlock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
},
{
// disabled
label: '设备标签',
disabled: true,
children: [
{
label: '创建设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '查看设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '更改设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '删除设备标签',
disabled: true,
handler: this.undeveloped
}
]
},
{
label: '帮助',
disabled: true,
handler: this.undeveloped
},
{
label: '道岔反位',
handler: this.reverse,
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION,
isDisabled: (station, work) => {
if (work === 'localWork') {
return station.reversePosition === 1;
} else {
return station.reversePosition === 1;
}
}
]
},
},
{
label: '道岔单锁',
handler: this.lock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK,
isDisabled: (station, work) => {
if (work === 'localWork') {
return station.singleLock === 1;
} else {
return station.singleLock === 1;
}
}
},
{
label: '道岔单解',
handler: this.unlock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK,
isDisabled: (station, work) => {
if (work === 'localWork') {
return station.singleLock !== 1;
} else {
return station.singleLock !== 1;
}
}
},
{
// disabled
label: '设备标签',
disabled: true,
children: [
{
label: '创建设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '查看设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '更改设备标签',
disabled: true,
handler: this.undeveloped
},
{
label: '删除设备标签',
disabled: true,
handler: this.undeveloped
}
],
isDisabled: (station, work) => {
return true;
},
isShow: (station, work) => work === 'dispatchWork'
},
{
label: '帮助',
disabled: true,
handler: this.undeveloped,
isDisabled: (station, work) => {
return true;
},
isShow: (station, work) => work === 'dispatchWork'
}
],
menuEnabled: [
{
label: '使能',
@ -199,6 +208,13 @@ export default {
initMenu() {
//
// this.menu = MenuContextHandler.covert2(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work);
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});
//
if (this.operatemode === OperateMode.FAULT) {
if (!this.$store.state.scriptRecord.bgSet) {

View File

@ -60,172 +60,181 @@ export default {
default() {
return null;
}
},
work: {
type: String,
default() {
return '';
}
}
},
data() {
return {
topTip: '',
menu: [],
menuNormal: {
Local: [
],
Center: [
{
label: '追踪号',
children: [
{
label: '目的地ID',
handler: this.updateDestination,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '删除ID',
handler: this.deletDestionation,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '更改追踪号',
handler: this.updateTid,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '交换追踪号',
handler: this.switchTid,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '运行等级',
handler: this.handleRunLevel,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '列车模式',
handler: this.setTrainMode,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '惰性模式',
handler: this.setIdleRunningMode,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '旁路模式',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
}
]
},
{
label: '列车明细',
handler: this.getTrainDetail,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '请求',
children: [
{
label: '扣车/放行',
children:[
{
label: '扣车',
handler: this.setDetainTrain,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '发车 ',
handler: this.setTrainDeparture,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
}
]
},
{
label: '停车/放行',
children:[
{
label: '停车',
handler: this.trainOrderStop
},
{
label: '放行 ',
handler: this.trainCancleOrderStop
}
]
// cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '就绪状态',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '测试',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '救援列车',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '开车门',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '关车门',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
}
]
},
{
label: '设备标签',
children: [
{
label: '创建设备标签',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '查看设备标签',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '更改设备标签',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '删除设备标签',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
}
]
},
{
label: '列车报警确认',
children: [
{
label: '完整性报警确认',
handler: this.trainAlertor,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
}
]
},
{
label: '更新列车计划',
handler: this.updateTrainPlan,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '帮助',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
}
]
},
menuNormal: [
{
label: '追踪号',
children: [
{
label: '目的地ID',
handler: this.updateDestination,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '删除ID',
handler: this.deletDestionation,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '更改追踪号',
handler: this.updateTid,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '交换追踪号',
handler: this.switchTid,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '运行等级',
handler: this.handleRunLevel,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '列车模式',
handler: this.setTrainMode,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '惰性模式',
handler: this.setIdleRunningMode,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '旁路模式',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
}
],
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '列车明细',
handler: this.getTrainDetail,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE,
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '请求',
children: [
{
label: '扣车/放行',
children:[
{
label: '扣车',
handler: this.setDetainTrain,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '发车 ',
handler: this.setTrainDeparture,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
}
]
},
{
label: '停车/放行',
children:[
{
label: '停车',
handler: this.trainOrderStop
},
{
label: '放行 ',
handler: this.trainCancleOrderStop
}
]
// cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '就绪状态',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '测试',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '救援列车',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '开车门',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '关车门',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
}
],
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '设备标签',
children: [
{
label: '创建设备标签',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '查看设备标签',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '更改设备标签',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '删除设备标签',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
}
],
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '列车报警确认',
children: [
{
label: '完整性报警确认',
handler: this.trainAlertor,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
}
],
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '更新列车计划',
handler: this.updateTrainPlan,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE,
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '帮助',
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE,
isShow: (stand, work) => work === 'dispatchWork'
}
],
menuForce: [
{
label: '设置故障',
@ -331,8 +340,15 @@ export default {
},
initMenu() {
//
if (this.$store.state.training.prdType === '02') {
this.menu = this.menuNormal.Center;
if (this.work === 'dispatchWork') {
// if (this.$store.state.training.prdType === '02') {
// this.menu = this.menuNormal.Center;
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) {

View File

@ -69,6 +69,14 @@ export default {
components: {
NoticeInfo
},
props: {
work: {
type: String,
default() {
return '';
}
}
},
data() {
return {
dialogShow: false,
@ -88,10 +96,10 @@ export default {
},
computed: {
targetStatus() {
if (this.$store.state.training.prdType == '01') {
if (this.work == 'localWork') {
return '01';
}
if (this.$store.state.training.prdType == '02') {
if (this.work == 'dispatchWork') {
return '02';
}
return '';
@ -252,7 +260,7 @@ export default {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.agree.operation,
val: this.selection[0].code,
prdType: this.$store.state.training.prdType
prdType: this.targetStatus
};
this.clearTimer();
@ -273,7 +281,7 @@ export default {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
val: this.tableData[0].code,
prdType: this.$store.state.training.prdType
prdType: this.targetStatus
};
this.clearTimer();

View File

@ -1,6 +1,6 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" trigger="click" :tip-msg="topTip" text-align="left" pop-class="xian-02__pop_tip_station" disabledColor="#aaa" />
<pop-menu ref="popMenu" :menu="menu" trigger="click" :tip-msg="topTip" text-align="left" pop-class="xian-02__pop_tip_station" disabled-color="#aaa" />
<notice-info ref="noticeInfo" pop-class="xian-02__system" />
<update-stand-plan ref="updateStandPlan" :selected="selected" />
<warning-confirm ref="warningConfirm" :selected="selected" />
@ -22,6 +22,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'StationStandMenu',
@ -39,154 +40,205 @@ export default {
default: () => {
return null;
}
},
work: {
type: String,
default() {
return '';
}
}
},
data() {
return {
menu: [],
topTip: '',
updateStandPlan: {
Local: [],
Center: [
{
label: '更新站台计划',
handler: this.setStopTime,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
updateStandPlan: [
{
label: '更新站台计划',
handler: this.setStopTime,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
isDisabled: (station, work) => {
return false;
},
{
label: '帮助',
handler: this.setStopTime,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
}
]
},
stopJumping: {
Local: [],
Center: [
{
label: '列车跳停本站',
handler: this.setJumpStop,
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP,
checkDisabled: (selected) => { return selected && (selected.centerHoldTrain||selected.stationHoldTrain) }
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '帮助',
handler: this.setStopTime,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
isShow: (stand, work) => work === 'dispatchWork'
}
],
stopJumping: [
{
label: '列车跳停本站',
handler: this.setJumpStop,
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP,
checkDisabled: (selected) => { return selected && (selected.centerHoldTrain || selected.stationHoldTrain); },
isDisabled: (station, work) => {
return false;
},
{
label: '取消列车跳停本站',
handler: this.cancelJumpStop,
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '取消列车跳停本站',
handler: this.cancelJumpStop,
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP,
isDisabled: (station, work) => {
return false;
},
{
label: '帮助',
handler: this.setStopTime,
cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
}
]
},
allTrainStopJump: {
Local: [],
Center: [
{
label: '设备标签',
handler: this.setStopTime,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '帮助',
handler: this.setStopTime,
cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS,
isDisabled: (station, work) => {
return false;
},
{
label: '帮助',
handler: this.setStopTime,
cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
}
]
},
standDetain: {
Local: [],
Center: [
{
label: '扣车',
handler: this.setStandDetain,
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
checkDisabled: (selected) => { return selected && selected.allSkip }
isShow: (stand, work) => work === 'dispatchWork'
}
],
allTrainStopJump: [
{
label: '设备标签',
handler: this.setStopTime,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
isDisabled: (station, work) => {
return false;
},
{
label: '发车',
handler: this.cancelStandDetain,
cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART
}
]
},
stoppingProfile: {
Local: [],
Center: [
{
label: '站台停站调整', //
handler: this.setStopTime,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '帮助',
handler: this.setStopTime,
cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS,
isDisabled: (station, work) => {
return false;
},
{
label: '站台停站',
handler: this.setStopTime,
cmdType: ''
isShow: (stand, work) => work === 'dispatchWork'
}
],
standDetain: [
{
label: '扣车',
handler: this.setStandDetain,
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
checkDisabled: (selected) => { return selected && selected.allSkip; },
isDisabled: (station, work) => {
return false;
},
{
label: '帮助',
handler: this.setStopTime,
cmdType: ''
}
]
},
psdInfoConfirm: {
Local: [],
Center: [
{
label: '站台屏蔽门报警确认',
handler: this.confirmPsdWarning,
cmdType: ''
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '发车',
handler: this.cancelStandDetain,
cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART,
isDisabled: (station, work) => {
return false;
},
{
label: '帮助',
handler: this.setStopTime,
cmdType: ''
}
]
},
upStopProfile: {
Local: [],
Center: [
// {
// label: '线',
// handler: this.setStopTime,
// cmdType: ''
// },
{
label: '站台停站曲线',
handler: this.setUpStopProfile,
cmdType: ''
isShow: (stand, work) => work === 'dispatchWork'
}
],
stoppingProfile: [
{
label: '站台停站调整', //
handler: this.setStopTime,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
isDisabled: (station, work) => {
return false;
},
{
label: '帮助',
handler: this.setUpStopProfile,
cmdType: ''
}
]
},
downStopProfile: {
Local: [],
Center: [
// {
// label: '线',
// handler: this.setDownStopProfile,
// cmdType: ''
// },
{
label: '站台停站曲线',
handler: this.setDownStopProfile,
cmdType: ''
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '站台停站',
handler: this.setStopTime,
cmdType: '',
isDisabled: (station, work) => {
return false;
},
{
label: '帮助',
handler: this.setDownStopProfile,
cmdType: ''
}
]
},
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '帮助',
handler: this.setStopTime,
cmdType: '',
isDisabled: (station, work) => {
return false;
},
isShow: (stand, work) => work === 'dispatchWork'
}
],
psdInfoConfirm: [
{
label: '站台屏蔽门报警确认',
handler: this.confirmPsdWarning,
cmdType: '',
isDisabled: (station, work) => {
return false;
},
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '帮助',
handler: this.setStopTime,
cmdType: '',
isDisabled: (station, work) => {
return false;
},
isShow: (stand, work) => work === 'dispatchWork'
}
],
upStopProfile: [
// {
// label: '线',
// handler: this.setStopTime,
// cmdType: ''
// },
{
label: '站台停站曲线',
handler: this.setUpStopProfile,
cmdType: '',
isDisabled: (station, work) => {
return false;
},
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '帮助',
handler: this.setUpStopProfile,
cmdType: '',
isDisabled: (station, work) => {
return false;
},
isShow: (stand, work) => work === 'dispatchWork'
}
],
downStopProfile: [
// {
// label: '线',
// handler: this.setDownStopProfile,
// cmdType: ''
// },
{
label: '站台停站曲线',
handler: this.setDownStopProfile,
cmdType: '',
isDisabled: (station, work) => {
return false;
},
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: '帮助',
handler: this.setDownStopProfile,
cmdType: '',
isDisabled: (station, work) => {
return false;
},
isShow: (stand, work) => work === 'dispatchWork'
}
],
menuForce: [
{
label: '设置故障',
@ -231,37 +283,49 @@ export default {
self.doClose();
};
},
getMenu(type) {
this.menu = [];
this[type].forEach(menuItem => {
const status = judgeStationControl(this.selected.stationCode, this.selected.deviceStationCode, this.work);
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});
},
initMenu(type) {
//
this.topTip = '';
switch (type) {
case 'updateStandPlan':
this.menu = this.updateStandPlan.Center;
this.menu = this.updateStandPlan;
break;
case 'stopJumping':
// this.menu = MenuContextHandler.covertList(this.stopJumping.Center);
this.getMenu(type);
break;
case 'allTrainStopJump':
this.topTip = '所有列车跳停本站';
// this.menu = MenuContextHandler.covertList(this.allTrainStopJump.Center);
this.getMenu(type);
break;
case 'standDetain':
this.topTip = '站台扣车 SET/CANCEL';
// this.menu = MenuContextHandler.covertList(this.standDetain.Center);
this.getMenu(type);
break;
case 'psdInfoConfirm':
this.topTip = '站台屏蔽门报警-站台屏蔽门信息确认';
this.menu = this.psdInfoConfirm.Center;
this.menu = this.psdInfoConfirm;
break;
case 'upStopProfile':
this.menu = this.upStopProfile.Center;
this.menu = this.upStopProfile;
break;
case 'downStopProfile':
this.menu = this.downStopProfile.Center;
this.menu = this.downStopProfile;
break;
}
//
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}