{deviceChange(val,item)})" />
{{ item.placeholder }}
+ {{ item.buttonText }}
{{ item.placeholder }}
+ {{ item.buttonText }}
@@ -279,6 +281,21 @@
+
+
+
diff --git a/src/views/newMap/newMapdraft/mapoperate/models.js b/src/views/newMap/newMapdraft/mapoperate/models.js
index 3920312f2..dbe02b2f5 100644
--- a/src/views/newMap/newMapdraft/mapoperate/models.js
+++ b/src/views/newMap/newMapdraft/mapoperate/models.js
@@ -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';
diff --git a/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue b/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue
index b64da4906..989eb5889 100644
--- a/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue
@@ -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);
diff --git a/src/views/newMap/newMapdraft/mapoperate/section/index.vue b/src/views/newMap/newMapdraft/mapoperate/section/index.vue
index 73250087f..9d399dfbd 100644
--- a/src/views/newMap/newMapdraft/mapoperate/section/index.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/section/index.vue
@@ -7,7 +7,7 @@
{{ $t('map.updateObj') }}
- {{ $t('map.deleteObj') }}
+ {{ $t('map.deleteObj') }}
@@ -206,13 +206,12 @@ export default {
item: [
{ 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'), isHidden: !this.isSwitchSectionType || !this.isCrossSectionType },
+ { prop: 'lengthFact', label: this.$t('map.actualLength') + ':', type: 'number', min: 0, placeholder: this.$t('map.meter'), disabled: this.isStationCodeDisabled, isHidden: !this.isSwitchSectionType || !this.isCrossSectionType, button:true, clickFunction: this.divideLength, buttonText: '均分长度' },
+ { prop: 'logicLengthList', label: '逻辑区段实际长度:', type: 'lengthFact', isHidden: !this.isHasLogicPhysicalSection, mergeLength: this.mergeLength, 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,30 @@ 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);
+ });
+ },
+ mergeLength() {
+ let physicalLength = 0;
+ this.editModel.logicLengthList.forEach(logic => {
+ physicalLength += logic.lengthFact * 1000;
+ });
+ this.editModel.lengthFact = (physicalLength / 1000).toFixed(3);
+ },
addPoint(index) {
const data = { x: 0, y: 0 };
this.editModel.points.splice(index + 1, 0, data);
@@ -529,7 +533,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 +543,7 @@ export default {
this.$message('还有属性未填写,修改未生效!');
this.$emit('deviceSelect', '');
}
+ // debugger;
});
},
handleRelevanceStand(model) { // 站台轨关联站台调整 所属集中站
@@ -559,39 +563,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.type == '02') {
- // section.parentCode
- // const sectionModel = this.$store.getters['map/getDeviceByCode'](section.parentCode);
- // const copySection = deepAssign({}, sectionModel);
- // // if (section.leftSectionCode) {
- // // console.log(section.leftSectionCode, '111111');
- // // }
- // if (section.rightSectionCode) {
- // const sectionModel1 = this.$store.getters['map/getDeviceByCode'](section.rightSectionCode);
- // if (sectionModel1.type == '02') {
- // copySection.rightSectionCode = sectionModel1.parentCode;
- // } else {
- // copySection.rightSectionCode = section.rightSectionCode;
- // }
- // console.log(section.rightSectionCode, '22222');
- // }
- // models.push(copySection);
- // console.log(section.rightSectionCode, section.leftSectionCode);
- // const copySection = deepAssign({}, section);
- // if (section.rightSectionCode) {
- // delete copySection.rightSectionCode;
- // }
- // if (section.leftSectionCode) {
- // delete copySection.leftSectionCode;
- // }
- // models.push(copySection);
- }
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];
}
@@ -622,24 +600,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);
}
@@ -670,20 +630,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) {
@@ -708,10 +658,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];
diff --git a/src/views/trainingPlatform/demonList.vue b/src/views/trainingPlatform/demonList.vue
index b126bc3cd..891d046d1 100644
--- a/src/views/trainingPlatform/demonList.vue
+++ b/src/views/trainingPlatform/demonList.vue
@@ -101,6 +101,9 @@ export default {
this.mapId = obj.id;
const router = { path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`};
this.toNextPage(isReplace, router);
+ } else if ( obj.type === 'System' ) {
+ const router = { path: `${UrlConfig.trainingPlatform.secondaryHome}`, query: { type: obj.id } };
+ this.toNextPage(isReplace, router);
} else if ( obj.type === 'MapSystem') {
getSubSystemInfo(obj.id).then(resp => { // 查询子系统信息
let router = '';
diff --git a/src/views/trainingPlatform/secondaryHome.vue b/src/views/trainingPlatform/secondaryHome.vue
new file mode 100644
index 000000000..11afde3d1
--- /dev/null
+++ b/src/views/trainingPlatform/secondaryHome.vue
@@ -0,0 +1,119 @@
+
+
+
+
+
{{ title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+