Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1

 Conflicts:
	src/jmapNew/theme/factory.js
This commit is contained in:
fan 2022-12-08 14:17:38 +08:00
commit 7029394ea8
12 changed files with 110 additions and 1804 deletions

View File

@ -182,7 +182,7 @@ export function localImportMap(data) {
url: '/api/map/local/import',
method: 'post',
data: data
});
});
}
/** 根据group获取排序的车站列表包含车辆段/停车场) */

View File

@ -107,7 +107,7 @@ export default {
.chengdou-03__systerm .el-dialog {
background: #0055E8;
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
border: 1px solid rgb(69, 134, 247);
border: 1px solid #041c7d;
border-radius: 6px;
font-size: 13px !important;
color: #000;
@ -187,7 +187,7 @@ export default {
.chengdou-03__systerm .el-dialog .el-button:disabled {
border: 2px inset #E2E2E2;
}
.chengdou-03__systerm .el-dialog .el-button:disabled span {
border: 0px;
}

View File

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

View File

@ -1,380 +0,0 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
<menu-button ref="menuButton" />
<menu-axle-reset ref="menuAxleReset" :selected="selected" />
<menu-auto-trun-route ref="menuAutoTrunRoute" :selected="selected" />
<menu-station-stand ref="menuStationStand" :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-limit ref="menuLimit" :selected="selected" />
<passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" pop-class="foshan-01__systerm" />
<passive-Timeout ref="passiveTimeout" />
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import MenuSignal from './menuSignal';
import MenuButton from './menuButton';
import MenuAxleReset from './menuAxleReset';
import MenuAutoTrunRoute from './menuAutoTrunRoute';
import MenuStationStand from './menuStationStand';
import MenuSwitch from './menuSwitch';
import MenuSection from './menuSection';
import MenuTrain from './menuTrain';
import MenuStation from './menuStation';
import MenuBar from './menuBar';
import MenuLimit from './menuLimit';
import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout';
export default {
name: 'Menus',
components: {
MenuBar,
MenuButton,
MenuAxleReset,
MenuAutoTrunRoute,
MenuSignal,
MenuSwitch,
MenuSection,
MenuStationStand,
MenuStation,
MenuTrain,
MenuLimit,
PassiveAlarm,
PassiveContorl,
PassiveTimeout
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
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');
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('config/updateMenuBar');
});
}
};
</script>
<style>
.menus .pop-menu {
background: #F0F0F0;
}
.menus .pop-menu span {
color: #000;
}
.menus .pop-menu .is-disabled span {
color: #B4B3B8;
}
.foshan-01__systerm {
overflow: hidden !important;
}
.foshan-01__systerm .el-dialog {
background: linear-gradient(to bottom, #9BB6D3, #B8D0EA);
border: 1px solid rgba(118, 162, 198, 1);
border-radius: 6px;
color: #000;
font-size: 14px;
}
.foshan-01__systerm .el-dialog .el-dialog__header {
padding: 10px;
height: 26px;
}
.foshan-01__systerm .el-dialog .el-dialog__footer {
background: #F0F0F0;
opacity: 1;
}
.foshan-01__systerm .el-dialog .el-dialog__body {
padding: 10px;
margin: 2px;
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
background: #F0F0F0;
opacity: 1;
}
.foshan-01__systerm .el-dialog .el-dialog__title {
position: absolute;
top: 6px;
color: #000;
border-radius: 4px;
padding: 0px 2px;
height: 20px;
line-height: 15px;
font-size: 15px;
}
.foshan-01__systerm .el-dialog .el-dialog__title::before {
content: '';
position: absolute;
top: 0;
left: 0;
filter: blur(7px);
height: 20px;
width: -webkit-fill-available;
background: rgba(190, 190, 190, 0.8);
z-index: -1;
}
.foshan-01__systerm .el-dialog .el-dialog__headerbtn {
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid #fff;
border-radius: 4px;
top: 5px;
right: 5px;
line-height: 18px;
}
.foshan-01__systerm .el-dialog .el-dialog__headerbtn .el-icon-close:before {
font-size: 16px;
}
.foshan-01__systerm .el-dialog .el-dialog__headerbtn .el-dialog__close {
color: #fff;
}
.foshan-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;
}
.foshan-01__systerm .el-dialog .expand {
width: 120px;
}
.foshan-01__systerm .el-dialog .el-button:focus span {
border: 1px dashed gray;
}
.foshan-01__systerm .el-dialog .el-button:active {
border: 2px inset #E2E2E2;
}
.foshan-01__systerm .el-dialog .el-button:disabled {
border: 2px inset #E2E2E2;
}
.foshan-01__systerm .el-dialog .el-button:disabled span {
border: 0px;
}
.foshan-01__systerm .el-dialog .el-input {
border: 2px inset #E9E9E9;
}
.foshan-01__systerm .el-dialog .el-input .el-input__inner {
color: #000;
background: #fff !important;
border: 0px;
border-radius: 0px !important;
box-sizing: border-box;
}
.foshan-01__systerm .el-dialog .el-input.is-disabled .el-input__inner {
background: #F0F0F0 !important;
}
.foshan-01__systerm .el-dialog .el-textarea {
border: 2px inset #E9E9E9;
border-radius: 0px;
}
.foshan-01__systerm .el-dialog .el-textarea .el-textarea__inner {
color: #000;
background: #fff !important;
border: 0px;
border-radius: 0px !important;
box-sizing: border-box;
}
.foshan-01__systerm .el-dialog .el-textarea.is-disabled .el-textarea__inner {
background: #F0F0F0 !important;
}
.foshan-01__systerm .el-dialog .el-table--border th.gutter {
background: #EBEADB !important;
}
.foshan-01__systerm .el-dialog .el-table {
border: 2px inset #E9E9E9;
color: #000 !important;
}
.foshan-01__systerm .el-dialog .el-table .cell {
line-height: unset !important;
}
.foshan-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;
}
.foshan-01__systerm.stand-detain-train .el-dialog .el-table th.is-leaf {
background: #fff !important;
border-right: 1px solid #fff !important;
border-bottom: 1px solid #EBEEF5 !important;
color: #000 !important;
height: 20px !important;
padding: 0px;
}
.foshan-01__systerm.stand-detain-train .el-dialog .el-table th.el-table-column--selection{
border-right: 1px solid #e2e2e2 !important;
}
.foshan-01__systerm.stand-detain-train .el-dialog .el-table .el-table__body-wrapper .el-table__row .el-table-column--selection {
border-right: 1px solid #e2e2e2 !important;
}
.foshan-01__systerm .el-dialog .el-table tr td {
height: 20px !important;
padding: 0px;
}
.foshan-01__systerm .el-dialog .el-table .el-table__empty-text {
top: 15px !important;
line-height: normal;
max-width:60%;
}
.foshan-01__systerm .el-dialog .current-row>td {
background: #3399FF !important;
color: #fff !important;
}
.foshan-01__systerm .el-dialog .el-checkbox__inner {
border: 1px inset #dcdfe6 !important;
}
.foshan-01__systerm .el-dialog .el-checkbox__label {
color: #000 !important;
}
.foshan-01__systerm .el-dialog .el-checkbox.is-disabled .el-checkbox__inner {
background: #E6E6E6 !important;
}
.foshan-01__systerm .el-dialog .el-checkbox.is-disabled .el-checkbox__label {
color: #C5C9CC !important;
}
.foshan-01__systerm .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner {
background: #fff !important;
border: 1px inset #dcdfe6 !important;
}
.foshan-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;
}
.foshan-01__systerm .el-dialog .el-radio__inner {
border: 1px inset #dcdfe6 !important;
}
.foshan-01__systerm .el-dialog .el-radio__label {
color: #000 !important;
}
.foshan-01__systerm .el-dialog .el-radio__input.is-checked .el-radio__inner {
background: #fff !important;
border: 1px inset #dcdfe6 !important;
}
.foshan-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%;
}
.foshan-01__systerm .el-dialog .el-radio.is-disabled .el-radio__inner {
background: #E6E6E6 !important;
}
.foshan-01__systerm .el-dialog .el-radio.is-disabled .el-radio__label {
color: #C5C9CC !important;
}
.foshan-01__systerm .el-dialog .base-label {
background: #F0F0F0;
padding: 0 5px;
position: relative;
left: -15px;
top: -18px;
}
.foshan-01__systerm .el-dialog .el-form-item label {
font-weight: normal !important;
color: #000 !important;
}
.foshan-01__systerm .el-dialog .context {
height: 100px;
border: 2px inset #E2E2E2;
overflow-y: scroll;
}
.foshan-01__systerm .el-dialog .table {
margin-top: 10px;
}
.foshan-01__systerm .el-dialog .notice {
margin-left: 62px;
line-height: 30px;
}
.foshan-01__systerm .el-dialog .button-group {
margin-top: 10px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import LoadSpareTrain from '@/jmapNew/theme/components/menus/dialog/loadSpareTrain';
// import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'SectionMenu',
@ -61,11 +62,10 @@ export default {
handler: this.lock,
cmdType: CMD.Section.CMD_SECTION_BLOCK,
isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.blockade === 1 || device.controlMode !== 'Local';
return section.blockade === 1;
} else {
return section.blockade === 1 || device.controlMode !== 'Center';
return section.blockade === 1;
}
},
isShow: (section, work) => ['01', '02', '03'].includes(section.type)
@ -75,11 +75,10 @@ export default {
handler: this.unlock,
cmdType: CMD.Section.CMD_SECTION_UNBLOCK,
isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.blockade !== 1 || device.controlMode !== 'Local';
return section.blockade !== 1;
} else {
return section.blockade !== 1 || device.controlMode !== 'Center';
return section.blockade !== 1;
}
},
isShow: (section, work) => ['01', '02', '03'].includes(section.type)
@ -89,12 +88,7 @@ export default {
handler: this.fault,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') {
return device.controlMode !== 'Local';
} else {
return device.controlMode !== 'Center';
}
return false;
},
isShow: (section, work) => ['01', '02', '03'].includes(section.type)
},
@ -103,12 +97,7 @@ export default {
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') {
return device.controlMode !== 'Local';
} else {
return device.controlMode !== 'Center';
}
return false;
},
isShow: (section, work) => section.type === '02'
},
@ -117,12 +106,7 @@ export default {
handler: this.cancelSpeed,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED,
isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') {
return device.controlMode !== 'Local';
} else {
return device.controlMode !== 'Center';
}
return false;
},
isShow: (section, work) => section.type === '02'
},
@ -212,7 +196,8 @@ export default {
// this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
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);
});

View File

@ -29,6 +29,7 @@ import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import ConflictRoute from './dialog/conflictRoute';
import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'SignalMenu',
@ -67,12 +68,7 @@ export default {
handler: this.arrangementRoute,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return false;
} else {
return device.controlMode !== 'Center';
}
return false;
}
},
{
@ -80,12 +76,7 @@ export default {
handler: this.cancelTrainRoute,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return false;
} else {
return device.controlMode !== 'Center';
}
return false;
}
},
{
@ -93,11 +84,10 @@ export default {
handler: this.lock,
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.blockade === 1;
return signal.blockade === 1;
} else {
return signal.blockade === 1 || device.controlMode !== 'Center';
return signal.blockade === 1;
}
}
},
@ -106,11 +96,10 @@ export default {
handler: this.unlock,
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.blockade !== 1;
return signal.blockade !== 1;
} else {
return signal.blockade !== 1 || device.controlMode !== 'Center';
return signal.blockade !== 1;
}
}
},
@ -119,12 +108,7 @@ export default {
handler: this.signalClose,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return false;
} else {
return device.controlMode !== 'Center';
}
return false;
}
},
{
@ -132,12 +116,7 @@ export default {
handler: this.reopenSignal,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return false;
} else {
return device.controlMode !== 'Center';
}
return false;
}
},
{
@ -145,12 +124,7 @@ export default {
handler: this.guide,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return false;
} else {
return device.controlMode !== 'Center';
}
return false;
}
},
{
@ -158,69 +132,55 @@ export default {
handler: this.setAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.fleetMode !== 0;
return signal.fleetMode !== 0;
} else {
return signal.fleetMode !== 0 || device.controlMode !== 'Center';
return signal.fleetMode !== 0;
}
},
isShow: (signal, work) => work === 'localWork'
}
},
{
label: '取消联锁自动进路',
handler: this.cancelAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO,
isDisabled: (signal, work) => {
console.log('🚀 ~ file: menuSignal.vue:182 ~ data ~ signal', signal);
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.fleetMode !== 1;
return signal.fleetMode !== 1;
} else {
return signal.fleetMode !== 1 || device.controlMode !== 'Center';
return signal.fleetMode !== 1;
}
},
isShow: (signal, work) => work === 'localWork'
}
},
{
label: '设置联锁自动触发',
handler: this.setAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.ciControl === 1 || !signal.canSetCi;
return signal.ciControl === 1 && !signal.canSetCi;
} else {
return signal.ciControl === 1 || !signal.canSetCi || device.controlMode !== 'Center';
return signal.ciControl === 1 && !signal.canSetCi;
}
},
isShow: (signal, work) => work === 'localWork'
}
},
{
label: '取消联锁自动触发',
handler: this.cancelAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.ciControl !== 1;
return signal.ciControl !== 1;
} else {
return signal.ciControl !== 1 || device.controlMode !== 'Center';
return signal.ciControl !== 1;
}
},
isShow: (signal, work) => work === 'localWork'
}
},
{
label: '进路交人工控',
handler: this.humanControl,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return false;
} else {
return device.controlMode !== 'Center';
}
return false;
}
},
{
@ -228,12 +188,7 @@ export default {
handler: this.atsAutoControl,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return false;
} else {
return device.controlMode !== 'Center';
}
return false;
}
},
{
@ -305,7 +260,8 @@ export default {
// this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
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);
});

View File

@ -22,6 +22,7 @@ import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'StationMenu',
@ -100,8 +101,7 @@ export default {
} else {
return station.controlMode !== 'Center';
}
},
isShow: (station, work) => work === 'localWork'
}
},
{
label: '所有进路交人工控',
@ -113,40 +113,31 @@ export default {
} else {
return station.controlMode !== 'Center';
}
},
isShow: (station, work) => work === 'localWork'
},
}
}
// {
// label: '',
// handler: this.execKeyOperationTest,
// cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST,
// }
{
label: '所有进路交人工控',
handler: this.humanControlALL,
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING,
isDisabled: (station, work) => {
if (work === 'localWork') {
return station.controlMode !== 'Local';
} else {
return station.controlMode !== 'Center';
}
},
isShow: (station, work) => work === 'dispatchWork'
},
{
label: '所有进路交ATS自动控',
handler: this.atsAutoControlALL,
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
isDisabled: (station, work) => {
if (work === 'localWork') {
return station.controlMode !== 'Local';
} else {
return station.controlMode !== 'Center';
}
},
isShow: (station, work) => work === 'dispatchWork'
}
// {
// label: '',
// handler: this.humanControlALL,
// cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING,
// isDisabled: (station, work) => {
// return false;
// },
// isShow: (station, work) => work === 'dispatchWork'
// },
// {
// label: 'ATS',
// handler: this.atsAutoControlALL,
// cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
// isDisabled: (station, work) => {
// return false;
// },
// isShow: (station, work) => work === 'dispatchWork'
// }
// {
// label: '',
// handler: this.execKeyOperationTest,
@ -201,7 +192,8 @@ export default {
// this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
const status = judgeStationControl(this.selected.code, this.selected.stationCode, this.work);
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) || !status : true;
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
this.menu.push(menuItem);
});

View File

@ -29,6 +29,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'StationStandMenu',
@ -67,9 +68,8 @@ export default {
handler: this.setDetainTrain,
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.stationHoldTrain !== 0 || device.controlMode !== 'Local';
return stand.stationHoldTrain !== 0;
} else {
return stand.centerHoldTrain !== 0;
}
@ -80,9 +80,8 @@ export default {
handler: this.cancelDetainTrain,
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.stationHoldTrain !== 1 || device.controlMode !== 'Local';
return stand.stationHoldTrain !== 1;
} else {
return stand.centerHoldTrain !== 1;
}
@ -93,12 +92,7 @@ export default {
handler: this.cancelDetainTrainForce,
cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || device.controlMode !== 'Local';
} else {
return false;
}
return false;
},
isShow: (section, work) => work === 'dispatchWork'
},
@ -107,12 +101,7 @@ export default {
handler: this.detail,
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || device.controlMode !== 'Local';
} else {
return false;
}
return false;
}
},
{
@ -127,7 +116,7 @@ export default {
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP,
isDisabled: (stand, work) => {
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode;
return false;
} else {
return stand.allSkip !== 0;
}
@ -140,7 +129,7 @@ export default {
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP,
isDisabled: (stand, work) => {
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode;
return false;
} else {
return stand.allSkip !== 1 && stand.assignSkip !== 1;
}
@ -213,7 +202,8 @@ export default {
// this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
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);
});
@ -225,15 +215,15 @@ export default {
this.menu = this.menuForce;
}
// PSL
if (this.operatemode !== OperateMode.FAULT && this.work === 'localWork') {
this.menu = [
...this.menu,
{
label: 'PSL',
handler: this.openPsl
}
];
}
// if (this.operatemode !== OperateMode.FAULT && this.work === 'localWork') {
// this.menu = [
// ...this.menu,
// {
// label: 'PSL',
// handler: this.openPsl
// }
// ];
// }
},
doShow(point) {
this.initMenu();

View File

@ -22,6 +22,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'SwitchMenu',
@ -57,11 +58,10 @@ export default {
handler: this.lock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.singleLock === 1 || device.controlMode !== 'Local';
return switchDevice.singleLock === 1;
} else {
return switchDevice.singleLock === 1 || device.controlMode !== 'Center';
return switchDevice.singleLock === 1;
}
}
},
@ -70,11 +70,10 @@ export default {
handler: this.unlock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.singleLock !== 1 || device.controlMode !== 'Local';
return switchDevice.singleLock !== 1;
} else {
return switchDevice.singleLock !== 1 || device.controlMode !== 'Center';
return switchDevice.singleLock !== 1;
}
}
},
@ -83,11 +82,10 @@ export default {
handler: this.block,
cmdType:CMD.Switch.CMD_SWITCH_BLOCK,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.blockade === 1 || device.controlMode !== 'Local';
return switchDevice.blockade === 1;
} else {
return switchDevice.blockade === 1 || device.controlMode !== 'Center';
return switchDevice.blockade === 1;
}
}
},
@ -96,11 +94,10 @@ export default {
handler: this.unblock,
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.blockade !== 1 || device.controlMode !== 'Local';
return switchDevice.blockade !== 1;
} else {
return switchDevice.blockade !== 1 || device.controlMode !== 'Center';
return switchDevice.blockade !== 1;
}
}
},
@ -109,12 +106,7 @@ export default {
handler: this.switchTurnout,
cmdType:CMD.Switch.CMD_SWITCH_TURN,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
} else {
return device.controlMode !== 'Center';
}
return false;
}
},
{
@ -122,12 +114,7 @@ export default {
handler: this.fault,
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
} else {
return device.controlMode !== 'Center';
}
return false;
}
},
// {
@ -140,12 +127,7 @@ export default {
handler: this.split,
cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
return false;
}
},
{
@ -153,12 +135,7 @@ export default {
handler: this.active,
cmdType:CMD.Switch.CMD_SWITCH_ACTIVE,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
return false;
}
},
{
@ -166,12 +143,7 @@ export default {
handler: this.setSpeed,
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
} else {
return device.controlMode !== 'Center';
}
return false;
}
},
{
@ -179,12 +151,7 @@ export default {
handler: this.cancelSpeed,
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
} else {
return device.controlMode !== 'Center';
}
return false;
}
}
],
@ -235,7 +202,8 @@ export default {
// this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
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);
});

View File

@ -8,9 +8,9 @@
<script>
import { getCompanyListPaging, deleteCompany, getCompanyQrCode } from '@/api/company';
import { getAllBackProjectConfig} from '@/api/projectConfig';
import EditCompany from './add';
import QrCode from '@/components/QrCode';
import { ProjectList } from '@/scripts/ProjectConfig';
export default {
name: 'CompanyManage',
components: {
@ -96,9 +96,15 @@ export default {
};
},
created() {
ProjectList.forEach(elem => {
// this.projectMap[elem.value.toUpperCase()] = elem.label;
this.projectListNew.push({value: elem.value.toUpperCase(), label: elem.label});
getAllBackProjectConfig().then(res=>{
const response = res.data || [];
const projectList = [];
response.forEach(elem => {
projectList.push({value: elem.code, label: elem.name});
});
this.projectListNew = projectList;
}).catch(() => {
this.$message.error('获取项目列表失败');
});
},
methods: {

View File

@ -60,14 +60,6 @@ export default {
],
description: [
{ required: true, message: '请输入项目描述', trigger: 'blur' }
],
mapId: [
{ required: true, message: '请选择实训室关联地图', trigger: 'blur' },
{ required: true, message: '请选择实训室关联地图', trigger: 'change' }
],
functionId: [
{ required: true, message: '请选择实训室关联功能', trigger: 'blur' },
{ required: true, message: '请选择实训室关联功能', trigger: 'change' }
]
};
return crules;