Merge branch 'dev' of https://git.code.tencent.com/lian-cbtc/jl-client into dev
This commit is contained in:
commit
193f9267a1
@ -107,7 +107,8 @@ export default {
|
||||
'stationList',
|
||||
'sectionList',
|
||||
'zcList',
|
||||
'lineCode'
|
||||
'lineCode',
|
||||
'stationStandList'
|
||||
]),
|
||||
form() {
|
||||
return {
|
||||
@ -198,6 +199,7 @@ export default {
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
this.editModel.runPlanName = selected.runPlanName || '';
|
||||
// 筛选数据 去掉已经是集中站的数据,去掉自己本身,去掉被别的集中站选中的数据
|
||||
this.chargeStation = this.stationList.filter(data=>{
|
||||
return !data.centralized && data.code != this.editModel.code && !(data.controlled && data.concentrateStationCode != this.editModel.code);
|
||||
});
|
||||
@ -209,17 +211,20 @@ export default {
|
||||
this.$emit('stationSectionCode', '');
|
||||
}
|
||||
},
|
||||
// 选择管理车站
|
||||
changeChargeStation(data) {
|
||||
if (data.length > 0) {
|
||||
this.chargeStation.forEach(station=>{
|
||||
const newModal = Object.assign({}, station);
|
||||
newModal.controlled = false;
|
||||
newModal.concentrateStationCode = '';
|
||||
this.setStationStand(station,"");
|
||||
data.forEach(each=>{
|
||||
switch (each) {
|
||||
case station.code: {
|
||||
newModal.controlled = true;
|
||||
newModal.concentrateStationCode = this.editModel.code;
|
||||
this.setStationStand(station,this.editModel.code);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -227,27 +232,44 @@ export default {
|
||||
this.$emit('updateMapModel', newModal);
|
||||
});
|
||||
} else {
|
||||
this.chargeStation.forEach(station=>{
|
||||
const newModal = Object.assign({}, station);
|
||||
newModal.controlled = false;
|
||||
newModal.concentrateStationCode = '';
|
||||
this.$emit('updateMapModel', newModal);
|
||||
});
|
||||
//没有选中数据,直接将其他车站设置为非控制
|
||||
this.modifyChargeStation();
|
||||
}
|
||||
this.edit();
|
||||
},
|
||||
changeCentralized(data) {
|
||||
if (!data) {
|
||||
// 将当前车站选为非集中站
|
||||
this.editModel.chargeStationCodeList = [];
|
||||
this.edit();
|
||||
this.chargeStation.forEach(station=>{
|
||||
const newModal = Object.assign({}, station);
|
||||
newModal.controlled = false;
|
||||
newModal.concentrateStationCode = '';
|
||||
this.$emit('updateMapModel', newModal);
|
||||
});
|
||||
this.modifyChargeStation();
|
||||
this.setStationStand(this.editModel,'');
|
||||
}else{
|
||||
this.setStationStand(this.editModel,this.editModel.code);
|
||||
}
|
||||
},
|
||||
modifyChargeStation(){
|
||||
this.chargeStation.forEach(station=>{
|
||||
const newModal = Object.assign({}, station);
|
||||
newModal.controlled = false;
|
||||
newModal.concentrateStationCode = '';
|
||||
|
||||
// 将原来被控制的车站下的站台,属性{所属设备集中站}设置为空
|
||||
this.setStationStand(station,"");
|
||||
|
||||
this.$emit('updateMapModel', newModal);
|
||||
});
|
||||
},
|
||||
// 设置属性{所属设备集中站}
|
||||
setStationStand(station,code){
|
||||
this.stationStandList.forEach(elem=>{
|
||||
if(elem.stationCode==station.code){
|
||||
const stationStand = Object.assign({}, elem);
|
||||
stationStand.deviceStationCode=code;
|
||||
this.$emit('updateMapModel', stationStand);
|
||||
}
|
||||
});
|
||||
},
|
||||
hover(field) {
|
||||
this.field = field === this.field ? '' : field;
|
||||
this.$emit('stationSectionCode', this.field);
|
||||
|
@ -18,7 +18,7 @@
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-form ref="make" :model="addModel" label-width="120px" size="mini" :rules="makeRules">
|
||||
<el-form-item :label="$t('map.stationstandName')" prop="stationCode">
|
||||
<el-select v-model="addModel.stationCode" filterable>
|
||||
<el-select v-model="addModel.stationCode" filterable multiple style="width: 350px;">
|
||||
<el-option
|
||||
v-for="item in stationList"
|
||||
:key="item.code"
|
||||
@ -77,7 +77,7 @@ export default {
|
||||
// lskContent: ''
|
||||
},
|
||||
addModel: {
|
||||
stationCode: ''
|
||||
stationCode: []
|
||||
},
|
||||
makeRules: {
|
||||
stationCode: [
|
||||
@ -190,27 +190,30 @@ export default {
|
||||
create() {
|
||||
this.$refs['make'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.addModel.stationCode) {
|
||||
const uid = getUID('StationControl');
|
||||
const model = {
|
||||
_type: 'StationControl',
|
||||
code: uid
|
||||
// zokContent: '中控',
|
||||
// zbjkContent: '总报警',
|
||||
// zakContent: '站控',
|
||||
// jjzkContent: '紧急站控',
|
||||
// zzkContent: '站中控按钮',
|
||||
// lskContent: '连锁控'
|
||||
};
|
||||
this.stationList.forEach(elem => {
|
||||
if (elem.code === this.addModel.stationCode) {
|
||||
model.name = 'StationControl_' + elem.name.replace('Station_', '');
|
||||
model.position = { x: elem.position.x, y: elem.position.y };
|
||||
model.stationCode = elem.code;
|
||||
}
|
||||
if (this.addModel.stationCode.length) {
|
||||
const models = [];
|
||||
this.addModel.stationCode.forEach(item => {
|
||||
const uid = getUID('StationControl');
|
||||
const model = {
|
||||
_type: 'StationControl',
|
||||
code: uid
|
||||
// zokContent: '中控',
|
||||
// zbjkContent: '总报警',
|
||||
// zakContent: '站控',
|
||||
// jjzkContent: '紧急站控',
|
||||
// zzkContent: '站中控按钮',
|
||||
// lskContent: '连锁控'
|
||||
};
|
||||
this.stationList.forEach(elem => {
|
||||
if (elem.code === item) {
|
||||
model.name = 'StationControl_' + elem.name.replace('Station_', '');
|
||||
model.position = { x: elem.position.x, y: elem.position.y + 30 };
|
||||
model.stationCode = elem.code;
|
||||
}
|
||||
});
|
||||
models.push(model);
|
||||
});
|
||||
|
||||
this.$emit('updateMapModel', model);
|
||||
this.$emit('updateMapModel', models);
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectedStationEmpty'));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user