This commit is contained in:
fan 2019-12-03 13:36:30 +08:00
commit 676d93d1bd
6 changed files with 78 additions and 9 deletions

View File

@ -554,5 +554,6 @@ export default {
coordinateMode: 'Coordinate mode',
sectionAssociationMode: 'Section association mode',
leftAssociatedSection: 'Left associated section',
rightAssociatedSection: 'Right associated section'
rightAssociatedSection: 'Right associated section',
chargeStationList:'Managed station list'
};

View File

@ -548,5 +548,6 @@ export default {
coordinateMode: '坐标方式',
sectionAssociationMode: '区段关联方式',
leftAssociatedSection: '左关联区段',
rightAssociatedSection: '右关联区段'
rightAssociatedSection: '右关联区段',
chargeStationList:'管理车站列表'
};

View File

@ -24,7 +24,6 @@ export default class StationControl extends Group {
}
create() {
debugger;
const model = this.model;
// 紧急站控
if (this.style.StationControl.lamp.emergencyControlShow) {

View File

@ -41,6 +41,26 @@
</template>
</el-form-item>
</template>
<template v-if="checkFieldType(item, 'multiSelect')">
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
<el-select
v-model="formModel[item.prop]"
filterable
multiple
:placeholder="item.placeholder"
:disabled="item.disabled"
:clearable="item.clearable"
@change="item.deviceChange"
>
<el-option
v-for="option in item.options"
:key="option[item.optionValue]"
:label="handleLabel(option, item.optionLabel)"
:value="option[item.optionValue]"
/>
</el-select>
</el-form-item>
</template>
<template v-if="checkFieldType(item, 'selectHover')">
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
<el-select

View File

@ -67,6 +67,7 @@ export default {
return {
activeName: 'first',
field: '',
chargeStation:[],
editModel: {
centralized: false,
concentrateStationCode: '',
@ -83,10 +84,12 @@ export default {
kmPostFont: '',
kmPostFontColor: '#FFFFFF',
isShowControlMode: '',
chargeStationCodeList:[],
position: {
x: 0,
y: 0
}
},
controlled:false
},
addModel: {
sectionCode: ''
@ -135,9 +138,10 @@ export default {
map: {
name: this.$t('map.mapData'),
item: [
{ prop: 'concentrateStationCode', label: this.$t('map.concentrateStationCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.stationList },
{ prop: 'centralized', label: this.$t('map.centralized'), type: 'checkbox' },
{ prop: 'concentrateStationCode', label: this.$t('map.concentrateStationCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.stationList, disabled:this.editModel.controlled },
{ prop: 'centralized', label: this.$t('map.centralized'), type: 'checkbox', disabled:this.editModel.controlled, change:true, deviceChange:this.changeCentralized },
{ prop: 'zcCode', label: this.$t('map.zcCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.zcList, isHidden: !this.isZcCode },
{ prop: 'chargeStationCodeList', label: this.$t('map.chargeStationList'), type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.chargeStation, isHidden: !this.isZcCode, deviceChange:this.changeChargeStation},
{ prop: 'runPlanName', label: this.$t('map.stationRunPlanName'), type: 'input' }
]
}
@ -194,6 +198,9 @@ 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);
});
}
if (this.field.toUpperCase() === 'selectStationCode'.toUpperCase()) {
this.addModel.sectionCode = selected.code;
@ -202,6 +209,45 @@ 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 = '';
data.forEach(each=>{
switch (each) {
case station.code: {
newModal.controlled = true;
newModal.concentrateStationCode = this.editModel.code;
break;
}
}
});
this.$emit('updateMapModel', newModal);
});
} else {
this.chargeStation.forEach(station=>{
const newModal = Object.assign({}, station);
newModal.controlled = false;
newModal.concentrateStationCode = '';
this.$emit('updateMapModel', newModal);
});
}
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);
});
}
},
hover(field) {
this.field = field === this.field ? '' : field;
this.$emit('stationSectionCode', this.field);
@ -224,7 +270,9 @@ export default {
kmPostFont: '8px consolas',
kmPostFontColor: '#FFFFFF',
centralized: false,
concentrateStationCode: ''
concentrateStationCode: '',
controlled:false,
chargeStationCodeList:[]
};
this.sectionList.forEach(elem => {
if (elem.code === this.addModel.sectionCode) {

View File

@ -28,7 +28,7 @@
</el-select>
</el-form-item>
<el-form-item :label="$t('map.equipmentStation')" prop="deviceStationCode">
<el-select v-model="addModel.deviceStationCode" filterable>
<el-select v-model="addModel.deviceStationCode" filterable disabled>
<el-option
v-for="item in stationList"
:key="item.code"
@ -149,7 +149,7 @@ export default {
map: {
name: this.$t('map.mapData'),
item: [
{ prop: 'deviceStationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.stationList, change: true, deviceChange:this.updateView },
{ prop: 'deviceStationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.stationList, change: true, deviceChange:this.updateView, disabled:true},
{ prop: 'stationCode', label: this.$t('map.belongsStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, change: true, deviceChange:this.updateView }
]
}