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 @@ -