调整区段字段保存获取

This commit is contained in:
zyy 2019-12-18 11:17:57 +08:00
parent d82c9eaf70
commit 436db38200
10 changed files with 87 additions and 92 deletions

View File

@ -65,8 +65,8 @@ export default class Section extends Group {
this.section = new ELines({
zlevel: this.zlevel,
z: this.z,
isSwitchSection: model.isSwitchSection,
isCurve: model.isCurve,
isSwitchSection: model.switchSection,
isCurve: model.curve,
points: model.points,
style: style
});
@ -78,7 +78,7 @@ export default class Section extends Group {
createTurnBack() {
const model = this.model;
const style = this.style;
if (model.isReentryTrack && style.Section.shuttleBack) {
if (model.reentryTrack && style.Section.shuttleBack) {
const radius = 3;
model.drict = 1; // 箭头朝向 (是折返轨加一个方向选择) 目前在区段右边
const width = style.Section.line.width * 2;
@ -177,9 +177,9 @@ export default class Section extends Group {
position: [x, -y],
style: style,
switch: model.switch,
isSwitchSection: model.isSwitchSection,
isSwitchSection: model.switchSection,
relSwitchCode: model.relSwitchCode,
isCurve: model.isCurve, // 是否曲线
isCurve: model.curve, // 是否曲线
points: model.points
});
this.speedLimitRight = new ELimitLines({
@ -188,9 +188,9 @@ export default class Section extends Group {
position: [-x, y],
style: style,
switch: model.switch,
isSwitchSection: model.isSwitchSection,
isSwitchSection: model.switchSection,
relSwitchCode: model.relSwitchCode,
isCurve: model.isCurve, // 是否曲线
isCurve: model.curve, // 是否曲线
points: model.points
});
if (style.Section.speedLimit.nameShow) {
@ -323,7 +323,7 @@ export default class Section extends Group {
}
/** 站台轨名称*/
if (model.isStandTrack && model.standTrackNameShow && style.Section.standText.show) {
if (model.standTrack && model.standTrackNameShow && style.Section.standText.show) {
const opposite = style.Section.standText.opposite ? -1 : 1;
const tempx = x + traingle.getSin(style.Section.standText.distance);
const tempy = y + traingle.getCos(style.Section.standText.distance) * (style.Section.standText.position || opposite * drict);
@ -346,7 +346,7 @@ export default class Section extends Group {
}
/** 折返轨名称*/
if (model.isReentryTrack && model.reentryTrackNameShow && style.Section.reentryText.show) {
if (model.reentryTrack && model.reentryTrackNameShow && style.Section.reentryText.show) {
const opposite = style.Section.reentryText.opposite ? -1 : 1;
const tempx = x + traingle.getSin(style.Section.reentryText.distance);
const tempy = y + traingle.getCos(style.Section.reentryText.distance) * (style.Section.reentryText.position || opposite * drict);
@ -369,7 +369,7 @@ export default class Section extends Group {
}
/** 转换轨名称*/
if (model.isTransferTrack && model.transferTrackNameShow && style.Section.transferText.show) {
if (model.transferTrack && model.transferTrackNameShow && style.Section.transferText.show) {
const opposite = style.Section.transferText.opposite ? -1 : 1;
const tempx = x + traingle.getSin(style.Section.transferText.distance);
const tempy = y + traingle.getCos(style.Section.transferText.distance) * (style.Section.transferText.position || opposite * drict);

View File

@ -112,7 +112,7 @@ export default {
const list = [];
if (val && val.length) {
val.forEach(elem => {
if (elem.isStandTrack || elem.isReentryTrack || elem.isTransferTrack) {
if (elem.standTrack || elem.reentryTrack || elem.transferTrack) {
list.push({ label: this.formatName(elem.code), value: elem.code });
}
});

View File

@ -146,7 +146,7 @@ export default {
]),
filterSectionList() {
if (this.sectionList) {
return this.sectionList.filter(elem => { return elem.isStandTrack || elem.isReentryTrack || elem.isTransferTrack; });
return this.sectionList.filter(elem => { return elem.standTrack || elem.reentryTrack || elem.transferTrack; });
} else {
return [];
}

View File

@ -232,7 +232,7 @@ export default {
]),
filterSectionList() {
if (this.sectionList) {
return this.sectionList.filter(elem => { return elem.isStandTrack || elem.isReentryTrack || elem.isTransferTrack; });
return this.sectionList.filter(elem => { return elem.standTrack || elem.reentryTrack || elem.transferTrack; });
} else {
return [];
}

View File

@ -240,30 +240,29 @@ export default {
kmRangeLeft: 0,
region: '',
logicSectionNum: [],
logicSectionShow: false,
isStandTrack: false,
logicSectionShow: false, //
standTrack: false, //
standTrackName: '',
standTrackNamePosition: { x: 0, y: 0 },
isReentryTrack: false,
reentryTrack: false, //
reentryTrackName: '',
reentryTrackNamePosition: { x: 0, y: 0 },
isTransferTrack: false,
isSegmentation: false,
transferTrack: false, //
// segmentation: false, //
segmentationPosition: { x: 0, y: 0 },
transferTrackName: '',
transferTrackNamePosition: { x: 0, y: 0 },
isSwitchSection: false,
switchSection: false, //
relSwitchCode: '',
stationCode: '',
logicSectionNameSort: true,
sepTypeLeft: '',
sepTypeRight: '',
offsetRight: 0,
// trainPosType: '', //
parentCode: '',
points: [],
lengthFact: 0,
isCurve: false,
curve: false, // 线
leftSectionCode: '',
rightSectionCode: '',
trainWindowCode: '',
@ -275,7 +274,6 @@ export default {
addModel: {
code: '',
splitNumber: 2,
// trainPosType: '01', //
splitOffsetMax: 15
},
operationModel: { //
@ -295,9 +293,6 @@ export default {
splitNumber: [
{ required: true, message: this.$t('rules.pleaseEnterSplit'), trigger: 'blur' }
]
// trainPosType: [
// { required: true, message: this.$t('rules.pleaseSelectTrainDir'), trigger: 'change' }
// ]
},
mergeRules: {
lsectioncode: [
@ -394,14 +389,14 @@ export default {
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, pointDisabled: this.isStationCodeDisabled, addPoint: this.addPoint, delPoint: this.delPoint, lastDisabled: true },
{ prop: 'logicSectionStartOffset', label: '逻辑区段起点偏移:', type: 'number', min: 0, width: '150px', isHidden: !this.isLSectionOffsetShow, disabled: true},
{ prop: 'logicSectionEndOffset', label: '逻辑区段终点偏移:', type: 'number', min: 0, width: '150px', isHidden: !this.isLSectionOffsetShow, disabled: true},
{ prop: 'isStandTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isStandTrackShow }, // 1
{ prop: 'standTrack', 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: [
{ prop: 'standTrackNamePosition.x', firstLevel: 'standTrackNamePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px'},
{ prop: 'standTrackNamePosition.y', firstLevel: 'standTrackNamePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px'}
] },
{ prop: 'isReentryTrack', label: this.$t('map.isReentryTrack'), type: 'checkbox', isHidden: !this.isStandTrackShow }, // 1
{ prop: 'reentryTrack', 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: [
@ -409,7 +404,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.isStandTrackShow }, // 1
{ prop: 'transferTrack', 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: [
@ -422,7 +417,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.isAssociatedSwitchSectionshow, disabled: true },
{ prop: 'switchSection', 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
@ -430,12 +425,12 @@ export default {
{value: true, label: this.$t('map.fromSmallToLarge')},
{value: false, label: this.$t('map.fromLargeToSmall')}
] }, // 1
{ 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.isSwitchSectionType },
// { prop: 'segmentation', 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: 'curve', label: this.$t('map.isCurve'), type: 'checkbox', isHidden: !this.isSwitchSectionType },
{ prop: 'relevanceSectionList', label: '关联道岔区段:', type: 'multiSelect', optionLabel: 'name&&code', optionValue: 'code', options: this.switchSectionList, isHidden: this.isSwitchSectionType }
]
},
@ -566,29 +561,29 @@ export default {
return this.editModel.section == '02';
},
isstandTrackNameShow() {
return this.editModel.type !== '04' && this.editModel.isStandTrack;
return this.editModel.type !== '04' && this.editModel.standTrack;
},
isreentryTrackName() {
return this.editModel.type !== '04' && this.editModel.isReentryTrack;
return this.editModel.type !== '04' && this.editModel.reentryTrack;
},
istransferTrackName() {
return this.editModel.type !== '04' && this.editModel.isTransferTrack;
return this.editModel.type !== '04' && this.editModel.transferTrack;
},
isdestinationCode() {
return this.editModel.type !== '04' && (this.editModel.isReentryTrack || this.editModel.isTransferTrack);
return this.editModel.type !== '04' && (this.editModel.reentryTrack || this.editModel.transferTrack);
},
isStopPointOffset() {
return this.editModel.type !== '04' && (this.editModel.isReentryTrack || this.editModel.isStandTrack || this.editModel.isTransferTrack);
return this.editModel.type !== '04' && (this.editModel.reentryTrack || this.editModel.standTrack || this.editModel.transferTrack);
},
isRelSwitchCode() {
return this.editModel.type !== '04' && this.editModel.isSwitchSection;
return this.editModel.type !== '04' && this.editModel.switchSection;
},
isLogicSectionNameSort() { //
return this.editModel.type == '01' && !this.editModel.isSwitchSection;
},
issegmentationPosition() {
return this.editModel.type !== '04' && this.editModel.isSegmentation;
return this.editModel.type == '01' && !this.editModel.switchSection;
},
// issegmentationPosition() {
// return this.editModel.type !== '04' && this.editModel.segmentation;
// },
isPointsShow() {
return this.editModel.type !== '04' && this.editModel.points.length > 0;
},
@ -599,13 +594,13 @@ export default {
return false;
},
isSwitchSectionShow() { //
return this.editModel.type !== '04' && !this.editModel.isSwitchSection;
return this.editModel.type !== '04' && !this.editModel.switchSection;
},
isAssociatedSwitchSectionshow() {
return this.editModel.type !== '04' && this.editModel.type !== '03';
},
isStandTrackShow() {
return this.editModel.type !== '04' && this.editModel.type !== '03' && !this.editModel.isSwitchSection;
return this.editModel.type !== '04' && this.editModel.type !== '03' && !this.editModel.switchSection;
},
isLeftSectionButtonShow() {
return this.field === 'leftSection';
@ -675,7 +670,7 @@ export default {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0];
this.editModel.isSegmentation = selected.isSegmentation || false;
// this.editModel.segmentation = selected.segmentation || false;
this.editModel.points = JSON.parse(JSON.stringify(selected.points));
this.oldPoint = JSON.parse(JSON.stringify(selected.points));
this.oldLeftSectionCode = selected.leftSectionCode;
@ -747,17 +742,17 @@ export default {
name: name,
type: '01',
axleShow: false,
isStandTrack: false,
standTrack: false,
standTrackName: '',
standTrackNamePosition: { x: 0, y: 0 },
isReentryTrack: false,
reentryTrack: false,
reentryTrackName: '',
reentryTrackNamePosition: { x: 0, y: 0 },
isTransferTrack: false,
transferTrack: false,
transferTrackName: '',
transferTrackNamePosition: { x: 0, y: 0 },
isSwitchSection: false, //
isSegmentation: false,
switchSection: false, //
// segmentation: false,
segmentationPosition: { x: 0, y: 0 },
relSwitchCode: '',
rightSectionCode: '',
@ -780,7 +775,7 @@ export default {
destinationCode: '',
trainWindowCode: '',
destinationCodePoint: { x: 0, y: 0 },
isCurve: false,
curve: false,
relevanceSectionList: [],
points: []
};
@ -1022,20 +1017,20 @@ export default {
type: '01',
parentCode: '',
axleShow: selected.axleShow,
isStandTrack: false,
standTrack: false,
kmRangeRight: '',
kmRangeLeft: '',
region: '',
standTrackName: '',
standTrackNamePosition: { x: 0, y: 0 },
isReentryTrack: false,
reentryTrack: false,
reentryTrackName: '',
reentryTrackNamePosition: { x: 0, y: 0 },
isTransferTrack: false,
transferTrack: false,
transferTrackName: '',
transferTrackNamePosition: { x: 0, y: 0 },
isSwitchSection: false,
isSegmentation: false,
switchSection: false,
// segmentation: false,
segmentationPosition: { x: 0, y: 0 },
relSwitchCode: '',
trainWindowCode: '',
@ -1046,7 +1041,7 @@ export default {
sepTypeRight: index == this.addModel.splitNumber ? selected.sepTypeRight : '01', // ( 01)
offsetRight: selected.offsetRight,
// trainPosType: this.addModel.trainPosType,
isCurve: selected.isCurve,
curve: selected.curve,
lengthFact: 0,
points: [
{
@ -1121,20 +1116,20 @@ export default {
parentCode: '',
name: lsection.name,
type: '01',
isStandTrack: false,
standTrack: false,
standTrackName: '',
standTrackNamePosition: { x: 0, y: 0 },
isSegmentation: false,
// segmentation: false,
segmentationPosition: { x: 0, y: 0 },
isReentryTrack: false,
reentryTrack: false,
reentryTrackName: '',
reentryTrackNamePosition: { x: 0, y: 0 },
isTransferTrack: false,
transferTrack: false,
transferTrackName: '',
transferTrackNamePosition: { x: 0, y: 0 },
isSwitchSection: false,
switchSection: false,
relSwitchCode: '',
isCurve: false,
curve: false,
kmRangeRight: '',
kmRangeLeft: '',
region: '',
@ -1151,7 +1146,7 @@ export default {
// model.trainPosType = lsection.trainPosType;
model.sepTypeLeft = lsection.sepTypeLeft;
model.sepTypeRight = rsection.sepTypeRight;
model.isCurve = lsection.isCurve;
model.curve = lsection.curve;
model.points = [
{ x: lsection.points[0].x, y: lsection.points[0].y },
{ x: rsection.points[rsection.points.length - 1].x, y: rsection.points[rsection.points.length - 1].y }
@ -1183,7 +1178,7 @@ export default {
model.offsetLeft = rsection.offsetLeft;
model.sepTypeRight = lsection.sepTypeRight;
model.offsetRight = lsection.offsetRight + rsection.offsetRight;
model.isCurve = rsection.isCurve;
model.curve = rsection.curve;
model.points = [
{ x: rsection.points[0].x, y: rsection.points[0].y },
{ x: lsection.points[lsection.points.length - 1].x, y: lsection.points[lsection.points.length - 1].y }

View File

@ -133,31 +133,31 @@ export default {
axleShow: false,
type: '02',
namePosition: { x: 0, y: 0 },
isStandTrack: false,
standTrack: false,
standTrackName: model.standTrackName,
standTrackNamePosition: {
x: model.standTrackNamePosition.x,
y: model.standTrackNamePosition.y
},
isReentryTrack: false,
reentryTrack: false,
reentryTrackName: model.reentryTrackName,
reentryTrackNamePosition: {
x: model.reentryTrackNamePosition.x,
y: model.reentryTrackNamePosition.y
},
isTransferTrack: false,
transferTrack: false,
transferTrackName: model.transferTrackName,
transferTrackNamePosition: {
x: model.transferTrackNamePosition.x,
y: model.transferTrackNamePosition.y
},
isSegmentation: false,
// segmentation: false,
segmentationPosition: {
x: model.segmentationPosition.x,
y: model.segmentationPosition.y
},
logicSectionNameSort: model.logicSectionNameSort,
isSwitchSection: model.isSwitchSection,
switchSection: model.switchSection,
relSwitchCode: model.relSwitchCode,
logicSectionNum: [],
logicSectionShow: model.logicSectionShow,
@ -166,7 +166,7 @@ export default {
sepTypeRight: '00',
trainPosType: model.trainPosType,
points: points,
isCurve: false,
curve: false,
lengthFact: 0,
kmRangeRight: model.kmRangeRight,
kmRangeLeft: model.kmRangeLeft,

View File

@ -104,7 +104,7 @@ export default {
PhysicalSectionList() {
let list = [];
if (this.sectionList && this.sectionList.length) {
list = this.sectionList.filter(elem => { return elem.type === '01' && !elem.isSwitchSection; });
list = this.sectionList.filter(elem => { return elem.type === '01' && !elem.switchSection; });
}
return list;
},

View File

@ -233,7 +233,7 @@ export default {
PhysicalSectionList() {
let list = [];
if (this.sectionList && this.sectionList.length) {
list = this.sectionList.filter(elem => { return elem.type === '01' && !elem.isSwitchSection; });
list = this.sectionList.filter(elem => { return elem.type === '01' && !elem.switchSection; });
}
return list;
},

View File

@ -548,9 +548,9 @@ export default {
sectiona.relSwitchCode = elem.code;
sectionb.relSwitchCode = elem.code;
sectionc.relSwitchCode = elem.code;
sectiona.isSwitchSection = true;
sectionb.isSwitchSection = true;
sectionc.isSwitchSection = true;
sectiona.switchSection = true;
sectionb.switchSection = true;
sectionc.switchSection = true;
sectionb.sepTypeLeft = '00';
sectionb.sepTypeRight = '00';
models.push(sectiona);
@ -576,21 +576,21 @@ export default {
type: '04',
axleShow: false,
namePosition: point,
isStandTrack: false,
standTrack: false,
kmRangeRight: '',
kmRangeLeft: '',
region: '',
standTrackName: '',
standTrackNamePosition: { x: 0, y: 0 },
isReentryTrack: false,
reentryTrack: false,
reentryTrackName: '',
reentryTrackNamePosition: { x: 0, y: 0 },
isTransferTrack: false,
transferTrack: false,
transferTrackName: '',
transferTrackNamePosition: { x: 0, y: 0 },
isSegmentation: false,
// segmentation: false,
segmentationPosition: { x: 0, y: 0 },
isSwitchSection: true,
switchSection: true,
relSwitchCode: '',
relevanceSectionList: elem.relevanceSectionList,
points: [{ x: 0, y: 0 }, { x: 0, y: 0 }],
@ -603,7 +603,7 @@ export default {
parentCode: '',
stationCode: sectiona.stationCode,
trainPosType: sectiona.trainPosType,
isCurve: false
curve: false
});
}
});
@ -630,21 +630,21 @@ export default {
x: sectiona.points[sectiona.points.length - 1].x,
y: sectiona.points[sectiona.points.length - 1].y
},
isStandTrack: false,
standTrack: false,
kmRangeRight: '',
kmRangeLeft: '',
region: '',
standTrackName: '',
standTrackNamePosition: { x: 0, y: 0 },
isReentryTrack: false,
reentryTrack: false,
reentryTrackName: '',
reentryTrackNamePosition: { x: 0, y: 0 },
isTransferTrack: false,
transferTrack: false,
transferTrackName: '',
transferTrackNamePosition: { x: 0, y: 0 },
isSegmentation: false,
// segmentation: false,
segmentationPosition: { x: 0, y: 0 },
isSwitchSection: true,
switchSection: true,
relSwitchCode: '',
relevanceSectionList: this.fromData.relevanceSectionList,
points: [{ x: 0, y: 0 }, { x: 0, y: 0 }],
@ -657,7 +657,7 @@ export default {
parentCode: '',
stationCode: sectiona.stationCode,
trainPosType: sectiona.trainPosType,
isCurve: false
curve: false
});
this.$emit('updateMapModel', models);
this.fromData.relevanceSectionList = [];

View File

@ -308,7 +308,7 @@ export default {
this.addList = []; // codelist
if (this.sectionList && this.sectionList.length) {
this.sectionList.forEach(elem => {
if (elem.type !== '04' && !elem.isSwitchSection && !elem.trainWindowCode && (elem.logicSectionNum.length == 0 || elem.logicSectionNum.length == 1 && elem.logicSectionNum[0] == 0)) {
if (elem.type !== '04' && !elem.switchSection && !elem.trainWindowCode && (elem.logicSectionNum.length == 0 || elem.logicSectionNum.length == 1 && elem.logicSectionNum[0] == 0)) {
const triangle = new JTriangle(elem.points[0], elem.points[elem.points.length - 1]);
const param = this.createModel({
triangle: triangle,