占线板&进路序列调整

This commit is contained in:
fan 2022-07-18 13:07:45 +08:00
parent 0943fc515d
commit e176823ec6
9 changed files with 89 additions and 19 deletions

View File

@ -48,7 +48,7 @@
<div style="margin-right: 10px;">车站</div>
<el-select v-model="stationCode" size="mini" @change="stationChange">
<el-option
v-for="item in stationList"
v-for="item in showStationList"
:key="item.code"
:label="item.name"
:value="item.code"
@ -144,7 +144,8 @@ export default {
sheetList: [{ label: '历史进路', value: 'historyRoute' }],
sequenceList: [],
sequenceMap: {},
menu: [{label: '人工触发', handler: this.artificialTrigger, disabled: false}, {label: '删除', handler: this.artificialTrigger, disabled: true}]
menu: [{label: '人工触发', handler: this.artificialTrigger, disabled: false}, {label: '删除', handler: this.artificialTrigger, disabled: true}],
showStationList: []
};
},
computed: {
@ -186,23 +187,42 @@ export default {
}
}
}
},
'$store.state.map.showCentralizedStationCode': function (val) {
this.initShowStationList(val);
}
},
mounted() {
EventBus.$on('bottomTableShowOrHidden', () => {
this.showTable = !this.showTable;
});
if (this.stationList && this.stationList.length) {
this.stationCode = this.stationList[0].code;
}
// if (this.stationList && this.stationList.length) {
// this.stationCode = this.stationList[0].code;
// }
},
methods: {
doShow() {
this.initShowStationList(this.$store.state.map.showCentralizedStationCode);
this.showTable = true;
},
doClose() {
this.showTable = false;
},
initShowStationList(val) {
if (val) {
const centralizedStation = this.$store.getters['map/getDeviceByCode'](val);
const sn = centralizedStation.sn;
this.showStationList = [centralizedStation];
this.stationCode = centralizedStation.code;
this.stationList.forEach(station => {
if (station.sn === sn - 1) {
this.showStationList.unshift(station);
} else if (station.sn === sn + 1) {
this.showStationList.push(station);
}
});
}
},
getRouteStatus(status) {
if (status === '2') {
return '触发完成';

View File

@ -397,7 +397,7 @@ export default {
},
buttonDown(operation, commandTypeList) {
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode);
if (station.controlMode === 'Interlock') { return; }
if (!station || station.controlMode === 'Interlock') { return; }
this.clearOperate();
if (operation != this.Command.cancel.clearMbm.operation) {
const operate = {

View File

@ -121,7 +121,6 @@ export default {
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
console.log(this.buttonOperation, '***********');
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Section) && (!this.buttonOperation || this.$route.query.ctc)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {

View File

@ -12,7 +12,7 @@
<div style="height: 500px; overflow-y: auto;background: #DFE3E6;padding: 7px;">
<div style="width: 100%;display: flex;align-items: center;margin-bottom: 10px;">
<div
v-for="item in stationList"
v-for="item in showStationList"
:key="item.code"
class="tab-box"
:style="{background: selectCode === item.code ? '#F1F1F1': '#DBDBDB', color: selectCode === item.code ? '#000': '#ccc'}"
@ -214,7 +214,7 @@
</el-table>
<div style="width: 100%;display: flex;align-items: center;margin: 5px 0;">
<div
v-for="item in stationList"
v-for="item in showStationList"
:key="item.code"
class="tab-box"
:style="{background: selectCode1 === item.code ? '#F1F1F1': '#DBDBDB', color: selectCode1 === item.code ? '#000': '#ccc'}"
@ -335,7 +335,8 @@ export default {
sequenceList: [],
readOnlyMap: {},
standTrackSectionMap: {},
trackList: []
trackList: [],
showStationList: []
};
},
computed: {
@ -436,6 +437,9 @@ export default {
this.standTrackSectionMap[item.code] = { trackName: item.name, occupied: false, belongStation:item.belongStation, lineMap: {}};
}
});
},
'$store.state.map.showCentralizedStationCode': function (val) {
this.initShowStationList(val);
}
},
mounted() {
@ -444,11 +448,26 @@ export default {
handleClose() {
this.dialogVisible = false;
},
initShowStationList(val) {
if (val) {
const centralizedStation = this.$store.getters['map/getDeviceByCode'](val);
const sn = centralizedStation.sn;
this.showStationList = [centralizedStation];
this.stationList.forEach(station => {
if (station.sn === sn - 1) {
this.showStationList.unshift(station);
} else if (station.sn === sn + 1) {
this.showStationList.push(station);
}
});
}
},
doShow() {
this.dialogVisible = true;
if (this.stationList[0]) {
this.selectStandCode(this.stationList[0].code);
this.selectStandCode1(this.stationList[0].code);
this.initShowStationList(this.$store.state.map.showCentralizedStationCode);
if (this.showStationList[0]) {
this.selectStandCode(this.showStationList[0].code);
this.selectStandCode1(this.showStationList[0].code);
}
},
selectStandCode(code) {

View File

@ -1,7 +1,7 @@
<template>
<div>
<div class="schema" :style="{top: offset+'px'}">
<select-station v-if="isShowSelectStation && !isScript" ref="selectStation" :style-css="'width: 100px;'" />
<select-station v-show="!$route.query.joint" v-if="isShowSelectStation && !isScript" ref="selectStation" :style-css="'width: 100px;'" />
<el-select v-model="speed" style="width: 100px;" size="small" @change="speedChange">
<el-option
v-for="item in speedList"

View File

@ -42,7 +42,13 @@ export default {
this.initStationListMode();
},
'$store.state.training.simulationUserList': function(val) {
console.log('----------11');
this.initData();
},
'$store.state.socket.simulationRoleList':function(list) {
if (list && list.length) { //
this.checkRoleChange(list);
}
}
},
mounted() {
@ -128,6 +134,26 @@ export default {
if (this.showMemberId) {
this.switchStationMode( this.showMemberId);
}
},
checkRoleChange(data) {
data.forEach(item => {
if (item.messageType === 'KICK_OUT' && item.userId == this.$store.state.user.id) {
this.$messageBox('您已经被请离房间!');
window.close();
} else if (item.messageType === 'PLAY_CHANGE' && item.userId == this.$store.state.user.id && item.type === 'STATION_SUPERVISOR') {
this.showMemberId = item.memberId;
this.oldShowMemberId = item.memberId;
this.showStation = item.deviceCode;
const showStationCode = this.stationCentralizedMap[item.deviceCode];
const mapDevice = this.$store.state.map.mapDevice;
const list = [];
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
this.$jlmap.updateShowStation(list, showStationCode || item.deviceCode);
this.setCenter(showStationCode);
}
});
}
}
};

View File

@ -265,6 +265,7 @@ export default {
mapId:this.$route.query.mapId,
project: this.project,
newApi: false,
joint: true,
ctc: true,
try: this.$route.query.try || 0,
token:getToken(),

View File

@ -12,6 +12,7 @@
<el-form-item label="画面类型:" prop="type">
<el-select v-model="ruleForm.type" placeholder="请选择画面类型">
<el-option label="站间透明" value="lucency" />
<el-option label="连锁车站" value="chainStation" />
</el-select>
</el-form-item>
<el-form-item label="所属车站:" prop="stationCode">

View File

@ -69,6 +69,10 @@ export default {
}
},
methods: {
reloadMenuComponent(lineCode) {
this.menus = this.$theme.loadMenuComponent(lineCode); // menu
this.$store.commit('training/notifyGetCommandDefinition', lineCode); // 线
},
//
getDeviceByEm(em) {
var device = this.$store.getters['map/getDeviceByCode'](em.deviceCode) || null;
@ -196,13 +200,13 @@ export default {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
}
} else if (this.$route.query.ctc) {
this.$store.dispatch('menuOperation/setSelected', {device: this.selected, subType: em.subType});
menu = getDeviceMenuByDeviceType(device._type);
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
}
this.$store.dispatch('menuOperation/setSelected', {device: this.selected, subType: em.subType});
menu = getDeviceMenuByDeviceType(device._type);
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
}
} else {
menu = getDeviceMenuByDeviceType('Cancel');
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
}
this.$store.dispatch('training/emitTipFresh');
},