This commit is contained in:
fan 2019-12-06 14:36:27 +08:00
commit a4f83d1f38

View File

@ -742,6 +742,8 @@ export default {
isSegmentation: false,
segmentationPosition: { x: 0, y: 0 },
relSwitchCode: '',
rightSectionCode:'',
leftSectionCode:'',
kmRangeRight: '',
kmRangeLeft: '',
region: '',
@ -792,9 +794,17 @@ export default {
{ x: start_x, y: start_y },
{ x: end_x, y: end_y }
];
const models = [];
const leftSection = this.getSectionByCode(this.createModel.leftSectionCode);
const rightSection = this.getSectionByCode(this.createModel.rightSectionCode);
model.leftSectionCode = this.createModel.leftSectionCode;
leftSection.rightSectionCode = model.code;
rightSection.leftSectionCode = model.code;
model.rightSectionCode = this.createModel.rightSectionCode;
this.$emit('updateMapModel', model);
models.push(model);
models.push(leftSection);
models.push(rightSection);
this.$emit('updateMapModel', models);
} else if (this.createModel.type == '03') {
if (this.createModel.leftSectionCode) {
const startModel = this.$store.getters['map/getDeviceByCode'](this.createModel.leftSectionCode);
@ -804,8 +814,13 @@ export default {
{ x: start_x, y: start_y },
{ x: start_x + this.createModel.length, y: start_y }
];
const models = [];
model.leftSectionCode = this.createModel.leftSectionCode;
this.$emit('updateMapModel', model);
const leftSection = this.getSectionByCode(this.createModel.leftSectionCode);
leftSection.rightSectionCode = model.code;
models.push(model);
models.push(leftSection);
this.$emit('updateMapModel', models);
}
}