一键生成集中站现地配置
This commit is contained in:
parent
3bb9c2a8d4
commit
d2357e0797
@ -2,11 +2,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.8.107:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.2.175:9000'; // 旭强 有线
|
||||
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线
|
||||
BASE_API = 'http://192.168.2.183:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.2.183:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||
|
@ -57,12 +57,13 @@ export default {
|
||||
this.showMemberId = val;
|
||||
const member = this.$store.state.training.memberData[val];
|
||||
const station = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
const lineCode = this.$store.getters['map/lineCode'];
|
||||
if ((lineCode === '02' || lineCode === '05') && station) {
|
||||
this.showStation = station.code;
|
||||
const showStationCode = this.stationCentralizedMap[station.code];
|
||||
this.setCenter(showStationCode);
|
||||
} else if (station) {
|
||||
// const lineCode = this.$store.getters['map/lineCode'];
|
||||
// if ((lineCode === '02' || lineCode === '05') && station) {
|
||||
// this.showStation = station.code;
|
||||
// const showStationCode = this.stationCentralizedMap[station.code];
|
||||
// this.setCenter(showStationCode);
|
||||
// } else
|
||||
if (station) {
|
||||
this.showStation = station.code;
|
||||
const showStationCode = this.stationCentralizedMap[station.code];
|
||||
const mapDevice = this.$store.state.map.mapDevice;
|
||||
|
@ -502,18 +502,18 @@ export default {
|
||||
},
|
||||
setShowStation(stationCode, setCenter) {
|
||||
const lineCode = this.$store.getters['map/lineCode'];
|
||||
if (lineCode === '02' || lineCode === '05') {
|
||||
!setCenter && this.setCenter(stationCode);
|
||||
} else {
|
||||
const list = [];
|
||||
const mapDevice = this.$store.state.map.mapDevice;
|
||||
for (const key in mapDevice) {
|
||||
list.push(mapDevice[key]);
|
||||
}
|
||||
|
||||
this.$jlmap.updateShowStation(list, stationCode);
|
||||
!setCenter && this.setCenter(stationCode);
|
||||
// if (lineCode === '02' || lineCode === '05') {
|
||||
// !setCenter && this.setCenter(stationCode);
|
||||
// } else {
|
||||
const list = [];
|
||||
const mapDevice = this.$store.state.map.mapDevice;
|
||||
for (const key in mapDevice) {
|
||||
list.push(mapDevice[key]);
|
||||
}
|
||||
|
||||
this.$jlmap.updateShowStation(list, stationCode);
|
||||
!setCenter && this.setCenter(stationCode);
|
||||
// }
|
||||
},
|
||||
setOffset(data, num, sum, obj) {
|
||||
this.$jlmap.switchScreen(data, num, sum, obj);
|
||||
|
@ -552,18 +552,18 @@ export default {
|
||||
// },
|
||||
setShowStation(stationCode) {
|
||||
const showStation = this.centralizedStationMap[stationCode];
|
||||
const lineCode = this.$store.getters['map/lineCode'];
|
||||
if (lineCode === '02' || lineCode === '05') {
|
||||
this.$jlmap.setCenter(showStation);
|
||||
} else {
|
||||
const list = [];
|
||||
const mapDevice = this.$store.state.map.mapDevice;
|
||||
for (const key in mapDevice) {
|
||||
list.push(mapDevice[key]);
|
||||
}
|
||||
this.$jlmap.updateShowStation(list, showStation);
|
||||
this.$jlmap.setCenter(showStation);
|
||||
// const lineCode = this.$store.getters['map/lineCode'];
|
||||
// if (lineCode === '02' || lineCode === '05') {
|
||||
// this.$jlmap.setCenter(showStation);
|
||||
// } else {
|
||||
const list = [];
|
||||
const mapDevice = this.$store.state.map.mapDevice;
|
||||
for (const key in mapDevice) {
|
||||
list.push(mapDevice[key]);
|
||||
}
|
||||
this.$jlmap.updateShowStation(list, showStation);
|
||||
this.$jlmap.setCenter(showStation);
|
||||
// }
|
||||
},
|
||||
setCentralizedstationList(map) {
|
||||
this.centralizedstationList = [];
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="view-control-content">
|
||||
<div v-loading="loading" class="view-control-content">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-table :data="tableData" style="width: 80%; margin: 0 auto;">
|
||||
<el-table-column label="车站">
|
||||
@ -54,6 +54,7 @@
|
||||
</div>
|
||||
</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" @click="back">返回</el-button>
|
||||
</div>
|
||||
@ -87,13 +88,30 @@ export default {
|
||||
field: '',
|
||||
cardMode: 'generate',
|
||||
index: '',
|
||||
isPreview: true
|
||||
isPreview: true,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'sectionList',
|
||||
'stationList',
|
||||
'signalList',
|
||||
'switchList',
|
||||
'stationStandList',
|
||||
'automaticRouteButtonList',
|
||||
'axleCounterResetButtonList',
|
||||
'cycleButtonList',
|
||||
'directionRodList',
|
||||
'indicatorLightList',
|
||||
'lineList',
|
||||
'outerFrameList',
|
||||
'psdList',
|
||||
'responderList',
|
||||
'tbStrategyList',
|
||||
'tempSpeedLimitList',
|
||||
'textList',
|
||||
'totalGuideLockButtonVOList',
|
||||
'localStationConfig',
|
||||
'seclectDeviceList'
|
||||
]),
|
||||
@ -214,6 +232,43 @@ export default {
|
||||
this.addModel = { stationCodeList: [], elementList: [] };
|
||||
this.index = '';
|
||||
this.cardMode = 'generate';
|
||||
},
|
||||
generateData() {
|
||||
this.loading = true;
|
||||
this.tableData = [];
|
||||
this.stationList.forEach(item => {
|
||||
if (item.centralized) {
|
||||
this.tableData.push({stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code]});
|
||||
}
|
||||
});
|
||||
|
||||
[...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList,
|
||||
...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList,
|
||||
...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList].forEach(item => {
|
||||
const target = this.tableData.find(elem => elem.stationCodeList.includes(item.stationCode));
|
||||
target && target.elementList.push(item.code);
|
||||
});
|
||||
[...this.directionRodList].forEach(item => {
|
||||
const target = this.tableData.find(elem => elem.stationCodeList.includes(item.deviceStationCode));
|
||||
target && target.elementList.push(item.code);
|
||||
});
|
||||
this.psdList.forEach(item => {
|
||||
const stand = this.$store.getters['map/getDeviceByCode'](item.standCode);
|
||||
const target = this.tableData.find(elem => elem.stationCodeList.includes(stand.stationCode));
|
||||
target && target.elementList.push(item.code);
|
||||
});
|
||||
const map = this.$store.state.map.map;
|
||||
const param = {
|
||||
displayList: this.tableData,
|
||||
mapId: this.$route.params.mapId
|
||||
};
|
||||
saveMap(Object.assign(map, param)).then(response => {
|
||||
this.loading = false;
|
||||
this.$message.success('保存现地配置成功');
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox('保存现地配置失败');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user