From 54ea10290ce9cc79dc47f6b66fffce267e01e04c Mon Sep 17 00:00:00 2001 From: shijing Date: Fri, 8 Jul 2022 17:11:45 +0800 Subject: [PATCH 1/4] personmove --- src/api/model/third.js | 20 ++ src/views/bigScreen/index.vue | 103 ++----- src/views/hrm/employee.vue | 549 +++++++++++++++++++--------------- 3 files changed, 354 insertions(+), 318 deletions(-) diff --git a/src/api/model/third.js b/src/api/model/third.js index 05831b4b..e4caabb9 100644 --- a/src/api/model/third.js +++ b/src/api/model/third.js @@ -12,6 +12,26 @@ export default { ); } }, + bltBind: { + name: "绑定/解绑定位卡", + req: async function(data){ + return await http.post( + `${config.API_URL}/third/tdevice/blt_bind/`, + data + ); + } + }, + bltSync: { + name: "同步标签mac至平台", + req: async function(data){ + return await http.post( + `${config.API_URL}/third/tdevice/blt_sync/`, + data + ); + } + }, + + }, blt:{ diff --git a/src/views/bigScreen/index.vue b/src/views/bigScreen/index.vue index c7f5a634..17f328b2 100644 --- a/src/views/bigScreen/index.vue +++ b/src/views/bigScreen/index.vue @@ -903,6 +903,7 @@ mark: '1', }, LBType: '1', + userMarker:{}, } }, created() { @@ -1062,13 +1063,6 @@ } else { } }); - /* - *
-
`+event.markers[0].text+`
-
-
-
- * */ //左侧数据统计 this.getManCount();//人员统计$$ this.getWarnings();//报警统计$$ @@ -1082,9 +1076,7 @@ this.getAllMen();//人员 this.getAllPost();//岗位 setInterval(function () { - /*this.getManCount();//人员统计$$ - this.getWarnings();//报警统计$$ - this.getAreas();//区域*/ + },3000) }, @@ -1181,13 +1173,14 @@ }, //获取人员列表(全部在线标签列表信息) getAllMen() { - this.$API.third.blt.all.req().then(res => { + let that = this; + that.$API.third.blt.all.req().then(res => { if (res.err_msg) { } else { - this.userList = res.filter(item => { + that.userList = res.filter(item => { return item.my_info.employee }); - // console.log(this.userList) + that.showUserMarkers(); } }) }, @@ -1299,6 +1292,7 @@ show: false }); window.map.addLayer(that.userMaskerLayer); + that.getAllMen(); }, //喇叭layer speakersMaskerLayers() {//消防物资 @@ -1427,10 +1421,13 @@ let that = this; let iconTextMarker = null; if(that.userList.length>0){ + let lng = [114.62923138539462,114.6315404372349];//经度 + let i=0; + iconTextMarker = that.userList[0].mac+'userMarker'; let employee_ = that.userList[0].my_info.employee_; - iconTextMarker = new jsmap.JSIconTextMarker({ + that.userMarker[iconTextMarker] = new jsmap.JSIconTextMarker({ id: that.userList[0].my_info.code, - position: {x: 114.6315404372349, y: 38.813557855009435, z: 0}, //坐标 + position: {x: 114.62923138539462, y: 38.8133418942645, z: 0}, //坐标 floorId: 1, //楼层id,默认为1(地面) image: "/img/user.png", text: employee_.name, @@ -1450,66 +1447,16 @@ properties: { employee: employee_ }, - callback: (marker) => { - return employee_ - } }); - - that.userMaskerLayer.addMarker(iconTextMarker); - setTimeout(function () { - console.log(that.userMaskerLayer); - that.userMaskerLayer.updateMarkerPosition(iconTextMarker,{ + that.userMaskerLayer.addMarker(that.userMarker[iconTextMarker]); + setInterval(function () { + i=(i+1)%2; + that.userMaskerLayer.updateMarkerPosition(that.userMarker[iconTextMarker],{ floorId:1, - position: {x:114.62923138539462, y:38.8133418942642, z:0}, - animate: true + position: {x:lng[i], y:38.8133418942642, z:0}, + animate: {duration: 8000,} });//动画效果,持续时间一秒 - },3000); - setTimeout(function () { - console.log(that.userMaskerLayer); - that.userMaskerLayer.updateMarkerPosition(iconTextMarker,{ - floorId:1, - position: {x:114.6315404372349, y: 38.813557855009435, z:0}, - animate: true - });//动画效果,持续时间一秒 - },6000); - debugger; - /*let employee_1 = that.userList[1].my_info.employee_; - iconTextMarker1 = new jsmap.JSIconTextMarker({ - id: that.userList[1].my_info.code, - position: {x: 114.62923138539462, y: 38.8133418942642, z: 0}, //坐标 - floorId: 1, //楼层id,默认为1(地面) - image: "/img/user.png", - text: employee_1.name, - font: '10px sans-serif', - fontColor: '#ffffff', - imageHeight: 25, - imageWidth: 25, - backgroundColor: 'rgba(0,0,0,0.3)', - backgroundRadius: 1, - backgroundStrokeColor: 'rgba(0,0,0,0.3)', - backgroundStrokeWidth: 1, - iconTextType: jsmap.JSIconTextType.TOPTEXT_BOTTOMICON, - allowPicking: true, - displayCondition: new jsmap.JSDisplayCondition(0.0, 1000), - nearFarScale: new jsmap.JSNearFarScale(0.0, 1, 500, 1), - show: true, - properties: { - employee: employee_1 - }, - callback: (marker) => { - return employee_1 - } - }); - that.userMaskerLayer.addMarker(iconTextMarker1); - setTimeout(function () { - that.userMaskerLayer.updateMarkerPosition(jsmap.JSIconTextMarker,{ - floorId:1, - position: {x:114.6315404372349, y:38.813557855009435, z:0}, - animate: true - });//动画效果,持续时间一秒 - - },3000)*/ - }else{ + },8500) } /*that.userList.forEach(item => { if (item.my_info.code) { @@ -1737,17 +1684,7 @@ that.riskMarkerLayer.show = false; } if (that.markList[6]) { - that.$API.third.blt.all.req().then(res => { - if (res.err_msg) { - } else { - that.userMaskerLayer.show = true; - that.userList = res.filter(item=>{ - return item.my_info.code - }); - // this.showUserMarkers(); - that.showUserMarkers(); - } - }) + that.userMaskerLayer.show = true; } else { that.userMaskerLayer.show = false; } diff --git a/src/views/hrm/employee.vue b/src/views/hrm/employee.vue index d79f4880..15a2bea1 100644 --- a/src/views/hrm/employee.vue +++ b/src/views/hrm/employee.vue @@ -1,247 +1,326 @@ - From cfd0f4df9556368f9a35b26841db08dd4be35564 Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 11 Jul 2022 13:35:17 +0800 Subject: [PATCH 2/4] track&bindblt --- src/views/bigScreen/index.vue | 267 +++++++++++++++++++--------------- src/views/hrm/employee.vue | 65 +++++---- 2 files changed, 183 insertions(+), 149 deletions(-) diff --git a/src/views/bigScreen/index.vue b/src/views/bigScreen/index.vue index 17f328b2..d6e776c2 100644 --- a/src/views/bigScreen/index.vue +++ b/src/views/bigScreen/index.vue @@ -119,7 +119,8 @@
内部员工
- {{userCount.count_employee}}  + {{userCount.count_employee}} 
@@ -127,7 +128,8 @@
访客
-
{{userCount.count_visitor}}  +
{{userCount.count_visitor}} 
@@ -136,7 +138,8 @@
相关方
- {{userCount.count_remployee}}  + {{userCount.count_remployee}} 
@@ -488,10 +491,15 @@
-
+
+ + 取消跟踪 +
+
跟踪
+
轨迹 @@ -519,7 +527,8 @@ @@ -835,6 +844,7 @@ countIndex: '2', markList: [false, false, false, false, false, false, false], autoRun: false, + tracking: false, areaDetail: false, screenJob: false, screenUser: false, @@ -845,13 +855,13 @@ showUserSelect: false, warningDetail: false, filterCtrlFocus: true, - warningListTotal:0, - warningData:{ - list:[], - total:0, - params:{ - page:1, - page_size:10 + warningListTotal: 0, + warningData: { + list: [], + total: 0, + params: { + page: 1, + page_size: 10 } }, Vchannels: [],//摄像头列表 @@ -903,7 +913,7 @@ mark: '1', }, LBType: '1', - userMarker:{}, + userMarker: {}, } }, created() { @@ -1051,6 +1061,10 @@ //人员 that.screenUserItem = item.properties.get("employee"); that.screenUser = true; + debugger; + window.map.flyToMarker(that.userMarker[that.screenUserItem.mac],{ + duration:1000 + }) } } @@ -1077,55 +1091,57 @@ this.getAllPost();//岗位 setInterval(function () { - },3000) + }, 3000) }, methods: { - areaRowClick(){ + areaRowClick(data) { this.areaDetail = true; + console.log(data); + debugger; }, //岗位 - getAllPost(){ - this.$API.system.post.list.req({page:0}).then(res=>{ + getAllPost() { + this.$API.system.post.list.req({page: 0}).then(res => { let arr = []; let children = genTree(res); - for(let i=0;i<4;i++){ - let obj=new Object(); - if(i===0){ - obj.id=''; + for (let i = 0; i < 4; i++) { + let obj = new Object(); + if (i === 0) { + obj.id = ''; obj.name = '全部'; obj.label = '全部'; - }else if(i===1){ - obj.id=''; + } else if (i === 1) { + obj.id = ''; obj.name = '内部员工'; obj.label = '内部员工'; obj.children = children; - }else if(i===2){ - obj.id=''; + } else if (i === 2) { + obj.id = ''; obj.name = '相关方'; obj.label = '相关方'; - }else if(i===3){ - obj.id=''; + } else if (i === 3) { + obj.id = ''; obj.name = '访客'; obj.label = '访客'; } arr.push(obj) } - this.postList =arr; + this.postList = arr; // console.log(arr) }) }, //人员统计 getManCount() { let that = this; - if(that.countIndex==='2'){ + if (that.countIndex === '2') { that.$API.third.blt.countNow.req().then(res => { if (res.err_msg) { } else { that.userCount = {...res}; } }) - }else{ + } else { that.$API.third.blt.countBind.req().then(res => { if (res.err_msg) { } else { @@ -1180,11 +1196,11 @@ that.userList = res.filter(item => { return item.my_info.employee }); - that.showUserMarkers(); + that.showUserMarkers(that.userList); } }) }, - handleCurrentChange(){ + handleCurrentChange() { this.getWarnings(); }, //获取报警列表 @@ -1222,7 +1238,7 @@ //获取人员详细信息 showUserDetail() { this.screenUserDetail = true; - this.$API.hrm.employee.item.req(this.screenUserItem.id).then(res=>{ + this.$API.hrm.employee.item.req(this.screenUserItem.id).then(res => { // console.log(res); this.screenUserItemDetail = res; }) @@ -1232,12 +1248,12 @@ let that = this; this.showUserSelect = false; this.screenUser = true; - that.screenUserItem.name=this.userList[0].my_info.employee_.name; - that.screenUserItem.type=this.userList[0].my_info.employee_.type; - that.screenUserItem.id=this.userList[0].my_info.employee_.id; - that.screenUserItem.photo=this.userList[0].my_info.employee_.photo?this.userList[0].my_info.employee_.photo:''; - that.screenUserItem.post_name=this.userList[0].my_info.employee_.post_name?this.userList[0].my_info.employee_.post_name:''; - that.screenUserItem.belong_dept_name=this.userList[0].my_info.employee_.belong_dept_name?this.userList[0].my_info.employee_.belong_dept_name:''; + that.screenUserItem.name = this.userList[0].my_info.employee_.name; + that.screenUserItem.type = this.userList[0].my_info.employee_.type; + that.screenUserItem.id = this.userList[0].my_info.employee_.id; + that.screenUserItem.photo = this.userList[0].my_info.employee_.photo ? this.userList[0].my_info.employee_.photo : ''; + that.screenUserItem.post_name = this.userList[0].my_info.employee_.post_name ? this.userList[0].my_info.employee_.post_name : ''; + that.screenUserItem.belong_dept_name = this.userList[0].my_info.employee_.belong_dept_name ? this.userList[0].my_info.employee_.belong_dept_name : ''; }, //风险区域layer riskMaskerLayers() { @@ -1417,16 +1433,20 @@ }) }, //人员 - showUserMarkers() { + showUserMarkers(userList) { + let that = this; let iconTextMarker = null; - if(that.userList.length>0){ - let lng = [114.62923138539462,114.6315404372349];//经度 - let i=0; - iconTextMarker = that.userList[0].mac+'userMarker'; - let employee_ = that.userList[0].my_info.employee_; + if (userList.length > 0) { + let lng = [114.62923138539462, 114.6315404372349];//经度 + let i = 0; + iconTextMarker = userList[0].mac; + let employee_ = userList[0].my_info.employee_; + employee_.mac = userList[0].mac; + console.log(employee_) + debugger; that.userMarker[iconTextMarker] = new jsmap.JSIconTextMarker({ - id: that.userList[0].my_info.code, + id: userList[0].my_info.code, position: {x: 114.62923138539462, y: 38.8133418942645, z: 0}, //坐标 floorId: 1, //楼层id,默认为1(地面) image: "/img/user.png", @@ -1450,75 +1470,70 @@ }); that.userMaskerLayer.addMarker(that.userMarker[iconTextMarker]); 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: 8000,} + i = (i + 1) % 2; + that.userMaskerLayer.updateMarkerPosition(that.userMarker[iconTextMarker], { + floorId: 1, + position: {x: lng[i], y: 38.8133418942642, z: 0}, + animate: {duration: 10000,} });//动画效果,持续时间一秒 - },8500) + },11000) } - /*that.userList.forEach(item => { - if (item.my_info.code) { - let employee_ = item.my_info.employee_; - //{114.62923138539462,38.8133418942642} - iconTextMarker = new jsmap.JSIconTextMarker({ - id: item.my_info.code, - position: {x: 114.6315404372349, y: 38.813557855009435, z: 0}, //坐标 - floorId: 1, //楼层id,默认为1(地面) - image: "/img/user.png", - text: employee_.name, - font: '10px sans-serif', - fontColor: '#ffffff', - imageHeight: 25, - imageWidth: 25, - backgroundColor: 'rgba(0,0,0,0.3)', - backgroundRadius: 1, - backgroundStrokeColor: 'rgba(0,0,0,0.3)', - backgroundStrokeWidth: 1, - iconTextType: jsmap.JSIconTextType.TOPTEXT_BOTTOMICON, - allowPicking: true, - displayCondition: new jsmap.JSDisplayCondition(0.0, 1000), - nearFarScale: new jsmap.JSNearFarScale(0.0, 1, 500, 1), - show: true, - properties: { - employee: employee_ - }, - callback: (marker) => { - return employee_ - } + /*setInterval(function () { + that.refreshUserMarker(); + }, 8500)*/ + }, + //更新人员标记 + refreshUserMarker() { + let that = this; + that.$API.third.blt.all.req().then(res => { + if (res.err_msg) { + } else { + let userList = res.filter(item => { + return item.my_info.employee }); - that.userMaskerLayer.addMarker(iconTextMarker); - iconTextMarker1 = new jsmap.JSIconTextMarker({ - id: item.my_info.code, - position: {x: 114.62923138539462, y: 38.8133418942642, z: 0}, //坐标 - floorId: 1, //楼层id,默认为1(地面) - image: "/img/user.png", - text: employee_.name, - font: '10px sans-serif', - fontColor: '#ffffff', - imageHeight: 25, - imageWidth: 25, - backgroundColor: 'rgba(0,0,0,0.3)', - backgroundRadius: 1, - backgroundStrokeColor: 'rgba(0,0,0,0.3)', - backgroundStrokeWidth: 1, - iconTextType: jsmap.JSIconTextType.TOPTEXT_BOTTOMICON, - allowPicking: true, - displayCondition: new jsmap.JSDisplayCondition(0.0, 1000), - nearFarScale: new jsmap.JSNearFarScale(0.0, 1, 500, 1), - show: true, - properties: { - employee: employee_ - }, - callback: (marker) => { - return employee_ - } - }); - that.userMaskerLayer.addMarker(iconTextMarker1); + let addUser = that.func(userList, that.userList)[0]; + let refreshList = that.func(userList, that.userList)[1]; + let subUser = that.func(that.userList, userList)[0]; + that.userList = refreshList.concat(addUser);//更新userList + that.showUserMarkers(addUser);//增加新进在线员工 + //that.userMaskerLayer.removeMarker(sectorMarker)(addUser);//删除离线员工 + refreshList.forEach(item => { + that.userMaskerLayer.updateMarkerPosition(that.userMarker[item.id], { + floorId: 1, + position: {x: item.longitude, y: item.latitude, z: item.z}, + animate: {duration: 1000,} + });//动画效果,持续时间一秒 + }) } - - })*/ + }) + }, + //比较两次获取的人数的变动 func(a,b)//a与b相比多出来的 + func(arr1, arr2) { + /*var arr1 = [{name:1},{name:2},{name:3},{name:4}]; + var arr2 = [{name:2},{name:3},{name:4},{name:5}];*/ + let arr = []; + let list = []; + let bool = false; + let same = false; + for (let i = 0; i < arr1.length; i++) { + for (let j = 0; j < arr2.length; j++) { + //遇到相同直接跳出循环 + if (arr1[i].id === arr2[j].id) { + same = i; + bool = false; + break; + } else { + same = false; + bool = i; + } + } + if (same !== false) list.push(arr1[same]); + if (bool !== false) arr.push(arr1[bool]); + } + let arrList = [arr,list]; + debugger; + console.log(arrList); + return arrList; }, //危险作业 showPolygonMarkers() { @@ -1546,9 +1561,10 @@ }); this.polygonMaskerLayer.addMarker(polygonMarker); }, + //危险作业图片标记 showJobDomMarkers() { let domMarker = new jsmap.JSDomMarker({ - id: 'polygonmark', + id: 'polygonmark', position: new jsmap.JSPoint(114.63168864138028, 38.81254802029822, 0), floorId: 1, depthTest: true, @@ -1738,19 +1754,27 @@ }) }, //员工列表点击 - userRowClick(row){ + userRowClick(row) { debugger; console.log(row); let that = this; - that.screenUserItem.name=row.my_info.employee_.name; - that.screenUserItem.type=row.my_info.employee_.type; - that.screenUserItem.id=row.my_info.employee_.id; - that.screenUserItem.photo=row.my_info.employee_.photo?row.my_info.employee_.photo:''; - that.screenUserItem.post_name=row.my_info.employee_.post_name?row.my_info.employee_.post_name:''; - that.screenUserItem.belong_dept_name=row.my_info.employee_.belong_dept_name?row.my_info.employee_.belong_dept_name:''; + that.screenUserItem.name = row.my_info.employee_.name; + that.screenUserItem.type = row.my_info.employee_.type; + that.screenUserItem.id = row.my_info.employee_.id; + that.screenUserItem.photo = row.my_info.employee_.photo ? row.my_info.employee_.photo : ''; + that.screenUserItem.post_name = row.my_info.employee_.post_name ? row.my_info.employee_.post_name : ''; + that.screenUserItem.belong_dept_name = row.my_info.employee_.belong_dept_name ? row.my_info.employee_.belong_dept_name : ''; }, - userTrack(){ - + //人员追踪 + userTrack() { + this.tracking = true; + window.map.trackMarker(this.userMarker[this.screenUserItem.mac],{ + range:150 + }) + }, + userUnTrack(){ + window.map.cancelTrack(); + this.tracking = false; }, //区域/部门切换 cockpitChange(index) { @@ -2750,6 +2774,7 @@ border-radius: 4px; transition: .5s; z-index: 10; + .drop-content-item { color: #fff; position: relative; diff --git a/src/views/hrm/employee.vue b/src/views/hrm/employee.vue index 15a2bea1..d1791251 100644 --- a/src/views/hrm/employee.vue +++ b/src/views/hrm/employee.vue @@ -48,9 +48,7 @@ > 绑定证书 - + 查看 - + 编辑 - + - + { - this.bltList = res/*.filter(item=>{ - return item.my_info.code === undefined - })*/ + getBltList() { + let that = this; + that.$API.third.tdevice.list.req({type: 30, page: 0}).then(res => { + that.tdevice = res; + that.bltList = res.filter(item => { + return item.employee_ === null + }) + ; + console.log(res); + console.log(that.bltList); }) }, - handleBindBlt(type,row) { + handleBindBlt(type, row) { + this.dis = false; this.bindBltName = row.name; this.form.type = type; this.form.employee = row.id; + if(type===20){ + this.dis = true; + this.form.blt = row.blt_.id; + } this.showBindBlt = true; }, - submitBindBlt(){ - this.$API.third.tdevice.bltBind.req(this.form).then(res=>{ - this.bltList = res.filter(item=>{ - - }) + submitBindBlt() { + let that = this; + that.$API.third.tdevice.bltBind.req(this.form).then(res => { + if(res.err_msg){}else{ + that.showBindBlt = false; + that.$refs.table.refresh(); + } }) }, }, From d4b72069f2258fcb428a88c530b2062c0184f249 Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 11 Jul 2022 14:13:48 +0800 Subject: [PATCH 3/4] clearConsolelogs --- src/views/am/area_rail_form.vue | 25 +++---------------------- src/views/am/vchannel_view.vue | 29 +++++------------------------ 2 files changed, 8 insertions(+), 46 deletions(-) diff --git a/src/views/am/area_rail_form.vue b/src/views/am/area_rail_form.vue index c8964073..7c25c0d2 100644 --- a/src/views/am/area_rail_form.vue +++ b/src/views/am/area_rail_form.vue @@ -3,6 +3,7 @@ :title="areaName+'围栏设置'" v-model="visible" destroy-on-close + :size="'80%'" @closed="closeDrawer" > { - console.log('Map loadComplete!'); - var pointMarker = new jsmap.JSPointMarker({ - color: '#00FF00', //填充颜色 - size: 10, //尺寸 - position: new jsmap.JSPoint(114.628074820438, 38.8157131095379, 0), //坐标 - floorId: 2, //楼层id,默认为1(地面) - outlineColor: '#CD5C5C', //边线颜色 - outlineWidth: 2, //边线宽 - depthTest: true, //是否开启深度检测 - show: true, //是否显示 - allowPicking: true, //是否允许点击 - displayCondition: new jsmap.JSDisplayCondition(0.0, 1000), //可见范围 - nearFarScale: new jsmap.JSNearFarScale(0.0, 10.0, 500, 0.5), //比例缩放 - callback: (node) => { - console.log(node); - }//回调事件 - }); - window.map.addMarker(pointMarker); let drawTool2 = new jsmap.JSDrawToolControl({ position: jsmap.JSControlPosition.RIGHT_TOP, //画图工具在容器中的相对位置,当前为右上 offset: { @@ -133,9 +116,9 @@ drawMode: jsmap.JSDrawMode.POLYGON, //画图类型POINT:画点 POLYLINE:画线 POLYGON:画面 //画图结束的回调,返回所画的面信息 callback: (feature) => { - console.log('add', feature); + /*console.log('add', feature); console.log(feature.properties);//type:POLYGON;id:"";name:"";floorNo:"";floorId:"" - console.log(feature.geometry);//feature.geometry.coordinates:[[],[]]面数组 + console.log(feature.geometry);//feature.geometry.coordinates:[[],[]]面数组*/ this.coordinates.floorNo = feature.properties.floorNo; this.coordinates.floorId = feature.properties.floorId; that.points = feature.geometry.coordinates[0]; @@ -168,9 +151,7 @@ if(points.length>0){ that.isSaveing = true; that.coordinates.color = 'rgba(255,0,0,.4)'; - debugger; points.forEach(item=>{ - debugger; let coordinate = {x:parseFloat(item[0]),y:parseFloat(item[1])}; let pixel = tool.mapToScreenCoordinate(coordinate); pointXY.push(pixel); diff --git a/src/views/am/vchannel_view.vue b/src/views/am/vchannel_view.vue index 393262b8..9a6f721a 100644 --- a/src/views/am/vchannel_view.vue +++ b/src/views/am/vchannel_view.vue @@ -128,24 +128,7 @@ }); window.map.openMapById('0000'); window.map.on('loadComplete', e => { - console.log('Map loadComplete!'); - var pointMarker = new jsmap.JSPointMarker({ - color: '#00FF00', //填充颜色 - size: 10, //尺寸 - position: new jsmap.JSPoint(114.628074820438, 38.8157131095379, 0), //坐标 - floorId: 2, //楼层id,默认为1(地面) - outlineColor: '#CD5C5C', //边线颜色 - outlineWidth: 2, //边线宽 - depthTest: true, //是否开启深度检测 - show: true, //是否显示 - allowPicking: true, //是否允许点击 - displayCondition: new jsmap.JSDisplayCondition(0.0, 1000), //可见范围 - nearFarScale: new jsmap.JSNearFarScale(0.0, 10.0, 500, 0.5), //比例缩放 - callback: (node) => { - console.log(node); - }//回调事件 - }); - window.map.addMarker(pointMarker); + // console.log('Map loadComplete!'); var drawTool = new jsmap.JSDrawToolControl({ position: jsmap.JSControlPosition.RIGHT_TOP, //画图工具在容器中的相对位置,当前为右上 offset: { @@ -156,12 +139,10 @@ //画图结束的回调,返回所画的点的信息 callback: (feature) => { - debugger; - 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] + //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] this.form.location = feature.geometry.coordinates; - debugger; }, //移除相应点的回调,返回相应点信息 removeCallback: (feature) => { @@ -196,7 +177,7 @@ submit() { let that = this; let item = this.form.location; - console.log(this.form.location); + //console.log(this.form.location); that.form.code = that.channelCode; that.form.type = that.channelType; that.form.name = that.channelName; From 0231e6ce3233b3c72f3835cc31475669bb541dc5 Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 11 Jul 2022 17:01:43 +0800 Subject: [PATCH 4/4] thirdlogs&blt --- src/api/model/third.js | 18 ++++++++ src/config/route.js | 20 +++++--- src/views/am/blt.vue | 87 +++++++++++++++++++++++++++++++++++ src/views/bigScreen/index.vue | 57 +++++++++++++++++++++-- src/views/ops/logInfo.vue | 18 +++++--- src/views/ops/log_request.vue | 15 ++++-- src/views/ops/thirdLogs.vue | 72 +++++++++++++++++++++++++++++ 7 files changed, 267 insertions(+), 20 deletions(-) create mode 100644 src/views/am/blt.vue create mode 100644 src/views/ops/thirdLogs.vue diff --git a/src/api/model/third.js b/src/api/model/third.js index e4caabb9..0a86fbfb 100644 --- a/src/api/model/third.js +++ b/src/api/model/third.js @@ -35,6 +35,15 @@ export default { }, blt:{ + list:{ + name: "全部在线标签列表信息", + req: async function(data){ + return await http.post( + `${config.API_URL}/third/tdevice/blt/`, + data + ); + } + }, all:{ name: "全部在线标签列表信息", req: async function(data){ @@ -64,5 +73,14 @@ export default { } }, + thirdLog:{ + name: "第三方日志", + req: async function(data){ + return await http.get( + `${config.API_URL}/third/tlog/`, + data + ); + } + } } diff --git a/src/config/route.js b/src/config/route.js index 6b9fcea2..4e8aaa85 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -525,6 +525,14 @@ const routes = [ "icon": "el-icon-menu", }, "component": "am/audio" + },{ + "name": "blt", + "path": "/am/blt", + "meta": { + "title": "定位标签", + "icon": "el-icon-menu", + }, + "component": "am/blt" }, ] }, @@ -669,15 +677,15 @@ const routes = [ }, "component": "ops/log_request" }, - /*{ - "name": "monitor", - "path": "/ops/monitor", + { + "name": "thirdLogs", + "path": "/ops/thirdLogs", "meta": { - "title": "服务监控", + "title": "第三方日志", "icon": "el-icon-fold", }, - "component": "ops/monitor" - },*/ + "component": "ops/thirdLogs" + }, ] }, ] diff --git a/src/views/am/blt.vue b/src/views/am/blt.vue new file mode 100644 index 00000000..6c8e0b87 --- /dev/null +++ b/src/views/am/blt.vue @@ -0,0 +1,87 @@ + + diff --git a/src/views/bigScreen/index.vue b/src/views/bigScreen/index.vue index d6e776c2..a8d31431 100644 --- a/src/views/bigScreen/index.vue +++ b/src/views/bigScreen/index.vue @@ -833,6 +833,7 @@ userMaskerLayer: null, jobDomMarkerLayer: null, riskMarkerLayer: null,//风险区域 + areaMarkerLayer: null,//区域展示 pointMarkerLayer: null,//点位图层 polygonMaskerLayer: null,//危险作业 cameraMaskerLayer: null,//摄像头 @@ -840,6 +841,7 @@ carsMaskerLayer: null,//车辆 manMaskerLayer: null,//人员 flyManager: null, + eareMarker: null, dropIndex: '1', countIndex: '2', markList: [false, false, false, false, false, false, false], @@ -963,6 +965,8 @@ this.polygonMarkerLayers();//危险作业 this.speakersMaskerLayers();//喇叭 this.jobDomMarkerLayers();//危险作业图片 + this.areaMarkerLayers();//危险作业图片 + let compassControl = new jsmap.JSCompassControl({ position: jsmap.JSControlPosition.LEFT_TOP, offset: { @@ -979,7 +983,6 @@ } }); window.map.addControl(zoomControl); - // this.pointMaskerLayers();//点 }); window.map.on('mapClickNode', event => { let item = event; @@ -1096,9 +1099,45 @@ }, methods: { areaRowClick(data) { - this.areaDetail = true; - console.log(data); - debugger; + let that = this; + that.areaDetail = true; + // let points = data.third_info.xx_rail.detail.polygon.points[0]; + window.map.flyToPosition(new jsmap.JSPoint(114.63168864138028, 38.81254802029822, 0),{duration:1000}); + + /*debugger; + let tool = new jsmap.JSMapCoordTool(map); + let points = data.third_info.xx_rail.detail.polygon.points; + let position = [];*/ + /*for(let i=0;i {{data.path}} {{data.method}} - {{data.status_code}} + {{data.target}} + {{data.result}} + {{data.status_code}} {{data.id}} {{data.requested_at}} @@ -32,15 +34,17 @@ methods: { setData(data){ this.data = data; - // debugger; - console.log(data); let dataStr = ''; for (let i in data) { - let X = i + ':' + data[i]+'
'; + let X=''; + if(typeof data[i] ==='object'){ + let temp =JSON.stringify(data[i]); + X =''+i+''+ ':' + temp+'
'; + }else{ + X =''+i+''+ ':' + data[i]+'
'; + } dataStr += X; - console.log(i); } - console.log(dataStr); this.dataStr = dataStr; document.getElementById("logDetail").innerHTML = dataStr; } @@ -50,7 +54,7 @@