diff --git a/src/i18n/langs/zh/map.js b/src/i18n/langs/zh/map.js index b2cee0a22..20da7782a 100644 --- a/src/i18n/langs/zh/map.js +++ b/src/i18n/langs/zh/map.js @@ -236,7 +236,7 @@ export default { sectionLogicalNumber: '逻辑区段数量', sectionLsectioncode: '左侧区段名称:', sectionRsectioncode: '右侧区段名称:', - associatedSection: '所属物理/道岔区段:', + associatedSection: '所属物理/道岔/岔心区段:', blockCoding: '区段编码:', sectionType: '区段类型:', sectionNameColon: '区段名称:', diff --git a/src/jmapNew/shape/Section/ETextName.js b/src/jmapNew/shape/Section/ETextName.js index c12a4c5f4..e33da6002 100644 --- a/src/jmapNew/shape/Section/ETextName.js +++ b/src/jmapNew/shape/Section/ETextName.js @@ -24,7 +24,7 @@ class ETextName extends Group { const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); const drict = model.trainPosType != '01' ? 1 : -1; if (this.model.type == 'name') { - if (model.type == '01') { // 物理区段名称 + if (model.type == '01' && !model.parentCode) { // 物理区段名称 const tempx = x + traingle.getSin(styleModel.distance); const tempy = y + traingle.getCos(styleModel.distance) * (styleModel.position || drict); styleX = tempx + model.namePosition.x; diff --git a/src/views/newMap/newMapdraft/mapoperate/section/crossSection.vue b/src/views/newMap/newMapdraft/mapoperate/section/crossSection.vue index d18a874a8..af2695ce4 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/crossSection.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/crossSection.vue @@ -11,7 +11,7 @@ import { mapGetters } from 'vuex'; import { getUID } from '@/jmapNew/utils/Uid'; import CreateOperate from '../components/createOperate'; -import {segmentsIntr} from '@/utils/index'; +import {segmentsIntr, deepAssign} from '@/utils/index'; export default { name:'CrossDraft', components: { @@ -116,6 +116,7 @@ export default { }, updateMapDraw(standCode) { + const models = []; const model = { _type: 'Section', code: getUID('T', this.sectionList), @@ -126,7 +127,15 @@ export default { relateSectionList:this.addModel.relateSectionList, stationCode:standCode }; - this.$emit('updateMapModel', model); + const relateSectionList = this.addModel.relateSectionList; + const newSectionA = deepAssign({}, this.$store.getters['map/getDeviceByCode'](relateSectionList[0])); + const newSectionB = deepAssign({}, this.$store.getters['map/getDeviceByCode'](relateSectionList[1])); + newSectionA.parentCode = model.code; + newSectionB.parentCode = model.code; + models.push(model); + models.push(newSectionA); + models.push(newSectionB); + this.$emit('updateMapModel', models); } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/section/index.vue b/src/views/newMap/newMapdraft/mapoperate/section/index.vue index b406ae0f3..85bfe6622 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/index.vue @@ -343,7 +343,7 @@ export default { return this.hasAssociatedSection && this.editModel.rightAxlePosition; }, isParentCode() { - return this.editModel.type == '02' || this.editModel.type == '03'; + return this.editModel.type == '02' || this.editModel.type == '03' || (this.editModel.type == '01' && this.editModel.parentCode); }, isstandTrackNameShow() { return this.editModel.type == '01' && this.editModel.standTrack; @@ -731,7 +731,8 @@ export default { delRightSection.leftSectionCode = ''; models.push(delRightSection); } - selected.relevanceSectionList.forEach(dataCode => { // 关联道岔区段 父元素清空 + const relateSection = selected.relevanceSectionList || selected.relateSectionList; + relateSection.forEach(dataCode => { // 关联道岔区段 父元素清空 const sectionModel = this.getSectionByCode(dataCode); if (sectionModel) { sectionModel.parentCode = ''; diff --git a/src/views/newMap/newMapdraft/mapoperate/signal/batchSetting.vue b/src/views/newMap/newMapdraft/mapoperate/signal/batchSetting.vue index 081b7af56..5d0810c31 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal/batchSetting.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal/batchSetting.vue @@ -304,9 +304,6 @@ export default { }, // 寻找信号机关联区段 findSection(signal) { - if (signal.code == 'S40506' || signal.code == 'X99289' || signal.code == 'S63773') { - debugger; - } const arrList = []; this.sectionList.forEach(section => { if (section.type == '01' || section.type == '03') {