This commit is contained in:
zyy 2019-12-03 14:42:07 +08:00
commit c089ce1187
29 changed files with 647 additions and 593 deletions

View File

@ -9,10 +9,11 @@ export function getMapTree() {
} }
/** 草稿地图列表*/ /** 草稿地图列表*/
export function listMap() { export function listMap(params) {
return request({ return request({
url: '/api/mapBuild/list', url: '/api/mapBuild/list',
method: 'get' method: 'get',
params: params
}); });
} }

View File

@ -554,5 +554,6 @@ export default {
coordinateMode: 'Coordinate mode', coordinateMode: 'Coordinate mode',
sectionAssociationMode: 'Section association mode', sectionAssociationMode: 'Section association mode',
leftAssociatedSection: 'Left associated section', 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: '坐标方式', coordinateMode: '坐标方式',
sectionAssociationMode: '区段关联方式', sectionAssociationMode: '区段关联方式',
leftAssociatedSection: '左关联区段', leftAssociatedSection: '左关联区段',
rightAssociatedSection: '右关联区段' rightAssociatedSection: '右关联区段',
chargeStationList:'管理车站列表'
}; };

View File

@ -151,7 +151,6 @@ class SkinCode extends defaultStyle {
text: { text: {
show: true, // 信号机名称显示 show: true, // 信号机名称显示
distance: 3, // 文字和灯杆的距离 distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式 isAlignCenter: false, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小 fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细 fontWeight: 'bold', // 信号机名称字体粗细

View File

@ -151,7 +151,6 @@ class SkinCode extends defaultStyle {
text: { text: {
show: true, // 信号机名称显示 show: true, // 信号机名称显示
distance: 3, // 文字和灯杆的距离 distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式 isAlignCenter: false, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小 fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细 fontWeight: 'bold', // 信号机名称字体粗细

View File

@ -154,7 +154,6 @@ class SkinCode extends defaultStyle {
text: { text: {
show: true, // 信号机名称显示 show: true, // 信号机名称显示
distance: 3, // 文字和灯杆的距离 distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式 isAlignCenter: false, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小 fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细 fontWeight: 'bold', // 信号机名称字体粗细

View File

@ -151,7 +151,6 @@ class SkinCode extends defaultStyle {
text: { text: {
show: true, // 信号机名称显示 show: true, // 信号机名称显示
distance: 3, // 文字和灯杆的距离 distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式 isAlignCenter: false, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小 fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细 fontWeight: 'bold', // 信号机名称字体粗细

View File

@ -27,7 +27,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式 textVerticalAlign: 'middle' // 文字垂直对齐方式
}, },
logicText: { logicText: {
show: false, // 逻辑区段名称显示 show: true, // 逻辑区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 6, // 文字离区段距离 distance: 6, // 文字离区段距离
fontSize: 8, // 字体大小 fontSize: 8, // 字体大小
@ -144,7 +144,6 @@ class SkinCode extends defaultStyle {
text: { text: {
show: true, // 信号机名称显示 show: true, // 信号机名称显示
distance: 0, // 文字和灯杆的距离 distance: 0, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: true, // 信号字体对其方式 isAlignCenter: true, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小 fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细 fontWeight: 'bold', // 信号机名称字体粗细

View File

@ -68,13 +68,12 @@ class Signal extends Group {
// 信号机名称 // 信号机名称
const sigNameX = model.position.x - drict * (style.Signal.post.standardWidth) + model.namePosition.x; const sigNameX = model.position.x - drict * (style.Signal.post.standardWidth) + model.namePosition.x;
const sigNameY = model.position.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance); const sigNameY = model.position.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance);
const textAlign = style.Signal.text.isAlignCenter ? 'middle': this.model.directionShowType == '01'? 'right': 'left'; const textAlign = style.Signal.text.isAlignCenter ? 'middle' : this.model.directionShowType == '01' ? 'right' : 'left';
const textVerticalAlign = posit == 1 ? 'top' : 'bottom'; const textVerticalAlign = posit == 1 ? 'top' : 'bottom';
this.sigName = new ESigName({ this.sigName = new ESigName({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
silent: false, silent: false,
isNoRotation: style.Signal.text.isNoRotation,
style: style, style: style,
x: sigNameX, x: sigNameX,
y: sigNameY, y: sigNameY,
@ -172,7 +171,7 @@ class Signal extends Group {
device.eachChild(item => { device.eachChild(item => {
if (item instanceof Group) { if (item instanceof Group) {
this.transformRotation(item); this.transformRotation(item);
} else if (item && item.model && item.model.isNoRotation) { } else if (item) {
item.origin = [this.model.position.x, this.model.position.y]; item.origin = [this.model.position.x, this.model.position.y];
item.rotation = -Math.PI / 180 * Number(this.model.rotate); item.rotation = -Math.PI / 180 * Number(this.model.rotate);
item.dirty(); item.dirty();

View File

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

View File

@ -99,7 +99,7 @@ export default {
this.loading = true; this.loading = true;
this.treeData = this.treeList = []; this.treeData = this.treeList = [];
try { try {
const res = await listMap(); const res = await listMap({ drawWay:'0'});
res.data && res.data.forEach(elem=>{ res.data && res.data.forEach(elem=>{
elem.type = 'map'; elem.type = 'map';
elem.children = [ elem.children = [

View File

@ -143,7 +143,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'0'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -152,7 +152,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'0'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -162,7 +162,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'0'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -245,7 +245,7 @@ export default {
} }
}, },
acquireMapList() { acquireMapList() {
listMap().then(response => { listMap({ drawWay:'0'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -175,7 +175,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'0'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -127,7 +127,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'0'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -87,7 +87,7 @@ export default {
this.loading = true; this.loading = true;
this.treeData = this.treeList = []; this.treeData = this.treeList = [];
try { try {
const res = await listMap(); const res = await listMap({ drawWay:'1'});
res.data && res.data.forEach(elem=>{ res.data && res.data.forEach(elem=>{
elem.type = 'map'; elem.type = 'map';
elem.children = [ elem.children = [

View File

@ -143,7 +143,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'1'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -152,7 +152,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'1'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -162,7 +162,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'1'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -245,7 +245,7 @@ export default {
} }
}, },
acquireMapList() { acquireMapList() {
listMap().then(response => { listMap({ drawWay:'1'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -175,7 +175,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({drawWay: '1'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -127,7 +127,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'1'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -41,6 +41,26 @@
</template> </template>
</el-form-item> </el-form-item>
</template> </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')"> <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-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
<el-select <el-select
@ -97,7 +117,7 @@
<template v-if="checkFieldType(item, 'radio')"> <template v-if="checkFieldType(item, 'radio')">
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required"> <el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
<el-radio-group v-model="formModel[item.prop]" :disabled="item.disabled"> <el-radio-group v-model="formModel[item.prop]" :disabled="item.disabled">
<el-radio v-for="(opts, indexs) in item.radioList" :key="indexs" :border="item.border" :label="opts.value">{{ opts.label }}</el-radio> <el-radio v-for="(opts, indexs) in item.radioList" :key="indexs" :border="item.border" :label="opts[item.optionValue]||opts.value">{{ opts[item.optionLabel]||opts.label }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</template> </template>

View File

@ -32,45 +32,46 @@
@click="hover('selectSingalCode')" @click="hover('selectSingalCode')"
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item label="信号机名称:" prop="name">
<el-input v-model="addModel.name" style="width: 178px;" />
</el-form-item>
<el-form-item :label="$t('map.leftOrRight')" prop="leftOrRight"> <el-form-item :label="$t('map.leftOrRight')" prop="leftOrRight">
<el-select v-model="addModel.leftOrRight" filterable> <el-radio-group v-model="addModel.leftOrRight">
<el-option <el-radio
v-for="item in SignalLeftOrRightList" v-for="item in SignalLeftOrRightList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.value"
:value="item.value" border
/> size="mini"
</el-select> >
</el-form-item> {{ item.label }}</el-radio>
<el-form-item :label="$t('map.directionType')" prop="directionType"> </el-radio-group>
<el-select v-model="addModel.directionType" filterable>
<el-option
v-for="item in SignalDirectionTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.signalDirectionTypeX')" prop="directionShowType"> <el-form-item :label="$t('map.signalDirectionTypeX')" prop="directionShowType">
<el-select v-model="addModel.directionShowType" filterable> <el-radio-group v-model="addModel.directionShowType">
<el-option <el-radio
v-for="item in SignalDirectionList" v-for="item in SignalDirectionList"
:key="item.code" :key="item.code"
:label="item.name" :label="item.code"
:value="item.code" border
/> size="mini"
</el-select> >
{{ item.name }}
</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.positionType')" prop="positionType"> <el-form-item :label="$t('map.positionType')" prop="positionType">
<el-select v-model="addModel.positionType" filterable> <el-radio-group v-model="addModel.positionType">
<el-option <el-radio
v-for="item in SignalPositionTypeList" v-for="item in SignalPositionTypeList"
:key="item.code" :key="item.code"
:label="item.name" :label="item.code"
:value="item.code" border
/> size="mini"
</el-select> >
{{ item.name }}
</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.equipmentStation')" prop="stationCode"> <el-form-item :label="$t('map.equipmentStation')" prop="stationCode">
<el-select v-model="addModel.stationCode" filterable> <el-select v-model="addModel.stationCode" filterable>
@ -125,7 +126,6 @@ export default {
SignalPotLampTypeList: [], SignalPotLampTypeList: [],
SignalLampPostTypeList: [], SignalLampPostTypeList: [],
SignalLampPositionTypeList: [], SignalLampPositionTypeList: [],
SignalDirectionTypeList: [],
SignalPositionTypeList: [], SignalPositionTypeList: [],
SignalUseTypeList: [], SignalUseTypeList: [],
failTypes: [ failTypes: [
@ -141,7 +141,6 @@ export default {
lampPositionType: '', lampPositionType: '',
potLampType: '01', potLampType: '01',
directionShowType: '', directionShowType: '',
directionType: '',
positionType: '', positionType: '',
namePosition: { x: 0, y: 0 }, namePosition: { x: 0, y: 0 },
useType: '', useType: '',
@ -158,7 +157,7 @@ export default {
field: '', field: '',
addModel: { addModel: {
sectionCode: '', sectionCode: '',
directionType: '01', name: '',
directionShowType: '01', directionShowType: '01',
leftOrRight: '0', leftOrRight: '0',
positionType: '01', positionType: '01',
@ -168,9 +167,6 @@ export default {
sectionCode: [ sectionCode: [
{ required: true, message: this.$t('rules.selectPhysicalExtentName'), trigger: 'change' } { required: true, message: this.$t('rules.selectPhysicalExtentName'), trigger: 'change' }
], ],
directionType: [
{ required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.directionType'), trigger: 'change' }
],
directionShowType: [ directionShowType: [
{ required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.directionType'), trigger: 'change' } { required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.directionType'), trigger: 'change' }
], ],
@ -181,7 +177,7 @@ export default {
{ required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.positionType'), trigger: 'change' } { required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.positionType'), trigger: 'change' }
], ],
stationCode: [ stationCode: [
{ required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.equipmentStation'), trigger: 'change' } { required: false, message: this.$t('map.pleaseSelect') + '' + this.$t('map.equipmentStation'), trigger: 'change' }
] ]
} }
}; };
@ -228,10 +224,10 @@ export default {
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' }, { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }, ] },
{ prop: 'lampPostType', label: this.$t('map.lampPostType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPostTypeList }, { prop: 'lampPostType', label: this.$t('map.lampPostType'), type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.SignalLampPostTypeList },
{ prop: 'lampPositionType', label: this.$t('map.lampPositionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPositionTypeList }, { prop: 'lampPositionType', label: this.$t('map.lampPositionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPositionTypeList },
{ prop: 'directionShowType', label: this.$t('map.signalDirectionTypeX'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalDirectionList }, { prop: 'directionShowType', label: this.$t('map.signalDirectionTypeX'), type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.SignalDirectionList },
{ prop: 'positionType', label: this.$t('map.signalPositionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalPositionTypeList }, { prop: 'positionType', label: this.$t('map.signalPositionType'), type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.SignalPositionTypeList },
{ prop: 'rotate', label: this.$t('map.rotateAngle'), type: 'number', min: -90, max: 90, placeholder: this.$t('tip.angle') }, { prop: 'rotate', label: this.$t('map.rotateAngle'), type: 'number', min: -90, max: 90, placeholder: this.$t('tip.angle') },
{ prop: 'namePosition', label: this.$t('map.signalNamePosition'), type: 'coordinate', width: '140px', children: [ { prop: 'namePosition', label: this.$t('map.signalNamePosition'), type: 'coordinate', width: '140px', children: [
{ prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' }, { prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
@ -253,7 +249,6 @@ export default {
name: this.$t('map.mapData'), name: this.$t('map.mapData'),
item: [ item: [
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList }, { prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList },
{ prop: 'directionType', label: this.$t('map.signalDirectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalDirectionTypeList },
{ prop: 'uniqueName', label: this.$t('map.signalUniqueName'), type: 'input' }, { prop: 'uniqueName', label: this.$t('map.signalUniqueName'), type: 'input' },
{ prop: 'useType', label: this.$t('map.signalUseType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalUseTypeList }, { prop: 'useType', label: this.$t('map.signalUseType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalUseTypeList },
{ prop: 'potLampType', label: this.$t('map.potLampType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalPotLampTypeList }, { prop: 'potLampType', label: this.$t('map.potLampType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalPotLampTypeList },
@ -320,10 +315,6 @@ export default {
this.SignalLampPositionTypeList = list; this.SignalLampPositionTypeList = list;
}); });
this.$Dictionary.signalDirectionType().then(list => {
this.SignalDirectionTypeList = list;
});
this.$Dictionary.signalPositionType().then(list => { this.$Dictionary.signalPositionType().then(list => {
this.SignalPositionTypeList = list; this.SignalPositionTypeList = list;
}); });
@ -369,7 +360,6 @@ export default {
uniqueName: uid, uniqueName: uid,
sectionCode: this.addModel.sectionCode, sectionCode: this.addModel.sectionCode,
positionType: this.addModel.positionType, positionType: this.addModel.positionType,
directionType: this.addModel.directionType,
directionShowType: this.addModel.directionShowType, directionShowType: this.addModel.directionShowType,
nameShow: true, nameShow: true,
namePosition: { x: 0, y: 0 }, namePosition: { x: 0, y: 0 },
@ -383,7 +373,7 @@ export default {
}; };
this.sectionList.forEach(elem => { this.sectionList.forEach(elem => {
if (elem.code === this.addModel.sectionCode) { if (elem.code === this.addModel.sectionCode) {
model.name = 'Signal_' + elem.name.replace('Section_', ''); model.name = this.addModel.name || 'Signal_' + elem.name.replace('Section_', '');
model.linkCode = elem.code; model.linkCode = elem.code;
if (this.addModel.leftOrRight === '0') { if (this.addModel.leftOrRight === '0') {
const beg = elem.points[0]; const beg = elem.points[0];

View File

@ -67,6 +67,7 @@ export default {
return { return {
activeName: 'first', activeName: 'first',
field: '', field: '',
chargeStation:[],
editModel: { editModel: {
centralized: false, centralized: false,
concentrateStationCode: '', concentrateStationCode: '',
@ -83,10 +84,12 @@ export default {
kmPostFont: '', kmPostFont: '',
kmPostFontColor: '#FFFFFF', kmPostFontColor: '#FFFFFF',
isShowControlMode: '', isShowControlMode: '',
chargeStationCodeList:[],
position: { position: {
x: 0, x: 0,
y: 0 y: 0
} },
controlled:false
}, },
addModel: { addModel: {
sectionCode: '' sectionCode: ''
@ -135,9 +138,10 @@ export default {
map: { map: {
name: this.$t('map.mapData'), name: this.$t('map.mapData'),
item: [ item: [
{ prop: 'concentrateStationCode', label: this.$t('map.concentrateStationCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.stationList }, { 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' }, { 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: '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' } { prop: 'runPlanName', label: this.$t('map.stationRunPlanName'), type: 'input' }
] ]
} }
@ -194,6 +198,9 @@ export default {
this.activeName = 'first'; this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected); this.editModel = deepAssign(this.editModel, selected);
this.editModel.runPlanName = selected.runPlanName || ''; 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()) { if (this.field.toUpperCase() === 'selectStationCode'.toUpperCase()) {
this.addModel.sectionCode = selected.code; this.addModel.sectionCode = selected.code;
@ -202,6 +209,45 @@ export default {
this.$emit('stationSectionCode', ''); 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) { hover(field) {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;
this.$emit('stationSectionCode', this.field); this.$emit('stationSectionCode', this.field);
@ -224,7 +270,9 @@ export default {
kmPostFont: '8px consolas', kmPostFont: '8px consolas',
kmPostFontColor: '#FFFFFF', kmPostFontColor: '#FFFFFF',
centralized: false, centralized: false,
concentrateStationCode: '' concentrateStationCode: '',
controlled:false,
chargeStationCodeList:[]
}; };
this.sectionList.forEach(elem => { this.sectionList.forEach(elem => {
if (elem.code === this.addModel.sectionCode) { if (elem.code === this.addModel.sectionCode) {

View File

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