From 7ef4994a09d45126fd7d3a2f1fd63b26425383b0 Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Tue, 24 Nov 2020 17:32:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E5=AE=A2=E6=B5=81=E8=A7=86=E7=AA=97=E8=B7=B3=E8=BD=AC=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jl3dtrafficplan/jl3dtrafficplan.js | 8 ++- .../jl3dtrafficplan/jl3dtraffictrain.js | 12 +++- .../jl3dtrafficplan/model/passerstation.js | 17 +++++- .../jlmap3d/trafficplan/jl3dtrafficplan.vue | 17 ++++-- .../jlmap3d/trafficplan/jl3dtraffictrain.vue | 13 +++-- src/views/newMap/displayNew/demonMenu.vue | 56 +++++++++---------- src/views/newMap/jlmapNew/index.vue | 40 ++++++++++++- 7 files changed, 119 insertions(+), 44 deletions(-) diff --git a/src/jlmap3d/jl3dtrafficplan/jl3dtrafficplan.js b/src/jlmap3d/jl3dtrafficplan/jl3dtrafficplan.js index 8e2a8ea83..5909a1f4e 100644 --- a/src/jlmap3d/jl3dtrafficplan/jl3dtrafficplan.js +++ b/src/jlmap3d/jl3dtrafficplan/jl3dtrafficplan.js @@ -59,7 +59,7 @@ let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/trafficplan/traffi //老版本临时ai控制 let olddataai = false; -export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap) { +export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap,initCode) { // let stats = new Stats(); // dom.appendChild( stats.dom ); @@ -185,7 +185,7 @@ export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap) { }); this.initTrafficStart = function(){ - + passerStation.initCodeStation(initCode); scope.humanWaitTop = passerStation.nowStation.toppassers; scope.humanWaitDown = passerStation.nowStation.downpassers; scope.humanInSpeed = 0; @@ -194,6 +194,8 @@ export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap) { passerAi.initPasser(humanlist,topWaitPassers,downWaitPassers,passerHuman,scope); updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed); + + } this.changestation = function(stationname){ @@ -229,7 +231,7 @@ export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap) { this.updateNowLeaveData = function(direct,outNum){ if(direct == "top"){ waitForCreatOutTop = getnum(outNum,17); - console.log(waitForCreatOutTop); + // console.log(waitForCreatOutTop); for(let i=0;i
@@ -114,7 +115,7 @@ export default { }, data() { return { - + initCode:null, isActive:0, localStatic:JL3D_LOCAL_STATIC, openeds:['2','3','4','5','6','7'], @@ -159,8 +160,8 @@ export default { // document.querySelector("link[rel*='icon']").href = loginInfo[this.$route.query.project].linkIcon || ProjectIcon[this.$route.query.project]; }, mounted() { - - this.init(); + this.initCode = this.$route.query.deviceCode; + this.init(this.initCode); this.takelist = this.getnum(this.allPassers,6); // console.log(this.takelist); if (this.$route.query.type == 'CCTV') { @@ -173,10 +174,11 @@ export default { beforeDestroy() { }, methods: { - init: function () { + init: function (code) { // let mapdata = this.$store.state.socket.device; + this.value = code; const dom = document.getElementById('jl3d'); - this.jl3d = new Jl3dTrafficTrain(dom, this.$route.query.mapid, this.$route.query.group, 'normal'); + this.jl3d = new Jl3dTrafficTrain(dom, this.$route.query.mapid, this.$route.query.group, 'normal',code); }, assetSelect(index){ // console.log(index); @@ -213,6 +215,7 @@ export default { // } // // console.log(this.trainlist); }, + updateTrainCode(selVal) { // console.log(selVal); // this.jl3d.changeTrain(selVal); diff --git a/src/views/newMap/displayNew/demonMenu.vue b/src/views/newMap/displayNew/demonMenu.vue index c2ca3a348..a9a020349 100644 --- a/src/views/newMap/displayNew/demonMenu.vue +++ b/src/views/newMap/displayNew/demonMenu.vue @@ -15,8 +15,8 @@ {{ jl3dpassflow }} - {{ jl3dtrafficplan }} - {{ $t('display.demon.traffictraintext') }} + 故障设备 @@ -213,32 +213,32 @@ export default { }); window.open(routeData.href, '_blank', 'noopener noreferrer'); }, - jumpjl3dtrafficplan() { - const routeData = this.$router.resolve({ - path:'/jlmap3d/trafficplan', - query:{ - mapid:this.mapId, - group:this.group, - project: this.project, - noPreLogout: true, - lineCode:this.lineCode - } - }); - window.open(routeData.href, '_blank', 'noopener noreferrer'); - }, - jumpjl3dtraffictrain() { - const routeData = this.$router.resolve({ - path:'/jlmap3d/traffictrain', - query:{ - mapid:this.mapId, - group:this.group, - project: this.project, - noPreLogout: true, - lineCode:this.lineCode - } - }); - window.open(routeData.href, '_blank', 'noopener noreferrer'); - }, + // jumpjl3dtrafficplan() { + // const routeData = this.$router.resolve({ + // path:'/jlmap3d/trafficplan', + // query:{ + // mapid:this.mapId, + // group:this.group, + // project: this.project, + // noPreLogout: true, + // lineCode:this.lineCode + // } + // }); + // window.open(routeData.href, '_blank', 'noopener noreferrer'); + // }, + // jumpjl3dtraffictrain() { + // const routeData = this.$router.resolve({ + // path:'/jlmap3d/traffictrain', + // query:{ + // mapid:this.mapId, + // group:this.group, + // project: this.project, + // noPreLogout: true, + // lineCode:this.lineCode + // } + // }); + // window.open(routeData.href, '_blank', 'noopener noreferrer'); + // }, jumpjlmap3dFault() { const routeData = this.$router.resolve({ path:'/jlmap3d/maintainer', diff --git a/src/views/newMap/jlmapNew/index.vue b/src/views/newMap/jlmapNew/index.vue index 1018e9b70..baa1ff61a 100644 --- a/src/views/newMap/jlmapNew/index.vue +++ b/src/views/newMap/jlmapNew/index.vue @@ -384,7 +384,45 @@ export default { }, // 点击选择事件 onSelected(em) { - this.$emit('onSelect', em); + console.log(em); + + + const path = window.location.href; + if (path.includes("/practiceDisplay")){ + if(em.deviceType == "StationStand"){ + // console.log(em.deviceType ); + const routeData = this.$router.resolve({ + path:'/jlmap3d/trafficplan', + query:{ + mapid:this.$route.query.mapId, + group:this.$route.query.group, + project: this.$route.query.project, + noPreLogout: true, + lineCode:this.$route.query.lineCode, + deviceCode:em.deviceCode, + } + }); + window.open(routeData.href, '_blank', 'noopener noreferrer'); + } + if(em.deviceType == "Train"){ + // console.log(em.deviceType ); + const routeData = this.$router.resolve({ + path:'/jlmap3d/traffictrain', + query:{ + mapid:this.$route.query.mapId, + group:this.$route.query.group, + project: this.$route.query.project, + noPreLogout: true, + lineCode:this.$route.query.lineCode, + deviceCode:em.deviceCode, + } + }); + window.open(routeData.href, '_blank', 'noopener noreferrer'); + } + }else{ + this.$emit('onSelect', em); + } + }, // 右键点击事件 onContextMenu(em) { From 9ba73cbb77ed2854d2dfa600b6bd591d0c3c35cd Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Tue, 24 Nov 2020 17:35:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=93=88=E5=B0=94?= =?UTF-8?q?=E6=BB=A8=E7=BB=BC=E5=90=88=E7=9B=91=E6=8E=A7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iscsSystem/config/canvas/iscsCanvas.vue | 36 +++++++++++++------ .../iscsSystem/config/fire-alarm/stand.vue | 1 - .../lessoncategory/edit/lesson/publish.vue | 6 ++-- .../newMap/displayNew/demon/planSchedule.vue | 2 -- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/views/iscs/iscsSystem/config/canvas/iscsCanvas.vue b/src/views/iscs/iscsSystem/config/canvas/iscsCanvas.vue index 10bf0ab97..a59c34312 100644 --- a/src/views/iscs/iscsSystem/config/canvas/iscsCanvas.vue +++ b/src/views/iscs/iscsSystem/config/canvas/iscsCanvas.vue @@ -1,6 +1,6 @@ @@ -8,7 +8,8 @@ import Vue from 'vue'; import Iscs from '@/iscs/iscs'; import { parser } from '@/iscs/utils/parser'; -import {getIscsData} from '@/iscs/constant/iscsData'; +// import { getIscsData } from '@/iscs/constant/iscsData'; +import { getIscsData } from '@/api/iscs'; export default { name: 'Iscs', @@ -45,7 +46,6 @@ export default { showBackButton: true, initTime: '', started: false, - loading: false, stationCode: '', banUpOpenScreenDoor: false, banDownOpenScreenDoor: false @@ -78,7 +78,20 @@ export default { this.iscsDestroy(); }, methods: { - show (mode, system, part) { + async getDetail(mode, system, part) { + const params = { + lineCode: this.$route.query.lineCode, + totalSystem: mode, + system: system, + userInterface : part + }; + const resp = await getIscsData(params); + if (resp.data) { + const data = JSON.parse(resp.data.graphData); + return data; + } + }, + async show (mode, system, part) { if (!mode || !system || !part) { return; } @@ -86,8 +99,8 @@ export default { return false; }; this.iscsDestroy(); - this.loading = true; - const data = parser(getIscsData(mode, system, part), {width: this.widthCanvas, height: this.canvasHeight}); + const dataIscs = await this.getDetail(mode, system, part); + const data = parser(dataIscs, {width: this.widthCanvas, height: this.canvasHeight}); this.$iscs = new Iscs({ dom: document.getElementById(this.iscsId), config: { @@ -109,8 +122,8 @@ export default { if (this.$route.params.mode) { this.$iscs.on('selected', this.onSelected, this); } - this.setIscs(data, getIscsData(mode, system, part)); - this.$store.dispatch('iscs/setIscsData', getIscsData(mode, system, part)); + this.setIscs(data, dataIscs); + this.$store.dispatch('iscs/setIscsData', dataIscs); window.document.oncontextmenu = function () { return false; }; @@ -118,8 +131,9 @@ export default { setIscs(data, oldData) { this.$iscs.setIscs(oldData, data, this.$route.query.lineCode); }, - iscsLoadData(mode, system, part) { - this.$iscs.loadData(parser(getIscsData(mode, system, part), {width: this.widthCanvas, height: this.canvasHeight})); + async iscsLoadData(mode, system, part) { + const dataIscs = await this.getDetail(mode, system, part); + this.$iscs.loadData(parser(dataIscs, {width: this.widthCanvas, height: this.canvasHeight})); }, // 点击选择事件 onSelected(em) { @@ -147,7 +161,7 @@ export default { } }, handleViewLoaded() { - this.loading = false; + }, statusMessage(val) { this.$iscs && this.$iscs.setDeviceStatus(val); diff --git a/src/views/iscs/iscsSystem/config/fire-alarm/stand.vue b/src/views/iscs/iscsSystem/config/fire-alarm/stand.vue index bdbc598fa..28bfa04ff 100644 --- a/src/views/iscs/iscsSystem/config/fire-alarm/stand.vue +++ b/src/views/iscs/iscsSystem/config/fire-alarm/stand.vue @@ -26,7 +26,6 @@ export default { this.$nextTick(() => { this.$refs.iscsPlate.iscsLoadData('fas', 'stand', 'standPublicArea'); }); - console.log(this.width); } else if (device && device._type === 'IscsButton' && device.function === 'GoBack') { this.width = 1100; this.$nextTick(() => { diff --git a/src/views/lesson/lessoncategory/edit/lesson/publish.vue b/src/views/lesson/lessoncategory/edit/lesson/publish.vue index 0fc49a88f..0ee244475 100644 --- a/src/views/lesson/lessoncategory/edit/lesson/publish.vue +++ b/src/views/lesson/lessoncategory/edit/lesson/publish.vue @@ -1,5 +1,5 @@