This commit is contained in:
sunzhenyu 2021-07-30 17:00:11 +08:00
commit 87f94e2dbe
6 changed files with 131 additions and 48 deletions

View File

@ -472,7 +472,7 @@ class SkinCode extends defaultStyle {
borderColor: '#FE0000', // 道岔边框颜色
lossColor: '#FFFFFF', // 道岔失去颜色
locateColor: '#00FF00', // 道岔定位颜色
inversionColor: '#9C9D09', // 道岔反位颜色
inversionColor: '#EDBD65', // 道岔反位颜色
monolockLocationColor: '#ea282c', // 道岔单锁'定位'颜色
monolockInversionColor: '#ea282c', // 道岔单锁'反位'颜色
block: true, // 封锁名称

View File

@ -5,7 +5,7 @@
:class="systemName+' route-hand-control'"
:title="title"
:visible.sync="show"
width="300px"
:width="width"
:before-close="doClose"
:z-index="2000"
:modal="false"
@ -48,6 +48,11 @@
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column v-if="systemName === 'xian-01__systerm'" width="200">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ getProtectedSectionName(scope.row) }}</span>
</template>
</el-table-column>
</el-table>
</div>
<el-row>
@ -115,7 +120,8 @@ export default {
computed: {
...mapGetters('map', [
'signalList',
'routeData'
'routeData',
'overlapData'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
@ -123,6 +129,9 @@ export default {
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
width() {
return this.systemName === 'xian-01__systerm' ? '500px' : '300px';
},
domIdChoose() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
@ -247,6 +256,18 @@ export default {
});
},
getProtectedSectionName(row) {
let name = '';
if (row && row.overlapCode && this.overlapData[row.overlapCode] &&
this.overlapData[row.overlapCode].pathList.length &&
this.overlapData[row.overlapCode].pathList[0].switchPositionList.length) {
const switchDevice = this.$store.getters['map/getDeviceByCode'](this.overlapData[row.overlapCode].pathList[0].switchPositionList[0].switchCode);
if (switchDevice) {
name = switchDevice.name + (this.overlapData[row.overlapCode].pathList[0].switchPositionList[0].normal ? '定位保护' : '反位保护');
}
}
return name;
},
allSelectChange() {
this.changeList = [];
if (this.allSelect) {

View File

@ -102,19 +102,12 @@ export default {
methods: {
getProtectedSectionName(row) {
let name = '';
if (row &&
row.overlapSectionList &&
row.overlapSectionList &&
row.overlapSectionList.length > 0) {
const protect = row.overlapSectionList[0];
name = `${protect.name}`;
if (protect.parentName) {
name = `${protect.parentName}${protect.name}`;
}
const station = this.$store.getters['map/getDeviceByCode'](protect.stationCode);
if (station) {
name = `${name}(${station.name})`;
if (row && row.overlapCode && this.overlapData[row.overlapCode] &&
this.overlapData[row.overlapCode].pathList.length &&
this.overlapData[row.overlapCode].pathList[0].switchPositionList.length) {
const switchDevice = this.$store.getters['map/getDeviceByCode'](this.overlapData[row.overlapCode].pathList[0].switchPositionList[0].switchCode);
if (switchDevice) {
name = switchDevice.name + (this.overlapData[row.overlapCode].pathList[0].switchPositionList[0].normal ? '定位保护' : '反位保护');
}
}
return name;

View File

@ -74,7 +74,8 @@ export default {
val && this.$store.dispatch('config/updateMenuBar');
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel) && this.$store.state.training.prdType == '02') {
// && this.$store.state.training.prdType == '02'
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.popDoShow(this.$store.state.menuOperation.menuPosition);
} else {
this.popDoClose();
@ -118,30 +119,71 @@ export default {
},
initMenu() {
this.menuNormal = [];
this.$store.state.map.map.stationList.forEach(station => {
if (station.relStationCodeList && station.relStationCodeList.length) {
const node = {
label: station.name,
children: []
};
const relStationCodeList = [...station.relStationCodeList];
relStationCodeList.push(station.code);
relStationCodeList.sort((a, b) => {
if (this.$store.state.training.prdType == '02') {
this.$store.state.map.map.stationList.forEach(station => {
if (station.relStationCodeList && station.relStationCodeList.length) {
const node = {
label: station.name,
children: []
};
const relStationCodeList = [...station.relStationCodeList];
relStationCodeList.push(station.code);
relStationCodeList.sort((a, b) => {
const stationA = this.$store.getters['map/getDeviceByCode'](a);
const stationB = this.$store.getters['map/getDeviceByCode'](b);
return stationA.kmRange - stationB.kmRange;
});
relStationCodeList.forEach(item => {
const next = this.$store.getters['map/getDeviceByCode'](item);
node.children.push({
code: next.code,
label: next.name,
handler: this.mapLocation
});
});
this.menuNormal.push(node);
}
});
} else if (this.$store.state.training.prdType == '01') {
const roleDeviceCode = this.$store.state.training.roleDeviceCode;
const displayList = this.$store.state.map.map.displayList;
const display = displayList.find(each=>{
return each.stationCodeList.includes(roleDeviceCode);
});
if (display) {
const codeList = [...display.switchStationCodeList];
let relStationCodeList = [];
let ciStaionCode = '';
codeList.sort((a, b) => {
const stationA = this.$store.getters['map/getDeviceByCode'](a);
const stationB = this.$store.getters['map/getDeviceByCode'](b);
if (stationA.relStationCodeList && stationA.relStationCodeList.length > 0 && relStationCodeList.length <= 0) {
relStationCodeList = [...stationA.relStationCodeList];
ciStaionCode = stationA.code;
relStationCodeList.push(stationA.code);
}
return stationA.kmRange - stationB.kmRange;
});
relStationCodeList.forEach(item => {
const next = this.$store.getters['map/getDeviceByCode'](item);
node.children.push({
code: next.code,
label: next.name,
handler: this.mapLocation
});
const ciStaion = this.$store.getters['map/getDeviceByCode'](ciStaionCode);
const currentNode = {label: ciStaion.name, children: []};
codeList.forEach(code=>{
let node;
const station = this.$store.getters['map/getDeviceByCode'](code);
if (station.depot) {
return;
}
if (relStationCodeList.includes(code)) {
currentNode.children.push({label: station.name, code: station.code, handler: this.mapLocation});
if (currentNode.children.length == relStationCodeList.length) {
this.menuNormal.push(currentNode);
}
} else {
node = {label: station.name, code: station.code, handler: this.mapLocation};
this.menuNormal.push(node);
}
});
this.menuNormal.push(node);
}
});
}
this.menu = [...this.menuNormal];
},
popDoClose() {

View File

@ -71,7 +71,7 @@ export default {
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
this.$store.dispatch('training/setRoleDeviceCode', station.code);
this.$jlmap.updateShowStation(list, showStationCode);
this.setCenter(showStationCode);
}

View File

@ -42,9 +42,20 @@
/>
</el-select>
</div>
<div style="margin-top:10px">
<span>可切换显示的车站</span>
<el-select v-model="addModel.switchStationCodeList" size="mini" style="width:200px;" multiple placeholder="请选择">
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</div>
<div class="content-box-list" style="margin-top: 10px;">
<div class="title-box">设备列表</div>
<div class="list-box">
<div class="list-box" style="height:400px;overflow:auto">
<div v-for="nor in addModel.elementList" :key="nor.code" class="list-content">
<div class="name">{{ getDeviceName(nor) }}</div>
<div class="close" @click="delList(nor, addModel.elementList)"><i class="el-icon-close" /></div>
@ -55,7 +66,7 @@
</el-card>
<div style="display: table; margin-left: 90px; margin-top: 12px; margin-bottom: 20px;">
<el-button type="primary" size="small" @click="generateData">按集中站生成并保存</el-button>
<el-button type="primary" size="small" @click="save">保存</el-button>
<el-button type="primary" size="small" :loading="dataLoading" @click="save">保存</el-button>
<el-button type="primary" size="small" @click="back">返回</el-button>
</div>
</el-scrollbar>
@ -82,6 +93,7 @@ export default {
tableData: [],
addModel: {
stationCodeList: [],
switchStationCodeList:[],
elementList: []
},
list: [],
@ -89,7 +101,8 @@ export default {
cardMode: 'generate',
index: '',
isPreview: true,
loading: false
loading: false,
dataLoading:false
};
},
computed: {
@ -181,12 +194,16 @@ export default {
},
updateOverlab() {
if (this.index || this.index == 0) {
this.clearData();
if (!this.addModel.stationCodeList.length) {
this.$messageBox('请选择车站!');
} else {
this.tableData.splice(this.index, 1, this.addModel);
return;
}
this.clearData();
if (!this.addModel.switchStationCodeList.length) {
this.$messageBox('请选择可切换显示的车站!');
return;
}
this.tableData.splice(this.index, 1, this.addModel);
}
},
//
@ -208,9 +225,13 @@ export default {
displayList: this.tableData,
mapId: this.$route.params.mapId
};
this.dataLoading = true;
saveMap(Object.assign(map, param)).then(response => {
this.$message.success('保存现地配置成功');
this.dataLoading = false;
this.cancelOverlab();
}).catch(() => {
this.dataLoading = false;
this.$messageBox('保存现地配置失败');
});
},
@ -220,25 +241,30 @@ export default {
generateOverlab() { //
if (!this.addModel.stationCodeList.length) {
this.$messageBox('请选择车站!');
} else {
this.tableData.push(this.addModel);
this.clearData();
return;
}
if (!this.addModel.switchStationCodeList.length) {
this.$messageBox('请选择可切换显示的车站!');
return;
}
this.tableData.push(this.addModel);
this.clearData();
},
clear() {
this.addModel = { stationCodeList: [], elementList: [] };
this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] };
},
clearData() {
this.addModel = { stationCodeList: [], elementList: [] };
this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] };
this.index = '';
this.cardMode = 'generate';
},
generateData() {
this.loading = true;
this.tableData = [];
// switchStationCodeList:[...item.switchStationCodeList, item.code]
this.stationList.forEach(item => {
if (item.centralized) {
this.tableData.push({stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code]});
this.tableData.push({stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code], switchStationCodeList:[...item.chargeStationCodeList, item.code]});
}
});
@ -265,6 +291,7 @@ export default {
saveMap(Object.assign(map, param)).then(response => {
this.loading = false;
this.$message.success('保存现地配置成功');
this.cancelOverlab();
}).catch(() => {
this.loading = false;
this.$messageBox('保存现地配置失败');