From c203ede05473f02f80c7472c5da0de50be3efcd1 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 29 Nov 2019 18:06:47 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=8C=BA=E6=AE=B5=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/newMapdraft/mapoperate/section.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index 8155381eb..64658855f 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -836,9 +836,17 @@ 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 (start_x == end_x && start_y == end_y) { + 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); From 9a6647f2567b63363978ea08b971554a60d7c717 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 29 Nov 2019 18:16:21 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/newMapdraft/mapoperate/section.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index 64658855f..d7759786e 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -841,7 +841,12 @@ export default { 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 = [ From 0afb9666fc94c2c5fc499c9f49ea05473ffd3c07 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 29 Nov 2019 18:32:34 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMap/newMapdraft/mapoperate/section.vue | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index 8155381eb..a05d23895 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -382,7 +382,9 @@ 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, disabled: true }, + { 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 @@ -500,6 +502,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; @@ -960,6 +968,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) { + 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); // 添加新增拆分区段 } @@ -1000,7 +1020,6 @@ export default { parentCode: '', name: uid, type: '01', - linkCode: lsection.linkCode, isStandTrack: false, standTrackName: '', standTrackNamePosition: { x: 0, y: 0 }, @@ -1039,6 +1058,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 +1080,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); } From e8cfe647b5fcfa7f8d112d4f7800fef6f5c15a19 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 29 Nov 2019 18:49:16 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/newMapdraft/mapoperate/section.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index 3a47fc58f..b1645b830 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -273,7 +273,9 @@ export default { parentCode: '', points: [], lengthFact: 0, - isCurve: false + isCurve: false, + leftSection: '', + rightSection: '' }, tableData: [], oldPoint: [], // 区段未修改前 坐标 @@ -849,7 +851,7 @@ export default { 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){ + if (this.createModel.leftSection == this.createModel.rightSection) { this.$messageBox('左关联区段不能和右关联区段相同'); return; } @@ -985,7 +987,7 @@ export default { if (index === 0) { elem.leftSection = selected.leftSection; elem.rightSection = models[index + 1].code; - } else if (index === models.length) { + } else if (index === models.length-1) { elem.leftSection = models[index - 1].code; elem.rightSection = selected.rightSection; } else { From 52816d63978aaee531709af3a1500e6d847e4dcb Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 2 Dec 2019 09:49:44 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=88=A0=E9=99=A4link=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMap/newMapdraft/mapoperate/section.vue | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index b1645b830..784605dfc 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -226,7 +226,6 @@ export default { data() { return { questionList: [], - linksCollection: [], activeName: 'first', SectionTypeList: [], SectionSepTypeList: [], @@ -264,7 +263,6 @@ export default { relSwitchCode: '', stationCode: '', logicSectionNameSort: '', - linkCode: '', sepTypeLeft: '', offsetLeft: 0, sepTypeRight: '', @@ -735,7 +733,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', @@ -882,7 +879,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) { @@ -965,7 +962,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, @@ -987,7 +983,7 @@ export default { if (index === 0) { elem.leftSection = selected.leftSection; elem.rightSection = models[index + 1].code; - } else if (index === models.length-1) { + } else if (index === models.length - 1) { elem.leftSection = models[index - 1].code; elem.rightSection = selected.rightSection; } else { @@ -1024,10 +1020,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', @@ -1168,18 +1160,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; - } - } From 4b7683248cb68db9e08d67436ebde98a894c293e Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 2 Dec 2019 11:12:45 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/newMapdraft/mapoperate/section.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index 784605dfc..5eff303c9 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -517,6 +517,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() { From a3936c0e5bc85a54dca967e5c0ff125479d2ed15 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 2 Dec 2019 13:01:26 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BB=98=E5=9B=BE?= =?UTF-8?q?=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/zh/map.js | 4 +- src/jmap/utils/JTriangle.js | 118 +++++++++--------- src/jmapNew/shape/Section/index.js | 10 +- src/utils/baseUrl.js | 4 +- .../newMap/newMapdraft/mapoperate/section.vue | 63 ++++++---- .../newMap/newMapdraft/mapoperate/signal.vue | 21 +++- 6 files changed, 125 insertions(+), 95 deletions(-) diff --git a/src/i18n/langs/zh/map.js b/src/i18n/langs/zh/map.js index 7a581ce21..869041043 100644 --- a/src/i18n/langs/zh/map.js +++ b/src/i18n/langs/zh/map.js @@ -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:', diff --git a/src/jmap/utils/JTriangle.js b/src/jmap/utils/JTriangle.js index 5b732c31a..082e0e342 100644 --- a/src/jmap/utils/JTriangle.js +++ b/src/jmap/utils/JTriangle.js @@ -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; diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index 9c1d46060..91c63050f 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -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); diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 771ec6ec2..1e9afea51 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,10 +3,10 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 - BASE_API = 'http://192.168.3.41:9000'; // 张赛 + // BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.82:9000'; // 杜康 } else { BASE_API = process.env.VUE_APP_BASE_API; diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index b1645b830..be89e8f78 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -224,6 +224,19 @@ 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: [], @@ -389,7 +402,7 @@ export default { { 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: [ @@ -398,7 +411,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: [ @@ -406,7 +419,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: [ @@ -419,7 +432,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 @@ -427,14 +440,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 } ] }, @@ -448,7 +461,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 } ] } } @@ -538,8 +551,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'; @@ -548,38 +561,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) { @@ -588,7 +601,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: { @@ -987,7 +1006,7 @@ export default { if (index === 0) { elem.leftSection = selected.leftSection; elem.rightSection = models[index + 1].code; - } else if (index === models.length-1) { + } else if (index === models.length - 1) { elem.leftSection = models[index - 1].code; elem.rightSection = selected.rightSection; } else { diff --git a/src/views/newMap/newMapdraft/mapoperate/signal.vue b/src/views/newMap/newMapdraft/mapoperate/signal.vue index 02565de38..6af719a09 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal.vue @@ -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; } } });