# Conflicts:
#	src/views/newMap/newMapdraft/mapoperate/section.vue
This commit is contained in:
zyy 2019-12-02 13:09:09 +08:00
commit 829d1b7e0c
5 changed files with 167 additions and 119 deletions

View File

@ -241,7 +241,7 @@ export default {
displayAxleCounter: '是否显示计轴:',
displayLogicalExtents: '是否显示逻辑区段:',
displayLogicalWxtentNames: '是否显示逻辑区段名称:',
isStandTrack: '是否站台轨:',
1: '是否站台轨:',
standTrackName: '站台轨名称:',
standTrackNamePosition: '站台轨名称偏移量:',
relStandCode: '站台编码:',
@ -287,7 +287,7 @@ export default {
signalDirectionType: '行驶方向:',
signalDirectionTypeX: '显示方向:',
signalPositionType: '信号机位置类型:',
signalOffset: '所属link偏移量:',
signalOffset: '所属区段偏移量:',
signalLinkCode: '所属link',
signalPositionX: '信号机x:',
signalPositionY: '信号机y:',

View File

@ -1,67 +1,67 @@
/** 三角函数计算 */
function JTriangle(beg, end) {
this.init(beg, end);
this.init(beg, end);
}
JTriangle.prototype = {
constructor: JTriangle,
beg: null,
end: null,
abspowx: 0,
abspowy: 0,
abspowz: 0,
drictx: 0,
dricty: 0,
drict: 0,
constructor: JTriangle,
beg: null,
end: null,
abspowx: 0,
abspowy: 0,
abspowz: 0,
drictx: 0,
dricty: 0,
drict: 0,
init (beg, end) {
this.beg = beg;
this.end = end;
this.abspowx = Math.pow(this.end.x - this.beg.x, 2);
this.abspowy = Math.pow(this.end.y - this.beg.y, 2);
this.abspowz = this.abspowx + this.abspowy;
this.absx = Math.abs(this.end.x - this.beg.x);
this.absy = Math.abs(this.end.y - this.beg.y);
this.absz = Math.sqrt(Math.pow(this.end.x - this.beg.x, 2), Math.pow(this.end.y - this.beg.y, 2));
this.drictx = this.end.x > this.beg.x ? 1 : -1;
this.dricty = this.end.y > this.beg.y ? 1 : -1;
this.drict = this.drictx * this.dricty;
this.diff_x = end.x - beg.x;
this.diff_y = end.y - beg.y;
},
getRotation () {
return Math.atan(this.diff_y / this.diff_x);
},
getAngle () {
return 360 * Math.atan(this.diff_y / this.diff_x) / (2 * Math.PI);
},
getCos (n) {
return this.drictx * Math.sqrt(Math.pow(n, 2) * this.abspowx / this.abspowz);
},
getSin (n) {
return this.dricty * Math.sqrt(Math.pow(n, 2) * this.abspowy / this.abspowz);
},
getCosRate () {
return Math.sqrt(this.abspowx / this.abspowz);
},
getSinRate () {
return Math.sqrt(this.abspowy / this.abspowz);
},
getTanRate () {
var diff_x = this.end.x - this.beg.x;
var diff_y = this.end.y - this.beg.y;
return Math.abs(diff_y / diff_x);
},
getCotRate () {
var diff_x = this.end.x - this.beg.x;
var diff_y = this.end.y - this.beg.y;
return Math.abs(diff_x / diff_y);
},
middlePoint () {
return {
x: Math.min(this.end.x, this.beg.x) + Math.abs(this.end.x - this.beg.x) / 2,
y: Math.min(this.end.y, this.beg.y) + Math.abs(this.end.y - this.beg.y) / 2
};
}
init (beg, end) {
this.beg = beg;
this.end = end;
this.abspowx = Math.pow(this.end.x - this.beg.x, 2);
this.abspowy = Math.pow(this.end.y - this.beg.y, 2);
this.abspowz = this.abspowx + this.abspowy;
this.absx = Math.abs(this.end.x - this.beg.x);
this.absy = Math.abs(this.end.y - this.beg.y);
this.absz = Math.sqrt(Math.pow(this.end.x - this.beg.x, 2), Math.pow(this.end.y - this.beg.y, 2));
this.drictx = this.end.x > this.beg.x ? 1 : -1;
this.dricty = this.end.y > this.beg.y ? 1 : -1;
this.drict = this.drictx * this.dricty;
this.diff_x = end.x - beg.x;
this.diff_y = end.y - beg.y;
},
getRotation () {
return Math.atan(this.diff_y / this.diff_x);
},
getAngle () {
return 360 * Math.atan(this.diff_y / this.diff_x) / (2 * Math.PI);
},
getCos (n) {
return this.drictx * Math.sqrt(Math.pow(n, 2) * this.abspowx / this.abspowz);
},
getSin (n) {
return this.dricty * Math.sqrt(Math.pow(n, 2) * this.abspowy / this.abspowz);
},
getCosRate () {
return Math.sqrt(this.abspowx / this.abspowz);
},
getSinRate () {
return Math.sqrt(this.abspowy / this.abspowz);
},
getTanRate () {
var diff_x = this.end.x - this.beg.x;
var diff_y = this.end.y - this.beg.y;
return Math.abs(diff_y / diff_x);
},
getCotRate () {
var diff_x = this.end.x - this.beg.x;
var diff_y = this.end.y - this.beg.y;
return Math.abs(diff_x / diff_y);
},
middlePoint () {
return {
x: Math.min(this.end.x, this.beg.x) + Math.abs(this.end.x - this.beg.x) / 2,
y: Math.min(this.end.y, this.beg.y) + Math.abs(this.end.y - this.beg.y) / 2
};
}
};
export default JTriangle;

View File

@ -29,17 +29,17 @@ export default class Section extends Group {
create() {
const model = this.model;
// 01:物理区段02逻辑区段03道岔区段
// 01:计轴区段02逻辑区段03道岔区段 04道岔计轴区段
this.createSectionText(); // 创建区段文字
if (model.type === '01' && (
if ((model.type === '01' || model.type === '03') && (
model.logicSectionNum.length <= 0 ||
model.logicSectionNum.length == 1 && model.logicSectionNum[0] == 0) ||
model.type === '02') {
model.type === '02' ) {
this.createSection(); // 创建区段
this.creatRelease(); // 创建延时释放
this.createSeparator(); // 创建分隔符
this.createTurnBack(); // 创建成都三号线 折返箭头
if (model.type === '01') {
if (model.type === '01' && model.type === '03') {
this.createAxles(); // 创建计轴
}
}
@ -235,7 +235,7 @@ export default class Section extends Group {
let tempx = x;
let tempy = y;
// 创建区段名称
if (model.type !== '03') {
if (model.type !== '04') {
if (model.type == '02') {
const opposite = style.Section.logicText.opposite ? -1 : 1;
tempx += traingle.getSin(style.Section.logicText.distance);

View File

@ -224,9 +224,21 @@ export default {
}
},
data() {
var validateLeftSection = (rule, value, callback) => {
if (value === '') {
callback(new Error('请选择做关联区段'));
} else {
const leftSection = this.$store.getters['map/getDeviceByCode'](value);
if (leftSection.point[0] !== this.selected.point[0]) {
callback(new Error('所选择关联区段不相邻!'));
} else {
callback();
}
}
};
return {
questionList: [],
linksCollection: [],
activeName: 'first',
SectionTypeList: [],
SectionSepTypeList: [],
@ -264,7 +276,6 @@ export default {
relSwitchCode: '',
stationCode: '',
logicSectionNameSort: '',
linkCode: '',
sepTypeLeft: '',
offsetLeft: 0,
sepTypeRight: '',
@ -273,7 +284,9 @@ export default {
parentCode: '',
points: [],
lengthFact: 0,
isCurve: false
isCurve: false,
leftSection: '',
rightSection: ''
},
tableData: [],
oldPoint: [], //
@ -382,10 +395,12 @@ export default {
{ prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'type', label: this.$t('map.sectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList },
{ prop: 'leftSection', label: '左关联区段', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.PhysicalSectionList},
{ prop: 'rightSection', label: '右关联区段', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.PhysicalSectionList},
{ prop: 'type', label: this.$t('map.sectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList},
{ prop: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: true, options: this.sectionList, isHidden: !this.isParentCode },
{ prop: 'isStandTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isSwitchSectionShow }, // 1
{ prop: 'isStandTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isStandTrackShow }, // 1
{ prop: 'standTrackName', label: this.$t('map.standTrackName'), type: 'input', isHidden: !this.isstandTrackNameShow },
{ prop: 'standTrackNamePosition', label: this.$t('map.standTrackNamePosition'), type: 'coordinate', width: '150px', isHidden: !this.isstandTrackNameShow, children: [
@ -394,7 +409,7 @@ export default {
] },
{ prop: 'relStandCode', label: this.$t('map.relStandCode'), type: 'selectHover', optionLabel: 'code&&name', optionValue: 'code', options: this.stationStandList, hover: this.hover, buttonType: 'relStandCode', buttonShowType: this.isButtonType, isHidden: !this.isrelStandCode },
{ prop: 'isReentryTrack', label: this.$t('map.isReentryTrack'), type: 'checkbox', isHidden: !this.isSwitchSectionShow }, // 1
{ prop: 'isReentryTrack', label: this.$t('map.isReentryTrack'), type: 'checkbox', isHidden: !this.isStandTrackShow }, // 1
{ prop: 'reentryTrackName', label: this.$t('map.reentryTrackName'), type: 'input', isHidden: !this.isreentryTrackName },
{ prop: 'reentryTrackNamePosition', label: this.$t('map.reentryTrackNamePosition'), type: 'coordinate', width: '150px', isHidden: !this.isreentryTrackName, children: [
@ -402,7 +417,7 @@ export default {
{ prop: 'reentryTrackNamePosition.y', firstLevel: 'reentryTrackNamePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px'}
] },
{ prop: 'isTransferTrack', label: this.$t('map.isTransferTrack'), type: 'checkbox', isHidden: !this.isSwitchSectionShow }, // 1
{ prop: 'isTransferTrack', label: this.$t('map.isTransferTrack'), type: 'checkbox', isHidden: !this.isStandTrackShow }, // 1
{ prop: 'transferTrackName', label: this.$t('map.transferTrackName'), type: 'input', isHidden: !this.istransferTrackName },
{ prop: 'transferTrackNamePosition', label: this.$t('map.transferTrackNamePosition'), type: 'coordinate', width: '150px', isHidden: !this.istransferTrackName, children: [
@ -415,7 +430,7 @@ export default {
{ prop: 'destinationCodePoint.y', firstLevel: 'destinationCodePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px'}
] },
{ prop: 'isSwitchSection', label: this.$t('map.isSwitchSection'), type: 'checkbox', isHidden: !this.isSectionType, disabled: true },
{ prop: 'isSwitchSection', label: this.$t('map.isSwitchSection'), type: 'checkbox', isHidden: !this.isAssociatedSwitchSectionshow, disabled: true },
{ prop: 'relSwitchCode', label: this.$t('map.relSwitchCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.switchList, change: true, deviceChange: this.deviceChange, isHidden: !this.isRelSwitchCode, disabled: true },
{ prop: 'logicSectionShow', label: this.$t('map.displayLogicalExtents'), type: 'checkbox', isHidden: !this.isSwitchSectionShow }, // 1
@ -423,14 +438,14 @@ export default {
{value: true, label: this.$t('map.fromSmallToLarge')},
{value: false, label: this.$t('map.fromLargeToSmall')}
] }, // 1
{ prop: 'sepTypeLeft', label: this.$t('map.sepTypeLeft'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSectionType },
{ prop: 'sepTypeRight', label: this.$t('map.sepTypeRight'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSectionType },
{ prop: 'isSegmentation', label: this.$t('map.isSegmentation'), type: 'checkbox', isHidden: !this.isSectionType },
{ prop: 'sepTypeLeft', label: this.$t('map.sepTypeLeft'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType },
{ prop: 'sepTypeRight', label: this.$t('map.sepTypeRight'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType },
{ prop: 'isSegmentation', label: this.$t('map.isSegmentation'), type: 'checkbox', isHidden: !this.isSwitchSectionType },
{ prop: 'segmentationPosition', label: this.$t('map.segmentationPosition'), type: 'coordinate', width: '150px', isHidden: !this.issegmentationPosition, children: [
{ prop: 'segmentationPosition.x', firstLevel: 'segmentationPosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
{ prop: 'segmentationPosition.y', firstLevel: 'segmentationPosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
] },
{ prop: 'isCurve', label: this.$t('map.isCurve'), type: 'checkbox', isHidden: !this.isSectionType },
{ prop: 'isCurve', label: this.$t('map.isCurve'), type: 'checkbox', isHidden: !this.isSwitchSectionType },
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, pointDisabled: this.isStationCodeDisabled, addPoint: this.addPoint, delPoint: this.delPoint }
]
},
@ -444,7 +459,7 @@ export default {
{ prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow },
{ prop: 'kmRangeLeft', label: this.$t('map.leftKilometerMark'), type: 'number', min: 0, placeholder: this.$t('map.meter') },
{ prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0, placeholder: this.$t('map.meter') },
{ prop: 'trainPosType', label: this.$t('map.trainDirection'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.TrainPositionTypeList, isHidden: !this.isSectionType }
{ prop: 'trainPosType', label: this.$t('map.trainDirection'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.TrainPositionTypeList, isHidden: !this.isSwitchSectionType }
]
}
}
@ -500,6 +515,12 @@ export default {
],
trainPosType: [
{ required: true, message: this.$t('rules.pleaseSelectTrainDir'), trigger: 'change' }
],
leftSection: [
{ required: this.editModel.type === '01', message: '请选择左关联区段', trigger: 'change' }
],
rightSection: [
{ required: this.editModel.type === '01', message: '请选择右关联区段', trigger: 'change'}
]
};
return rules;
@ -509,6 +530,7 @@ export default {
if (this.sectionList && this.sectionList.length) {
list = this.sectionList.filter(elem => { return elem.type === '01'; });
}
list.unshift({code: '', name: '无'});
return list;
},
ReverseSectionList() {
@ -528,8 +550,8 @@ export default {
isStationCodeDisabled() {
return this.editModel.type == '02';
},
isSectionType() {
return this.editModel.type !== '03';
isSwitchSectionType() {
return this.editModel.type !== '04';
},
isPhysicalSection() {
return this.editModel.type == '01';
@ -538,38 +560,38 @@ export default {
return this.editModel.section == '02';
},
isstandTrackNameShow() {
return this.editModel.type !== '03' && this.editModel.isStandTrack;
return this.editModel.type !== '04' && this.editModel.isStandTrack;
},
isreentryTrackName() {
return this.editModel.type !== '03' && this.editModel.isReentryTrack;
return this.editModel.type !== '04' && this.editModel.isReentryTrack;
},
istransferTrackName() {
return this.editModel.type !== '03' && this.editModel.isTransferTrack;
return this.editModel.type !== '04' && this.editModel.isTransferTrack;
},
isdestinationCode() {
return this.editModel.type !== '03' && (this.editModel.isReentryTrack || this.editModel.isTransferTrack);
return this.editModel.type !== '04' && (this.editModel.isReentryTrack || this.editModel.isTransferTrack);
},
isStopPointOffset() {
return this.editModel.type !== '03' && (this.editModel.isReentryTrack || this.editModel.isStandTrack || this.editModel.isTransferTrack);
return this.editModel.type !== '04' && (this.editModel.isReentryTrack || this.editModel.isStandTrack || this.editModel.isTransferTrack);
},
isButtonType() {
return this.fieldS == 'relStandCode';
},
isrelStandCode() {
return this.editModel.type !== '03' && this.editModel.isStandTrack && this.editModel.type == '01';
return this.editModel.type !== '04' && this.editModel.isStandTrack && this.editModel.type == '01';
},
isRelSwitchCode() {
return this.editModel.type !== '03' && this.editModel.isSwitchSection;
return this.editModel.type !== '04' && this.editModel.isSwitchSection;
},
isLogicSectionNameSort() { //
return this.editModel.type == '01' && !this.editModel.isSwitchSection;
},
issegmentationPosition() {
return this.editModel.type !== '03' && this.editModel.isSegmentation;
return this.editModel.type !== '04' && this.editModel.isSegmentation;
},
isPointsShow() {
return this.editModel.type !== '03' && this.editModel.points.length > 0;
return this.editModel.type !== '04' && this.editModel.points.length > 0;
},
sectionColonShow() {
if (this.$store.state.map.map) {
@ -578,7 +600,13 @@ export default {
return false;
},
isSwitchSectionShow() { //
return this.editModel.type !== '03' && !this.editModel.isSwitchSection;
return this.editModel.type !== '04' && !this.editModel.isSwitchSection;
},
isAssociatedSwitchSectionshow() {
return this.editModel.type !== '04' && this.editModel.type !== '03';
},
isStandTrackShow() {
return this.editModel.type !== '04' && this.editModel.type !== '03' && !this.editModel.isSwitchSection;
}
},
watch: {
@ -725,7 +753,6 @@ export default {
logicSectionNum: [],
logicSectionShow: model.logicSectionShow,
stationCode: model.stationCode,
linkCode: model.linkCode,
offsetLeft: middleOffset * (index) + model.offsetLeft,
offsetRight: middleOffset * (index + 1) + model.offsetLeft,
sepTypeLeft: '00',
@ -836,9 +863,22 @@ export default {
} else if (this.createModel.type == '02') {
const startModel = this.$store.getters['map/getDeviceByCode'](this.createModel.leftSection);
const endModel = this.$store.getters['map/getDeviceByCode'](this.createModel.rightSection);
const start_x = startModel.points[startModel.points.length - 1].x;
const end_x = endModel.points[0].x;
const start_y = startModel.points[startModel.points.length - 1].y;
const end_y = endModel.points[0].y;
if (this.createModel.leftSection == this.createModel.rightSection) {
this.$messageBox('左关联区段不能和右关联区段相同');
return;
}
if (start_x == end_x && start_y == end_y) {
this.$messageBox('左关联区段终点不能和右关联区段起点相同');
return;
}
model.points = [
{ x: startModel.points[startModel.points.length - 1].x, y: startModel.points[startModel.points.length - 1].y },
{ x: endModel.points[0].x, y: endModel.points[0].y }
{ x: start_x, y: start_y },
{ x: end_x, y: end_y }
];
}
this.$emit('updateMapModel', model);
@ -859,7 +899,7 @@ export default {
copySection.trainPosType = model.trainPosType;
models.push(copySection);
}
if (section.linkCode == model.linkCode && model.code != section.code && section.type == '01') {
if (model.code != section.code && section.type == '01') {
const lastIndex = this.oldPoint.length - 1;
const copySection = deepAssign({}, section);
if (this.oldPoint[0].x == section.points[section.points.length - 1].x && this.oldPoint[0].y == section.points[section.points.length - 1].y) {
@ -942,7 +982,6 @@ export default {
offsetLeft: selected.offsetLeft,
sepTypeRight: index == this.addModel.splitNumber ? selected.sepTypeRight : '01', // ( 01)
offsetRight: selected.offsetRight,
linkCode: selected.linkCode,
trainPosType: this.addModel.trainPosType,
isCurve: selected.isCurve,
lengthFact: 0,
@ -960,6 +999,18 @@ export default {
};
models.push(model);
}
models.forEach((elem, index) => {
if (index === 0) {
elem.leftSection = selected.leftSection;
elem.rightSection = models[index + 1].code;
} else if (index === models.length - 1) {
elem.leftSection = models[index - 1].code;
elem.rightSection = selected.rightSection;
} else {
elem.leftSection = models[index - 1].code;
elem.rightSection = models[index + 1].code;
}
});
models.push(deepAssign(selected, { _dispose: true }));
this.$emit('updateMapModel', models); //
}
@ -989,10 +1040,6 @@ export default {
}
if (rsection && lsection) {
if (lsection.linkCode !== rsection.linkCode) {
this.$messageBox(this.$t('tip.linkCannotMerged'));
return;
}
const uid = getUID('Section');
const model = {
_type: 'Section',
@ -1000,7 +1047,6 @@ export default {
parentCode: '',
name: uid,
type: '01',
linkCode: lsection.linkCode,
isStandTrack: false,
standTrackName: '',
standTrackNamePosition: { x: 0, y: 0 },
@ -1039,6 +1085,8 @@ export default {
model.logicSectionNameSort = lsection.logicSectionNameSort;
model.namePosition = { x: 0, y: 0 };
model.lengthFact = Number(lsection.lengthFact) + Number(rsection.lengthFact);
model.leftSection = lsection.leftSection;
model.rightSection = rsection.rightSection;
models.push(model);
this.$emit('updateMapModel', models);
}
@ -1059,6 +1107,8 @@ export default {
model.logicSectionNameSort = rsection.logicSectionNameSort;
model.namePosition = { x: 0, y: 0 };
model.lengthFact = Number(lsection.lengthFact) + Number(rsection.lengthFact);
model.leftSection = rsection.leftSection;
model.rightSection = lsection.rightSection;
models.push(model);
this.$emit('updateMapModel', models);
}
@ -1130,18 +1180,5 @@ export default {
padding: 18px 0;
}
}
.link_box_select{
padding: 10px 20px;
.title{
width: 100px;
display: block;
float: left;
text-align: right;
line-height: 28px;
font-weight: 700;
font-size: 14px;
color: #606266;
}
}
</style>

View File

@ -146,9 +146,9 @@ export default {
namePosition: { x: 0, y: 0 },
useType: '',
stationCode: '',
linkCode: '',
offset: 0,
rotate: 0,
sectionCode: '',
guideShow: false,
buttonShow: false,
position: { x: 0, y: 0 },
@ -201,6 +201,16 @@ export default {
}
return list;
},
//
signalSectionList() {
let list = [];
if (this.sectionList && this.sectionList.length) {
list = this.sectionList.filter(elem => {
return elem.type === '01' || elem.type === '03';
});
}
return list;
},
form() {
return {
labelWidth: '150px',
@ -247,7 +257,7 @@ export default {
{ 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: 'potLampType', label: this.$t('map.potLampType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalPotLampTypeList },
{ prop: 'linkCode', label: this.$t('map.signalLinkCode') + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
{ prop: 'sectionCode', label: '所属区段:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.signalSectionList },
{ prop: 'offset', label: this.$t('map.signalOffset'), type: 'number', min: 0, placeholder: this.$t('tip.meter') }
]
@ -357,6 +367,7 @@ export default {
_type: 'Signal',
code: uid,
uniqueName: uid,
sectionCode: this.addModel.sectionCode,
positionType: this.addModel.positionType,
directionType: this.addModel.directionType,
directionShowType: this.addModel.directionShowType,
@ -373,7 +384,7 @@ export default {
this.sectionList.forEach(elem => {
if (elem.code === this.addModel.sectionCode) {
model.name = 'Signal_' + elem.name.replace('Section_', '');
model.linkCode = elem.linkCode;
model.linkCode = elem.code;
if (this.addModel.leftOrRight === '0') {
const beg = elem.points[0];
const end = elem.points[0 + 1];
@ -382,7 +393,7 @@ export default {
model.position = { x: elem.points[0].x, y: elem.points[0].y };
model.guidePosition = { x: elem.points[0].x, y: elem.points[0].y };
model.buttonPosition = { x: elem.points[0].x, y: elem.points[0].y };
model.offset = elem.offsetLeft;
model.offset = elem.lengthFact && elem.lengthFact > 2 ? 2 : 0;
} else {
const r = elem.points.length - 1;
const beg = elem.points[r - 1];
@ -392,7 +403,7 @@ export default {
model.position = { x: elem.points[r].x, y: elem.points[r].y };
model.guidePosition = { x: elem.points[r].x, y: elem.points[r].y };
model.buttonPosition = { x: elem.points[r].x, y: elem.points[r].y };
model.offset = elem.offsetRight;
model.offset = elem.lengthFact && elem.lengthFact > 2 ? elem.lengthFact - 2 : 0;
}
}
});