From 029483953027c4b0d3ff056ce2fb00e26bfd7d3d Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 7 Dec 2020 09:11:09 +0800 Subject: [PATCH 01/52] =?UTF-8?q?=E5=9B=BD=E8=B5=9B=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/index.vue | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 24ada033a..30b5b3ea7 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -11,16 +11,6 @@ {{ loginTitle==='空串'?'':loginTitle }} -
-
距离2020年“新誉杯”全国城市轨道交通行业职业技能竞赛还剩
-
{{ days[0] }}
-
{{ days[1] }}
-
{{ days[2] }}
-
-
-
-
全国调度大赛已结束
-
{{ language }} @@ -111,13 +101,6 @@
主体:北京玖琏科技有限公司 备案号:京ICP备18028522号
-
-
郑重承诺:满足用户的一切技术需求!新地图上线三周!新需求两周完成!新BUG两天修复!
-
-
备战国赛
-
免费使用
-
-
@@ -213,9 +196,7 @@ export default { versionBaseNoShow: VersionBaseNoShow, mainBodyNoShow: MainBodyNoShow, noQrcodeList: NoQrcodeList, - expirationDate: 1606784400000, countdown: null, - days: [0, 0, 0], gameOver: false, wchatImg: wchat, handRight: HandRight @@ -319,12 +300,6 @@ export default { if (this.syncLogin || !this.project.endsWith('heb')) { this.loginRefresh(); } - if (this.project === 'drts') { - this.getDaysTime(); - this.countdown = setInterval(()=>{ - this.getDaysTime(); - }, 24 * 60 * 60 * 1000); - } }, beforeDestroy() { this.countdown && clearInterval(this.countdown); @@ -567,18 +542,6 @@ export default { this.$i18n.locale = this.lang; LangStorage.setLang(this.lang); }, - getDaysTime() { - const nowTime = Date.parse(new Date()); - this.days = []; this.hours = []; this.minutes = []; this.seconds = []; - const difference = this.expirationDate - nowTime; - if (difference <= 0) { - this.gameOver = true; - } - const day = Math.ceil(difference / (24 * 60 * 60 * 1000)); - this.days.push(Math.floor(day / 100)); - this.days.push(Math.floor((day % 100) / 10)); - this.days.push(day % 10); - }, goCompetitionRules(val) { if (val === '1') { window.open('https://mp.weixin.qq.com/s?__biz=MzI3NzMwODY3OQ==&mid=2247506304&idx=1&sn=77708ca228404cee2b28e131cdfb9735&chksm=eb6aade8dc1d24fe6eb9f1334aadda239f47dafc79de7d522e0f3f00e2d3ba1dd213dda6764c&xtrack=1&scene=90&subscene=93&sessionid=1598522875&clicktime=1598523062&enterid=1598523062&ascene=56&devicetype=android-29&version=3.0.27.2701&nettype=WIFI&abtest_cookie=AAACAA%3D%3D&lang=zh_CN&exportkey=AQZ2cTPSob%2B5kBDiWnKw0Js%3D&pass_ticket=12Xyhe%2BbZsC9Vuzfs0iYUUn0i%2Br5JlZiOGCxWoExuthBhnIrpkmUyjVRi6bjyA1I&wx_header=1&platform=win', '_blank'); From d52fe1828118a817e332571e4ead770fd634860c Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Mon, 7 Dec 2020 09:46:00 +0800 Subject: [PATCH 02/52] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E5=AE=A2=E6=B5=81=E4=B8=8A=E4=B8=8B=E8=BD=A6=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/edit/connect/getmodels.js | 179 ------------------ src/jlmap3d/edit/connect/testconnect.js | 10 - src/jlmap3d/edit/jl3dEditorLoader.js | 1 - .../jl3ddrive/moveupdate/DrivingConnectNew.js | 1 + .../model/traintrunk/passertrunkhuman.js | 4 +- 5 files changed, 4 insertions(+), 191 deletions(-) delete mode 100644 src/jlmap3d/edit/connect/getmodels.js delete mode 100644 src/jlmap3d/edit/connect/testconnect.js diff --git a/src/jlmap3d/edit/connect/getmodels.js b/src/jlmap3d/edit/connect/getmodels.js deleted file mode 100644 index 2a56c5714..000000000 --- a/src/jlmap3d/edit/connect/getmodels.js +++ /dev/null @@ -1,179 +0,0 @@ -//import request from '@/utils/request'; - -export function getmodels(data) { - let postmap = { - id:data.mapdata.id, - mapId:data.mapdata.mapId, - assets:"null", - sections:"null", - signals:"null", - trains:"null", - stands:"null", - switchs:"null" - }; - - if(data.mapdata.sectionlist.sections== undefined){ - return postmap; - } - - - if(data == undefined){ - - return postmap; - }else{ - //资源 - let assets = []; - for(let i=0;i Date: Mon, 7 Dec 2020 15:09:53 +0800 Subject: [PATCH 03/52] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=A5=E5=8C=BA?= =?UTF-8?q?=E6=AE=B5=E4=B8=BA=E7=9B=AE=E6=A0=87=E5=88=A0=E9=99=A4=E5=B7=A6?= =?UTF-8?q?=E5=8F=B3=E6=89=80=E6=9C=89=E5=85=83=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMapdraft/mapoperate/ImageControl.vue | 4 + .../newMap/newMapdraft/mapoperate/arrow.vue | 4 + .../mapoperate/components/operateProperty.vue | 1 + .../newMapdraft/mapoperate/controlLamp.vue | 4 + .../newMap/newMapdraft/mapoperate/counter.vue | 4 + .../newMapdraft/mapoperate/delayunlock.vue | 4 + .../newMapdraft/mapoperate/directionRod.vue | 8 +- .../newMapdraft/mapoperate/espDraft.vue | 8 +- .../newMapdraft/mapoperate/floodGate.vue | 4 + .../newMap/newMapdraft/mapoperate/index.vue | 10 +- .../newMapdraft/mapoperate/lcControl.vue | 4 + .../newMap/newMapdraft/mapoperate/line.vue | 4 + .../mapoperate/outFrameControl.vue | 4 + .../newMap/newMapdraft/mapoperate/power.vue | 5 +- .../newMapdraft/mapoperate/psdDraft.vue | 8 +- .../mapoperate/section/batchSettings.vue | 126 ++++++++++++++++-- .../newMapdraft/mapoperate/section/index.vue | 3 + .../newMapdraft/mapoperate/signal/index.vue | 8 +- .../newMapdraft/mapoperate/splitStation.vue | 8 +- .../newMap/newMapdraft/mapoperate/station.vue | 5 +- .../newMapdraft/mapoperate/stationstand.vue | 12 +- .../newMapdraft/mapoperate/switch/index.vue | 2 +- .../mapoperate/switch/switchModle.vue | 6 +- .../newMap/newMapdraft/mapoperate/text.vue | 4 + .../newMapdraft/mapoperate/trainwindow.vue | 12 +- .../newMapdraft/mapoperate/zcControl.vue | 1 + 26 files changed, 223 insertions(+), 40 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue index 6844d1f80..276435a5c 100644 --- a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue @@ -8,6 +8,7 @@ :rules="rules" type="Resource" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -162,6 +163,9 @@ export default { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceSelect(selected) { this.$refs.form && this.$refs.form.resetFields(); this.$refs.make && this.$refs.make.resetFields(); diff --git a/src/views/newMap/newMapdraft/mapoperate/arrow.vue b/src/views/newMap/newMapdraft/mapoperate/arrow.vue index 7a3187c5a..a6c202e5a 100644 --- a/src/views/newMap/newMapdraft/mapoperate/arrow.vue +++ b/src/views/newMap/newMapdraft/mapoperate/arrow.vue @@ -8,6 +8,7 @@ :rules="rules" type="Arrow" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -139,6 +140,9 @@ export default { clear() { this.addModel = getModel('Arrow'); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, create() { const model = deepAssign(this.addModel, {code:getUID('Arrow', this.arrowList)}); this.$emit('updateMapModel', model); diff --git a/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue b/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue index dd6dd7755..c9fad141e 100644 --- a/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue +++ b/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue @@ -51,6 +51,7 @@ export default { data.content = `${this.editModel.prepend}::${this.editModel.content}`; } this.$emit('updateMapModel', data); + this.$emit('clearDeviceSelect'); } else { this.$message('还有属性未填写,修改未生效!'); } diff --git a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue index bb061bc4d..40c9aef82 100644 --- a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue +++ b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue @@ -8,6 +8,7 @@ :rules="rules" :type="editModel.type" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -228,6 +229,9 @@ export default { this.$emit('deviceSelect', ''); } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, handleIndicatorLightList(indicatorLightList) { this.atsControlList = []; this.centerCommunicationList = []; diff --git a/src/views/newMap/newMapdraft/mapoperate/counter.vue b/src/views/newMap/newMapdraft/mapoperate/counter.vue index a14e2af63..628c30a78 100644 --- a/src/views/newMap/newMapdraft/mapoperate/counter.vue +++ b/src/views/newMap/newMapdraft/mapoperate/counter.vue @@ -8,6 +8,7 @@ :rules="rules" type="Counter" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -162,6 +163,9 @@ export default { this.addModel.stationCode = selected.code; } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, create() { const uid = getUID('Counter', this.counterList); const model = { diff --git a/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue b/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue index 742e0aad4..1c3294446 100644 --- a/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue +++ b/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue @@ -8,6 +8,7 @@ :rules="rules" type="DelayUnlock" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -148,6 +149,9 @@ export default { deviceChange(code) { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceSelect(selected) { this.$nextTick(() => { this.$refs.form && this.$refs.form.resetFields(); diff --git a/src/views/newMap/newMapdraft/mapoperate/directionRod.vue b/src/views/newMap/newMapdraft/mapoperate/directionRod.vue index dfcf6c757..e6ed7e030 100644 --- a/src/views/newMap/newMapdraft/mapoperate/directionRod.vue +++ b/src/views/newMap/newMapdraft/mapoperate/directionRod.vue @@ -8,6 +8,7 @@ :rules="rules" type="Resource" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -200,6 +201,9 @@ export default { this.$emit('deviceSelect', ''); } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, hover(field) { this.field = field === this.field ? '' : field; if (this.field) { @@ -229,8 +233,8 @@ export default { }, updateMapModel(data) { data.uniqueCode = `${data.startStationCode}-${data.endStationCode}-${data.right}`; - this.$emit('updateMapModel', data); - this.field = ''; + this.$emit('updateMapModel', data); + this.field = ''; }, deleteObj() { this.$refs.dataform.deleteObj(); diff --git a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue index cd48a662c..23408cc91 100644 --- a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue @@ -8,6 +8,7 @@ :rules="rules" type="Esp" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -109,6 +110,9 @@ export default { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); // this.edit(); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, hover(field) { this.field = field === this.field ? '' : field; if (this.field) { @@ -163,8 +167,8 @@ export default { } }, updateMapModel(data) { - this.$emit('updateMapModel', data); - this.field = ''; + this.$emit('updateMapModel', data); + this.field = ''; }, deleteObj() { this.$refs.dataform.deleteObj(); diff --git a/src/views/newMap/newMapdraft/mapoperate/floodGate.vue b/src/views/newMap/newMapdraft/mapoperate/floodGate.vue index 57225ba0a..63b4a7c36 100644 --- a/src/views/newMap/newMapdraft/mapoperate/floodGate.vue +++ b/src/views/newMap/newMapdraft/mapoperate/floodGate.vue @@ -8,6 +8,7 @@ :rules="rules" type="Resource" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -143,6 +144,9 @@ export default { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceSelect(selected) { this.$refs.form && this.$refs.form.resetFields(); this.$refs.make && this.$refs.make.resetFields(); diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index cb94b7bf5..9396129e3 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -3,10 +3,12 @@
- - {{ $t('map.mapName') }} - {{ mapInfo.name }} - +
+ {{ $t('map.mapName') }} + + {{ mapInfo.name }} + +
{{ $t('map.save') }} 数据操作 diff --git a/src/views/newMap/newMapdraft/mapoperate/lcControl.vue b/src/views/newMap/newMapdraft/mapoperate/lcControl.vue index 25a00dd7c..e5d7f7ff5 100644 --- a/src/views/newMap/newMapdraft/mapoperate/lcControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/lcControl.vue @@ -8,6 +8,7 @@ :rules="rules" type="LcControl" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -142,6 +143,9 @@ export default { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceSelect(selected) { this.$refs.form && this.$refs.form.resetFields(); this.$refs.make && this.$refs.make.resetFields(); diff --git a/src/views/newMap/newMapdraft/mapoperate/line.vue b/src/views/newMap/newMapdraft/mapoperate/line.vue index 9cc7d7fbf..afc02f4ae 100644 --- a/src/views/newMap/newMapdraft/mapoperate/line.vue +++ b/src/views/newMap/newMapdraft/mapoperate/line.vue @@ -8,6 +8,7 @@ :rules="rules" type="Line" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -149,6 +150,9 @@ export default { }); }, methods: { + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceChange(code) { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); diff --git a/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue b/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue index 364442e4c..fd0f6739c 100644 --- a/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue @@ -8,6 +8,7 @@ :rules="rules" type="OutFrame" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -156,6 +157,9 @@ export default { this.editModel = deepAssign(this.editModel, selected); } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, addPoint(index) { const data = { x: 0, y: 0 }; this.editModel.points.splice(index + 1, 0, data); diff --git a/src/views/newMap/newMapdraft/mapoperate/power.vue b/src/views/newMap/newMapdraft/mapoperate/power.vue index 5e768a019..2a6dee6f2 100644 --- a/src/views/newMap/newMapdraft/mapoperate/power.vue +++ b/src/views/newMap/newMapdraft/mapoperate/power.vue @@ -8,6 +8,7 @@ :rules="rules" type="Power" @updateMapModel="updateMapModel" + @clearDeviceSelect="tabClick" /> @@ -324,8 +325,8 @@ export default { } else { delete data.sectionUnitList; } - this.$emit('updateMapModel', data); - this.field = ''; + this.$emit('updateMapModel', data); + this.field = ''; } }, deleteObj() { diff --git a/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue b/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue index 8c1abd1c5..8659367a7 100644 --- a/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue @@ -8,6 +8,7 @@ :rules="rules" type="Psd" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -200,6 +201,9 @@ export default { this.$emit('deviceSelect', ''); } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceSelect(selected) { if (selected && selected._type.toUpperCase() === 'Psd'.toUpperCase()) { this.$refs.dataform && this.$refs.dataform.resetFields(); @@ -235,8 +239,8 @@ export default { this.$refs.createForm.resetForm(); }, updateMapModel(data) { - this.$emit('updateMapModel', data); - this.field = ''; + this.$emit('updateMapModel', data); + this.field = ''; }, // 批量设置 batchSettings() { diff --git a/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue b/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue index e3f9a04e7..e6f8716f5 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue @@ -3,12 +3,6 @@ - {{ $t('global.set') }} @@ -103,6 +97,34 @@ 设置 + + + + + + + {{ $t('map.activate') }} + + + 右边删除 + 左边删除 + + + + 删除 + + + +
@@ -124,10 +146,6 @@ export default { data() { return { activeName: '', - // form: { - // leftDistance: 0, - // rightDistance: 0 - // }, formModel: { modelList: [], trainPosType: '' @@ -136,6 +154,10 @@ export default { roadType: null, sectionCode: '' }, + fromModel: { + sectionCode: '', + right: false + }, positionTypes: [ { name: '上方', type: '01' }, { name: '下方', type: '02' } @@ -332,6 +354,90 @@ export default { }); this.$emit('updateMapModel', models); this.$message.success('道岔区段设置成功!'); + }, + handleAllDelete() { + const section = this.$store.getters['map/getDeviceByCode'](this.fromModel.sectionCode); + const index = this.fromModel.right ? section.points.length - 1 : 0; + const pointX = section.points[index].x; + const map = this.$store.state.map.map; + const models = []; + console.log(this.$store.state.map.map); + map.sectionList.forEach(item => { + if (item.type == '04') { + const flag = this.fromModel.right ? item.namePosition.x >= pointX : item.namePosition.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + } else { + const flag = this.fromModel.right ? item.points[0].x >= pointX : item.points[0].x < pointX; + if (flag) { + if (item.type == '03') { + const switchModel = this.$store.getters['map/getDeviceByCode'](item.relSwitchCode); + models.push(deepAssign(switchModel, { _dispose: true })); + } + models.push(deepAssign(item, { _dispose: true })); + } + } + }); + map.lineList.forEach(item => { + const flag = this.fromModel.right ? item.points[0].x >= pointX : item.points[0].x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + map.trainWindowList.forEach(item => { + const flag = this.fromModel.right ? item.point.x > pointX : item.point.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + map.powerLineList.forEach(item => { + const flag = this.fromModel.right ? item.points[0].x >= pointX : item.points[0].x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + map.signalList.forEach(item => { + const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + map.stationList.forEach(item => { + const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + map.stationStandList.forEach(item => { + const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + const esp = map.espList.find(ele => ele.standCode == item.code); + models.push(deepAssign(esp, { _dispose: true })); + } + }); + map.psdList.forEach(item => { + const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + map.textList.forEach(item => { + const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + if (this.fromModel.right && section.rightSectionCode) { + section.rightSectionCode = ''; + } + if (!this.fromModel.right && section.leftSectionCode) { + section.leftSectionCode = ''; + } + models.push(deepAssign(section, { _type: 'Section' })); + this.$emit('updateMapModel', models); + console.log(models, '批量删除'); } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/section/index.vue b/src/views/newMap/newMapdraft/mapoperate/section/index.vue index f328fd171..78ae6f1c2 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/index.vue @@ -465,6 +465,9 @@ export default { } else if (this.field.toUpperCase() === 'sectionRoadCode'.toUpperCase()) { this.$refs.batchSettings.roadModel.sectionCode = selected.code; this.activeName = 'five'; + } else if (this.field.toUpperCase() === 'sectiondeleteCode'.toUpperCase()) { + this.$refs.batchSettings.fromModel.sectionCode = selected.code; + this.activeName = 'five'; } } }, diff --git a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue index 903aaa198..4ed37c12d 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue @@ -8,6 +8,7 @@ :rules="rules" type="Signal" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -424,6 +425,9 @@ export default { this.field = field == this.field ? '' : field; this.signalSectionCode(this.field); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceChange(code) { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); @@ -472,8 +476,8 @@ export default { } }, updateMapModel(data) { - this.$emit('updateMapModel', data); - this.field = ''; + this.$emit('updateMapModel', data); + this.field = ''; }, signalSectionCode(field) { this.field = field; diff --git a/src/views/newMap/newMapdraft/mapoperate/splitStation.vue b/src/views/newMap/newMapdraft/mapoperate/splitStation.vue index 44ad8380e..661fd2bc7 100644 --- a/src/views/newMap/newMapdraft/mapoperate/splitStation.vue +++ b/src/views/newMap/newMapdraft/mapoperate/splitStation.vue @@ -8,6 +8,7 @@ :rules="createRules" :type="editModel.type" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -142,6 +143,9 @@ export default { this.editModel.type = selected._type; } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, // 创建对象 create() { const uid = getUID(this.addModel.type, this.splitStationList); // 根据类型写 uid 前缀命名 @@ -162,8 +166,8 @@ export default { this.$refs.createForm.resetForm(); }, updateMapModel(data) { - this.$emit('updateMapModel', data); - this.field = ''; + this.$emit('updateMapModel', data); + this.field = ''; }, deleteObj() { this.$refs.dataform.deleteObj(); diff --git a/src/views/newMap/newMapdraft/mapoperate/station.vue b/src/views/newMap/newMapdraft/mapoperate/station.vue index ef3d2fc61..27b30f1e7 100644 --- a/src/views/newMap/newMapdraft/mapoperate/station.vue +++ b/src/views/newMap/newMapdraft/mapoperate/station.vue @@ -419,8 +419,9 @@ export default { const list = this.changeChargeStation(this.editModel.chargeStationCodeList); const centralizedList = this.changeCentralized(this.editModel.centralized); const models = [this.editModel, ...list, ...centralizedList]; - this.$emit('updateMapModel', models); - this.field = ''; + this.$emit('updateMapModel', models); + this.field = ''; + this.$emit('deviceSelect', ''); } }); }, diff --git a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue index c5cbd997f..9635891f3 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue @@ -8,6 +8,7 @@ :rules="rules" type="StationStand" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -289,6 +290,9 @@ export default { this.$emit('deviceSelect', ''); } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, changeStation(station) { this.editModel.deviceStationCode = this.getDeviceStationCode(station); }, @@ -416,12 +420,12 @@ export default { models.push(deepAssign(item, { _dispose: true })); } }); - this.$emit('updateMapModel', models); - this.field = ''; + this.$emit('updateMapModel', models); + this.field = ''; } else { // 用于更新 - this.$emit('updateMapModel', selected); - this.field = ''; + this.$emit('updateMapModel', selected); + this.field = ''; } }, deleteObj() { diff --git a/src/views/newMap/newMapdraft/mapoperate/switch/index.vue b/src/views/newMap/newMapdraft/mapoperate/switch/index.vue index b9c67254a..43b90820f 100644 --- a/src/views/newMap/newMapdraft/mapoperate/switch/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/switch/index.vue @@ -1,7 +1,7 @@ From f9d8bda8b0475908443315890a50da31a414aea4 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 11 Dec 2020 13:19:34 +0800 Subject: [PATCH 43/52] =?UTF-8?q?=E5=AE=81=E6=B3=A2=E4=B8=89=E5=8F=B7?= =?UTF-8?q?=E7=BA=BF=E5=BB=B6=E7=BB=AD=E4=BF=9D=E6=8A=A4=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=AE=AD=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Section/index.js | 5 +++-- src/views/newMap/newMapdraft/mapoperate/models.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index 8bb3e8274..c8e8735e5 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -207,12 +207,13 @@ export default class Section extends Group { } /** 保护区段锁闭 09*/ - protectiveLock() { + protectiveLock(lockRight) { if (this.line) { this.line.setStyle({ stroke: this.style.Section.line.protectiveLockColor, lineWidth: this.style.Section.line.width + this.style.Section.line.beyondWidth }); + this.line.setRouteLock(lockRight); } } @@ -259,7 +260,7 @@ export default class Section extends Group { } // 顺序代表优先级 /** 道岔保护区段锁闭 */ - model.overlapLock && this.protectiveLock(); + model.overlapLock && this.protectiveLock(model.lockRight); /** 空闲锁闭或者叫进路锁闭 */ model.routeLock && this.routeLock(model.lockRight); /** 轨道封锁 */ diff --git a/src/views/newMap/newMapdraft/mapoperate/models.js b/src/views/newMap/newMapdraft/mapoperate/models.js index 4349b849c..02906787f 100644 --- a/src/views/newMap/newMapdraft/mapoperate/models.js +++ b/src/views/newMap/newMapdraft/mapoperate/models.js @@ -135,7 +135,7 @@ class Model { this.position = { x: 0, y: 0 }; this.kilometerPosition = { x: 0, y: 0 }; // 公里标偏移坐标 this.createControlMode = false; - // this.createTurnBack = false; + this.createTurnBack = false; // this.turnBackPoint = {x: 0, y: 0}; // 按图折返坐标 this.controlModePoint = { x: 0, y: 0 }; // 控制模式坐标 } From 0d8f0f021a5d4d7590521b760c0e0ce002167329 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 11 Dec 2020 14:51:04 +0800 Subject: [PATCH 44/52] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/configLine/config.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/system/configLine/config.vue b/src/views/system/configLine/config.vue index 1c4f1d42a..8ede03fea 100644 --- a/src/views/system/configLine/config.vue +++ b/src/views/system/configLine/config.vue @@ -77,9 +77,9 @@ export default { height: 800, roadData: [], focus: false, - booleanList: ['upRight', 'lockFirst', 'switchSingleHandle', 'switchNRTurnChain', 'switchSingleLockChain', 'switchLossChain', 'signalForceCancelRoute', 'initSingleLockSwitch', 'ctcOverlapOnlyTurnBackStationLock', 'guideNeedRouteSettingFirst', 'signalOpenAfterParking', 'standHoldCloseLogicLight', 'atsAutoHandleManualFrontTurnBack'], + booleanList: ['upRight', 'lockFirst', 'switchSingleHandle', 'switchNRTurnChain', 'switchSingleLockChain', 'switchLossChain', 'signalForceCancelRoute', 'initSingleLockSwitch', 'ctcOverlapOnlyTurnBackStationLock', 'guideNeedRouteSettingFirst', 'signalOpenAfterParking', 'standHoldCloseLogicLight', 'atsAutoHandleManualFrontTurnBack', 'doNotSetRouteWhenSectionOccupied'], selectList: ['runMode'], - generalConfig: ['lockFirst', 'switchSingleHandle', 'upRight', 'switchNRTurnChain', 'switchSingleLockChain', 'switchLossChain', 'signalForceCancelRoute', 'runMode', 'initSingleLockSwitch', 'ctcOverlapOnlyTurnBackStationLock', 'noParkingSM', 'parkingSM', 'rmAtpSpeed', 'urmAtpSpeed', 'guideNeedRouteSettingFirst', 'signalOpenAfterParking', 'standHoldCloseLogicLight', 'atsAutoHandleManualFrontTurnBack'], + generalConfig: ['lockFirst', 'switchSingleHandle', 'upRight', 'switchNRTurnChain', 'switchSingleLockChain', 'switchLossChain', 'signalForceCancelRoute', 'runMode', 'initSingleLockSwitch', 'ctcOverlapOnlyTurnBackStationLock', 'noParkingSM', 'parkingSM', 'rmAtpSpeed', 'urmAtpSpeed', 'guideNeedRouteSettingFirst', 'signalOpenAfterParking', 'standHoldCloseLogicLight', 'atsAutoHandleManualFrontTurnBack', 'doNotSetRouteWhenSectionOccupied'], rangeList: ['noParkingSM', 'parkingSM'], speedList: ['rmAtpSpeed', 'urmAtpSpeed'], numberList: [], @@ -104,7 +104,8 @@ export default { guideNeedRouteSettingFirst: '引导办理是否需要先排列进路', signalOpenAfterParking: '是否列车停站开门后,才办理出站进路开放出站信号机', standHoldCloseLogicLight: '站台扣车是否关闭逻辑点灯的信号机', - atsAutoHandleManualFrontTurnBack:'ATS是否自动处理人工设置的站前折返自动更新车次' + atsAutoHandleManualFrontTurnBack:'ATS是否自动处理人工设置的站前折返自动更新车次', + doNotSetRouteWhenSectionOccupied: '当进路的区段占用时不排列进路' } }; }, From f8876c452ebcb843b6332791f4a0a0e30acfffae Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 11 Dec 2020 16:33:51 +0800 Subject: [PATCH 45/52] =?UTF-8?q?Text=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Text/index.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/jmapNew/shape/Text/index.js b/src/jmapNew/shape/Text/index.js index a77b17302..4379fd822 100644 --- a/src/jmapNew/shape/Text/index.js +++ b/src/jmapNew/shape/Text/index.js @@ -1,6 +1,7 @@ import Text from 'zrender/src/graphic/Text'; import Group from 'zrender/src/container/Group'; import {isShowThePrdType} from '../../utils/handlePath'; +import BoundingRect from 'zrender/src/core/BoundingRect'; import Vue from 'vue'; export default class Text2 extends Group { @@ -14,10 +15,10 @@ export default class Text2 extends Group { this.style = style; this.z = 6; this.isShowShape = true; - // if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) { - this.create(); - this.setState(model); - // } + if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) { + this.create(); + this.setState(model); + } if (model.previewOrMapDraw) { this.setShowMode(); } @@ -54,6 +55,8 @@ export default class Text2 extends Group { getBoundingRect() { if (this.text) { return this.text.getBoundingRect().clone(); + } else { + return new BoundingRect(this.model.position.x, this.model.position.y, 0, 0); } } // 设置显示模式 From 97241040f677ec43e7010e24002318b000f1b060 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 11 Dec 2020 16:38:13 +0800 Subject: [PATCH 46/52] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AE=81=E6=B3=A2?= =?UTF-8?q?=E4=B8=89=E5=8F=B7=E7=BA=BF=E7=AB=99=E5=8F=B0=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/StationStand/safeStand/ESolidStand.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/jmapNew/shape/StationStand/safeStand/ESolidStand.js b/src/jmapNew/shape/StationStand/safeStand/ESolidStand.js index 60b2fc005..a01e571cd 100644 --- a/src/jmapNew/shape/StationStand/safeStand/ESolidStand.js +++ b/src/jmapNew/shape/StationStand/safeStand/ESolidStand.js @@ -69,6 +69,7 @@ class ESolidStand extends Group { recover() { const style = this.model.style; this.setColor(style.StationStand.solidStand.spareColor); + this.setStroke(style.StationStand.solidStand.spareStrokeColor); } setState(model) { From caeea6d9d6779fb8cb96a52f5056bd09bc41fefe Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Fri, 11 Dec 2020 18:02:56 +0800 Subject: [PATCH 47/52] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=BC=E5=90=88?= =?UTF-8?q?=E6=BC=94=E7=BB=83=E4=B8=89=E7=BB=B4=E9=A9=BE=E9=A9=B6=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=9C=AAdestory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/jlmap3d/drive/jl3ddrive.vue | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/views/jlmap3d/drive/jl3ddrive.vue b/src/views/jlmap3d/drive/jl3ddrive.vue index 78b31e6bf..cfe78fde7 100644 --- a/src/views/jlmap3d/drive/jl3ddrive.vue +++ b/src/views/jlmap3d/drive/jl3ddrive.vue @@ -167,6 +167,9 @@ export default { // this.$destroy(); } }, + destroyed(){ + window.removeEventListener('popstate', this.goBack, false); + }, computed: { userId() { return this.$store.state.user ? this.$store.state.user.id : ''; @@ -180,9 +183,27 @@ export default { if(this.$route.query.type == "DRIVE"){ this.backmsg = "退出"; } + + if (window.history && window.history.pushState) { + history.pushState(null, null, document.URL); + window.addEventListener('popstate', this.goBack, false); + } // this.$refs.mmiui.init(); }, methods: { + goBack(){ + if(this.$route.query.type == "DRIVE"){ + store.dispatch('LogOut').then(() => { + location.reload(); + }); + }else{ + this.$emit('showdriving'); + this.jlmap3d.eventoff(); + this.jlmap3d.animateoff(); + // this.jlmap3d = null; + } + // this.jlmap3d = null; + }, show: function (skinCode,group,zindex) { // console.log("show"); // console.log(skinCode); From dcc1bb4506986078b1bf1903c82f510d0b0aea6c Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Fri, 11 Dec 2020 18:11:20 +0800 Subject: [PATCH 48/52] =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=BC=94=E7=BB=83?= =?UTF-8?q?=E4=B8=89=E7=BB=B4=E9=A9=BE=E9=A9=B6=E8=BF=94=E5=9B=9Ebug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/jlmap3d/drive/jl3ddrive.vue | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/views/jlmap3d/drive/jl3ddrive.vue b/src/views/jlmap3d/drive/jl3ddrive.vue index cfe78fde7..04a9087a0 100644 --- a/src/views/jlmap3d/drive/jl3ddrive.vue +++ b/src/views/jlmap3d/drive/jl3ddrive.vue @@ -163,12 +163,12 @@ export default { this.jlmap3d.endsocket(); this.jlmap3d.dispose(); this.jlmap3d = null; - + // window.removeEventListener('popstate', this.goBack, false); // this.$destroy(); } }, destroyed(){ - window.removeEventListener('popstate', this.goBack, false); + }, computed: { userId() { @@ -184,26 +184,26 @@ export default { this.backmsg = "退出"; } - if (window.history && window.history.pushState) { - history.pushState(null, null, document.URL); - window.addEventListener('popstate', this.goBack, false); - } + // if (window.history && window.history.pushState) { + // history.pushState(null, null, document.URL); + // window.addEventListener('popstate', this.goBack, false); + // } // this.$refs.mmiui.init(); }, methods: { - goBack(){ - if(this.$route.query.type == "DRIVE"){ - store.dispatch('LogOut').then(() => { - location.reload(); - }); - }else{ - this.$emit('showdriving'); - this.jlmap3d.eventoff(); - this.jlmap3d.animateoff(); - // this.jlmap3d = null; - } - // this.jlmap3d = null; - }, + // goBack(){ + // if(this.$route.query.type == "DRIVE"){ + // store.dispatch('LogOut').then(() => { + // location.reload(); + // }); + // }else{ + // this.$emit('showdriving'); + // this.jlmap3d.eventoff(); + // this.jlmap3d.animateoff(); + // // this.jlmap3d = null; + // } + // // this.jlmap3d = null; + // }, show: function (skinCode,group,zindex) { // console.log("show"); // console.log(skinCode); From a80b6c7fb03f5a30a9ce2464fb7e81a2dffdba20 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 11 Dec 2020 19:28:38 +0800 Subject: [PATCH 49/52] =?UTF-8?q?=E4=B8=80=E9=94=AE=E9=A2=86=E5=8F=96?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/management/author.js | 7 ++++ .../xian_02/menus/dialog/trainDestination.vue | 2 +- src/views/publish/publishMap/index.vue | 40 +++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/api/management/author.js b/src/api/management/author.js index e580cf508..134c41d98 100644 --- a/src/api/management/author.js +++ b/src/api/management/author.js @@ -79,3 +79,10 @@ export function gotPermissionUserList(params) { params: params }); } +/** 一键领取地图权限 */ +export function getPermissionQuickly(mapId, count) { + return request({ + url: `/api/userPermission/${mapId}/getPermissions?count=${count}`, + method: 'post' + }); +} diff --git a/src/jmapNew/theme/xian_02/menus/dialog/trainDestination.vue b/src/jmapNew/theme/xian_02/menus/dialog/trainDestination.vue index fcb775617..1a76d4836 100644 --- a/src/jmapNew/theme/xian_02/menus/dialog/trainDestination.vue +++ b/src/jmapNew/theme/xian_02/menus/dialog/trainDestination.vue @@ -154,7 +154,7 @@ export default { async getParamList() { const res = await getSimulationDestinationList(this.$route.query.group); res.data.forEach(item => { - const lable = this.typeList.find(ele => ele.value == item.type); + const lable = this.typeList.find(ele => ele.value == item.type) || {}; item['active'] = false; let code = `0000${item.code}`; code = code.substring(code.length - 4); diff --git a/src/views/publish/publishMap/index.vue b/src/views/publish/publishMap/index.vue index 24353af60..ff8133a0b 100644 --- a/src/views/publish/publishMap/index.vue +++ b/src/views/publish/publishMap/index.vue @@ -8,6 +8,20 @@ + +
{{ '地 图:' + mapName }}
+ 权限个数 + + + 取 消 + 确 定 + +
@@ -23,6 +37,7 @@ import ExportMap from './exportMap'; import MapSort from './mapSort'; import { superAdmin } from '@/router/index_APP_TARGET'; import { ProjectList } from '@/scripts/ProjectConfig'; +import { getPermissionQuickly } from '@/api/management/author'; export default { name: 'PublishMap', @@ -36,7 +51,11 @@ export default { }, data() { return { + dialogVisible: false, cityList: [], + mapName: '', + mapId: '', + permissionNum: 10, lineCodeList: [], pagerConfig: { pageSize: 'pageSize', @@ -159,6 +178,11 @@ export default { handleClick: this.handleDelete, type: 'danger', showControl: () => { return this.isShow != -1; } + }, + { + name: '领取权限', + handleClick: this.handlePermission, + type: 'default' } ] } @@ -410,6 +434,22 @@ export default { this.$messageBox('生成子系统及权限失败!'); }); }).catch(() => { }); + }, + handleClose() { + this.dialogVisible = false; + }, + handlePermission(index, row) { + this.mapName = row.name; + this.mapId = row.id; + this.dialogVisible = true; + }, + permissionCommit() { + getPermissionQuickly(this.mapId, this.permissionNum).then(resp => { + this.dialogVisible = false; + this.$message.success('成功获取权限'); + }).catch(() => { + this.$message.error('获取权限失败!'); + }); } } }; From 70e260cc4f11c3e756a6553176697bdabf398fe9 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 11 Dec 2020 19:49:48 +0800 Subject: [PATCH 50/52] =?UTF-8?q?=E5=93=88=E5=B0=94=E6=BB=A8=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E9=97=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/jl3ddevice/jl3ddeviceNew.js | 1570 +++++++++---------- src/views/newMap/jointTrainingNew/index.vue | 4 +- 2 files changed, 783 insertions(+), 791 deletions(-) diff --git a/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js b/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js index 00a38b578..6a109f3ef 100644 --- a/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js +++ b/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js @@ -1,7 +1,7 @@ import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; -//loader +// loader import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader'; import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls'; @@ -11,847 +11,839 @@ import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js'; import { Moveanimate } from '@/jlmap3d/jl3ddevice/component/moveanimate.js'; import { Textconfig } from '@/jlmap3d/jl3ddevice/component/textconfig.js'; -import { getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; - +import { getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; import StompClient from '@/utils/sock'; import store from '@/store/index_APP_TARGET'; var clock = new THREE.Clock(); -export function Jl3ddeviceNew(dom,group,token,skinCode) { +export function Jl3ddeviceNew(dom, group, token, skinCode) { - window.speechSynthesis.getVoices() - let voices = speechSynthesis.getVoices(); + window.speechSynthesis.getVoices(); + const voices = speechSynthesis.getVoices(); - var scope = this; - let helpbox,textplane; - let daochamodel; - let psdtexturemap = []; - let psdVoiceStationList = []; + var scope = this; + let helpbox, textplane; + let daochamodel; + const psdtexturemap = []; + const psdVoiceStationList = []; - this.dom = dom; - this.nowcode = null; - this.animateswitch = false; - this.signallights = []; - Signallightload(this.signallights); - this.mixers = []; - this.showmodel = null; + this.dom = dom; + this.nowcode = null; + this.animateswitch = false; + this.signallights = []; + Signallightload(this.signallights); + this.mixers = []; + this.showmodel = null; + // 点击事件状态 + this.raycasterstatus = false; + // 动画状态 + this.animastats = false; + // 当前选中模型 + this.nowobject = null; + // 当前动画播放模型 + this.animationmodel = null; - //点击事件状态 - this.raycasterstatus = false; - //动画状态 - this.animastats = false; - //当前选中模型 - this.nowobject = null; - //当前动画播放模型 - this.animationmodel = null; + this.stationtexture = []; + this.devicetext = new Textconfig(); - this.stationtexture = []; - this.devicetext = new Textconfig(); + this.windowstatus = '0'; - this.windowstatus = '0'; + // 初始化webgl渲染 + this.renderer = new THREE.WebGLRenderer({ antialias: true }); - //初始化webgl渲染 - this.renderer = new THREE.WebGLRenderer({ antialias: true }); + this.renderer.setClearColor(new THREE.Color(0x000000)); + this.renderer.setSize(dom.offsetWidth, dom.offsetHeight); + this.renderer.shadowMap.enabled = true; + this.renderer.shadowMap.type = THREE.PCFSoftShadowMap; + this.dom.appendChild(this.renderer.domElement); - this.renderer.setClearColor(new THREE.Color(0x000000)); - this.renderer.setSize(dom.offsetWidth, dom.offsetHeight); - this.renderer.shadowMap.enabled = true; - this.renderer.shadowMap.type = THREE.PCFSoftShadowMap; - this.dom.appendChild(this.renderer.domElement); + // 定义相机 + this.camera = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 200); + this.camera.position.set(0, 20, 30); + this.camera.aspect = dom.offsetWidth / dom.offsetHeight; + this.camera.updateProjectionMatrix(); + // 定义场景(渲染容器) + this.scene = new THREE.Scene(); + this.scene.background = new THREE.Color(0xa0a0a0); - //定义相机 - this.camera = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 200); - this.camera.position.set(0, 20, 30); - this.camera.aspect = dom.offsetWidth / dom.offsetHeight; - this.camera.updateProjectionMatrix(); - //定义场景(渲染容器) - this.scene = new THREE.Scene(); - this.scene.background = new THREE.Color(0xa0a0a0); + var mesh = new THREE.Mesh(new THREE.PlaneBufferGeometry(200, 200), new THREE.MeshPhongMaterial({ color: 0x999999, depthWrite: false })); + mesh.rotation.x = -Math.PI / 2; + mesh.receiveShadow = true; + this.scene.add(mesh); - var mesh = new THREE.Mesh(new THREE.PlaneBufferGeometry(200, 200), new THREE.MeshPhongMaterial({ color: 0x999999, depthWrite: false })); - mesh.rotation.x = - Math.PI / 2; - mesh.receiveShadow = true; - this.scene.add(mesh); + var grid = new THREE.GridHelper(200, 20, 0x000000, 0x000000); + grid.material.opacity = 0.2; + grid.material.transparent = true; + this.scene.add(grid); - var grid = new THREE.GridHelper(200, 20, 0x000000, 0x000000); - grid.material.opacity = 0.2; - grid.material.transparent = true; - this.scene.add(grid); + const moveanima = new Moveanimate(scope); - let moveanima = new Moveanimate(scope); + // 定义全局光 + const ambientLight = new THREE.AmbientLight(0xffffff, 1.3); + this.scene.add(ambientLight); - //定义全局光 - let ambientLight = new THREE.AmbientLight(0xffffff, 1.3); - this.scene.add(ambientLight); + // 区域聚光灯 + var spotLight = new THREE.SpotLight(0xececff); + spotLight.position.set(-50, 80, 0); + spotLight.castShadow = true; + spotLight.shadow.mapSize.width = 2048; + spotLight.shadow.mapSize.height = 2048; + this.scene.add(spotLight); - //区域聚光灯 - var spotLight = new THREE.SpotLight(0xececff); - spotLight.position.set(-50, 80, 0); - spotLight.castShadow = true; - spotLight.shadow.mapSize.width = 2048; - spotLight.shadow.mapSize.height = 2048; - this.scene.add(spotLight); + // 定义轨道视角控制器 + this.controls = new THREE.OrbitControls(this.camera, dom); + this.controls.maxPolarAngle = Math.PI / 2; + this.controls.minPolarangle = Math.PI / 5; + this.controls.maxDistance = 80; + this.controls.screenSpacePanning = true; + this.controls.update(); - //定义轨道视角控制器 - this.controls = new THREE.OrbitControls(this.camera, dom); - this.controls.maxPolarAngle = Math.PI / 2; - this.controls.minPolarangle = Math.PI / 5; - this.controls.maxDistance = 80; - this.controls.screenSpacePanning = true; - this.controls.update(); + // 设备名称和设备code + const lableCodeMap = []; + getPublishMapDetail(skinCode).then(data => { + const mapnetdata = data.data; + for (let i = 0, leni = mapnetdata.switchList.length; i < leni; i++) { + lableCodeMap[mapnetdata.switchList[i].name] = mapnetdata.switchList[i].code; + } + for (let i = 0, leni = mapnetdata.psdList.length; i < leni; i++) { + lableCodeMap[mapnetdata.psdList[i].standCode] = mapnetdata.psdList[i].code; + } + for (let i = 0, leni = mapnetdata.signalList.length; i < leni; i++) { + lableCodeMap[mapnetdata.signalList[i].name] = mapnetdata.signalList[i].code; + } + for (let i = 0, leni = mapnetdata.sectionList.length; i < leni; i++) { + lableCodeMap[mapnetdata.sectionList[i].name] = mapnetdata.sectionList[i].code; + } - //设备名称和设备code - let lableCodeMap = []; - getPublishMapDetail(skinCode).then(data => { - let mapnetdata = data.data; - for(let i=0,leni=mapnetdata.switchList.length;i { - location.reload(); - }); - } - } - let changeelement = document.getElementById('jl3d'); - window.addEventListener('resize', () => - onresize() - , false) - let onresize = function () { - - scope.camera.aspect = changeelement.offsetWidth / changeelement.offsetHeight; - scope.camera.updateProjectionMatrix(); - scope.renderer.setSize(changeelement.offsetWidth, changeelement.offsetHeight); - - } - - this.domresize = function(){ - scope.camera.aspect = scope.dom.offsetWidth / scope.dom.offsetHeight; - scope.camera.updateProjectionMatrix(); - scope.renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight); - } - - this.anime = null; - - this.modelmanager = new ModelManager(); - - getPublish3dMapDetail(skinCode).then(netdata => { - - let netDataAssets = JSON.parse(netdata.data.assets); - if(netDataAssets.stationTextureList[0].urls.length > 1){ - setpsdstationmap(JSON.parse(netdata.data.stands)); - Standtextureload(scope,netDataAssets.stationTextureList[0]); - } - scope.modelmanager.loadpromise(netDataAssets.deviceAssetList, scope.mixers).then(function (data) { - //综合演练情况下当模型加载后显示 - psdModelShow(); - moveanima.initlistnew(scope.modelmanager.switchmodel.mesh); - daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA"); - if(scope.stationtexture["devicelist"]){ - scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["devicelist"]; - scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true; - } - if(scope.stationtexture["pingbimen"]){ - scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map =scope.stationtexture["pingbimen"]; - scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map.needsUpdate = true; - } - - }) - let checkobject = setInterval(function(){ - if(scope.modelmanager.switchmodel.mesh){ - clearInterval(checkobject); - animate(); - } - - - },1000); - - }); - - //初始化屏蔽门贴图 - function setpsdstationmap(stationlist){ - for(let i=0,leni=stationlist.length;i { + location.reload(); + }); + } + } + const changeelement = document.getElementById('jl3d'); + window.addEventListener('resize', () => + onresize() + , false); + const onresize = function () { + + scope.camera.aspect = changeelement.offsetWidth / changeelement.offsetHeight; + scope.camera.updateProjectionMatrix(); + scope.renderer.setSize(changeelement.offsetWidth, changeelement.offsetHeight); + + }; + + this.domresize = function() { + scope.camera.aspect = scope.dom.offsetWidth / scope.dom.offsetHeight; + scope.camera.updateProjectionMatrix(); + scope.renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight); + }; + + this.anime = null; + + this.modelmanager = new ModelManager(); + + getPublish3dMapDetail(skinCode).then(netdata => { + + const netDataAssets = JSON.parse(netdata.data.assets); + if (netDataAssets.stationTextureList[0].urls.length > 1) { + setpsdstationmap(JSON.parse(netdata.data.stands)); + Standtextureload(scope, netDataAssets.stationTextureList[0]); + } + scope.modelmanager.loadpromise(netDataAssets.deviceAssetList, scope.mixers).then(function (data) { + // 综合演练情况下当模型加载后显示 + psdModelShow(); + moveanima.initlistnew(scope.modelmanager.switchmodel.mesh); + daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName('DAOCHA'); + if (scope.stationtexture['devicelist']) { + scope.modelmanager.standmodel.mesh.getObjectByName('zhantailiebiao').material.map = scope.stationtexture['devicelist']; + scope.modelmanager.standmodel.mesh.getObjectByName('zhantailiebiao').material.map.needsUpdate = true; + } + if (scope.stationtexture['pingbimen']) { + scope.modelmanager.standmodel.mesh.getObjectByName('pingbimen1').material.map = scope.stationtexture['pingbimen']; + scope.modelmanager.standmodel.mesh.getObjectByName('pingbimen1').material.map.needsUpdate = true; + } + + }); + const checkobject = setInterval(function() { + if (scope.modelmanager.switchmodel.mesh) { + clearInterval(checkobject); + animate(); + } + + }, 1000); + + }); + + // 初始化屏蔽门贴图 + function setpsdstationmap(stationlist) { + for (let i = 0, leni = stationlist.length; i < leni; i++) { + psdtexturemap[stationlist[i].direction1.code] = stationlist[i].code; + psdtexturemap[stationlist[i].direction2.code] = stationlist[i].code; + psdtexturemap[stationlist[i].direction1.name] = stationlist[i].code; + psdtexturemap[stationlist[i].direction2.name] = stationlist[i].code; + } + } + + // 循环渲染函数 + function animate() { + + scope.anime = requestAnimationFrame(animate); + scope.renderer.render(scope.scene, scope.camera); + scope.controls.update(); + // scope.camera.lookAt(plane); + moveanima.animateupdate(); + const delta = clock.getDelta(); + if (scope.mixers) { + for (let i = 0; i < scope.mixers.length; i++) { + if (scope.mixers[i]) { + scope.mixers[i].update(delta); + } + } + } + } + // 隐藏道岔 + this.hideswitch = function (nowswitchstatus) { + if (nowswitchstatus) { + scope.modelmanager.switchmodel.mesh.add(daochamodel); + } else { + scope.modelmanager.switchmodel.mesh.remove(daochamodel); + } + }; + // 选择模型 + this.selectmodel = function (data) { + // scope.modelmanager + if (scope.showmodel) { + + if (scope.showmodel.code != data.code) { + scope.scene.remove(scope.showmodel); + scope.showmodel = null; + scope.nowcode = data.code; + if (scope.nowobject) { + scope.resetmodel(); + } + if (data._type == 'Switch') { + // scope.modelmanager.switchmodel.locateType = data.body.locateType; + scope.modelmanager.switchmodel.code = data.code; + scope.showmodel = scope.modelmanager.switchmodel.mesh; + scope.scene.add(scope.showmodel); + scope.devicetext.initdevicetext(scope.modelmanager.switchmodel.mesh); + scope.nowobject = scope.modelmanager.switchmodel.mesh; + updatemenulist(scope.devicetext.devicelist); + scope.raycasterstatus = true; + } else { + + scope.raycasterstatus = false; + scope.nowobject = null; + updatemenulist(); + } + if (data._type == 'Signal') { + scope.modelmanager.signalmodel.code = data.code; + scope.showmodel = scope.modelmanager.signalmodel.mesh; + scope.scene.add(scope.showmodel); + } + + if (data._type == 'Psd') { + scope.modelmanager.standmodel.code = data.code; + scope.showmodel = scope.modelmanager.standmodel.mesh; + scope.scene.add(scope.showmodel); + if (scope.stationtexture[psdtexturemap[data.standCode]]) { + scope.modelmanager.standmodel.mesh.getObjectByName('zhantaiming').material.map = scope.stationtexture[psdtexturemap[data.standCode]]; + scope.modelmanager.standmodel.mesh.getObjectByName('zhantaiming').material.map.needsUpdate = true; + } + } + + if (data._type == 'Section') { + scope.showmodel = scope.modelmanager.sectionmodel.mesh; + scope.scene.add(scope.showmodel); + } + + if (scope.showmodel) { + scope.resetmodel(); + scope.showmodel.code = data.code; + initstatus(data); + } + + } + } else { + scope.nowcode = data.code; + if (data._type == 'Switch') { + scope.modelmanager.switchmodel.normalPosition = '0'; + scope.showmodel = scope.modelmanager.switchmodel.mesh; + scope.scene.add(scope.showmodel); + + scope.devicetext.initdevicetext(scope.modelmanager.switchmodel.mesh); + scope.nowobject = scope.modelmanager.switchmodel.mesh; + updatemenulist(scope.devicetext.devicelist); + scope.raycasterstatus = true; + // scope.scene.add(scope.showmodel); + if (data.normalPosition == '0') { + scope.modelmanager.switchmodel.normalPosition = '0'; + if (scope.modelmanager.switchmodel.action) { + scope.modelmanager.switchmodel.action.reset(); + scope.modelmanager.switchmodel.action.time = 0; + scope.modelmanager.switchmodel.action.timeScale = -1; + scope.modelmanager.switchmodel.action.play(); + } + } else if (data.normalPosition == '1') { + scope.modelmanager.switchmodel.normalPosition = '1'; + if (scope.modelmanager.switchmodel.action) { + scope.modelmanager.switchmodel.action.reset(); + scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration; + scope.modelmanager.switchmodel.action.timeScale = 1; + scope.modelmanager.switchmodel.action.play(); + } + } + + } + if (data._type == 'Signal') { + scope.showmodel = scope.modelmanager.signalmodel.mesh; + scope.scene.add(scope.showmodel); + } + + if (data._type == 'Psd') { + scope.showmodel = scope.modelmanager.standmodel.mesh; + scope.scene.add(scope.showmodel); + if (data.standCode == undefined) { + if (psdtexturemap[data.code]) { + scope.modelmanager.standmodel.mesh.getObjectByName('zhantaiming').material.map = scope.stationtexture[psdtexturemap[data.code]]; + scope.modelmanager.standmodel.mesh.getObjectByName('zhantaiming').material.map.needsUpdate = true; + } else { + scope.modelmanager.standmodel.mesh.getObjectByName('zhantaiming').material.map = scope.stationtexture['Station18398']; + scope.modelmanager.standmodel.mesh.getObjectByName('zhantaiming').material.map.needsUpdate = true; + } + + } + if (scope.stationtexture[psdtexturemap[data.standCode]]) { + scope.modelmanager.standmodel.mesh.getObjectByName('zhantaiming').material.map = scope.stationtexture[psdtexturemap[data.standCode]]; + scope.modelmanager.standmodel.mesh.getObjectByName('zhantaiming').material.map.needsUpdate = true; + } + + } + + if (data._type == 'Section') { + scope.showmodel = scope.modelmanager.sectionmodel.mesh; + scope.scene.add(scope.showmodel); + } + initstatus(data); + } + + }; + + // 设备分解、归位动画按钮 + this.disperdevice1 = function() { + if (scope.nowobject) { + if (moveanima.status == true) { + if (scope.animastats == false) { + scope.animastats = true; + moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode + 'on'], true); + } else if (scope.animastats == true) { + scope.animastats = false; + moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode + 'off'], true); + } + } + } + + }; + + this.disperdevice2 = function() { + if (scope.nowobject) { + if (moveanima.status == true) { + if (scope.animastats == false) { + scope.animastats = true; + moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode + 'chaijie'], true); + } else if (scope.animastats == true) { + scope.animastats = false; + moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode + 'fuwei'], true); + } + } + } + + }; + + this.resetmodel = function() { + if (scope.nowobject) { + scope.animastats = false; + moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode + 'fuwei'], true); + } + + }; + + this.animationmsgshowon = function(nowobject) { + scope.animationmodel = nowobject; + if (helpbox) { + scope.animationmodel.helpbox = null; + scope.scene.remove( helpbox ); + helpbox = undefined; + } + + settext(scope.animationmodel, scope.animationmodel.position); + helpbox = new THREE.BoxHelper( scope.animationmodel, 0xff0000 ); + moveanima.updatehelpbox(helpbox, textplane); + // settext(intersects[0].object,intersects[0].point); + // getdevicemsg(intersects[0].object.name); + scope.scene.add( helpbox ); + getdevicemsg(nowobject.name); + }; + + this.animationmsgshowoff = function(nowobject) { + if (helpbox) { + scope.animationmodel.helpbox = null; + scope.scene.remove( helpbox ); + helpbox = undefined; + } + if (textplane) { + scope.scene.remove(textplane); + textplane.geometry.dispose(); + textplane.material.dispose(); + } + scope.animationmodel = null; + }; + // 根据数据切换设备样式 + this.updateaction = function (data) { + if (data.type == 'SWITCH') { + if (data.normal == '0') { + scope.modelmanager.switchmodel.normalPosition = '0'; + scope.modelmanager.switchmodel.action.reset(); + scope.modelmanager.switchmodel.action.time = 0; + scope.modelmanager.switchmodel.action.timeScale = 1; + scope.modelmanager.switchmodel.action.play(); + } else if (data.normal == '1') { + scope.modelmanager.switchmodel.normalPosition = '1'; + scope.modelmanager.switchmodel.action.reset(); + scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration; + scope.modelmanager.switchmodel.action.timeScale = -1; + scope.modelmanager.switchmodel.action.play(); + } + + } + if (data.type == 'SIGNAL') { // 从上往下红绿黄 + if (data.red == 1) { + scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights['red']; + scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; + } else { + scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights['black']; + scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; + } + if (data.yellow == 1) { + scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights['yellow']; + scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; + } else { + scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights['black']; + scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; + } + if (data.green == 1) { + scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights['green']; + scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; + } else { + scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights['black']; + scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; + } + } + + if (data.type == 'PSD' || data.type == 'STAND') { + if (data.code == scope.nowcode) { + if (data.open == '1' ) { + scope.modelmanager.standmodel.screenDoorOpenStatus = '0'; + + scope.modelmanager.standmodel.action.reset(); + scope.modelmanager.standmodel.action.time = 0; + scope.modelmanager.standmodel.action.timeScale = 1; + scope.modelmanager.standmodel.action.play(); + console.log(data); + localVoicePlay('开往' + psdVoiceStationList[data.code].finlStationName + '方向的列车进站了!'); + } + + if (data.open == '0' ) { + scope.modelmanager.standmodel.screenDoorOpenStatus = '1'; + + scope.modelmanager.standmodel.action.reset(); + scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration; + scope.modelmanager.standmodel.action.timeScale = -1; + scope.modelmanager.standmodel.action.play(); + } + } + + } + // scope.showmodel. + }; + + this.deviceFaultSet = function (data) { + + if (data.type == 'SIGNAL') { // 从上往下红绿黄 + scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights['black']; + scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights['black']; + scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights['black']; + scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; + } + if (data.type == 'PSD' || data.type == 'STAND') { + scope.modelmanager.standmodel.screenDoorOpenStatus = '0'; + scope.modelmanager.standmodel.action.reset(); + scope.modelmanager.standmodel.action.time = 0; + scope.modelmanager.standmodel.action.timeScale = 1; + scope.modelmanager.standmodel.action.play(); + } + + }; + + this.deviceFaultOver = function (data) { + // if (data.type == "SIGNAL") {//从上往下红绿黄 + // scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["red"]; + // scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; + // scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["yellow"]; + // scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; + // scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["green"]; + // scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; + // } + if (data.type == 'PSD' || data.type == 'STAND') { + scope.modelmanager.standmodel.screenDoorOpenStatus = '1'; + scope.modelmanager.standmodel.action.reset(); + scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration; + scope.modelmanager.standmodel.action.timeScale = -1; + scope.modelmanager.standmodel.action.play(); + } + }; + + this.deviceReset = function () { + scope.modelmanager.standmodel.screenDoorOpenStatus = '1'; + scope.modelmanager.standmodel.action.reset(); + scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration; + scope.modelmanager.standmodel.action.timeScale = -1; + scope.modelmanager.standmodel.action.play(); + }; + + this.updateselect = function(updata) { + if (helpbox) { + scope.scene.remove( helpbox ); + helpbox = null; + } + helpbox = new THREE.BoxHelper( updata.mesh, 0xff0000 ); + const point = { + x:updata.mesh.matrixWorld.elements[12], + y:updata.mesh.matrixWorld.elements[13], + z:updata.mesh.matrixWorld.elements[14] + }; + settext(updata.mesh, point); + getdevicemsg(updata.mesh.name); + scope.scene.add( helpbox ); + }; + + function getdevicemsg(selectname) { + for (let i = 0, leni = scope.devicetext.devicelist.length; i < leni; i++) { + + if (selectname == scope.devicetext.devicelist[i].name) { + updatemsg(scope.devicetext.devicelist[i].text, scope.devicetext.devicelist[i].msg); + i = leni; + } + } + } + + function initstatus(data) { + if (data._type == 'Switch') { + if (data.normalPosition == '0') { + scope.modelmanager.switchmodel.normalPosition = '0'; + if (scope.modelmanager.switchmodel.action) { + scope.modelmanager.switchmodel.action.reset(); + scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration; + scope.modelmanager.switchmodel.action.timeScale = 1; + scope.modelmanager.switchmodel.action.play(); + } + } else if (data.normalPosition == '1') { + scope.modelmanager.switchmodel.normalPosition = '1'; + if (scope.modelmanager.switchmodel.action) { + scope.modelmanager.switchmodel.action.reset(); + scope.modelmanager.switchmodel.action.time = 0; + scope.modelmanager.switchmodel.action.timeScale = -1; + scope.modelmanager.switchmodel.action.play(); + } + } + } + + if (data._type == 'Signal') { + if (data.logicLight == 0) { + if (data.redOpen == 1) { + scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights['red']; + scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; + } else { + scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights['black']; + scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; + } + if (data.yellowOpen == 1) { + scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights['yellow']; + scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; + } else { + scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights['black']; + scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; + } + if (data.greenOpen == 1) { + scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights['green']; + scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; + } else { + scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights['black']; + scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; + } + } else { + scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights['black']; + scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights['black']; + scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights['black']; + scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; + } + } + + if (data._type == 'Psd') { + if (data.screenDoorOpenStatus == '0') { + scope.modelmanager.standmodel.screenDoorOpenStatus = '0'; + scope.modelmanager.standmodel.action.reset(); + scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration; + scope.modelmanager.standmodel.action.timeScale = 1; + scope.modelmanager.standmodel.action.play(); + } + + if (data.screenDoorOpenStatus == '1') { + scope.modelmanager.standmodel.screenDoorOpenStatus = '1'; + scope.modelmanager.standmodel.action.reset(); + scope.modelmanager.standmodel.action.time = 0; + scope.modelmanager.standmodel.action.timeScale = -1; + scope.modelmanager.standmodel.action.play(); + } + scope.camera.position.x = 0; + scope.camera.position.y = 8.3; + scope.camera.position.z = 12; + scope.controls.target = new THREE.Vector3(0, 8.3, 0); scope.controls.update(); - }else{ - scope.camera.position.x = 0; - scope.camera.position.y = 20; - scope.camera.position.z = 30; - scope.controls.target = new THREE.Vector3(0,10,0); + } else { + scope.camera.position.x = 0; + scope.camera.position.y = 20; + scope.camera.position.z = 30; + scope.controls.target = new THREE.Vector3(0, 10, 0); scope.controls.update(); - } + } - } + } - this.updatewindowstatus = function(nowwindowstatus){ - scope.windowstatus == nowwindowstatus; - } + this.updatewindowstatus = function(nowwindowstatus) { + scope.windowstatus == nowwindowstatus; + }; - // - function onselect(event){ - if(event.button == '0'){ + // + function onselect(event) { + if (event.button == '0') { - if(scope.raycasterstatus){ + if (scope.raycasterstatus) { - //定义光线 - let raycaster = new THREE.Raycaster(); - //定义平面鼠标点击坐标 - let mouse = new THREE.Vector2(); - let getBoundingClientRect = scope.dom.getBoundingClientRect() - if(scope.windowstatus == '0'){ - mouse.x = ( (event.clientX - getBoundingClientRect .left) /scope.dom.offsetWidth) * 2-1; - mouse.y = -( (event.clientY - getBoundingClientRect .top) / scope.dom.offsetHeight) * 2 + 1; - }else{ - mouse.x = (event.clientX / scope.dom.offsetWidth) * 2 - 1; - mouse.y = -(event.clientY / scope.dom.offsetHeight) * 2 + 1; - } + // 定义光线 + const raycaster = new THREE.Raycaster(); + // 定义平面鼠标点击坐标 + const mouse = new THREE.Vector2(); + const getBoundingClientRect = scope.dom.getBoundingClientRect(); + if (scope.windowstatus == '0') { + mouse.x = ( (event.clientX - getBoundingClientRect.left) / scope.dom.offsetWidth) * 2 - 1; + mouse.y = -( (event.clientY - getBoundingClientRect.top) / scope.dom.offsetHeight) * 2 + 1; + } else { + mouse.x = (event.clientX / scope.dom.offsetWidth) * 2 - 1; + mouse.y = -(event.clientY / scope.dom.offsetHeight) * 2 + 1; + } - raycaster.setFromCamera( mouse, scope.camera ); + raycaster.setFromCamera( mouse, scope.camera ); - let intersects = raycaster.intersectObjects( scope.modelmanager.switchmodel.mesh.children,true); - if(helpbox){ - scope.scene.remove( helpbox ); - helpbox = null; - } - if(textplane){ - scope.scene.remove(textplane); - textplane.geometry.dispose(); - textplane.material.dispose(); - } - if(intersects[0]){ - if(intersects[0].object.raycastoff){ - helpbox = new THREE.BoxHelper( intersects[0].object.parent, 0xff0000 ); - settext(intersects[0].object.parent,intersects[0].point); - getdevicemsg(intersects[0].object.parent.name); + const intersects = raycaster.intersectObjects( scope.modelmanager.switchmodel.mesh.children, true); + if (helpbox) { + scope.scene.remove( helpbox ); + helpbox = null; + } + if (textplane) { + scope.scene.remove(textplane); + textplane.geometry.dispose(); + textplane.material.dispose(); + } + if (intersects[0]) { + if (intersects[0].object.raycastoff) { + helpbox = new THREE.BoxHelper( intersects[0].object.parent, 0xff0000 ); + settext(intersects[0].object.parent, intersects[0].point); + getdevicemsg(intersects[0].object.parent.name); - }else{ - helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 ); - settext(intersects[0].object,intersects[0].point); - getdevicemsg(intersects[0].object.name); - } - scope.scene.add( helpbox ); - } - } + } else { + helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 ); + settext(intersects[0].object, intersects[0].point); + getdevicemsg(intersects[0].object.name); + } + scope.scene.add( helpbox ); + } + } - } + } - } + } - function settext(intersects,point){ - if(intersects.text){ - let textgeometry = new THREE.PlaneBufferGeometry( 18, 12, 1 ); - let textt = new THREE.CanvasTexture(getTextCanvas(intersects.text)); - let textmaterial = new THREE.MeshBasicMaterial( { - side: THREE.DoubleSide, - map:textt ,transparent: true, - alphaTest:0.1 - } ); - if(textplane){ - scope.scene.remove(textplane); - textplane.geometry.dispose(); - textplane.material.dispose(); - } - textplane= new THREE.Mesh( textgeometry, textmaterial ); - // textplane.name = data[i].code; - textplane.position.x = point.x; - textplane.position.y = point.y+6; - textplane.position.z = point.z; - textplane.rotation.y = -Math.PI/2; - textplane.lookAt(scope.camera.position); - // scope.textlist.push(textplane); - // newmesh.children[0].add(textplane); - scope.scene.add(textplane); + function settext(intersects, point) { + if (intersects.text) { + const textgeometry = new THREE.PlaneBufferGeometry( 18, 12, 1 ); + const textt = new THREE.CanvasTexture(getTextCanvas(intersects.text)); + const textmaterial = new THREE.MeshBasicMaterial( { + side: THREE.DoubleSide, + map:textt, transparent: true, + alphaTest:0.1 + } ); + if (textplane) { + scope.scene.remove(textplane); + textplane.geometry.dispose(); + textplane.material.dispose(); + } + textplane = new THREE.Mesh( textgeometry, textmaterial ); + // textplane.name = data[i].code; + textplane.position.x = point.x; + textplane.position.y = point.y + 6; + textplane.position.z = point.z; + textplane.rotation.y = -Math.PI / 2; + textplane.lookAt(scope.camera.position); + // scope.textlist.push(textplane); + // newmesh.children[0].add(textplane); + scope.scene.add(textplane); - textgeometry.dispose(); - textmaterial.dispose(); - textt.dispose(); - } - } - var beauty = new Image(); - beauty.src = JL3D_LOCAL_STATIC+"/texture/guide.png"; - //canvas文字贴图方法 - //PS:待提炼 增强功能 - function getTextCanvas(text){ - var canvas = document.getElementById('canvastexture'); + textgeometry.dispose(); + textmaterial.dispose(); + textt.dispose(); + } + } + var beauty = new Image(); + beauty.src = JL3D_LOCAL_STATIC + '/texture/guide.png'; + // canvas文字贴图方法 + // PS:待提炼 增强功能 + function getTextCanvas(text) { + var canvas = document.getElementById('canvastexture'); canvas.width = 256; canvas.height = 128; var ctx = canvas.getContext('2d'); - //var bg = canvas.createPattern(img, "no-repeat"); - //ctx.fillStyle = bg; - ctx.fillRect(0, 0,256,128); - ctx.font = "20px Verdana"; + // var bg = canvas.createPattern(img, "no-repeat"); + // ctx.fillStyle = bg; + ctx.fillRect(0, 0, 256, 128); + ctx.font = '20px Verdana'; ctx.fillStyle = '#FFFFFF'; ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; - ctx.clearRect(0,0,256,128); - ctx.drawImage(beauty,0,0,256, 128); - ctx.fillText("设备部件:"+text, 90,30); + ctx.clearRect(0, 0, 256, 128); + ctx.drawImage(beauty, 0, 0, 256, 128); + ctx.fillText('设备部件:' + text, 90, 30); // ctx.fillText("车组人员:XXX", 40,20); // ctx.fillText("速度:XXX.XXX", 40,30); - //ctx.fillText(text.trainModel.name, width/2,height*3/4); - let data = ctx.getImageData(0, 0,256, 128); + // ctx.fillText(text.trainModel.name, width/2,height*3/4); + const data = ctx.getImageData(0, 0, 256, 128); return data; - } - let voiceSelect; - localVoiceInit(); - function localVoiceInit(){ - let voices = speechSynthesis.getVoices(); - for(let i = 0; i < voices.length; i++) { - if(voices[i].name == "Microsoft Huihui Desktop - Chinese (Simplified)"){ - voiceSelect = voices[i]; - break; - } - } - } + } + let voiceSelect; + localVoiceInit(); + function localVoiceInit() { + const voices = speechSynthesis.getVoices(); + for (let i = 0; i < voices.length; i++) { + if (voices[i].name == 'Microsoft Huihui Desktop - Chinese (Simplified)') { + voiceSelect = voices[i]; + break; + } + } + } - function localVoicePlay(playText) { - localVoiceCancel(); - let toSpeak = new SpeechSynthesisUtterance(playText); - toSpeak.rate = 0.7; - toSpeak.voice = voiceSelect; + function localVoicePlay(playText) { + localVoiceCancel(); + const toSpeak = new SpeechSynthesisUtterance(playText); + toSpeak.rate = 0.7; + toSpeak.voice = voiceSelect; - window.speechSynthesis.speak(toSpeak); - } + window.speechSynthesis.speak(toSpeak); + } - function localVoiceCancel() { - window.speechSynthesis.cancel(); - } + function localVoiceCancel() { + window.speechSynthesis.cancel(); + } } diff --git a/src/views/newMap/jointTrainingNew/index.vue b/src/views/newMap/jointTrainingNew/index.vue index f4f891745..44bd64e41 100644 --- a/src/views/newMap/jointTrainingNew/index.vue +++ b/src/views/newMap/jointTrainingNew/index.vue @@ -178,7 +178,7 @@ export default { // this.initMemberUserInfo(); if (this.$route.query.type === 'VR_PSD') { this.deviceif = true; - this.deviceShow = false; + this.deviceShow = true; } if (this.$route.query.type === 'DRIVE') { this.$store.dispatch('training/setPrdType', '04'); @@ -485,7 +485,7 @@ export default { if (this.$store.state.training.prdType == '04') { this.panelShow = false; this.drivingShow = true; - this.$refs.Jl3dDrive.show(this.mapId, this.group,34); + this.$refs.Jl3dDrive.show(this.mapId, this.group, 34); } else { const routeData = this.$router.resolve({ path:'/jlmap3d/sandbox', From a410832030ca792c572b6a0aaf7b6b4cf000d670 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 11 Dec 2020 20:16:56 +0800 Subject: [PATCH 51/52] =?UTF-8?q?=E5=93=88=E5=B0=94=E6=BB=A8=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E9=97=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/jl3ddevice/jl3ddeviceNew.js | 1454 ++++++++++++----------- 1 file changed, 731 insertions(+), 723 deletions(-) diff --git a/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js b/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js index 6a109f3ef..00a38b578 100644 --- a/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js +++ b/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js @@ -1,7 +1,7 @@ import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; -// loader +//loader import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader'; import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls'; @@ -11,839 +11,847 @@ import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js'; import { Moveanimate } from '@/jlmap3d/jl3ddevice/component/moveanimate.js'; import { Textconfig } from '@/jlmap3d/jl3ddevice/component/textconfig.js'; -import { getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; +import { getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; + import StompClient from '@/utils/sock'; import store from '@/store/index_APP_TARGET'; var clock = new THREE.Clock(); -export function Jl3ddeviceNew(dom, group, token, skinCode) { +export function Jl3ddeviceNew(dom,group,token,skinCode) { - window.speechSynthesis.getVoices(); - const voices = speechSynthesis.getVoices(); + window.speechSynthesis.getVoices() + let voices = speechSynthesis.getVoices(); - var scope = this; - let helpbox, textplane; - let daochamodel; - const psdtexturemap = []; - const psdVoiceStationList = []; + var scope = this; + let helpbox,textplane; + let daochamodel; + let psdtexturemap = []; + let psdVoiceStationList = []; - this.dom = dom; - this.nowcode = null; - this.animateswitch = false; - this.signallights = []; - Signallightload(this.signallights); - this.mixers = []; - this.showmodel = null; + this.dom = dom; + this.nowcode = null; + this.animateswitch = false; + this.signallights = []; + Signallightload(this.signallights); + this.mixers = []; + this.showmodel = null; - // 点击事件状态 - this.raycasterstatus = false; - // 动画状态 - this.animastats = false; - // 当前选中模型 - this.nowobject = null; - // 当前动画播放模型 - this.animationmodel = null; - this.stationtexture = []; - this.devicetext = new Textconfig(); + //点击事件状态 + this.raycasterstatus = false; + //动画状态 + this.animastats = false; + //当前选中模型 + this.nowobject = null; + //当前动画播放模型 + this.animationmodel = null; - this.windowstatus = '0'; + this.stationtexture = []; + this.devicetext = new Textconfig(); - // 初始化webgl渲染 - this.renderer = new THREE.WebGLRenderer({ antialias: true }); + this.windowstatus = '0'; - this.renderer.setClearColor(new THREE.Color(0x000000)); - this.renderer.setSize(dom.offsetWidth, dom.offsetHeight); - this.renderer.shadowMap.enabled = true; - this.renderer.shadowMap.type = THREE.PCFSoftShadowMap; - this.dom.appendChild(this.renderer.domElement); + //初始化webgl渲染 + this.renderer = new THREE.WebGLRenderer({ antialias: true }); - // 定义相机 - this.camera = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 200); - this.camera.position.set(0, 20, 30); - this.camera.aspect = dom.offsetWidth / dom.offsetHeight; - this.camera.updateProjectionMatrix(); - // 定义场景(渲染容器) - this.scene = new THREE.Scene(); - this.scene.background = new THREE.Color(0xa0a0a0); + this.renderer.setClearColor(new THREE.Color(0x000000)); + this.renderer.setSize(dom.offsetWidth, dom.offsetHeight); + this.renderer.shadowMap.enabled = true; + this.renderer.shadowMap.type = THREE.PCFSoftShadowMap; + this.dom.appendChild(this.renderer.domElement); - var mesh = new THREE.Mesh(new THREE.PlaneBufferGeometry(200, 200), new THREE.MeshPhongMaterial({ color: 0x999999, depthWrite: false })); - mesh.rotation.x = -Math.PI / 2; - mesh.receiveShadow = true; - this.scene.add(mesh); + //定义相机 + this.camera = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 200); + this.camera.position.set(0, 20, 30); + this.camera.aspect = dom.offsetWidth / dom.offsetHeight; + this.camera.updateProjectionMatrix(); + //定义场景(渲染容器) + this.scene = new THREE.Scene(); + this.scene.background = new THREE.Color(0xa0a0a0); - var grid = new THREE.GridHelper(200, 20, 0x000000, 0x000000); - grid.material.opacity = 0.2; - grid.material.transparent = true; - this.scene.add(grid); + var mesh = new THREE.Mesh(new THREE.PlaneBufferGeometry(200, 200), new THREE.MeshPhongMaterial({ color: 0x999999, depthWrite: false })); + mesh.rotation.x = - Math.PI / 2; + mesh.receiveShadow = true; + this.scene.add(mesh); - const moveanima = new Moveanimate(scope); + var grid = new THREE.GridHelper(200, 20, 0x000000, 0x000000); + grid.material.opacity = 0.2; + grid.material.transparent = true; + this.scene.add(grid); - // 定义全局光 - const ambientLight = new THREE.AmbientLight(0xffffff, 1.3); - this.scene.add(ambientLight); + let moveanima = new Moveanimate(scope); - // 区域聚光灯 - var spotLight = new THREE.SpotLight(0xececff); - spotLight.position.set(-50, 80, 0); - spotLight.castShadow = true; - spotLight.shadow.mapSize.width = 2048; - spotLight.shadow.mapSize.height = 2048; - this.scene.add(spotLight); + //定义全局光 + let ambientLight = new THREE.AmbientLight(0xffffff, 1.3); + this.scene.add(ambientLight); - // 定义轨道视角控制器 - this.controls = new THREE.OrbitControls(this.camera, dom); - this.controls.maxPolarAngle = Math.PI / 2; - this.controls.minPolarangle = Math.PI / 5; - this.controls.maxDistance = 80; - this.controls.screenSpacePanning = true; - this.controls.update(); + //区域聚光灯 + var spotLight = new THREE.SpotLight(0xececff); + spotLight.position.set(-50, 80, 0); + spotLight.castShadow = true; + spotLight.shadow.mapSize.width = 2048; + spotLight.shadow.mapSize.height = 2048; + this.scene.add(spotLight); - // 设备名称和设备code - const lableCodeMap = []; - getPublishMapDetail(skinCode).then(data => { - const mapnetdata = data.data; - for (let i = 0, leni = mapnetdata.switchList.length; i < leni; i++) { - lableCodeMap[mapnetdata.switchList[i].name] = mapnetdata.switchList[i].code; - } - for (let i = 0, leni = mapnetdata.psdList.length; i < leni; i++) { - lableCodeMap[mapnetdata.psdList[i].standCode] = mapnetdata.psdList[i].code; - } - for (let i = 0, leni = mapnetdata.signalList.length; i < leni; i++) { - lableCodeMap[mapnetdata.signalList[i].name] = mapnetdata.signalList[i].code; - } - for (let i = 0, leni = mapnetdata.sectionList.length; i < leni; i++) { - lableCodeMap[mapnetdata.sectionList[i].name] = mapnetdata.sectionList[i].code; - } + //定义轨道视角控制器 + this.controls = new THREE.OrbitControls(this.camera, dom); + this.controls.maxPolarAngle = Math.PI / 2; + this.controls.minPolarangle = Math.PI / 5; + this.controls.maxDistance = 80; + this.controls.screenSpacePanning = true; + this.controls.update(); - const stationStandList = mapnetdata.stationStandList; - const psdList = mapnetdata.psdList; - for (let i = 0, leni = stationStandList.length; i < leni; i++) { - for (let j = 0, lenj = psdList.length; j < lenj; j++) { - if (stationStandList[i].code == psdList[j].standCode) { - psdVoiceStationList[psdList[j].code] = { - stationCode:stationStandList[i].stationCode, - right:stationStandList[i].right, - finlStationName:'', - nowStationName:'' - }; - j = lenj; - } - } - } - - const stationList = []; - for (let i = 0, leni = mapnetdata.stationList.length; i < leni; i++) { - if (mapnetdata.stationList[i].depot == false) { - - stationList.push(mapnetdata.stationList[i]); - } - } - // console.log(mapnetdata.stationList); - for (const k in psdVoiceStationList) { - for (let i = 0, leni = stationList.length; i < leni; i++) { - // console.log("---------------"); - // console.log("---------------"); - if (psdVoiceStationList[k].stationCode == stationList[i].code) { - psdVoiceStationList[k].nowStationName = stationList[i].name; - - if (psdVoiceStationList[k].right) { - psdVoiceStationList[k].finlStationName = stationList[leni - 1].name; - } else { - psdVoiceStationList[k].finlStationName = stationList[0].name; - } - i = leni; - } - } - } - }); - - document.addEventListener( 'mousedown', onselect, false ); - - const teststomp = new StompClient(); - // let topic = '/user/topic/simulation/assistant/'+group; - const topic = '/user/queue/simulation/jl3d/' + group; - const header = {'X-Token': token}; - try { - teststomp.subscribe(topic, callback, header); - } catch (error) { - console.error('websocket订阅失败'); + //设备名称和设备code + let lableCodeMap = []; + getPublishMapDetail(skinCode).then(data => { + let mapnetdata = data.data; + for(let i=0,leni=mapnetdata.switchList.length;i { - location.reload(); - }); - } - } - const changeelement = document.getElementById('jl3d'); - window.addEventListener('resize', () => - onresize() - , false); - const onresize = function () { + let teststomp = new StompClient(); + // let topic = '/user/topic/simulation/assistant/'+group; + let topic = '/user/queue/simulation/jl3d/'+group; + let header = {'X-Token': token}; + try { + teststomp.subscribe(topic, callback, header); + } catch (error) { + console.error('websocket订阅失败'); + } - scope.camera.aspect = changeelement.offsetWidth / changeelement.offsetHeight; - scope.camera.updateProjectionMatrix(); - scope.renderer.setSize(changeelement.offsetWidth, changeelement.offsetHeight); + function callback(Response) { - }; + let data = JSON.parse(Response.body); + if(data.type == "DeviceCtrl_3D"){ + if(data.body.code == scope.nowcode){ + scope.updateaction(data.body); + } + } - this.domresize = function() { - scope.camera.aspect = scope.dom.offsetWidth / scope.dom.offsetHeight; - scope.camera.updateProjectionMatrix(); - scope.renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight); - }; + if(data.type == "Device_Fault_Set_3D"){ + let realDeviceCode = lableCodeMap[data.body.code]; + if(realDeviceCode == scope.nowcode){ + scope.deviceFaultSet(data.body); + } + } - this.anime = null; + if(data.type == "Device_Fault_Over_3D"){ + let realDeviceCode = lableCodeMap[data.body.code]; + if(realDeviceCode == scope.nowcode){ + scope.deviceFaultOver(data.body); + } + } - this.modelmanager = new ModelManager(); + if(data.type == "Simulation_Reset"){ + scope.deviceReset(); + } - getPublish3dMapDetail(skinCode).then(netdata => { + if(data.type == 'Simulation_Over'){ + store.dispatch('LogOut').then(() => { + location.reload(); + }); + } + } + let changeelement = document.getElementById('jl3d'); + window.addEventListener('resize', () => + onresize() + , false) + let onresize = function () { - const netDataAssets = JSON.parse(netdata.data.assets); - if (netDataAssets.stationTextureList[0].urls.length > 1) { - setpsdstationmap(JSON.parse(netdata.data.stands)); - Standtextureload(scope, netDataAssets.stationTextureList[0]); - } - scope.modelmanager.loadpromise(netDataAssets.deviceAssetList, scope.mixers).then(function (data) { - // 综合演练情况下当模型加载后显示 - psdModelShow(); - moveanima.initlistnew(scope.modelmanager.switchmodel.mesh); - daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName('DAOCHA'); - if (scope.stationtexture['devicelist']) { - scope.modelmanager.standmodel.mesh.getObjectByName('zhantailiebiao').material.map = scope.stationtexture['devicelist']; - scope.modelmanager.standmodel.mesh.getObjectByName('zhantailiebiao').material.map.needsUpdate = true; - } - if (scope.stationtexture['pingbimen']) { - scope.modelmanager.standmodel.mesh.getObjectByName('pingbimen1').material.map = scope.stationtexture['pingbimen']; - scope.modelmanager.standmodel.mesh.getObjectByName('pingbimen1').material.map.needsUpdate = true; - } + scope.camera.aspect = changeelement.offsetWidth / changeelement.offsetHeight; + scope.camera.updateProjectionMatrix(); + scope.renderer.setSize(changeelement.offsetWidth, changeelement.offsetHeight); - }); - const checkobject = setInterval(function() { - if (scope.modelmanager.switchmodel.mesh) { - clearInterval(checkobject); - animate(); - } + } - }, 1000); + this.domresize = function(){ + scope.camera.aspect = scope.dom.offsetWidth / scope.dom.offsetHeight; + scope.camera.updateProjectionMatrix(); + scope.renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight); + } - }); + this.anime = null; - // 初始化屏蔽门贴图 - function setpsdstationmap(stationlist) { - for (let i = 0, leni = stationlist.length; i < leni; i++) { - psdtexturemap[stationlist[i].direction1.code] = stationlist[i].code; - psdtexturemap[stationlist[i].direction2.code] = stationlist[i].code; - psdtexturemap[stationlist[i].direction1.name] = stationlist[i].code; - psdtexturemap[stationlist[i].direction2.name] = stationlist[i].code; - } - } + this.modelmanager = new ModelManager(); - // 循环渲染函数 - function animate() { + getPublish3dMapDetail(skinCode).then(netdata => { - scope.anime = requestAnimationFrame(animate); - scope.renderer.render(scope.scene, scope.camera); - scope.controls.update(); - // scope.camera.lookAt(plane); - moveanima.animateupdate(); - const delta = clock.getDelta(); - if (scope.mixers) { - for (let i = 0; i < scope.mixers.length; i++) { - if (scope.mixers[i]) { - scope.mixers[i].update(delta); - } - } - } - } - // 隐藏道岔 - this.hideswitch = function (nowswitchstatus) { - if (nowswitchstatus) { - scope.modelmanager.switchmodel.mesh.add(daochamodel); - } else { - scope.modelmanager.switchmodel.mesh.remove(daochamodel); - } - }; - // 选择模型 - this.selectmodel = function (data) { - // scope.modelmanager - if (scope.showmodel) { + let netDataAssets = JSON.parse(netdata.data.assets); + if(netDataAssets.stationTextureList[0].urls.length > 1){ + setpsdstationmap(JSON.parse(netdata.data.stands)); + Standtextureload(scope,netDataAssets.stationTextureList[0]); + } + scope.modelmanager.loadpromise(netDataAssets.deviceAssetList, scope.mixers).then(function (data) { + //综合演练情况下当模型加载后显示 + psdModelShow(); + moveanima.initlistnew(scope.modelmanager.switchmodel.mesh); + daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA"); + if(scope.stationtexture["devicelist"]){ + scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["devicelist"]; + scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true; + } + if(scope.stationtexture["pingbimen"]){ + scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map =scope.stationtexture["pingbimen"]; + scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map.needsUpdate = true; + } - if (scope.showmodel.code != data.code) { - scope.scene.remove(scope.showmodel); - scope.showmodel = null; - scope.nowcode = data.code; - if (scope.nowobject) { - scope.resetmodel(); - } - if (data._type == 'Switch') { - // scope.modelmanager.switchmodel.locateType = data.body.locateType; - scope.modelmanager.switchmodel.code = data.code; - scope.showmodel = scope.modelmanager.switchmodel.mesh; - scope.scene.add(scope.showmodel); - scope.devicetext.initdevicetext(scope.modelmanager.switchmodel.mesh); - scope.nowobject = scope.modelmanager.switchmodel.mesh; - updatemenulist(scope.devicetext.devicelist); - scope.raycasterstatus = true; - } else { + }) + let checkobject = setInterval(function(){ + if(scope.modelmanager.switchmodel.mesh){ + clearInterval(checkobject); + animate(); + } - scope.raycasterstatus = false; - scope.nowobject = null; - updatemenulist(); - } - if (data._type == 'Signal') { - scope.modelmanager.signalmodel.code = data.code; - scope.showmodel = scope.modelmanager.signalmodel.mesh; - scope.scene.add(scope.showmodel); - } - if (data._type == 'Psd') { - scope.modelmanager.standmodel.code = data.code; - scope.showmodel = scope.modelmanager.standmodel.mesh; - scope.scene.add(scope.showmodel); - if (scope.stationtexture[psdtexturemap[data.standCode]]) { - scope.modelmanager.standmodel.mesh.getObjectByName('zhantaiming').material.map = scope.stationtexture[psdtexturemap[data.standCode]]; - scope.modelmanager.standmodel.mesh.getObjectByName('zhantaiming').material.map.needsUpdate = true; - } - } + },1000); - if (data._type == 'Section') { - scope.showmodel = scope.modelmanager.sectionmodel.mesh; - scope.scene.add(scope.showmodel); - } + }); - if (scope.showmodel) { - scope.resetmodel(); - scope.showmodel.code = data.code; - initstatus(data); - } + //初始化屏蔽门贴图 + function setpsdstationmap(stationlist){ + for(let i=0,leni=stationlist.length;i Date: Fri, 11 Dec 2020 20:17:18 +0800 Subject: [PATCH 52/52] =?UTF-8?q?=E5=93=88=E5=B0=94=E6=BB=A8=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E5=9B=BE=E7=BC=96=E5=88=B6=E4=BB=A3=E7=A0=81=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/router/index_Common.js | 6 + src/router/index_HEB.js | 6 + src/views/newMap/displayNew/menuSchema.vue | 22 +- .../editTool/menus/populatingGenericData.vue | 1 + src/views/planMonitor/newEditTool/index.vue | 27 +- src/views/planMonitor/newEditTool/menuBar.vue | 85 +++- .../planMonitor/newEditTool/menus/addTask.vue | 215 +++++---- .../newEditTool/menus/editPlanningTrain.vue | 28 +- .../newEditTool/menus/modifyingTask.vue | 444 ++++++++++-------- .../planMonitor/newEditTool/statusBar.vue | 49 +- 10 files changed, 560 insertions(+), 323 deletions(-) diff --git a/src/router/index_Common.js b/src/router/index_Common.js index a7c0507d4..01e622836 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -83,6 +83,7 @@ const ExamCourseDetail = () => import('@/views/exam/detail/courseDetail'); const DemonstrationDetail = () => import('@/views/demonstration/detail/index'); const PlanMonitorEditTool = () => import('@/views/planMonitor/editTool/index'); +const PlanMonitorNewEditTool = () => import('@/views/planMonitor/newEditTool/index'); const PlanMonitorEditAUSTool = () => import('@/views/planMonitor/editToolAUS/tool/index'); const PlanMonitorEditAUSLine = () => import('@/views/planMonitor/editToolAUS/line/index'); const PlanMonitorDetail = () => import('@/views/planMonitor/detail'); @@ -342,6 +343,11 @@ export const publicAsyncRoute = [ component: PlanMonitorEditTool, hidden: true }, + { // 哈尔滨运行图编辑 + path: '/plan/newTool', + component: PlanMonitorNewEditTool, + hidden: true + }, { path: '/displayIscs/system', component: IscsSystem, diff --git a/src/router/index_HEB.js b/src/router/index_HEB.js index 9bab86681..0f6d79c75 100644 --- a/src/router/index_HEB.js +++ b/src/router/index_HEB.js @@ -65,6 +65,7 @@ const ExamCourseDetail = () => import('@/views/exam/detail/courseDetail'); const DemonstrationDetail = () => import('@/views/demonstration/detail/index'); const PlanMonitorEditTool = () => import('@/views/planMonitor/editTool/index'); +const PlanMonitorNewEditTool = () => import('@/views/planMonitor/newEditTool/index'); const PlanMonitorDetail = () => import('@/views/planMonitor/detail'); const DesignPlatformHome = () => import('@/views/designPlatform/home'); @@ -226,6 +227,11 @@ export const publicAsyncRoute = [ component: PlanMonitorEditTool, hidden: true }, + { // 哈尔滨运行图编辑 + path: '/plan/newTool', + component: PlanMonitorNewEditTool, + hidden: true + }, { path: '/displayIscs/system', component: IscsSystem, diff --git a/src/views/newMap/displayNew/menuSchema.vue b/src/views/newMap/displayNew/menuSchema.vue index a89411828..158ab068c 100644 --- a/src/views/newMap/displayNew/menuSchema.vue +++ b/src/views/newMap/displayNew/menuSchema.vue @@ -22,7 +22,7 @@ - +