From 2ddc94f7aa67053d9a3e2edf7cccaefe922e009c Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 18 Dec 2020 13:10:55 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=8D=97=E4=BA=AC=E4=BA=8C=E5=8F=B7?= =?UTF-8?q?=E7=BA=BF=E7=9A=AE=E8=82=A4=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/bejing_01.js | 3 +- src/jmapNew/config/skinCode/chengdu_01.js | 3 +- src/jmapNew/config/skinCode/chengdu_03.js | 3 +- src/jmapNew/config/skinCode/foshan_01.js | 3 +- src/jmapNew/config/skinCode/fuzhou_01.js | 3 +- src/jmapNew/config/skinCode/haerbin_01.js | 3 +- src/jmapNew/config/skinCode/nanjing_02.js | 6 +- src/jmapNew/config/skinCode/ningbo_01.js | 3 +- src/jmapNew/config/skinCode/ningbo_03.js | 3 +- src/jmapNew/config/skinCode/race_01.js | 3 +- src/jmapNew/config/skinCode/xian_01.js | 3 +- src/jmapNew/config/skinCode/xian_02.js | 3 +- src/jmapNew/shape/Signal/ESigPost.js | 69 +++++++++++++++-------- src/jmapNew/shape/Signal/index.js | 4 +- 14 files changed, 73 insertions(+), 39 deletions(-) diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index 5c0308133..d8e766104 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -133,7 +133,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#5578B6', // 灯灯柱颜色 - standardWidth: 1.5 // 灯柱宽度 + standardVerticalWidth: 1.5, // 灯柱竖杆宽度 + standardRailWidth: 1.5 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index 53f27194f..5d936448d 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -141,7 +141,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#C0C0C0', // 灯柱颜色 - standardWidth: 2 // 灯柱宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index 773aaceab..fe98b57a7 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -147,7 +147,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#FFFFFF', // 灯柱颜色 - standardWidth: 2 // 灯柱宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/foshan_01.js b/src/jmapNew/config/skinCode/foshan_01.js index 72e90c9ab..43663387c 100644 --- a/src/jmapNew/config/skinCode/foshan_01.js +++ b/src/jmapNew/config/skinCode/foshan_01.js @@ -125,7 +125,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#3149C3', // 灯珠颜色 - standardWidth: 2 // 灯珠宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/fuzhou_01.js b/src/jmapNew/config/skinCode/fuzhou_01.js index 40cc992db..66d35f5f9 100644 --- a/src/jmapNew/config/skinCode/fuzhou_01.js +++ b/src/jmapNew/config/skinCode/fuzhou_01.js @@ -125,7 +125,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#3149C3', // 灯珠颜色 - standardWidth: 2 // 灯珠宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index ea1d37e3e..3066e10e8 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -148,7 +148,8 @@ class SkinCode extends defaultStyle { standardLength: 4, // 高柱长度 standardHeight: 5, // 灯柱高度 standardColor: '#FF0000', // 灯柱颜色 - standardWidth: 4 // 灯柱宽度 + standardVerticalWidth: 4, // 灯柱竖杆宽度 + standardRailWidth: 4 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/nanjing_02.js b/src/jmapNew/config/skinCode/nanjing_02.js index ea1d37e3e..a0f27cbc8 100644 --- a/src/jmapNew/config/skinCode/nanjing_02.js +++ b/src/jmapNew/config/skinCode/nanjing_02.js @@ -145,10 +145,12 @@ class SkinCode extends defaultStyle { distance: 10, // 设备距离区段的距离 post: { standardShow: true, // 灯柱显示 - standardLength: 4, // 高柱长度 + standardVerticalShape: '8', // 灯柱 竖杆 8边型 + standardLength: 12, // 高柱长度 standardHeight: 5, // 灯柱高度 standardColor: '#FF0000', // 灯柱颜色 - standardWidth: 4 // 灯柱宽度 + standardVerticalWidth: 1, // 灯柱竖杆宽度 + standardRailWidth: 6 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index a8b58e64c..d44eedb48 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -128,7 +128,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#C0C0C0', // 灯柱颜色 - standardWidth: 2 // 灯柱宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/ningbo_03.js b/src/jmapNew/config/skinCode/ningbo_03.js index 75bb13fa9..903960e87 100644 --- a/src/jmapNew/config/skinCode/ningbo_03.js +++ b/src/jmapNew/config/skinCode/ningbo_03.js @@ -164,7 +164,8 @@ class SkinCode extends defaultStyle { standardHeight: 6, // 灯柱高度 standardColor: '#000000', // 灯柱颜色 physicColor:'#c0c0c0', // 物理点灯灯柱颜色 - standardWidth: 2 // 灯柱宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/race_01.js b/src/jmapNew/config/skinCode/race_01.js index 5c4ab8f49..7834e4f12 100644 --- a/src/jmapNew/config/skinCode/race_01.js +++ b/src/jmapNew/config/skinCode/race_01.js @@ -150,7 +150,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#969696', // 灯灯柱颜色 - standardWidth: 3 // 灯柱宽度 + standardVerticalWidth: 3, // 灯柱竖杆宽度 + standardRailWidth: 3 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/xian_01.js b/src/jmapNew/config/skinCode/xian_01.js index e3fda6713..eea50c1a4 100644 --- a/src/jmapNew/config/skinCode/xian_01.js +++ b/src/jmapNew/config/skinCode/xian_01.js @@ -133,7 +133,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#3149C3', // 灯珠颜色 - standardWidth: 2 // 灯珠宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/xian_02.js b/src/jmapNew/config/skinCode/xian_02.js index c5d687bb4..189ac2a4a 100644 --- a/src/jmapNew/config/skinCode/xian_02.js +++ b/src/jmapNew/config/skinCode/xian_02.js @@ -142,7 +142,8 @@ class SkinCode extends defaultStyle { standardLength: 7, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#fff', // 灯柱颜色 - standardWidth: 2, // 灯柱宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2, // 灯柱横杆宽度 autoRouteColor: '#008000', // 自动进路开启灯柱颜色 shapeChange: true, // 灯柱形状改变 terminalOptional: '#CC3399' // 终端可选信号机灯柱颜色 diff --git a/src/jmapNew/shape/Signal/ESigPost.js b/src/jmapNew/shape/Signal/ESigPost.js index 5f23398c5..3f1fc12f2 100644 --- a/src/jmapNew/shape/Signal/ESigPost.js +++ b/src/jmapNew/shape/Signal/ESigPost.js @@ -12,23 +12,49 @@ class ESigPost extends Group { create() { const model = this.model; const style = this.model.style; - // 竖杆 - this.ver = new Polyline({ - _subType: 'SignalLamp', - _val: '3', - zlevel: model.zlevel, - z: model.z, - shape: { - points: [ - [model.x, model.y + style.Signal.post.standardHeight * 1.2], - [model.x, model.y - style.Signal.post.standardHeight * 1.2] - ] - }, - style: { - lineWidth: style.Signal.post.standardWidth, - stroke: style.Signal.post.standardColor - } - }); + // 基座 + let verPoints = [[model.x, model.y + style.Signal.post.standardHeight * 1.2], [model.x, model.y - style.Signal.post.standardHeight * 1.2]]; + if (style.Signal.post.standardVerticalShape && style.Signal.post.standardVerticalShape === '8') { + verPoints = [ + [model.x - model.drict * 2, model.y + style.Signal.post.standardHeight * 1.2], + [model.x - model.drict * 2, model.y - style.Signal.post.standardHeight * 1.2], + [model.x, model.y - style.Signal.post.standardHeight * 1.2], + [model.x, model.y - style.Signal.post.standardRailWidth / 2], + [model.x + model.drict * 2, model.y - style.Signal.post.standardRailWidth / 2], + [model.x + model.drict * 2, model.y + style.Signal.post.standardRailWidth / 2], + [model.x, model.y + style.Signal.post.standardRailWidth / 2], + [model.x, model.y + style.Signal.post.standardHeight * 1.2] + ]; + this.ver = new Polygon({ + _subType: 'SignalLamp', + _val: '3', + zlevel: model.zlevel, + z: model.z, + shape: { + points: verPoints + }, + style: { + lineWidth: style.Signal.post.standardVerticalWidth, + stroke: style.Signal.post.standardColor, + fill: style.Signal.post.standardColor + } + }); + } else { + this.ver = new Polyline({ + _subType: 'SignalLamp', + _val: '3', + zlevel: model.zlevel, + z: model.z, + shape: { + points: verPoints + }, + style: { + lineWidth: style.Signal.post.standardVerticalWidth, + stroke: style.Signal.post.standardColor, + fill: style.Signal.post.standardColor + } + }); + } // 横杆 this.hor = new Polyline({ zlevel: model.zlevel, @@ -41,18 +67,13 @@ class ESigPost extends Group { ] }, style: { - lineWidth: style.Signal.post.standardWidth, + lineWidth: style.Signal.post.standardRailWidth, stroke: style.Signal.post.standardColor } }); this.add(this.ver); this.add(this.hor); - - model.type === '01' ? this.hor.hide() : this.hor.show(); - if (style.Signal.post.standardShow) { - this.hor.show(); - } } setColor(color) { @@ -100,7 +121,7 @@ class ESigPost extends Group { if (style.Signal.post.standardShow) { type = '01'; } - const length = style.Signal.post.standardShow ? 4 : 0; + const length = style.Signal.post.standardShow ? style.Signal.post.standardLength : 0; if (type === '01') { return { x: model.x + model.drict * style.Signal.lamp.radiusR * 3 / 2 + model.drict * length, diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index 6c852fe24..7bdf700d3 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -180,7 +180,7 @@ class Signal extends Group { this.sigBack.hide(); } // 信号机名称 - const sigNameX = model.position.x + model.positionPoint.x - drict * (style.Signal.post.standardWidth) + model.namePosition.x; + const sigNameX = model.position.x + model.positionPoint.x - drict * (style.Signal.post.standardVerticalWidth) + model.namePosition.x; const sigNameY = model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance); const textAlign = style.Signal.text.isAlignCenter ? 'middle' : this.model.right ? 'left' : 'right'; const textVerticalAlign = posit == 1 ? 'top' : 'bottom'; @@ -725,7 +725,7 @@ class Signal extends Group { const rect = this.sigPost.getBoundingRect().clone(); return { - x: rect.x + drict * this.style.Signal.post.standardWidth, + x: rect.x + drict * this.style.Signal.post.standardVerticalWidth, y: rect.y - offsetY }; } From 941e0a791aebe315063949e8a2c5747ac6e8e6c0 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 18 Dec 2020 13:38:13 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E7=95=99=E8=A8=80=E6=9D=BF=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/ProjectConfig.js | 2 +- src/views/newMap/displayNew/demonMenu.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/ProjectConfig.js b/src/scripts/ProjectConfig.js index a6123e2bd..b558e9b92 100644 --- a/src/scripts/ProjectConfig.js +++ b/src/scripts/ProjectConfig.js @@ -427,7 +427,7 @@ export const ProjectIcon = { export const ProjectCode = { login: 'DEFAULT', - designlogin: 'DEFAULT', + design: 'DEFAULT', xty: 'XTY', designxty: 'XTY', gzb: 'GZB', diff --git a/src/views/newMap/displayNew/demonMenu.vue b/src/views/newMap/displayNew/demonMenu.vue index 936795ac0..b0640f918 100644 --- a/src/views/newMap/displayNew/demonMenu.vue +++ b/src/views/newMap/displayNew/demonMenu.vue @@ -277,7 +277,7 @@ export default { const routeData = this.$router.resolve({ path:'/messageBoard', query:{ - project: this.$route.query.project, + project: this.$route.query.project || getSessionStorage('project'), noPreLogout: true } }); From 31954a545d22930bba6e0bc2431bde412e517de4 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 18 Dec 2020 14:10:25 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=93=88=E5=B0=94=E6=BB=A8=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/haerbin_01/menus/dialog/trainControl.vue | 10 +++++----- src/jmapNew/theme/haerbin_01/menus/menuButton.vue | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/jmapNew/theme/haerbin_01/menus/dialog/trainControl.vue b/src/jmapNew/theme/haerbin_01/menus/dialog/trainControl.vue index e524d6151..a7c2c3146 100644 --- a/src/jmapNew/theme/haerbin_01/menus/dialog/trainControl.vue +++ b/src/jmapNew/theme/haerbin_01/menus/dialog/trainControl.vue @@ -29,7 +29,7 @@ @@ -52,7 +52,7 @@ @@ -157,7 +157,7 @@ export default { if (device && device.code && device.deviceType === 'TRAIN') { this.tempTableData = [device]; this.sectionCode = device.sectionModel.name; - this.tripNum = device.destinationCode + device.serviceNumber + device.tripNumber; + this.tripNum = device.destinationCode + device.serviceNumber + (device.tripNumber.substring(1)); this.groupNum = device.groupNumber; } } @@ -186,10 +186,10 @@ export default { }, commit() { this.newTripNumError = false; - if (this.newTripNum && this.newTripNum.length === 9) { + if (this.newTripNum && this.newTripNum.length === 8) { const params = { groupNumber: this.groupNum, - tripNumber: this.newTripNum.slice(6, 9), + tripNumber: '0' + this.newTripNum.slice(6, 8), serviceNumber: this.newTripNum.slice(3, 6) }; const step = { diff --git a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue index 76129d247..556527037 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue @@ -794,7 +794,7 @@ export default { this.standParamList = this.$store.state.training.prdType === '01' ? [] : [ { name: '扣车', cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN, operate: OperationEvent.StationStand.setDetainTrain.menuButton, show: false }, { name: '取消扣车', cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN, operate: OperationEvent.StationStand.cancelDetainTrain.menuButton, show: false }, - { name: '越站', cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP, operate: OperationEvent.StationStand.setJumpStop.menuButton, show: false, securityCommand: true }, + { name: '越站', cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP, operate: OperationEvent.StationStand.setJumpStop.menuButton, show: false }, { name: '取消越站', cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP, operate: OperationEvent.StationStand.cancelJumpStop.menuButton, show: false, securityCommand: true } ]; this.directionRodParamList = [ From 6351d966a130e5932d18d0b2b88abd2b4e9b795b Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Fri, 18 Dec 2020 15:26:02 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E5=AE=A2=E6=B5=81=E8=BD=A6=E7=AB=99=E4=B9=98=E5=AE=A2=E4=B8=8A?= =?UTF-8?q?=E9=94=99=E7=AB=99=E5=8F=B0bug=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=89=E7=BB=B4=E7=BC=96=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/jl3dtrafficplan/connect/stationconnect.js | 9 ++++++++- src/jlmap3d/jl3dtrafficplan/jl3dtrafficplan.js | 5 +++-- src/jlmap3d/jl3dtrafficplan/model/passerhuman.js | 8 ++++---- src/jlmap3d/jl3dtrafficplan/passerai/passerai.js | 4 +++- src/utils/baseUrl.js | 4 ++-- src/views/jlmap3d/edit/component/action.vue | 5 ++++- src/views/jlmap3d/edit/component/assets.vue | 5 ++++- 7 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/jlmap3d/jl3dtrafficplan/connect/stationconnect.js b/src/jlmap3d/jl3dtrafficplan/connect/stationconnect.js index 9a10d6c14..429994ab6 100644 --- a/src/jlmap3d/jl3dtrafficplan/connect/stationconnect.js +++ b/src/jlmap3d/jl3dtrafficplan/connect/stationconnect.js @@ -43,18 +43,23 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe } /** 站台客流当前人数信息 */ if(data.type == "STAND_PFI"){ - // console.log(data); + let newStandData = data.body; let count = 0; for(let j=0;j - +
@@ -341,6 +341,9 @@ export default { updateEditSelectAsset(selsetAsset,selectData){ console.log(selectData); if(this.nowSelect != null){ + if(selsetAsset == "clear"){ + + } if(selectData.fileType == "model"){ if(selsetAsset == "sceneEdit"){ this.sceneAssetList[this.nowSelect].id = selectData.id; diff --git a/src/views/jlmap3d/edit/component/assets.vue b/src/views/jlmap3d/edit/component/assets.vue index f5d7f2383..4bb3fac9e 100644 --- a/src/views/jlmap3d/edit/component/assets.vue +++ b/src/views/jlmap3d/edit/component/assets.vue @@ -20,7 +20,7 @@ - + @@ -175,6 +175,9 @@ export default { // this.$emit('smodel',this.modelList[index]); updateEditSelectAsset(this.nowAssetName,this.nowAssetList[index]); }, + clearModel(){ + updateEditSelectAsset("clear"); + }, //刷新资源库显示 updateAssetList(newdata,newtype){ console.log(newdata); From 901fa60bc42916d23d9f3f9e68eb00c6b31261fe Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Fri, 18 Dec 2020 15:37:35 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=81=93=E5=B2=94?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Section/index.js | 4 +- .../newMapdraft/mapoperate/section/index.vue | 5 +- .../newMapdraft/mapoperate/switch/create.vue | 287 +++++++++++++++--- 3 files changed, 256 insertions(+), 40 deletions(-) diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index c90bf65ba..09daa9ba4 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -246,12 +246,12 @@ export default class Section extends Group { // 哈尔滨线路 道岔相关区段设置 默认颜色 if (this.style.Switch.sectionAction.flag && model.relSwitchCode && !flag) { const switchModel = Vue.prototype.$jlmap.mapDevice[model.relSwitchCode]; - if (switchModel.normalPosition != 0) { // 定位情况 + if (switchModel && switchModel.normalPosition != 0) { // 定位情况 const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; sectionC && sectionC.instance && sectionC.instance.line.setStyle({ stroke: this.style.Switch.sectionAction.spareColor }); const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode]; sectionB && sectionB.instance && sectionB.instance.setState(sectionB, true); - } else if (switchModel.normalPosition == 0) { // 反位情况 + } else if (switchModel && switchModel.normalPosition == 0) { // 反位情况 const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode]; sectionB && sectionB.instance && sectionB.instance.line.setStyle({ stroke: this.style.Switch.sectionAction.spareColor }); const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; diff --git a/src/views/newMap/newMapdraft/mapoperate/section/index.vue b/src/views/newMap/newMapdraft/mapoperate/section/index.vue index 3cc9ff847..744d487e9 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/index.vue @@ -501,10 +501,7 @@ export default { model.rightStopPointOffset = model.rightStopPointOffset || model.lengthFact - 5; } const changeSectionList = this.handleOtherSectionChange(model); - // let changeStandList = []; - // if (this.editModel.stationCode != this.selected.stationCode) { // 优化 const changeStandList = this.handleRelevanceStand(model); - // } models = [...changeSectionList, ...changeStandList]; this.$emit('updateMapModel', models); @@ -512,8 +509,10 @@ export default { this.oldLeftSectionCode = model.leftSectionCode; this.oldRightSectionCode = model.rightSectionCode; this.field = ''; + this.$emit('deviceSelect', ''); // 清空属性 } else { this.$message('还有属性未填写,修改未生效!'); + this.$emit('deviceSelect', ''); } }); }, diff --git a/src/views/newMap/newMapdraft/mapoperate/switch/create.vue b/src/views/newMap/newMapdraft/mapoperate/switch/create.vue index 832eb1a4b..99abca947 100644 --- a/src/views/newMap/newMapdraft/mapoperate/switch/create.vue +++ b/src/views/newMap/newMapdraft/mapoperate/switch/create.vue @@ -23,6 +23,8 @@ export default { methods:{ create() { // 一键生成道岔 const createArr = []; // 创建model列表 + // const changeSectionLists = []; + // const changeSectionList = this.changeSectionsAttr(); // 找道岔中心点 const changeSectionList = this.changeSectionAttr(); // 找道岔中心点 changeSectionList.forEach(section => { if (section['typeModel'] && section['typeModel'] == 'start') { // 右侧关联关系为空 且 道岔区段 @@ -35,7 +37,7 @@ export default { if (this.handleResetPoint(item.points)) { sectionEnd = item.points[item.points.length - 1]; } else { - sectionEnd = item.points[0]; + sectionEnd = item.points.length == 2 ? item.points[0] : item.points[item.points.length - 2]; } if ((sectionEnd.y == section.points[section.points.length - 1].y) || (sectionEnd.x == section.points[section.points.length - 1].x)) { // 是否水平拿第二个点判断 sectionB = item; @@ -50,13 +52,13 @@ export default { if (this.handleResetPoint(section.points)) { intersection = section.points[section.points.length - 1]; } else { - intersection = section.points[0]; + intersection = section.points.length == 2 ? section.points[0] : section.points[section.points.length - 2]; } let skew; if (this.handleResetPoint(sectionC.points)) { skew = sectionC.points[sectionC.points.length - 1]; } else { - skew = sectionC.points[0]; + skew = sectionC.points.length == 2 ? sectionC.points[0] : sectionC.points[sectionC.points.length - 2]; } const data = { code: getUID('W', [...this.switchList, ...createArr]), @@ -91,7 +93,7 @@ export default { list.forEach(item => { let sectionStart; if (this.handleResetPoint(item.points)) { - sectionStart = item.points[0]; + sectionStart = item.points.length == 2 ? item.points[0] : item.points[item.points.length - 2]; } else { sectionStart = item.points[item.points.length - 1]; } @@ -106,13 +108,13 @@ export default { const switchModel = getModel('Switch'); let intersection; if (this.handleResetPoint(section.points)) { - intersection = section.points[0]; + intersection = section.points.length == 2 ? section.points[0] : section.points[section.points.length - 2]; } else { intersection = section.points[section.points.length - 1]; } let skew; if (this.handleResetPoint(sectionC.points)) { - skew = sectionC.points[0]; + skew = sectionC.points.length == 2 ? sectionC.points[0] : sectionC.points[sectionC.points.length - 2]; } else { skew = sectionC.points[sectionC.points.length - 1]; } @@ -140,6 +142,92 @@ export default { !swch && createArr.push(model); // 已有的道岔不在创建 } } + // if (item['typeModel'] == 'start') { // 右侧关联关系为空 且 道岔区段 + // const section = item.A; + // const sectionB = item.B; + // const sectionC = item.C; + // if (section.code && sectionB.code && sectionC.code) { + // const uname = 'W' + section.name.replace('T', ''); + // const switchModel = getModel('Switch'); + // let intersection; + // if (this.handleResetPoint(section.points)) { + // intersection = section.points[section.points.length - 1]; + // } else { + // intersection = section.points.length == 2 ? section.points[0] : section.points[section.points.length - 2]; + // } + // let skew; + // if (this.handleResetPoint(sectionC.points)) { + // skew = sectionC.points[sectionC.points.length - 1]; + // } else { + // skew = sectionC.points.length == 2 ? sectionC.points[0] : sectionC.points[sectionC.points.length - 2]; + // } + // const data = { + // code: getUID('W', [...this.switchList, ...createArr]), + // name: uname, + // nameShow: true, + // timeoutShow: true, + // sectionACode: section.code, + // sectionBCode: sectionB.code, + // sectionCCode: sectionC.code, + // turnTime: 3, + // intersection: { + // x: intersection.x, + // y: intersection.y + // }, + // skew: { + // x: skew.x, + // y: skew.y + // }, + // normalPosition: 1 // 默认状态定位 + // }; + // const model = Object.assign(switchModel, data); + // const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode); + // !swch && createArr.push(model); // 已有的道岔不在创建 + // } + // } + // if (item['typeModel'] == 'end') { // 左侧关联关系为空 且 道岔区段 + // const section = item.A; + // const sectionB = item.B; + // const sectionC = item.C; + // if (section.code && sectionB.code && sectionC.code) { + // const uname = 'W' + section.name.replace('T', ''); + // const switchModel = getModel('Switch'); + // let intersection; + // if (this.handleResetPoint(section.points)) { + // intersection = section.points.length == 2 ? section.points[0] : section.points[section.points.length - 2]; + // } else { + // intersection = section.points[section.points.length - 1]; + // } + // let skew; + // if (this.handleResetPoint(sectionC.points)) { + // skew = sectionC.points.length == 2 ? sectionC.points[0] : sectionC.points[sectionC.points.length - 2]; + // } else { + // skew = sectionC.points[sectionC.points.length - 1]; + // } + // const data = { + // code: getUID('W', [...this.switchList, ...createArr]), + // name: uname, + // nameShow: true, + // timeoutShow: true, + // sectionACode: section.code, + // sectionBCode: sectionB.code, + // sectionCCode: sectionC.code, + // turnTime: 3, + // intersection: { + // x: intersection.x, + // y: intersection.y + // }, + // skew: { + // x: skew.x, + // y: skew.y + // }, + // normalPosition: 1 // 默认状态定位 + // }; + // const model = Object.assign(switchModel, data); + // const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode); + // !swch && createArr.push(model); // 已有的道岔不在创建 + // } + // } } }); this.$confirm(this.$t('tip.confirmBatchGeneration'), this.$t('tip.hint'), { @@ -147,6 +235,8 @@ export default { cancelButtonText: this.$t('tip.cancel'), type: 'warning' }).then((res) => { + // console.log(createArr, changeSectionLists); + // debugger; const modelsList = this.createSwitchSection(createArr, changeSectionList); modelsList.forEach(item => { createArr.push(item); @@ -157,6 +247,133 @@ export default { this.$message( this.$t('tip.cancelGeneration')); }); }, + findArr(arr) { + if (arr[0].slope !== arr[1].slope && arr[0].slope !== arr[2].slope) { + return arr[0]; + } + for (var i = 0, len = arr.length; i < len; i++) { + if (arr[i].slope !== arr[0].slope) { + return arr[i]; + } + } + }, + // 修改区段属性 + // changeSectionsAttr() { + // const pointMap = {}; + // const ponitMapNew = {}; + // this.sectionList.forEach(item=> { + // if (item.type == '01' || item.type == '03') { + // const ponits = item.points; + // const startKey = ponits[0].x + '-' + ponits[0].y; + // const endKey = ponits[ponits.length - 1].x + '-' + ponits[ponits.length - 1].y; + // if (pointMap[startKey]) { + // pointMap[startKey].count++; + // pointMap[startKey].lists.push(item); + // if (pointMap[startKey].count >= 2) { ponitMapNew[startKey] = pointMap[startKey]; } + // } else { + // pointMap[startKey] = {count: 0, lists: [item]}; + // } + // if (pointMap[endKey]) { + // pointMap[endKey].count++; + // pointMap[endKey].lists.push(item); + // if (pointMap[endKey].count >= 2) { ponitMapNew[endKey] = pointMap[endKey]; } + // } else { + // pointMap[endKey] = {count: 0, lists: [item]}; + // } + // } + // }); + // const keys = Object.keys(ponitMapNew); + // const switchSections = []; + // keys.forEach(key => { + // if (ponitMapNew[key].count == 2) { + // const slopeList = []; + // ponitMapNew[key].lists.forEach(sectionModel => { + // let slope = ''; + // const points = sectionModel.points; + // const startKey = points[0].x + '-' + points[0].y; + // const endKey = points[points.length - 1].x + '-' + points[points.length - 1].y; + // if (key == startKey) { + // slope = ( points[1].y - points[0].y ) / ( points[1].x - points[0].x ); + // } + // if (key == endKey) { + // slope = ( points[points.length - 1].y - points[points.length - 2].y ) / ( points[points.length - 1].x - points[points.length - 2].x ); + // } + // slopeList.push({slope: slope, code: sectionModel.code, model: sectionModel}); + // }); + // const arr = []; + // let A, B; + // const sectionModelC = this.findArr(slopeList); + // slopeList.forEach(ele => { + // if (ele.slope != sectionModelC.slope) { + // arr.push(ele); + // } + // }); + // const C = sectionModelC.model; + // const pointsC = C.points; + // arr.forEach(item => { + // const sectionModel = item.model; + // const points = sectionModel.points; + // const startKey = points[0].x + '-' + points[0].y; + // const endKey = points[points.length - 1].x + '-' + points[points.length - 1].y; + // const startKeyC = pointsC[0].x + '-' + pointsC[0].y; + // const endKeyC = pointsC[pointsC.length - 1].x + '-' + pointsC[pointsC.length - 1].y; + // let pointC = null; + // if (key == startKeyC) { + // pointC = JSON.parse(JSON.stringify(pointsC[1])); + // } + // if (key == endKeyC) { + // pointC = JSON.parse(JSON.stringify(pointsC[pointsC.length - 2])); + // } + // let acuteAngle; + // if (key == startKey) { + // acuteAngle = this.handleAngle([points[1], points[0], pointC]); + // } + // if (key == endKey) { + // acuteAngle = this.handleAngle([points[points.length - 2], points[points.length - 1], pointC]); + // } + // if (acuteAngle) { + // B = item.model; + // } else { + // A = item.model; + // } + // }); + // let typeModel; + // if (key == A.points[A.points.length - 1].x + '-' + A.points[A.points.length - 1].y) { + // A.rightSectionCode = ''; + // A.sepTypeRight = '00'; // 分隔符 + // B.leftSectionCode = ''; + // B.sepTypeLeft = '00'; + // C.leftSectionCode = ''; + // C.sepTypeLeft = '00'; + // typeModel = 'start'; + // } + // if (key == A.points[0].x + '-' + A.points[0].y) { + // A.leftSectionCode = ''; + // A.sepTypeLeft = '00'; // 分隔符 + // B.rightSectionCode = ''; + // B.sepTypeRight = '00'; + // C.rightSectionCode = ''; + // C.sepTypeRight = '00'; + // typeModel = 'end'; + // } + // A.type = '03'; + // B.type = '03'; + // C.type = '03'; + // switchSections.push({A: A, B: B, C: C, typeModel: typeModel }); + // } + // }); + // console.log(switchSections); + // return switchSections; + // }, + // handleAngle(points) { + // const A = points[0]; + // const B = points[1]; + // const C = points[2]; + // var AB = Math.sqrt(Math.pow(A.x - B.x, 2) + Math.pow(A.y - B.y, 2)); + // var AC = Math.sqrt(Math.pow(A.x - C.x, 2) + Math.pow(A.y - C.y, 2)); + // var BC = Math.sqrt(Math.pow(B.x - C.x, 2) + Math.pow(B.y - C.y, 2)); + // return Math.pow(AB, 2) + Math.pow(BC, 2) > Math.pow(AC, 2); + // }, findSectionA(pointX, pointY, lists, code) { const list = []; lists.forEach(item => { @@ -208,19 +425,19 @@ export default { }, // 重置坐标点 handleResetPoint(points) { - return (points[points.length - 1].x >= points[0].x) && (points[points.length - 1].y >= points[0].y); + return points[points.length - 1].x >= points[points.length - 2].x; }, // 修改区段属性 changeSectionAttr() { const changeSectionList = []; // 改变的区段列表 this.sectionList.forEach(section => { - if (section.type == '01') { + if (section.type == '01' || section.type == '03') { const oneSection = section.points[section.points.length - 1]; const oneSectionStar = section.points[0]; let countA = 0; let countB = 0; this.sectionList.forEach(elem => { - if (elem.type == '01' && section.code != elem.code) { + if ((elem.type == '01' || section.type == '03') && section.code != elem.code) { let twoSection, twoSectionEnd; if (this.handleResetPoint(elem.points)) { twoSection = elem.points[0]; @@ -276,34 +493,34 @@ export default { }); return changeSectionList; }, - checkAddListA(points, code) { // 判断是否添加list (暂时不用) - let flag = false; - this.sectionList.forEach(section => { - section.points.forEach((point, index) => { - if (index > 0 && section.code != code) { - if (point.x == points.x && point.y == points.y) { - flag = true; - } - } - }); + // checkAddListA(points, code) { // 判断是否添加list (暂时不用) + // let flag = false; + // this.sectionList.forEach(section => { + // section.points.forEach((point, index) => { + // if (index > 0 && section.code != code) { + // if (point.x == points.x && point.y == points.y) { + // flag = true; + // } + // } + // }); - }); - return flag; - }, - checkAddListB(points, code) { // 判断是否添加list (暂时不用) - let flag = false; - this.sectionList.forEach(section => { - section.points.forEach((point, index) => { - if (index == 0 && section.code != code) { - if (point.x == points.x && point.y == points.y) { - flag = true; - } - } - }); + // }); + // return flag; + // }, + // checkAddListB(points, code) { // 判断是否添加list (暂时不用) + // let flag = false; + // this.sectionList.forEach(section => { + // section.points.forEach((point, index) => { + // if (index == 0 && section.code != code) { + // if (point.x == points.x && point.y == points.y) { + // flag = true; + // } + // } + // }); - }); - return flag; - }, + // }); + // return flag; + // }, // 一键生成道岔计轴区段 createSwitchSection(list, sectionLists) { const models = [];