parent
7ed9e882cc
commit
7dfa74857c
@ -159,8 +159,7 @@ export default {
|
||||
{ enlabel: 'Comprehensive exercise cloud platform', label: '综合演练云平台', value: '03'},
|
||||
{ enlabel: 'Driver simulation driving system', label: '司机模拟驾驶系统', value: '04'},
|
||||
{ enlabel: 'Dispatch workstation', label: '派班工作站', value: '05'},
|
||||
{ enlabel: 'ISCS workstation', label: 'ISCS工作站', value: '06'},
|
||||
{ enlabel: 'Interlocking station at depot', label: '车辆段联锁工作站', value: '09' }
|
||||
{ enlabel: 'ISCS workstation', label: 'ISCS工作站', value: '06'}
|
||||
],
|
||||
trainingDeviceType: {
|
||||
Switch: {enlabel: 'Switch training', label:'道岔实训'},
|
||||
|
@ -1,221 +0,0 @@
|
||||
<template>
|
||||
<div v-loading="loading" class="view-control-content">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-card class="box-card" shadow="never" style="width: 80%; margin: 0 auto 15px; border-top: none;">
|
||||
<div slot="header">
|
||||
<span>请选择车辆段显示设备</span>
|
||||
</div>
|
||||
<div style="padding: 10px;font-size: 14px;">
|
||||
<div class="content-box-list" style="margin-top: 10px;">
|
||||
<div class="title-box">设备列表</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<div style="display: table; margin-left: 150px; margin-top: 12px; margin-bottom: 20px;">
|
||||
<el-button type="primary" size="small" @click="generateData">自动生成</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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { saveMap } from '@/api/jmap/mapdraft';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default: function () {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
otherData: [],
|
||||
addModel: {
|
||||
type: 'DEPOT_IL',
|
||||
elementList: []
|
||||
},
|
||||
loading: false,
|
||||
dataLoading:false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'sectionList',
|
||||
'stationList',
|
||||
'signalList',
|
||||
'switchList',
|
||||
'stationStandList',
|
||||
'automaticRouteButtonList',
|
||||
'axleCounterResetButtonList',
|
||||
'cycleButtonList',
|
||||
'directionRodList',
|
||||
'indicatorLightList',
|
||||
'lineList',
|
||||
'outerFrameList',
|
||||
'psdList',
|
||||
'responderList',
|
||||
'tbStrategyList',
|
||||
'tempSpeedLimitList',
|
||||
'textList',
|
||||
'totalGuideLockButtonVOList',
|
||||
'seclectDeviceList'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
selected: function (val, oldVal) {
|
||||
this.deviceSelect(val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
this.$store.state.map.map.displayList.forEach(item => {
|
||||
if (item.type === 'DEPOT_IL') {
|
||||
this.addModel = item;
|
||||
} else {
|
||||
this.otherData.push(item);
|
||||
}
|
||||
});
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) {
|
||||
this.seclectDeviceList.forEach(item => {
|
||||
if (this.addModel.elementList.indexOf(item.code) < 0) {
|
||||
this.addModel.elementList.push(item.code);
|
||||
}
|
||||
});
|
||||
} else if (selected) {
|
||||
if (this.addModel.elementList.indexOf(selected.code) < 0) {
|
||||
this.addModel.elementList.push(selected.code);
|
||||
}
|
||||
}
|
||||
},
|
||||
getDeviceName(code) {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
return device.name || device.code;
|
||||
},
|
||||
// 删除当前选中
|
||||
delList(model, list) {
|
||||
list.forEach((nor, index) => {
|
||||
if (nor == model) {
|
||||
list.splice(index, 1);
|
||||
}
|
||||
});
|
||||
this.seclectDeviceList.forEach((item, index) => {
|
||||
if (item.code == model) {
|
||||
this.seclectDeviceList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
},
|
||||
save() {
|
||||
const map = this.$store.state.map.map;
|
||||
const param = {
|
||||
displayList: [...this.otherData, this.addModel],
|
||||
mapId: this.$route.params.mapId
|
||||
};
|
||||
this.dataLoading = true;
|
||||
saveMap(Object.assign(map, param)).then(response => {
|
||||
this.$message.success('保存车辆段配置成功');
|
||||
this.dataLoading = false;
|
||||
}).catch(() => {
|
||||
this.dataLoading = false;
|
||||
this.$messageBox('保存车辆段配置失败');
|
||||
});
|
||||
},
|
||||
back() {
|
||||
this.$emit('goDraw');
|
||||
},
|
||||
|
||||
clear() {
|
||||
this.addModel = { type: 'DEPOT_IL', elementList: [] };
|
||||
},
|
||||
generateData() {
|
||||
this.loading = true;
|
||||
this.clear();
|
||||
const station = this.stationList.find(item => item.depot);
|
||||
console.log(station, station.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 => {
|
||||
if (item.stationCode === station.code) {
|
||||
this.addModel.elementList.push(item.code);
|
||||
}
|
||||
});
|
||||
[...this.directionRodList].forEach(item => {
|
||||
if (item.deviceStationCode === station.code) {
|
||||
this.addModel.elementList.push(item.code);
|
||||
}
|
||||
});
|
||||
this.psdList.forEach(item => {
|
||||
const stand = this.$store.getters['map/getDeviceByCode'](item.standCode);
|
||||
if (stand.stationCode === station.code) {
|
||||
this.addModel.elementList.push(item.code);
|
||||
}
|
||||
});
|
||||
const map = this.$store.state.map.map;
|
||||
const param = {
|
||||
displayList: [...this.otherData, this.addModel],
|
||||
mapId: this.$route.params.mapId
|
||||
};
|
||||
saveMap(Object.assign(map, param)).then(response => {
|
||||
this.loading = false;
|
||||
this.$message.success('保存车辆段配置成功');
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox('保存车辆段配置失败');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.title-box{
|
||||
padding-left: 10px;
|
||||
border-left: 4px solid red;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.list-box{
|
||||
overflow: hidden;
|
||||
.list-content{
|
||||
float: left;
|
||||
background: #e2e2e2;
|
||||
margin: 5px;
|
||||
border-radius: 5px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding-left: 10px;
|
||||
padding-right: 3px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover{
|
||||
background: #ccc;
|
||||
}
|
||||
.name{
|
||||
float: left;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.close{
|
||||
float: left;
|
||||
width: 23px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -13,10 +13,8 @@
|
||||
<el-dropdown class="operate-button" trigger="click">
|
||||
<span class="el-dropdown-link">配置</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item><span @click="showDispatchConfig">行调配置</span></el-dropdown-item>
|
||||
<el-dropdown-item><span @click="showLocalConfig">现地配置</span></el-dropdown-item>
|
||||
<el-dropdown-item><span @click="showScreenConfig">大屏配置</span></el-dropdown-item>
|
||||
<el-dropdown-item><span @click="showDepotConfig">车辆段配置</span></el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-dropdown class="operate-button" trigger="click">
|
||||
@ -40,10 +38,16 @@
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<local-config v-if="configShow === 'local'" ref="localConfig" :selected="selected" @goDraw="goDraw" />
|
||||
<split-screen v-else-if="configShow === 'screen'" ref="splitScreen" :selected="selected" @goDraw="goDraw" />
|
||||
<dispatch-config v-else-if="configShow === 'dispatch'" ref="dispatchConfig" :selected="selected" @goDraw="goDraw" />
|
||||
<depot-config v-else-if="configShow === 'depot'" ref="dispatchConfig" :selected="selected" @goDraw="goDraw" />
|
||||
<template v-if="configShow === 'local'">
|
||||
<local-config ref="localConfig" :selected="selected" @goDraw="goDraw" />
|
||||
</template>
|
||||
<template v-show="configShow === 'screen'">
|
||||
<split-screen
|
||||
ref="splitScreen"
|
||||
:selected="selected"
|
||||
@goDraw="goDraw"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
@ -71,13 +75,11 @@ import ResponderDraft from './responder/index';
|
||||
import ControlLamp from './controlLamp';
|
||||
import SplitStation from './splitStation';
|
||||
import Arrow from './arrow';
|
||||
import SplitScreen from './displayConfig/splitScreen';
|
||||
import SplitScreen from './splitScreen';
|
||||
import FloodGate from './floodGate';
|
||||
import DirectionRod from './directionRod';
|
||||
import SignalButton from './signalButton';
|
||||
import LocalConfig from './displayConfig/localConfig';
|
||||
import DispatchConfig from './displayConfig/dispatchConfig';
|
||||
import DepotConfig from './displayConfig/depotConfig';
|
||||
import LocalConfig from './localConfig';
|
||||
|
||||
export default {
|
||||
name: 'MapOperate',
|
||||
@ -109,9 +111,7 @@ export default {
|
||||
FloodGate,
|
||||
DirectionRod,
|
||||
SignalButton,
|
||||
LocalConfig,
|
||||
DispatchConfig,
|
||||
DepotConfig
|
||||
LocalConfig
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -188,18 +188,12 @@ export default {
|
||||
dataRelation() {
|
||||
this.$emit('selectView', 'path');
|
||||
},
|
||||
showDispatchConfig() {
|
||||
this.configShow = 'dispatch';
|
||||
},
|
||||
showLocalConfig() {
|
||||
this.configShow = 'local';
|
||||
},
|
||||
showScreenConfig() {
|
||||
this.configShow = 'screen';
|
||||
},
|
||||
showDepotConfig() {
|
||||
this.configShow = 'depot';
|
||||
},
|
||||
goDraw() {
|
||||
this.configShow = 'none';
|
||||
},
|
||||
|
@ -65,8 +65,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="generateAllData">全显生成</el-button>
|
||||
<el-button type="primary" size="small" @click="generateData">按集中站生成并保存</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>
|
||||
@ -92,9 +91,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
otherData: [],
|
||||
addModel: {
|
||||
type: 'LOCAL',
|
||||
stationCodeList: [],
|
||||
switchStationCodeList:[],
|
||||
elementList: []
|
||||
@ -128,6 +125,7 @@ export default {
|
||||
'tempSpeedLimitList',
|
||||
'textList',
|
||||
'totalGuideLockButtonVOList',
|
||||
'localStationConfig',
|
||||
'seclectDeviceList'
|
||||
]),
|
||||
cardTitle() {
|
||||
@ -160,14 +158,7 @@ export default {
|
||||
// }
|
||||
// },
|
||||
initData() {
|
||||
// this.tableData = (this.$store.state.map.map.displayList || []).filter(item => item.type === 'LOCAL');
|
||||
this.$store.state.map.map.displayList.forEach( item => {
|
||||
if (item.type === 'LOCAL') {
|
||||
this.tableData.push(item);
|
||||
} else {
|
||||
this.otherData.push(item);
|
||||
}
|
||||
});
|
||||
this.tableData = this.$store.state.map.map.displayList || [];
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) {
|
||||
@ -231,7 +222,7 @@ export default {
|
||||
save() {
|
||||
const map = this.$store.state.map.map;
|
||||
const param = {
|
||||
displayList: [...this.tableData, ...this.otherData],
|
||||
displayList: this.tableData,
|
||||
mapId: this.$route.params.mapId
|
||||
};
|
||||
this.dataLoading = true;
|
||||
@ -260,63 +251,20 @@ export default {
|
||||
this.clearData();
|
||||
},
|
||||
clear() {
|
||||
this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] };
|
||||
this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] };
|
||||
},
|
||||
clearData() {
|
||||
this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] };
|
||||
this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] };
|
||||
this.index = '';
|
||||
this.cardMode = 'generate';
|
||||
},
|
||||
generateAllData() {
|
||||
this.loading = true;
|
||||
this.tableData = [];
|
||||
const tempData = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] };
|
||||
const stationCodeList = [];
|
||||
this.stationList.forEach(item => {
|
||||
if (!item.depot) {
|
||||
tempData.stationCodeList.push(item.code);
|
||||
} else { stationCodeList.push(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 => {
|
||||
if (!stationCodeList.includes(item.stationCode)) {
|
||||
tempData.elementList.push(item.code);
|
||||
}
|
||||
});
|
||||
[...this.directionRodList].forEach(item => {
|
||||
if (!stationCodeList.includes(item.deviceStationCode)) {
|
||||
tempData.elementList.push(item.code);
|
||||
}
|
||||
});
|
||||
this.psdList.forEach(item => {
|
||||
const stand = this.$store.getters['map/getDeviceByCode'](item.standCode);
|
||||
if (!stationCodeList.includes(stand.stationCode)) {
|
||||
tempData.elementList.push(item.code);
|
||||
}
|
||||
});
|
||||
this.tableData.push(tempData);
|
||||
const map = this.$store.state.map.map;
|
||||
const param = {
|
||||
displayList: [...this.tableData, ...this.otherData],
|
||||
mapId: this.$route.params.mapId
|
||||
};
|
||||
saveMap(Object.assign(map, param)).then(response => {
|
||||
this.loading = false;
|
||||
this.$message.success('保存现地配置成功');
|
||||
this.cancelOverlab();
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox('保存现地配置失败');
|
||||
});
|
||||
},
|
||||
generateData() {
|
||||
this.loading = true;
|
||||
this.tableData = [];
|
||||
// switchStationCodeList:[...item.switchStationCodeList, item.code]
|
||||
this.stationList.forEach(item => {
|
||||
if (item.centralized) {
|
||||
this.tableData.push({type: 'LOCAL', stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code], switchStationCodeList:[...item.chargeStationCodeList, item.code]});
|
||||
this.tableData.push({stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code], switchStationCodeList:[...item.chargeStationCodeList, item.code]});
|
||||
}
|
||||
});
|
||||
|
||||
@ -337,7 +285,7 @@ export default {
|
||||
});
|
||||
const map = this.$store.state.map.map;
|
||||
const param = {
|
||||
displayList: [...this.tableData, ...this.otherData],
|
||||
displayList: this.tableData,
|
||||
mapId: this.$route.params.mapId
|
||||
};
|
||||
saveMap(Object.assign(map, param)).then(response => {
|
Loading…
Reference in New Issue
Block a user