增加宁波一号线控制权转移

This commit is contained in:
zyy 2020-01-08 14:59:27 +08:00
parent 9bbc497488
commit 786a37ee2c
15 changed files with 452 additions and 14 deletions

View File

@ -318,7 +318,8 @@ class SkinCode extends defaultStyle {
emergencyControlShow: true, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
interconnectedControlShow: false // 联锁控显示
interconnectedControlShow: false, // 联锁控显示
centerControlButtonShow: false // 中控显示
},
arrow: {
show: false // 控制模式箭头显隐

View File

@ -318,7 +318,8 @@ class SkinCode extends defaultStyle {
emergencyControlShow: true, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
interconnectedControlShow: false // 联锁控显示
interconnectedControlShow: false, // 联锁控显示
centerControlButtonShow: false // 中控显示
},
arrow: {
show: false // 控制模式箭头显隐

View File

@ -321,7 +321,8 @@ class SkinCode extends defaultStyle {
emergencyControlShow: true, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
interconnectedControlShow: true // 联锁控显示
interconnectedControlShow: true, // 联锁控显示
centerControlButtonShow: false // 中控显示
},
arrow: {
show: false // 控制模式箭头显隐

View File

@ -301,7 +301,8 @@ class SkinCode extends defaultStyle {
emergencyControlShow: false, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
interconnectedControlShow: false // 联锁控显示
interconnectedControlShow: false, // 联锁控显示
centerControlButtonShow: false // 中控显示
},
arrow: {
show: true // 控制模式箭头显隐

View File

@ -299,7 +299,8 @@ class SkinCode extends defaultStyle {
fontWeight: 'normal', // 字体粗细
textAlign: 'middle', // 字体水平对齐
textVerticalAlign: 'top', // 字体垂直对齐
centerControlText: '中控', // 中控文字内容
centerControlButton: '站遥控按钮', // 中控文字内容
centerControlText: '遥控', // 中控文字内容
substationControlText: '站控', // 站控文字内容
emergencyControlText:'紧急站控', // 紧急站控文字内容
interconnectedControlText:'连锁控' // 连锁控文字内容
@ -318,7 +319,8 @@ class SkinCode extends defaultStyle {
emergencyControlShow: true, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
interconnectedControlShow: false // 联锁控显示
interconnectedControlShow: false, // 联锁控显示
centerControlButtonShow: true // 中控显示
},
arrow: {
show: false // 控制模式箭头显隐

View File

@ -221,6 +221,22 @@ export default class Station extends Group {
});
this.add(this.arrowsControl);
}
// 中控按钮
if (this.style.Station.StationControl.lamp.centerControlButtonShow) {
this.centerControlButton = new ESingleControl({
_subType: 'button',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / -2 + this.style.Station.StationControl.lamp.offset.x,
y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
},
context: this.style.Station.StationControl.text.centerControlButton,
pop: false
});
this.add(this.centerControlButton);
}
}
this.setState(model);
@ -244,7 +260,7 @@ export default class Station extends Group {
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor);
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
break;
case '03': // 紧急站控
case 'Emergency': // 紧急站控
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.redColor);
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);

View File

@ -0,0 +1,255 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="540px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row style="margin-bottom: 10px;">
<el-col :span="17">
<el-table ref="table" :data="stationLists" border style="width: 100%;" size="mini" height="260" highlight-current-row @row-click="clickEvent">
<el-table-column label="选择" width="50">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.checked" :disabled="scope.row.disable" />
</template>
</el-table-column>
<el-table-column label="车站名">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column label="当前状态">
<template slot-scope="scope">
<span v-if="scope.row.controlMode == 'Center'">遥控</span>
<span v-else-if="scope.row.controlMode == 'Local'">站控</span>
<span v-else-if="scope.row.controlMode == 'Local' && $route.query.prdType == '02'">中心请求站控</span>
<span v-else-if="scope.row.controlMode == 'Center' && $route.query.prdType == '01'">现地请求遥控</span>
<span v-else>获取状态中...</span>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="6" :offset="1">
<el-radio v-model="controlMode" label="center" :disabled="disabledAll" style="margin-bottom: 8px;">请求站控</el-radio>
<el-radio v-model="controlMode" label="local" :disabled="disabledAll">请求遥控</el-radio>
</el-col>
</el-row>
<el-row style="margin-bottom: 15px;">
<el-col :span="17">
<el-col :span="11" style="text-align: center;"><el-checkbox v-model="checkedAll" size="medium" :disabled="disabledAll" @change="selectAll">全部选择</el-checkbox></el-col>
<el-col :span="11" :offset="2"><el-checkbox v-model="checked2" :disabled="disabledAll" size="medium">全部确认</el-checkbox></el-col>
</el-col>
<el-col :span="5" :offset="1" style="margin-top: -56px;">
<el-button :id="domIdConfirm" type="primary" :loading="loading" style="margin-left: 0; margin-bottom: 10px; width: 100%;" @click="commit"> </el-button>
<el-button :id="domIdCancel" style="margin-left: 0; width: 100%;" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mouseCancelState } from '../utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
export default {
name: 'StationControl',
components: {
NoticeInfo
},
data() {
return {
controlMode: 'center',
beforeSectionList: [],
checkedAll: false,
dialogShow: false,
loading: false,
selected: null,
row: null,
operation: '',
stationLists: [],
disabledAll: false
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return '站遥控转换';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
getStationList(disable) {
this.stationLists = [];
if (this.stationList && this.stationList.length) {
this.stationList.forEach(item => {
if (item.centralized) {
const station = this.$store.getters['map/getDeviceByCode'](item.code);
let checked = false;
if (station.code == this.selected.code) {
checked = true;
}
const param = {
checked: checked,
disable: disable,
code: item.code,
name: item.name,
controlMode: station.controlMode
};
this.stationLists.push(param);
}
});
}
},
getProtectedSectionName(row) {
let name = '';
if (row &&
row.overlapSectionList &&
row.overlapSectionList &&
row.overlapSectionList.length > 0) {
const protect = row.overlapSectionList[0];
name = `${protect.name}`;
const station = this.$store.getters['map/getDeviceByCode'](protect.stationCode);
if (station) {
name = `${name}(${station.name})`;
}
}
return name;
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.operation = operate.operation;
if (selected) {
this.getStationList(true);
this.disabledAll = true;
} else {
this.getStationList(false);
this.disabledAll = false;
}
if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
this.controlMode = 'local';
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
this.controlMode = 'center';
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.restoreBeforeDevices();
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
restoreBeforeDevices() {
//
if (this.beforeSectionList && this.beforeSectionList.length) {
this.beforeSectionList.forEach(elem => {
elem.cutOff = false;
});
}
this.$store.dispatch('training/updateMapState', [...this.beforeSectionList]);
this.beforeSectionList = [];
},
selectAll() {
this.stationLists.forEach(row => {
if (this.checkedAll) {
row.checked = true;
} else {
row.checked = false;
}
});
},
clickEvent(row, event, column) {
this.row = row;
if (row) {
//
const operate = {
operation: OperationEvent.Signal.arrangementRoute.choose.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
}
},
commit() {
const list = [];
this.stationLists.forEach(row => {
if (row.checked) {
list.push(row.code);
}
});
if (list && list.length) {
const operate = {
over: true,
operation: '',
cmdType: '',
param: {
Station_List: list
}
};
if (this.controlMode == 'center') {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL;
operate.operation = OperationEvent.StationControl.requestCentralControl.menu.operation;
} else if (this.controlMode == 'local') {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL;
operate.operation = OperationEvent.StationControl.requestStationControl.menu.operation;
}
console.log(operate);
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -5,6 +5,7 @@
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
<menu-button ref="menuButton" />
<menu-station-stand ref="menuStationStand" :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" />
@ -24,6 +25,7 @@ import MenuCancel from './menuCancel';
import MenuSignal from './menuSignal';
import MenuButton from './menuButton';
import MenuStationStand from './menuStationStand';
import MenuStationControl from './menuStationControl';
import MenuSwitch from './menuSwitch';
import MenuSection from './menuSection';
import MenuTrain from './menuTrain';
@ -44,6 +46,7 @@ export default {
MenuSwitch,
MenuSection,
MenuStationStand,
MenuStationControl,
MenuStation,
MenuTrain,
MenuLimit,

View File

@ -138,7 +138,6 @@ export default {
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;

View File

@ -0,0 +1,150 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<station-control ref="stationControl" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import StationControl from './dialog/stationControl';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
name: 'StationControlMenu',
components: {
PopMenu,
StationControl
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
{
label: '请求站控',
handler: this.setStationControl,
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
},
{
label: '请求遥控',
handler: this.setCenterControl,
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
}
],
Center: [
{
label: '请求站控',
handler: this.setStationControl,
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
},
{
label: '请求遥控',
handler: this.setCenterControl,
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
}
]
},
menuForce: [
]
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationControl) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
this.getCurrentStateObject();
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
getCurrentStateObject() {
this.selected = this.$store.getters['menuOperation/selected'];
},
setCenterControl() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
// cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL,
param: {
StationControl_Code: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControl.doShow(step, this.selected);
}
});
},
setStationControl() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
// cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL,
param: {
StationControl_Code: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControl.doShow(step, this.selected);
}
});
}
}
};
</script>

View File

@ -149,7 +149,6 @@ export default {
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
@ -215,6 +214,7 @@ export default {
locate() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.locate.menu.operation,
param: {
Switch_Code: this.selected.code
@ -231,6 +231,7 @@ export default {
reverse() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.reverse.menu.operation,
param: {
Switch_Code: this.selected.code

View File

@ -136,7 +136,7 @@ export default {
{ label: '信号机', value: 'Signal' },
{ label: '站台', value: 'Stand' },
{ label: '车站', value: 'Station' },
// { label: '控制模式', value: 'ControlConvertMenu' },
{ label: '控制模式', value: 'ControlConvertMenu' },
{ label: '车次窗', value: 'TrainWindow' }
],
// 新版的产品类型枚举

View File

@ -90,8 +90,8 @@ class MenuContextHandler {
if (control) {
if ( this.getPrdType() != '') {
const type = State2SimulationMap[this.getPrdType()];
// const status = State2ControlMap[control.status]; // 缺少车站控制模式字段
const status = State2ControlMap['01']; // 缺少车站控制模式字段
const status = State2ControlMap[control.status]; // 缺少车站控制模式字段
// const status = State2ControlMap['01']; // 缺少车站控制模式字段
menu = [...menuList[type]];
if (menu.constructor === Array) {
menu.forEach(elem => {

View File

@ -3,11 +3,11 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
} else {
BASE_API = process.env.VUE_APP_BASE_API;
}

View File

@ -113,6 +113,14 @@ export default {
if (em.subType === 'TrainWindow') {
device = { _type: deviceType.Train, code: em.deviceCode };
this.$store.dispatch('map/setTrainWindowShow', true);
} else if (em.subType == 'button' && em.deviceType == 'Station') { // 线
const equipment = this.getDeviceByEm(em);
this.$store.dispatch('menuOperation/setSelected', equipment);
menu = getDeviceMenuByDeviceType('StationControl');
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
this.$store.dispatch('training/emitTipFresh');
// console.log(equipment, em, '');
return;
} else if (em.deviceCode && !this.isScreen) {
device = this.getDeviceByEm(em);
}