逻辑区段实际长度设置调整

This commit is contained in:
fan 2021-01-22 13:59:32 +08:00
parent 2cdbc1ee78
commit 4a0c7e1e95
11 changed files with 131 additions and 70 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

View File

@ -801,7 +801,7 @@ class Signal extends Group {
});
}
}
if ( model.level === 3 && !model.fleetMode) {
if ( model.level === 3 && this.style.Signal.post.mainSignalVerColor && !model.fleetMode) {
this.sigPost.setVerColor(this.style.Signal.post.mainSignalVerColor);
} else if (model.level === 1 && this.style.Signal.post.closeSignalVerColor && !model.fleetMode) {
this.sigPost.setVerColor(this.style.Signal.post.closeSignalVerColor);

View File

@ -279,6 +279,21 @@
</el-input>
</el-form-item>
</template>
<template v-if="checkFieldType(item, 'lengthFact')">
<div v-if="!item.isHidden" :key="item.prop" class="coordinate">
<span class="title" :style="{width: item.width}">{{ item.label }}</span>
<div class="point-section">
<el-button type="primary" size="mini" style="margin-left: 20px;margin-bottom: 10px;" @click="item.divideLength">均分长度</el-button>
<template v-for="(elem, j) in formModel[item.prop]">
<div :key="j" style="overflow: hidden;">
<el-form-item :label="elem.name" :prop="'logicLengthList[' + j + '].lengthFact'" label-width="20px">
<el-input-number v-model="elem.lengthFact" :min="0" :precision="3" /><span></span>
</el-form-item>
</div>
</template>
</div>
</div>
</template>
</template>
</fieldset>
</template>

View File

@ -53,6 +53,7 @@ class Model {
this.belongStation = ''; // 所属车站
this.rightAxleOffset = { x: 0, y: 0 };
this.leftAxleOffset = { x: 0, y: 0 };
this.logicLengthList = [];
}
SignalModel() {
this._type = 'Signal';

View File

@ -315,19 +315,12 @@ export default {
let startOffset = 0;
const sectionMap = {};
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
const sectionModel = deepAssign({}, section);
sectionModel.lengthFact = Number(sectionModel.logicSectionCodeList.reduce((pre, code) => pre + Number(this.$store.getters['map/getDeviceByCode'](code).lengthFact), 0).toFixed(3));
models.push(sectionModel);
section.logicSectionCodeList.forEach(sectionCode => {
const logicSection = this.$store.getters['map/getDeviceByCode'](sectionCode);
sectionMap[logicSection.points[0].x + 's' + logicSection.points[0].y] = logicSection;
});
while (sectionMap[startPoint]) {
const model = deepAssign({}, sectionMap[startPoint]);
if (!model.lengthFact) {
const length = section.lengthFact / section.logicSectionCodeList.length;
model.lengthFact = length.toFixed(3);
}
model.logicSectionStartOffset = startOffset;
model.logicSectionEndOffset = (model.lengthFact * 1000 + startOffset * 1000) / 1000;
models.push(model);

View File

@ -7,7 +7,7 @@
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="danger" size="small" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
<el-button :disabled="editModel.type == '02'" type="danger" size="small" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group>
</div>
</el-tab-pane>
@ -207,12 +207,11 @@ export default {
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.centralizedStationList, isHidden: this.isStationCodeDisabled },
{ prop: 'belongStation', label: '所属车站:', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, isHidden: !this.editModel.standTrack && !this.editModel.reentryTrack && !this.editModel.transferTrack },
{ prop: 'lengthFact', label: this.$t('map.actualLength') + ':', type: 'number', min: 0, placeholder: this.$t('map.meter'), disabled: this.isStationCodeDisabled, isHidden: !this.isSwitchSectionType || !this.isCrossSectionType },
{ prop: 'logicLengthList', label: '逻辑区段实际长度:', type: 'lengthFact', isHidden: !this.isHasLogicPhysicalSection, divideLength: this.divideLength, width: '160px'},
{ prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, max: this.maxLengthFact, isHidden: !this.isStopPointOffset }, //
{ prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, max: this.maxLengthFact, isHidden: !this.isStopPointOffset }, //
{ prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow },
{ prop: 'trainWindowCode', label: '关联车次窗', type: 'input', disabled: true, isHidden: !this.isSwitchSectionShow || !this.isCrossSectionType }
// { 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') }
]
}
}
@ -228,20 +227,6 @@ export default {
callback();
}
};
// var validateLeftStopPointOffset = (rule, value, callback) => {
// if (value != this.editModel.rightStopPointOffset) {
// callback();
// } else {
// callback(new Error(''));
// }
// };
// var validateRightStopPointOffset = (rule, value, callback) => {
// if (value != this.editModel.leftStopPointOffset) {
// callback();
// } else {
// callback(new Error(''));
// }
// };
const rules = {
code: [
{ required: true, message: this.$t('rules.selectEquipment'), trigger: 'change' }
@ -252,14 +237,6 @@ export default {
type: [
{ required: true, message: this.$t('rules.pleaseEnterSectionType'), trigger: 'blur' }
],
// leftStopPointOffset: [
// { required: true, message: this.$t('rules.pleaseEnterLeftStopPointOffset'), trigger: 'blur' },
// { validator: validateLeftStopPointOffset, trigger: 'blur' }
// ],
// rightStopPointOffset: [
// { required: true, message: this.$t('rules.rightStopPointOffset'), trigger: 'blur' },
// { validator: validateRightStopPointOffset, trigger: 'blur' }
// ],
'destinationCodePoint.x': [
{ required: true, message: this.$t('rules.destinationCodePointX'), trigger: 'blur' }
],
@ -367,7 +344,9 @@ export default {
isStopPointOffset() {
return this.editModel.type !== '04' && (this.editModel.reentryTrack || this.editModel.standTrack || this.editModel.transferTrack);
},
isHasLogicPhysicalSection() { //
return this.editModel.type == '01' && this.editModel.logicSectionCodeList && this.editModel.logicSectionCodeList.length;
},
isLeftSectionButtonShow() {
return this.field === 'leftSection';
},
@ -446,6 +425,7 @@ export default {
this.clear();
this.handleInit();
this.activeName = 'first';
this.handleLogicLengthList(selected);
this.editModel = deepAssign(this.editModel, selected);
this.oldPoint = JSON.parse(JSON.stringify(selected.points));
this.oldLeftSectionCode = selected.leftSectionCode;
@ -505,6 +485,23 @@ export default {
this.$emit('deviceSelect', '');
}
},
handleLogicLengthList(selected) {
if (selected.type === '01' && selected.logicSectionCodeList && selected.logicSectionCodeList.length) {
const logicLengthList = [];
selected.logicSectionCodeList.forEach(sectionCode => {
const section = this.$store.getters['map/getDeviceByCode'](sectionCode);
logicLengthList.push({code: section.code, name: section.name, lengthFact: section.lengthFact});
});
// this.$set(this.editModel, 'logicLengthList', logicLengthList);
this.editModel.logicLengthList = [...logicLengthList];
}
},
divideLength() {
const logicLength = this.editModel.lengthFact / this.editModel.logicSectionCodeList.length;
this.editModel.logicLengthList.forEach(logic => {
logic.lengthFact = logicLength.toFixed(3);
});
},
addPoint(index) {
const data = { x: 0, y: 0 };
this.editModel.points.splice(index + 1, 0, data);
@ -529,7 +526,6 @@ export default {
const changeSectionList = this.handleOtherSectionChange(model);
const changeStandList = this.handleRelevanceStand(model);
models = [...changeSectionList, ...changeStandList];
this.$emit('updateMapModel', models);
this.oldPoint = JSON.parse(JSON.stringify(model.points));
this.oldLeftSectionCode = model.leftSectionCode;
@ -540,6 +536,7 @@ export default {
this.$message('还有属性未填写,修改未生效!');
this.$emit('deviceSelect', '');
}
// debugger;
});
},
handleRelevanceStand(model) { //
@ -559,12 +556,13 @@ export default {
let models = [model];
const pointModel = [];
const slope1 = (this.oldPoint[this.oldPoint.length - 1].y - this.oldPoint[0].y) / (this.oldPoint[this.oldPoint.length - 1].x - this.oldPoint[0].x);
const logicLengthMap = {};
this.editModel.logicLengthList.forEach(item => { logicLengthMap[item.code] = item.lengthFact; });
this.sectionList.forEach(section => {
if (section.parentCode == model.code && section.type == '02') { //
const copySection = deepAssign({}, section);
copySection.stationCode = model.stationCode; //
// const length = model.lengthFact / model.logicSectionCodeList.length;
// copySection.lengthFact = length.toFixed(3);
copySection.lengthFact = logicLengthMap[copySection.code];
if (this.checkPointsCoincide(this.oldPoint[0], copySection.points[0])) {
copySection.points[0] = model.points[0];
}
@ -595,24 +593,6 @@ export default {
}
}
}
if (model.parentCode == copySection.code) { //
let lengthFact = copySection.logicSectionCodeList.filter(code => model.code != code).reduce((pre, code) => {
const length = this.$store.getters['map/getDeviceByCode'](code).lengthFact;
return pre + Number(length);
}, 0);
lengthFact += model.lengthFact;
copySection.lengthFact = Number(lengthFact.toFixed(3)); //
const logicSectionCodeList = copySection.logicSectionCodeList;
const last = deepAssign({}, this.$store.getters['map/getDeviceByCode'](logicSectionCodeList[logicSectionCodeList.length - 1]));
last.logicSectionEndOffset = copySection.lengthFact;
models.push(last);
if (copySection.lengthFact > 5) {
copySection.leftStopPointOffset = copySection.leftStopPointOffset || 5;
copySection.rightStopPointOffset = copySection.rightStopPointOffset || copySection.lengthFact - 5;
}
updataFlag = true;
}
if (this.checkPointsCoincide(this.oldPoint[0], section.points[section.points.length - 1])) {
pointModel.push(copySection);
}
@ -643,20 +623,10 @@ export default {
}
});
if (!model.parentCode) {
if (model.type === '01') {
const arr = this.setLogicOffset(model, models);
models = [...models, ...arr];
} else {
const sectionModel = this.$store.getters['map/getDeviceByCode'](model.parentCode);
let arr = [];
if (sectionModel) {
arr = this.setLogicOffset(sectionModel, models);
} else {
arr = this.setLogicOffset(model, models);
}
models = [...models, ...arr];
}
return models;
},
selectSectionCode(code, list) {
@ -681,10 +651,6 @@ export default {
});
while (sectionMap[startPoint]) {
const model = sectionMap[startPoint].deepFlag ? sectionMap[startPoint] : deepAssign({}, sectionMap[startPoint]);
if (!model.lengthFact) {
const length = section.lengthFact / section.logicSectionCodeList.length;
model.lengthFact = length.toFixed(3);
}
model.logicSectionStartOffset = startOffset;
const lastData = Object.keys(sectionMap);
const temp = lastData[lastData.length - 1];

View File

@ -0,0 +1,86 @@
<template>
<div class="joylink-card">
<el-scrollbar wrap-class="scrollbar-wrapper">
<div class="content_box">
<h1 class="title">{{ title }}</h1>
<div class="card-box">
<el-carousel :interval="4000" type="card" height="380px">
<el-carousel-item v-for="(item, index) in listImg" :key="index">
<img :src="item.src" alt="" height="100%" width="100%">
</el-carousel-item>
</el-carousel>
</div>
<!--<div class="brief-box">{{ $t('demonstration.simulationSystemDescription') }}</div>-->
</div>
</el-scrollbar>
</div>
</template>
<script>
import home1 from '@/assets/home/home1.png';
import home2 from '@/assets/home/home2.png';
import home3 from '@/assets/home/script.png';
// import simulation1 from '@/assets/home_simulation/simulation1';
// import simulation2 from '@/'
export default {
name: 'SecondaryHome',
data() {
return {
listImg: [
{ src: home1 },
{ src: home2 },
{ src: home3 }
],
title: ''
};
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
/deep/ .el-carousel {
overflow: hidden;
width:100%;
}
.joylink-card{
height: 100%;
font-family: 'Microsoft YaHei';
overflow: hidden;
.content_box{
padding: 0 100px 15px;
}
.title {
font-size: 35px;
width: 100%;
text-align: center;
font-weight: 400;
margin-top: 55px;
border-bottom: 2px dashed #333;
padding-bottom: 15px;
margin-bottom: 70px;
position: relative;
.logo-img {
position: absolute;
right: 0;
top: 0;
width: 55px;
}
}
.card-box {
width: 100%;
padding: 0 50px;
}
.brief-box {
font-size: 18px;
text-indent: 2em;
line-height: 32px;
padding: 40px 20px 0;
font-family: unset;
}
}
</style>