diff --git a/src/views/am/vchannel_view.vue b/src/views/am/vchannel_view.vue index cb051f0f..464fc15f 100644 --- a/src/views/am/vchannel_view.vue +++ b/src/views/am/vchannel_view.vue @@ -77,6 +77,7 @@ export default { }) this.form.area = this.channelArea; this.form.areas = this.channelAreas; + this.form.location = this.channelLocation; debugger; this.getArea(); }, @@ -119,6 +120,7 @@ export default { console.log(that.channelLocation) //如果位置已标记,显示上次标记的位置 if (that.channelLocation.x) { + window.map.flyToPosition(new jsmap.JSPoint(that.channelLocation.x, that.channelLocation.y,that.channelLocation.z), { duration: 1000 }); var pointMarker = new jsmap.JSPointMarker({ color: '#536dfe', //填充颜色 size: 2, //尺寸 @@ -151,6 +153,7 @@ export default { //画图结束的回调,返回所画的点的信息 callback: (feature) => { + that.form.location = []; console.log('add', feature); console.log(feature.properties);//type:POINT;id:"";name:"";floorNo:"";floorId:"" console.log(feature.geometry);//type:POINT;coordinates:[114.63028499839209,38.81195080123784,0] @@ -193,8 +196,13 @@ export default { //表单提交方法 submit() { let that = this; - let item = this.form.location; - that.form.location = { x: item[0], y: item[1], z: item[2] ,floorNo:item[3],floorId:item[4]}; + debugger;if(that.form.location.x){ + debugger; + }else{ + debugger; + let item = this.form.location; + that.form.location = { x: item[0], y: item[1], z: item[2] ,floorNo:item[3],floorId:item[4]}; + } that.$API.am.tdevice.labelLocation.req(that.channelId, that.form) .then(res => { that.isSaveing = false; diff --git a/src/views/bigScreen/index.vue b/src/views/bigScreen/index.vue index ba288c7d..ba90e100 100644 --- a/src/views/bigScreen/index.vue +++ b/src/views/bigScreen/index.vue @@ -374,7 +374,7 @@
- +
@@ -875,6 +875,10 @@ export default { document.head.appendChild(scriptInfo) }, mounted() { + debugger; + let timeeee= '2022-09-20 16:00:00'; + console.log(new Date( timeeee ).getTime()); + debugger; let that = this; let date = new Date(); that.timeNow = date.getDay(); @@ -924,7 +928,6 @@ export default { that.speakersMaskerLayers();//喇叭 that.jobDomMarkerLayers();//危险作业图片 that.areaMarkerLayers();//危险作业图片 - let compassControl = new jsmap.JSCompassControl({ position: jsmap.JSControlPosition.LEFT_TOP, offset: { @@ -952,7 +955,7 @@ export default { let areaId = item.properties.get("areaId"); console.log(areaId); that.$API.am.area.item.req(areaId).then(res=>{ - debugger; + // debugger; console.log(res); that.areaItemDetail = res; that.screenJob = false; @@ -1032,7 +1035,7 @@ export default { //人员 that.screenUserItem = item.properties.get("employee"); that.screenUser = true; - // debugger; + debugger; window.map.flyToMarker(that.userMarker[that.screenUserItem.mac], { duration: 1000 }) @@ -1068,6 +1071,8 @@ export default { // document.getElementsByClassName('area-info-body')[0].style.height = simpleBodyHeight + 'px'; }, beforeUnmount(){ + window.map.destroy(); + window.map = null; clearInterval(this.timerUser) clearInterval(this.timerTime) }, @@ -1120,7 +1125,7 @@ export default { that.areaDetail = true; that.areaDetailId = data.id; this.getAreaOperation(); - debugger; + // debugger; console.log(data); let points = data.third_info.xx_rail.detail.polygon.points[0]; window.map.flyToPosition(new jsmap.JSPoint(points.x, points.y, points.z), { duration: 1000 }); @@ -1166,6 +1171,7 @@ export default { if (res.err_msg) { } else { let rpartsList=[]; + let arr = []; let children = genTree(res); for (let i = 0; i < 5; i++) { let obj = new Object(); @@ -1319,7 +1325,7 @@ export default { }, //警报类型查询 warningTypeSelected(id,name) { - debugger; + // debugger; let that = this; this.warningTypeShow = false; let params = new Object(); @@ -1423,6 +1429,21 @@ export default { show: false }); window.map.addLayer(that.userMaskerLayer); + //添加线的图层 + let points0 = [{x:114.63000343420656, y: 38.81372685720612, z: 0}, + {x: 114.63016642812906, y: 38.81357460804729, z: 0.}, + {x: 114.63072033314663,y: 38.813113546390916, z: 0}, + {x: 114.63040619763623, y: 38.81281832964802, z: 0}, + {x: 114.63014001753065, y:38.81279008573829, z: 0}]; + let line1 = new jsmap.JSLineMarker({ + position: points0, + floorId: 1, + lineType: jsmap.JSLineType.ARROW, + color: '#0000ff', + width: 5, + depthTest: true + }); + window.map.addMarker(line1); that.getAllMen(); }, //喇叭layer @@ -1575,8 +1596,84 @@ export default { }) }, + // model(){ + // marker = new jsmap.JSModelMarker({ + // id: '1', + // position: points0[0], + // url: 'http://mapdemo.joysuch.com/lib/LocalAssets/img/human_red.gltf', + // rotation: { + // rx: 0, + // ry: 0, + // rz: -90 + // }, + // text: '巡逻中...', + // fontColor: '#0000ff', + // font: '14px 微软雅黑', + // backgroundColor: 'rgba(112,253,147,0.5)', + // backgroundRadius: 5, + // textOffsetInMeter: 1.6, + // backgroundStrokeColor: 'rgb(255,255,255)', + // modelAnimate: { + // multiplier: 2, + // }, + // scale: 0.8, + // properties: { + // name: 'JSMap007' + // }, + // callback: (marker) => { + // map.trackMarker(marker, { + // range: 40, + // tilt: 60, + // rotate: 310 + // }); + + // for (let i = 1; i < points0.length; i++) { + // setTimeout(() => { + // map.updateMarkerPosition(marker, { + // position: points0[i], + // animate: { + // duration: 1000, + // begin: () => { + // marker.startModelAnimators(); + // }, + // complete: () => { + // marker.pauseModelAnimators(); + // }, + // update: (pos) => { + // line1.trace(pos) + // } + // } + // }); + // }, i * 1000); + // } + + // setTimeout(() => { + // marker.text = '寻息专家来交流,速归...'; + // }, (points0.length + 1) * 1000); + + // setTimeout(() => { + // map.flyToMarker(marker, { + // offset: { + // range: 20, + // tilt: 20, + // rotate: 330 + // }, + // duration: 500 + // }); + // marker.text = '认真听报告中...'; + // }, (points0.length + points1.length + points2.length + points3.length + 5) * 1000); + // } + // }); + // map.addMarker(marker); + // }, //人员 showUserMarkers(userList) { + //路线坐标集合 + let points0 = [{x:114.63000343420656, y: 38.81372685720612, z: 0}, + {x: 114.63016642812906, y: 38.81357460804729, z: 0.}, + {x: 114.63072033314663,y: 38.813113546390916, z: 0}, + {x: 114.63040619763623, y: 38.81281832964802, z: 0}, + {x: 114.63014001753065, y:38.81279008573829, z: 0}]; // debugger; let that = this; //标记图片 @@ -1595,6 +1692,7 @@ export default { }else { userImage = "/img/visitor.png" } + that.userMarker[item.mac] = new jsmap.JSIconTextMarker({ id: item.my_info.code, position: { x:item.longitude, y: item.latitude, z: item.z }, //坐标 @@ -1617,30 +1715,33 @@ export default { properties: { employee: employee_ }, + callback: (marker) => { + for (let i = 1; i < points0.length; i++) { + // setTimeout(() => { + // window.map.updateMarkerPosition(that.userMarker[item.mac], { + // position: points0[i], + // animate: { + // duration: 1000, + // } + // }); + // }, i * 1000); + } + } }); that.userMaskerLayer.addMarker(that.userMarker[item.mac]); - // window.map.flyToPosition(new jsmap.JSPoint(114.63016059048613, 38.813788495383136, 0), { duration: 1000 }); }) - - // setInterval(function () { - // i = (i + 1) % 2; - // that.userMaskerLayer.updateMarkerPosition(that.userMarker[iconTextMarker], { - // floorId: 1, - // position: { x: lng[i], y: 38.8133418942642, z: 0 }, - // animate: { duration: 10000, } - // });//动画效果,持续时间一秒 - // }, 11000) } + clearInterval(that.timerUser); that.timerUser = setInterval(function () { that.refreshUserMarker(); - }, 30000) + }, 5000) }, //更新人员标记 refreshUserMarker() { if (document.getElementById("mapContainer") == null || document.getElementById("mapContainer") == undefined){ return } - debugger; + // debugger; let that = this; that.$API.third.blt.all.req().then(res => { if (res.err_msg) { @@ -1655,9 +1756,9 @@ export default { that.showUserMarkers(addUser);//增加新进在线员工 //that.userMaskerLayer.removeMarker(sectorMarker)(addUser);//删除离线员工 refreshList.forEach(item1 => { - debugger; + // debugger; console.log(item1) - that.userMaskerLayer.updateMarkerPosition(that.userMarker[item1.id], { + that.userMaskerLayer.updateMarkerPosition(that.userMarker[item1.mac], { floorId: 1, position: { x: item1.longitude, y: item1.latitude, z: item1.z }, animate: { duration: 10000, } @@ -1852,7 +1953,7 @@ export default { if (res.err_msg) { that.$message.error(res.err_msg); } else { - debugger; + // debugger; console.log(res.pageData.length) let Vchannels = res.pageData.filter(item=>{ return item.my_info.location!==undefined; @@ -1977,7 +2078,7 @@ export default { }, }, unmounted() { - window.map.destroy(); + // window.map.destroy(); window.map = null; }, }