track&line

This commit is contained in:
shijing 2022-09-23 17:12:19 +08:00
parent 72b5304b97
commit a0d2ca4068
4 changed files with 334 additions and 222 deletions

View File

@ -68,6 +68,15 @@ export default {
); );
} }
}, },
xunxiCommon:{
name: "寻息通用接口",
req: async function(data){
return await http.post(
`${config.API_URL}/third/xunxi/`,
data
);
}
},
all:{ all:{
name: "全部在线标签列表信息", name: "全部在线标签列表信息",
req: async function(data){ req: async function(data){

View File

@ -258,6 +258,7 @@
:areaId="areaId" :areaId="areaId"
:areaName="areaName" :areaName="areaName"
:areaPoints="areaPoints" :areaPoints="areaPoints"
:areaFloorId="areaFloorId"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.saveRail = false" @closed="dialog.saveRail = false"
></save-rail-dialog> ></save-rail-dialog>
@ -307,6 +308,7 @@ export default {
areaId: null, areaId: null,
areaName: "", areaName: "",
areaPoints:[], areaPoints:[],
areaFloorId:1,
cate_: { post: "岗位", org: "单位", people: "人员" }, cate_: { post: "岗位", org: "单位", people: "人员" },
}; };
}, },
@ -350,6 +352,7 @@ export default {
// console.log(row.third_info.xx_rail.detail.polygon.points); // console.log(row.third_info.xx_rail.detail.polygon.points);
if(row.third_info.xx_rail){ if(row.third_info.xx_rail){
this.areaPoints = row.third_info.xx_rail.detail.polygon.points; this.areaPoints = row.third_info.xx_rail.detail.polygon.points;
this.areaFloorId = row.third_info.xx_rail.detail.floorId;
}else{ }else{
} }

View File

@ -33,7 +33,10 @@ export default {
}, },
areaPoints: { areaPoints: {
type: Array, type: Array,
} },
areaFloorId:{
type: Number,
},
}, },
data() { data() {
return { return {
@ -45,11 +48,12 @@ export default {
floorId: 1, floorId: 1,
railName: '', railName: '',
railType: 1,//1:0 railType: 1,//1:0
mapType: 1,//2xy1 mapType: 2,//2xy1
color: '1', color: '1',
polygon: { polygon: {
points: [] points: []
} },
remark:'围栏'
}, },
points: [], points: [],
areaMarkerLayer: null, areaMarkerLayer: null,
@ -105,7 +109,7 @@ export default {
console.log(feature.properties);//type:POLYGON;id:"";name:"";floorNo:"";floorId:"" 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.floorId = feature.properties.floorId; this.coordinates.floorId = feature.properties.floorId;
this.coordinates.floorNo = feature.properties.floorNo == '室外' ? 'Floor1' : feature.properties.floorNo; this.coordinates.floorNo = feature.properties.floorNo == '室外' ? 'Floor1' : 'Floor'+feature.properties.floorId;
// this.coordinates.floorId = feature.properties.floorId; // this.coordinates.floorId = feature.properties.floorId;
that.points = feature.geometry.coordinates[0]; that.points = feature.geometry.coordinates[0];
}, },
@ -155,18 +159,27 @@ export default {
}, },
// //
areaMarkerLayers() { areaMarkerLayers() {
debugger;
let that = this; let that = this;
let areaPoints = []; let areaPoints = [];
that.areaPoints.forEach(item => { that.areaPoints.forEach(item => {
console.log(item) //console.log(item)
let point = new jsmap.JSPoint(Number(item.x), Number(item.y), 0); let point = null;
if(item.x){
point = new jsmap.JSPoint(Number(item.x), Number(item.y), 0);
}else{
point = new jsmap.JSPoint(Number(item.longitude), Number(item.latitude), 0);
}
areaPoints.push(point) areaPoints.push(point)
}) })
debugger;
console.log(that.areaId);
console.log(areaPoints);
console.log(that.areaFloorId);
console.log('00000');
var polygonMarker = new jsmap.JSPolygonMarker({ var polygonMarker = new jsmap.JSPolygonMarker({
id: that.areaId,//id id: that.areaId,//id
position: areaPoints,// position: areaPoints,//
floorId: 1,//id floorId: that.areaFloorId,//id
color: 'rgba(0,0,255,.44)',// color: 'rgba(0,0,255,.44)',//
strokeColor: 'rgba(0,0,255,.44)',//线 strokeColor: 'rgba(0,0,255,.44)',//线
depthTest: false,// depthTest: false,//
@ -190,7 +203,7 @@ export default {
that.isSaveing = true; that.isSaveing = true;
that.coordinates.color = 'rgba(255,0,0,.4)'; that.coordinates.color = 'rgba(255,0,0,.4)';
points.forEach(item => { points.forEach(item => {
let pixel = { x: parseFloat(item[0]), y: parseFloat(item[1]) }; let pixel = {longitude:parseFloat(item[0]),latitude:parseFloat(item[1])};
pointXY.push(pixel); pointXY.push(pixel);
}); });
that.coordinates.polygon.points = pointXY; that.coordinates.polygon.points = pointXY;

View File

@ -51,7 +51,7 @@
</div> </div>
<div class="drop-content" v-if="showUserSelect"> <div class="drop-content" v-if="showUserSelect">
<el-tree ref="group" id="bigScreenTree" node-key="id" :data="postList" show-checkbox <el-tree ref="group" id="bigScreenTree" node-key="id" :data="postList" show-checkbox
:current-node-key="''" :highlight-current="true" :expand-on-click-node="false" :current-node-key="''" :highlight-current="true" :expand-on-click-node="true"
@node-click="groupClick"></el-tree> @node-click="groupClick"></el-tree>
<el-button type="primary" @click="userFilter">查看</el-button> <el-button type="primary" @click="userFilter">查看</el-button>
@ -75,7 +75,7 @@
</div> </div>
</div> </div>
</div> </div>
<!--人员统计--> <!--人员统计/事件统计/部门统计-->
<div class="screen-cockpit"> <div class="screen-cockpit">
<div class="cockpit-count"> <div class="cockpit-count">
<div class="divider"></div> <div class="divider"></div>
@ -268,8 +268,9 @@
<el-table-column label="唯一标识" prop="code"></el-table-column> <el-table-column label="唯一标识" prop="code"></el-table-column>
</el-table> </el-table>
<el-table class="bigScreenTable" :data="areaUser" v-if="areaShowType==4"> <el-table class="bigScreenTable" :data="areaUser" v-if="areaShowType==4">
<el-table-column label="人员姓名"></el-table-column> <el-table-column label="人员姓名" prop="my_info.employee_.name"></el-table-column>
<el-table-column label="定位卡号"></el-table-column> <el-table-column label="人员姓名" prop="my_info.employee_.type"></el-table-column>
<el-table-column label="定位卡号" prop="mac"></el-table-column>
</el-table> </el-table>
</div> </div>
</div> </div>
@ -412,11 +413,14 @@
<span class="trackImg"></span> <span class="trackImg"></span>
<span>跟踪</span> <span>跟踪</span>
</div> </div>
<div v-if="!lineTracking" class="simple-btn-bg btn-item" @click="userLineTrack">
<div class="simple-btn-bg btn-item">
<span class="viewImg"></span> <span class="viewImg"></span>
<span>轨迹</span> <span>轨迹</span>
</div> </div>
<div v-else class="simple-btn-bg btn-item" @click="userLineTrackCancel">
<span class="viewImg"></span>
<span>取消轨迹</span>
</div>
</div> </div>
<div class="screen-per-list"> <div class="screen-per-list">
<el-table :data="userList" style="width: 100%" :row-key="row => { return row.id }" <el-table :data="userList" style="width: 100%" :row-key="row => { return row.id }"
@ -736,6 +740,9 @@
</div> </div>
</div> </div>
<audio id="audio" :src="audioSrc" autoplay @ended="audioFinished" preload>
对不起您的浏览器不支持HTML5音频播放
</audio>
</div> </div>
</template> </template>
<script> <script>
@ -744,8 +751,13 @@ import sysConfig from "@/config";
export default { export default {
data() { data() {
return { return {
line1:null,
music:null,
timerUser: null, timerUser: null,
timerTime: null, timerTime: null,
eventTimer:null,
eventAudioTimer:null,
trackMarker:null,
domMarkerLayer: null, domMarkerLayer: null,
userMaskerLayer: null, userMaskerLayer: null,
jobDomMarkerLayer: null, jobDomMarkerLayer: null,
@ -765,11 +777,12 @@ export default {
markList: [false, false, false, false, false, false], markList: [false, false, false, false, false, false],
autoRun: false, autoRun: false,
tracking: false, tracking: false,
lineTracking:false,
areaDetail: false, areaDetail: false,
screenJob: false, screenJob: false,
screenUser: false, screenUser: false,
screenRisk: false, screenRisk: false,
speakerPlayStatus:false, speakerPlayStatus:true,
screenWarning: false, screenWarning: false,
screenUserDetail: false, screenUserDetail: false,
warningTypeShow: false, warningTypeShow: false,
@ -801,10 +814,9 @@ export default {
deptList: [],// deptList: [],//
postList: [ postList: [
{id:0,name:'全部',label:'全部'}, {id:0,name:'全部',label:'全部'},
{id:1,name:'正式员工',label:'正式员工'}, {id:1,name:'曲阳金隅',label:'曲阳金隅'},
{id:2,name:'相关方',label:'相关方'}, {id:2,name:'访客',label:'访客'},
{id:3,name:'访客',label:'访客'}, {id:3,name:'司机',label:'司机'}],//
{id:4,name:'司机',label:'司机'}],//
dangerList: [],// dangerList: [],//
areaList: [],/// areaList: [],///
areaOperation:[], areaOperation:[],
@ -866,6 +878,10 @@ export default {
40:'重大风险' 40:'重大风险'
}, },
eventTypeName:'全部', eventTypeName:'全部',
audioSrc:'',
audioIndex:0,
audioList:{},
} }
}, },
created() { created() {
@ -875,14 +891,11 @@ export default {
document.head.appendChild(scriptInfo) document.head.appendChild(scriptInfo)
}, },
mounted() { mounted() {
debugger;
let timeeee= '2022-09-20 16:00:00';
console.log(new Date( timeeee ).getTime());
debugger;
let that = this; let that = this;
let date = new Date(); let date = new Date();
that.timeNow = date.getDay(); that.timeNow = date.getDay();
that.todayDate = this.warningData.params.start_create = this.cateAggForm.start_create = this.$TOOL.dateFormat(new Date(), 'yyyy-MM-dd'); that.todayDate = this.warningData.params.start_create = this.cateAggForm.start_create = this.$TOOL.dateFormat(new Date(), 'yyyy-MM-dd');
that.music = document.getElementById("audio");
that.showTime(); that.showTime();
that.timerTime = setInterval(() => { that.timerTime = setInterval(() => {
that.showTime(); that.showTime();
@ -955,8 +968,6 @@ export default {
let areaId = item.properties.get("areaId"); let areaId = item.properties.get("areaId");
console.log(areaId); console.log(areaId);
that.$API.am.area.item.req(areaId).then(res=>{ that.$API.am.area.item.req(areaId).then(res=>{
// debugger;
console.log(res);
that.areaItemDetail = res; that.areaItemDetail = res;
that.screenJob = false; that.screenJob = false;
that.screenWarning = false; that.screenWarning = false;
@ -1035,7 +1046,7 @@ export default {
// //
that.screenUserItem = item.properties.get("employee"); that.screenUserItem = item.properties.get("employee");
that.screenUser = true; that.screenUser = true;
debugger; // debugger;
window.map.flyToMarker(that.userMarker[that.screenUserItem.mac], { window.map.flyToMarker(that.userMarker[that.screenUserItem.mac], {
duration: 1000 duration: 1000
}) })
@ -1057,7 +1068,6 @@ export default {
this.getGroup();//$$ this.getGroup();//$$
// //
this.getDangers();//$$ this.getDangers();//$$
// this.getAllPost();//
this.getWarningTotal();// this.getWarningTotal();//
this.getWarningType();// this.getWarningType();//
let pageHeight = document.getElementsByClassName('screen-cockpit')[0].clientHeight; let pageHeight = document.getElementsByClassName('screen-cockpit')[0].clientHeight;
@ -1070,13 +1080,32 @@ export default {
document.getElementsByClassName('cockpit-info')[0].style.height = domHeight + 'px'; document.getElementsByClassName('cockpit-info')[0].style.height = domHeight + 'px';
// document.getElementsByClassName('area-info-body')[0].style.height = simpleBodyHeight + 'px'; // document.getElementsByClassName('area-info-body')[0].style.height = simpleBodyHeight + 'px';
}, },
computed:{
bgmSrc:function(){
return this.audioList[this.audioIndex]
}
},
beforeUnmount(){ beforeUnmount(){
window.map.destroy(); window.map.destroy();
window.map = null; window.map = null;
clearInterval(this.timerUser) this.timerUser = null;
clearInterval(this.timerTime) this.timerTime = null;
this.eventTimer = null;
this.eventAudioTimer = null;
window.map.destroy();
clearInterval(this.timerUser)//
clearInterval(this.timerTime)//
clearInterval(this.eventTimer)//
clearInterval(this.eventAudioTimer)//
}, },
methods: { methods: {
audioFinished(){
if(this.audioIndex<this.audioList.length){
this.audioIndex++;
}else{
this.audioIndex = 0;
}
},
showTime() { showTime() {
this.currentTime = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss'); this.currentTime = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss');
this.currentWeek = this.$TOOL.dateFormat(new Date(), 'week'); this.currentWeek = this.$TOOL.dateFormat(new Date(), 'week');
@ -1099,7 +1128,20 @@ export default {
} }
}, },
// //
getWarningTotal() { getWarningTotal() {
let that = this;
that.getEventTotal();
that.getNewEvent();
clearInterval(that.eventTimer);
that.eventTimer = setInterval(function () {
that.getEventTotal();
}, 60000)
clearInterval(that.eventAudioTimer);
that.eventAudioTimer = setInterval(function () {
that.getNewEvent();
}, 20000)
},
getEventTotal(){
let that = this; let that = this;
that.$API.ecm.event.cateAgg.req(that.cateAggForm).then(res => { that.$API.ecm.event.cateAgg.req(that.cateAggForm).then(res => {
if (res.err_msg) { } else { if (res.err_msg) { } else {
@ -1107,29 +1149,92 @@ export default {
} }
}) })
}, },
getNewEvent(){
let that = this;
that.$API.ecm.event.list.req({page_size:1}).then(res => {
if (res.err_msg) {
} else {
// debugger;
console.log('00000000000000');
console.log(res.results[0].id);
console.log(that.audioList.id);
let judge = res.results[0].id==that.audioList.id
console.log(judge);
console.log('11111111111111');
let item = res.results[0];
if(that.audioSrc!==''){
if(item.id==that.audioList.id){
// that.music.pause(); //
}else{
// debugger;
that.audioList = item;
that.audioSrc=item.voice_f;
// that.music.play();//
if(item.location){
window.map.flyToPosition(new jsmap.JSPoint(item.location.longitude, item.location.latitude), { duration: 1000 });
}
}
}else{
that.audioList = item;
that.audioSrc = item.voice_f;
that.music.play();//
}
}
})
},
// //
getWarningType() { getWarningType() {
let that = this; let that = this;
that.$API.ecm.event_cate.list.req().then(res => { that.$API.ecm.event_cate.list.req().then(res => {
if (res.err_msg) { } else { if (res.err_msg) { } else {
that.warningTypes = res.results; that.warningTypes = res.results;
} }
}) })
}, },
warningTypeChange(){ warningTypeChange(){
this.warningTypeShow = !this.warningTypeShow this.warningTypeShow = !this.warningTypeShow
}, },
handleCurrentChange() {
this.getWarnings();
},
//
getWarnings() {
this.$API.ecm.event.list.req(this.warningData.params).then(res => {
if (res.err_msg) {
} else {
this.warningData.list = res.results;
this.warningData.total = res.count;
}
})
},
//
warningTypeSelected(id,name) {
// debugger;
let that = this;
this.warningTypeShow = false;
let params = new Object();
params = that.warningData.params;
if (id !== null) {
params.cates = id;
}
this.eventTypeName = name;
that.$API.ecm.event.list.req(params).then(res => {
if (res.err_msg) { } else {
that.warningData.list = res.results;
that.warningData.total = res.count;
}
})
//
},
// //
areaRowClick(data) { areaRowClick(data) {
let that = this; let that = this;
that.areaDetail = true; that.areaDetail = true;
that.areaDetailId = data.id; that.areaDetailId = data.id;
this.getAreaOperation(); this.getAreaOperation();
// debugger;
console.log(data);
let points = data.third_info.xx_rail.detail.polygon.points[0]; 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 }); window.map.flyToPosition(new jsmap.JSPoint(points.x, points.y, points.z), { duration: 1000 });
}, },
// //
getAreaOperation(){ getAreaOperation(){
@ -1160,10 +1265,11 @@ export default {
let that = this; let that = this;
that.$API.third.blt.all.req({area:that.areaDetailId}).then(res=>{ that.$API.third.blt.all.req({area:that.areaDetailId}).then(res=>{
console.log(res) console.log(res)
that.areaUser = res; that.areaUser = res.filter(item=>{
return item.my_info.employee;
});
}) })
}, },
// //
getGroup() { getGroup() {
let that = this; let that = this;
@ -1173,33 +1279,27 @@ export default {
let rpartsList=[]; let rpartsList=[];
let arr = []; let arr = [];
let children = genTree(res); let children = genTree(res);
// debugger;
// console.log(children)
for (let i = 0; i < 5; i++) { for (let i = 0; i < 5; i++) {
let obj = new Object(); let obj = new Object();
if (i === 0) { if (i === 0) {
obj.id = 0; obj.id = 0;
obj.name = '全部'; obj.name = '全部';
obj.label = '全部'; obj.label = '全部';
} else if (i === 1) { } else if (i === 1) {
obj.id = 1; obj = children[0];
obj.name = '正式员工'; } else if (i === 2) {
obj.label = '正式员工'; obj.id = 2;
obj.children = children; obj.name = '访客';
} else if (i === 2) { obj.label = '访客';
obj.id = 2; }else if (i === 3) {
obj.name = '相关方'; obj.id = 3;
obj.label = '相关方'; obj.name = '司机';
obj.children = rpartsList; obj.label = '司机';
} else if (i === 3) { }
obj.id = 3; arr.push(obj)
obj.name = '访客';
obj.label = '访客';
}else if (i === 4) {
obj.id = 4;
obj.name = '司机';
obj.label = '司机';
} }
arr.push(obj)
}
that.postList = arr; that.postList = arr;
} }
}); });
@ -1283,8 +1383,6 @@ export default {
/// ///
getAreas() { getAreas() {
let that = this; let that = this;
// let areaList = that.$TOOL.data.get('qyjyAreaList');
that.$API.am.area.list.req({page:0}).then(res => { that.$API.am.area.list.req({page:0}).then(res => {
if (res.err_msg) { if (res.err_msg) {
} else { } else {
@ -1292,7 +1390,6 @@ export default {
that.showRiskMarkers(that.areaList); that.showRiskMarkers(that.areaList);
} }
}) })
}, },
//线 //线
getAllMen() { getAllMen() {
@ -1307,45 +1404,11 @@ export default {
} }
}) })
}, },
handleCurrentChange() {
this.getWarnings();
},
//
getWarnings() {
this.$API.ecm.event.list.req(this.warningData.params).then(res => {
if (res.err_msg) {
} else {
// debugger;
this.warningData.list = res.results.filter(item => {
return item.handle_user === null;
});
this.warningData.total = res.count;
}
})
},
//
warningTypeSelected(id,name) {
// debugger;
let that = this;
this.warningTypeShow = false;
let params = new Object();
params = that.warningData.params;
if (id !== null) {
params.cates = id;
}
this.eventTypeName = name;
that.$API.ecm.event.list.req(params).then(res => {
if (res.err_msg) { } else {
that.warningData.list = res.results;
that.warningData.total = res.count;
}
})
//
},
// //
groupClick(data) { groupClick(data) {
// console.log(data); debugger;
console.log(data);
}, },
// //
showUserDetail() { showUserDetail() {
@ -1430,20 +1493,6 @@ export default {
}); });
window.map.addLayer(that.userMaskerLayer); 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(); that.getAllMen();
}, },
//layer //layer
@ -1554,7 +1603,7 @@ export default {
} }
}); });
// debugger; // debugger;
console.log(that.cameraMaskerLayer) // console.log(that.cameraMaskerLayer)
that.cameraMaskerLayer.addMarker(cameraMarker); that.cameraMaskerLayer.addMarker(cameraMarker);
} }
}) })
@ -1596,85 +1645,8 @@ 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) { 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; let that = this;
// //
let userImage = ''; let userImage = '';
@ -1692,11 +1664,24 @@ export default {
}else { }else {
userImage = "/img/visitor.png" userImage = "/img/visitor.png"
} }
// debugger;
// console.log(item);
let floorId = 1;
if(item.floorNo=='Floor1'){
floorId = 1;
}else if(item.floorNo=='Floor2'){
floorId = 2;
}else if(item.floorNo=='Floor3'){
floorId = 3;
}else if(item.floorNo=='Floor4'){
floorId = 4;
}else if(item.floorNo=='Floor5'){
floorId = 5;
}
that.userMarker[item.mac] = new jsmap.JSIconTextMarker({ that.userMarker[item.mac] = new jsmap.JSIconTextMarker({
id: item.my_info.code, id: item.my_info.code,
position: { x:item.longitude, y: item.latitude, z: item.z }, // position: { x:item.longitude, y: item.latitude, z: item.z }, //
floorId: 1, //id,1 floorId: floorId, //id,1
image: userImage, image: userImage,
text: employee_.name, text: employee_.name,
font: '10px sans-serif', font: '10px sans-serif',
@ -1716,16 +1701,6 @@ export default {
employee: employee_ employee: employee_
}, },
callback: (marker) => { 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]); that.userMaskerLayer.addMarker(that.userMarker[item.mac]);
@ -1734,7 +1709,7 @@ export default {
clearInterval(that.timerUser); clearInterval(that.timerUser);
that.timerUser = setInterval(function () { that.timerUser = setInterval(function () {
that.refreshUserMarker(); that.refreshUserMarker();
}, 5000) }, 10000)
}, },
// //
refreshUserMarker() { refreshUserMarker() {
@ -1757,10 +1732,12 @@ export default {
//that.userMaskerLayer.removeMarker(sectorMarker)(addUser);//线 //that.userMaskerLayer.removeMarker(sectorMarker)(addUser);//线
refreshList.forEach(item1 => { refreshList.forEach(item1 => {
// debugger; // debugger;
console.log(item1) // console.log(item1)
that.userMaskerLayer.updateMarkerPosition(that.userMarker[item1.mac], { let item2 = {};
item2={...item1};
that.userMaskerLayer.updateMarkerPosition(that.userMarker[item2.mac], {
floorId: 1, floorId: 1,
position: { x: item1.longitude, y: item1.latitude, z: item1.z }, position: { x: item2.longitude, y: item2.latitude, z: item2.z },
animate: { duration: 10000, } animate: { duration: 10000, }
});//, });//,
}) })
@ -1792,7 +1769,7 @@ export default {
} }
let arrList = [arr, list]; let arrList = [arr, list];
// debugger; // debugger;
console.log(arrList); // console.log(arrList);
return arrList; return arrList;
}, },
// //
@ -2042,23 +2019,126 @@ export default {
range: 150 range: 150
}) })
}, },
//
userUnTrack() { userUnTrack() {
window.map.cancelTrack(); window.map.cancelTrack();
this.tracking = false; this.tracking = false;
}, },
//
userLineTrack(){
let that = this;
that.lineTracking = true;
that.userMaskerLayer.show = false;
let nowTime = new Date().getTime();
let preTime = nowTime-30*60 * 1000;
let params = {
url:"/api/datacenter/user/historypathV2",
method:"post",
json:{
mac: that.screenUserItem.mac,
startTime: preTime,
endTime: nowTime,
locationType: "real"
}
};
let points0 = [];
that.$API.third.blt.xunxiCommon.req(params).then(res => {
if (res.err_msg) { } else {
let points = [];
res.forEach(item=>{
item.points.forEach(poi=>{
points.push(poi)
})
})
points.forEach(item=>{
let obj=new Object();
obj.x=item.longitude;
obj.y=item.latitude;
obj.z=item.z;
points0.push(obj);
});
debugger;
console.log(points0)
if(points0.length>0){
that.line1 = null;
if (that.line1==null) {
that.line1 = new jsmap.JSLineMarker({
position: points0,
floorId: 1,
lineType: jsmap.JSLineType.ARROW,
color: '#0000ff',
width: 10,
depthTest: true
});
window.map.addMarker(that.line1);
}
that.trackMarker = new jsmap.JSIconTextMarker({
id: '1',
position: points0[0],
image: "/img/visitor.png",
rotation: {
rx: 0,
ry: 0,
rz: -90
},
text: that.screenUserItem.name,
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: 'trackMarker'
},
callback: (marker) => {
window.map.trackMarker(marker, {
range: 40,
tilt: 60,
rotate: 310
});
for (let i = 1; i < points0.length; i++) {
setTimeout(() => {
window.map.updateMarkerPosition(marker, {
position: points0[i],
animate: {
duration: 1000,
update: (pos) => {
that.line1.trace(pos)
}
}
});
}, i * 1000);
}
}
});
window.map.addMarker(that.trackMarker);
}else{
that.$message.error('暂无运动痕迹');
}
}
})
},
userLineTrackCancel(){
let that = this;
that.lineTracking = false;
that.userMaskerLayer.show = true;
window.map.cancelTrack();
window.map.removeMarker(that.trackMarker);
window.map.removeAllPointMarker();
window.map.removeMarker(that.line1);
window.map.removeAllLineMarker();
that.trackMarker = null;
that.line1 = null;
},
/// ///
cockpitChange(index) { cockpitChange(index) {
this.LBType = index; this.LBType = index;
}, },
/*pointMaskerLayers() {//
this.pointMarkerLayer = new jsmap.JSPointMarkerLayer({
minimumLevel: 3,
maxmumLevel: 22,
show: false
});
window.map.addLayer(this.pointMarkerLayer);
this.showPointMarkers();
},*/
// //
changeDropIndex(index) { changeDropIndex(index) {
let that = this; let that = this;
@ -2072,9 +2152,12 @@ export default {
}, },
speakerPasue(){ speakerPasue(){
this.speakerPlayStatus = false; this.speakerPlayStatus = false;
this.music.pause(); //
}, },
speakerPlay(){ speakerPlay(){
this.speakerPlayStatus = true; this.speakerPlayStatus = true;
// this.music.src = this.warningData.list[0].voice_f;
this.music.play();//
}, },
}, },
unmounted() { unmounted() {
@ -3672,4 +3755,8 @@ export default {
.bigScreenTable.el-table .el-table__body tr.current-row>td.el-table__cell { .bigScreenTable.el-table .el-table__body tr.current-row>td.el-table__cell {
background-color: rgba(255, 255, 255, .1); background-color: rgba(255, 255, 255, .1);
} }
#audio{
position: fixed;
opacity: 0;
}
</style> </style>