站台屏蔽门调整

This commit is contained in:
fan 2019-12-13 14:19:38 +08:00
parent 083e70dc02
commit fc3ab4cc21
6 changed files with 44 additions and 93 deletions

View File

@ -1,5 +1,6 @@
import Group from 'zrender/src/container/Group';
import ESafeDoor from './ESafeDoor';
import EHighlight from '../element/EHighlight';
export default class Line2 extends Group {
constructor(model, style) {
@ -12,6 +13,7 @@ export default class Line2 extends Group {
this.style = style;
this.create();
this.setState(model);
this.checkIsDrawMap();
}
create() {
@ -34,4 +36,17 @@ export default class Line2 extends Group {
setState(model) {
}
drawSelected(selected) {
this.highlight && this.highlight.drawSelected(selected);
}
checkIsDrawMap() {
const path = window.location.href;
if (path.includes('/map/draw')) {
this.highlight = new EHighlight(this);
this.add(this.highlight);
this.on('mouseout', () => { this.highlight.mouseout(); });
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
}

View File

@ -853,7 +853,7 @@ export default class Section extends Group {
drawSelected(selected) {
this.selected = selected;
if (selected) {
this.section && this.section.setStyle({stroke: 'rgba(204,255,255,0.8)'});
this.section && this.section.setStyle({stroke: 'rgba(0,255,255,0.6)'});
} else {
this.section && this.section.setStyle({stroke: this.style.Section.line.spareColor });
}

View File

@ -21,7 +21,7 @@ export default class EMouse extends Group {
z: this.device.z + 1,
shape: stationTextRect,
style: {
fill: 'rgba(204,255,255,0.5)'
fill: 'rgba(0,255,255,0.6)'
}
});

View File

@ -1,6 +1,5 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
import Polygon from 'zrender/src/graphic/shape/Polygon';
class EHighlight extends Group {
constructor(device) {
@ -11,13 +10,17 @@ class EHighlight extends Group {
}
create() {
if (this.device) {
let fill = 'rgba(0,255,255,0.6)';
if (this.device._type === 'Psd') {
fill = 'rgba(255,0,0,0.6)';
}
const rect = this.device.getBoundingRect();
this.lineBorder = new Rect({
zlevel: this.device.zlevel,
z: this.device.z + 1,
shape: rect,
style: {
fill: 'rgba(204,255,255,0.5)'
fill: fill
}
});
this.add(this.lineBorder);
@ -33,6 +36,7 @@ class EHighlight extends Group {
!this.selected && this.lineBorder && this.lineBorder.hide();
}
drawSelected(selected) {
console.log(selected, this.lineBorder, this.device);
if (selected && this.lineBorder) {
this.lineBorder && this.lineBorder.show();
this.selected = true;

View File

@ -172,6 +172,9 @@ export default {
this.enabledTab = data.name;
},
setSelected(selected) {
// if (selected._type === 'Psd' || selected._type === '') {
//
// }
switch (this.enabledTab) {
case 'protect':
this.$refs.protectOperate.setSelected(selected);

View File

@ -60,10 +60,6 @@ export default {
{ code: true, name: '右向'},
{ code: false, name: '左向'}
],
isSmallStandList: [
{ code: false, name: '否'},
{ code: true, name: '是'}
],
editModel: {
code: '',
name: '',
@ -75,9 +71,9 @@ export default {
stationCode: '', //
position: { x: 0, y: 0 },
visible: true, //
isRight: null,
isRight: true,
standTrackCode: '',
isSmallStand: false
small: false
// direction: '' //
},
field: '',
@ -87,13 +83,12 @@ export default {
pointY: 0, // y
width: 60,
height: 20,
doorType: '01', //
standTrackCode: '', //
standTrackUpCode: '', //
standTrackDownCode: '', //
stationstandDirection: '02', //
isRight: null,
isSmallStand: false
isRight: true,
small: false
}
};
},
@ -124,9 +119,9 @@ export default {
{ prop: 'visible', label: this.$t('map.stationVisible'), type: 'checkbox' },
{ prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectCode', buttonShowType: this.isButtonTypeS, isHidden: !this.doorTypeOne },
{ prop: 'isRight', label: '行驶方向', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList },
{ prop: 'isSmallStand', label: '小型站台', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isSmallStandList }
{ prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'editSectionSelectCode', buttonShowType: this.isButtonTypeES },
{ prop: 'isRight', label: '行驶方向:', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList },
{ prop: 'small', label: '是否小型站台:', type: 'checkbox' }
]
},
map: {
@ -165,12 +160,6 @@ export default {
],
standTrackCode: [
{ required: true, message: '请选择关联站台轨', trigger: 'change' }
],
isRight: [
{ required: true, message: '请选择行驶方向', trigger: 'change'}
],
isSmallStand: [
{ required: true, message: '请选择是否为小型站台', trigger: 'change'}
]
};
//
@ -193,20 +182,14 @@ export default {
{ prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectCode', buttonShowType: this.isButtonTypeS, isHidden: !this.doorTypeOne },
{ prop: 'isRight', label: '行驶方向', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList },
{ prop: 'isSmallStand', label: '小型站台', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isSmallStandList }
{ prop: 'isRight', label: '行驶方向:', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList },
{ prop: 'small', label: '是否小型站台:', type: 'checkbox' }
]
},
door: {
name: '屏蔽门数据',
item: [
{ prop: 'doorType', label: '屏蔽门类型:', type: 'radio', radioList: [
{value: '01', label: '单侧屏蔽门' },
{value: '02', label: '双侧屏蔽门' }
] },
{ prop: 'stationstandDirection', label: '屏蔽门朝向:', type: 'radio', radioList: this.DoorLocationTypeList, isHidden: !this.doorTypeOne },
{ prop: 'standTrackUpCode', label: '上行站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectUpCode', buttonShowType: this.isButtonTypeU, isHidden: !this.doorTypeTwo },
{ prop: 'standTrackDownCode', label: '下行站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectDownCode', buttonShowType: this.isButtonTypeD, isHidden: !this.doorTypeTwo }
{ prop: 'stationstandDirection', label: '屏蔽门朝向:', type: 'radio', radioList: this.DoorLocationTypeList }
]
}
}
@ -228,18 +211,6 @@ export default {
],
standTrackCode: [
{ required: true, message: '请选择关联站台轨', trigger: 'change' }
],
standTrackUpCode: [
{ required: true, message: '请选择站台轨', trigger: 'change' }
],
standTrackDownCode: [
{ required: true, message: '请选择站台轨', trigger: 'change' }
],
isRight: [
{ required: true, message: '请选择行驶方向', trigger: 'change'}
],
isSmallStand: [
{ required: true, message: '请选择是否为小型站台', trigger: 'change'}
]
};
},
@ -249,17 +220,8 @@ export default {
isButtonTypeS() {
return this.field == 'sectionSelectCode';
},
isButtonTypeU() {
return this.field == 'sectionSelectUpCode';
},
isButtonTypeD() {
return this.field == 'sectionSelectDownCode';
},
doorTypeOne() {
return this.addModel.doorType == '01';
},
doorTypeTwo() {
return this.addModel.doorType == '02';
isButtonTypeES() {
return this.field === 'editSectionSelectCode';
},
PhysicalSectionList() {
let list = [];
@ -322,14 +284,9 @@ export default {
this.activeName = 'second';
this.field = '';
this.$emit('standStationCode', '');
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionSelectUpCode'.toUpperCase()) {
this.addModel.standTrackUpCode = selected.code;
this.activeName = 'second';
this.field = '';
this.$emit('standStationCode', '');
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionSelectDownCode'.toUpperCase()) {
this.addModel.standTrackDownCode = selected.code;
this.activeName = 'second';
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'editSectionSelectCode'.toUpperCase()) {
this.editModel.standTrackCode = selected.code;
this.activeName = 'first';
this.field = '';
this.$emit('standStationCode', '');
}
@ -354,7 +311,7 @@ export default {
},
standTrackCode: this.addModel.standTrackCode,
isRight: this.addModel.isRight,
isSmallStand: this.addModel.isSmallStand
small: this.addModel.small
};
this.stationList.forEach(elem => {
if (elem.code == this.addModel.stationCode) {
@ -363,7 +320,7 @@ export default {
}
});
models.push(model);
if (this.addModel.doorType == '01' && !this.addModel.isSmallStand) {
if (!this.addModel.small) {
const uid = getUID('Psd', this.psdList);
const param = {
_type: 'Psd',
@ -381,36 +338,8 @@ export default {
param.position.y = this.addModel.pointY + (this.addModel.height / 2) + space;
}
models.push(param);
} else if (this.addModel.doorType == '02' && !this.addModel.isSmallStand) {
const arr = [];
for (let index = 0; index < 2; index++) {
const uid = getUID('Psd', [...this.psdList, ...arr]);
const param = {
_type: 'Psd',
code: uid,
name: `Psd${[...this.psdList, ...arr].length + 1}`,
width: this.addModel.width,
height: 3,
standCode: Standuid, // code
standTrackCode: '', //
position: {
x: models[0].position.x,
y: this.addModel.pointY
}
};
if (index == 0) {
param.standTrackCode = this.addModel.standTrackUpCode;
param.position.y = this.addModel.pointY - (this.addModel.height / 2) - space;
} else {
param.standTrackCode = this.addModel.standTrackDownCode;
param.position.y = this.addModel.pointY + (this.addModel.height / 2) + space;
}
arr.push(param);
}
arr.forEach(item => {
models.push(item);
});
}
console.log(models, '===========');
this.$emit('updateMapModel', models);
}
});