Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
a981965452
@ -48,7 +48,8 @@ export default class EMouse extends Group {
|
||||
e.target._subType == 'Text') {
|
||||
this.text.hide();
|
||||
} else {
|
||||
this.device.control.setControlColor(this.device.style.ZcControl.lamp.controlColor);
|
||||
// this.device.control.setControlColor(this.device.style.ZcControl.lamp.controlColor);
|
||||
this.device.setState(this.device.model)
|
||||
this.device.control.setTextColor('#FFFFFF');
|
||||
this.device.control.setTextBorder(false);
|
||||
this.device.control.setArcBorder(false);
|
||||
|
@ -73,7 +73,6 @@ export default class ZcControl extends Group {
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
this.recover();
|
||||
|
||||
// 只响应前端自定义类型的状态变化
|
||||
if (model._free) {
|
||||
this.setAshShow();
|
||||
|
@ -1,20 +1,35 @@
|
||||
import store from '@/store/index';
|
||||
import store from "@/store/index";
|
||||
/**
|
||||
* 判断菜单行值控制全
|
||||
* @param {String} stationCode 所属车站code
|
||||
* @param {String} centralStationCode 所属集中站code
|
||||
* @param {String} work 当前客户端
|
||||
* */
|
||||
export function judgeStationControl(stationCode, centralStationCode, work) {
|
||||
const centralStation = store.getters['map/getDeviceByCode'](centralStationCode);
|
||||
// 角色车站是 设备所属车站或所属集中站
|
||||
if (work === 'localWork') {
|
||||
const flag1 = store.state.training.roleDeviceCode === stationCode || store.state.training.roleDeviceCode === centralStationCode;
|
||||
const flag2 = centralStation.controlMode === 'Local' || centralStation.controlMode === 'Emergency';
|
||||
return flag1 && flag2;
|
||||
} else if ( work === 'dispatchWork' ) {
|
||||
return centralStation.controlMode === 'Center';
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
export function judgeStationControl(
|
||||
stationCode,
|
||||
centralStationCode,
|
||||
work,
|
||||
isAvailableInOtherControlMode
|
||||
) {
|
||||
const centralStation = store.getters["map/getDeviceByCode"](
|
||||
centralStationCode
|
||||
);
|
||||
const isCenterMode = centralStation.controlMode === "Center";
|
||||
const isLocalMode =
|
||||
centralStation.controlMode === "Local" ||
|
||||
centralStation.controlMode === "Emergency";
|
||||
// 角色车站是 设备所属车站或所属集中站
|
||||
if (work === "localWork") {
|
||||
const isBelongingStation =
|
||||
store.state.training.roleDeviceCode === stationCode ||
|
||||
store.state.training.roleDeviceCode === centralStationCode;
|
||||
return (
|
||||
((isCenterMode && isAvailableInOtherControlMode) || isLocalMode) &&
|
||||
isBelongingStation
|
||||
);
|
||||
} else if (work === "dispatchWork") {
|
||||
return isCenterMode || (isLocalMode && isAvailableInOtherControlMode);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -64,14 +64,16 @@ export default {
|
||||
handler: this.arrangementRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signal, work) => true
|
||||
isShow: (signal, work) => true,
|
||||
isAvailableInOtherControlMode: true
|
||||
},
|
||||
{
|
||||
label: '取消进路',
|
||||
handler: this.cancelTrainRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signal, work) => true
|
||||
isShow: (signal, work) => true,
|
||||
isAvailableInOtherControlMode: true
|
||||
},
|
||||
{
|
||||
label: '信号重开',
|
||||
@ -127,14 +129,16 @@ export default {
|
||||
handler: this.humanControl,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signal, work) => true
|
||||
isShow: (signal, work) => true,
|
||||
isAvailableInOtherControlMode: true
|
||||
},
|
||||
{
|
||||
label: '进路自排开',
|
||||
handler: this.atsAutoControl,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signal, work) => true
|
||||
isShow: (signal, work) => true,
|
||||
isAvailableInOtherControlMode: true
|
||||
},
|
||||
{
|
||||
label: '设置通过模式',
|
||||
@ -206,7 +210,7 @@ export default {
|
||||
initMenu() {
|
||||
this.menu = [];
|
||||
this.menuNormal.forEach(menuItem => {
|
||||
menuItem.disabled = !judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work) || menuItem.isDisabled(this.selected, this.work);
|
||||
menuItem.disabled = !judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work, menuItem.isAvailableInOtherControlMode) || menuItem.isDisabled(this.selected, this.work);
|
||||
menuItem.show = menuItem.isShow(this.selected, this.work);
|
||||
this.menu.push(menuItem);
|
||||
});
|
||||
|
@ -70,7 +70,7 @@ export default {
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
|
||||
isDisabled: (stand, work) => stand.stationHoldTrain === 1,
|
||||
isDisabled: (stand, work) => stand.stationHoldTrain !== 1,
|
||||
isShow: (stand, work) => work === 'localWork'
|
||||
},
|
||||
{
|
||||
@ -84,7 +84,7 @@ export default {
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
|
||||
isDisabled: (stand, work) => stand.centerHoldTrain === 1,
|
||||
isDisabled: (stand, work) => stand.centerHoldTrain !== 1,
|
||||
isShow: (stand, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user