track&bindblt

This commit is contained in:
shijing 2022-07-11 13:35:17 +08:00
parent 01084c4f5b
commit cfd0f4df95
2 changed files with 183 additions and 149 deletions

View File

@ -119,7 +119,8 @@
<div class="item-info">
<div title="员工" class="normal">内部员工</div>
<div class="bottom">
<span class="large">{{userCount.count_employee}}</span>&nbsp;<span class="normal"></span>
<span class="large">{{userCount.count_employee}}</span>&nbsp;<span
class="normal"></span>
</div>
</div>
</div>
@ -127,7 +128,8 @@
<div class="item-img item-img1"></div>
<div class="item-info">
<div title="外来人员" class="normal">访客</div>
<div class="bottom"><span class="large">{{userCount.count_visitor}}</span>&nbsp;<span class="normal"></span>
<div class="bottom"><span class="large">{{userCount.count_visitor}}</span>&nbsp;<span
class="normal"></span>
</div>
</div>
</div>
@ -136,7 +138,8 @@
<div class="item-info">
<div title="承包商" class="normal">相关方</div>
<div class="bottom">
<span class="large">{{userCount.count_remployee}}</span>&nbsp;<span class="normal"></span>
<span class="large">{{userCount.count_remployee}}</span>&nbsp;<span
class="normal"></span>
</div>
</div>
</div>
@ -488,10 +491,15 @@
</div>
</div>
<div class="basic-btn-group">
<div class="danger-btn-bg btn-item" @click="userTrack">
<div v-if="tracking" class="danger-btn-bg btn-item" @click="userUnTrack">
<span class="trackImg"></span>
<span>取消跟踪</span>
</div>
<div v-else class="danger-btn-bg btn-item" @click="userTrack">
<span class="trackImg"></span>
<span>跟踪</span>
</div>
<div class="simple-btn-bg btn-item">
<span class="viewImg"></span>
<span>轨迹</span>
@ -519,7 +527,8 @@
</el-table-column>
<el-table-column label="岗位">
<template #default="scope">
<span v-if="scope.row.my_info.employee_">{{scope.row.my_info.employee_.post_name}}</span>
<span
v-if="scope.row.my_info.employee_">{{scope.row.my_info.employee_.post_name}}</span>
</template>
</el-table-column>
</el-table>
@ -835,6 +844,7 @@
countIndex: '2',
markList: [false, false, false, false, false, false, false],
autoRun: false,
tracking: false,
areaDetail: false,
screenJob: false,
screenUser: false,
@ -1051,6 +1061,10 @@
//
that.screenUserItem = item.properties.get("employee");
that.screenUser = true;
debugger;
window.map.flyToMarker(that.userMarker[that.screenUserItem.mac],{
duration:1000
})
}
}
@ -1081,8 +1095,10 @@
},
methods: {
areaRowClick(){
areaRowClick(data) {
this.areaDetail = true;
console.log(data);
debugger;
},
//
getAllPost() {
@ -1180,7 +1196,7 @@
that.userList = res.filter(item => {
return item.my_info.employee
});
that.showUserMarkers();
that.showUserMarkers(that.userList);
}
})
},
@ -1417,16 +1433,20 @@
})
},
//
showUserMarkers() {
showUserMarkers(userList) {
let that = this;
let iconTextMarker = null;
if(that.userList.length>0){
if (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 = 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",
@ -1454,71 +1474,66 @@
that.userMaskerLayer.updateMarkerPosition(that.userMarker[iconTextMarker], {
floorId: 1,
position: {x: lng[i], y: 38.8133418942642, z: 0},
animate: {duration: 8000,}
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_
/*setInterval(function () {
that.refreshUserMarker();
}, 8500)*/
},
callback: (marker) => {
return employee_
}
//
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_
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,}
});//,
})
}
})
},
callback: (marker) => {
return employee_
// func(a,b)//ab
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;
}
});
that.userMaskerLayer.addMarker(iconTextMarker1);
}
})*/
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,6 +1561,7 @@
});
this.polygonMaskerLayer.addMarker(polygonMarker);
},
//
showJobDomMarkers() {
let domMarker = new jsmap.JSDomMarker({
id: 'polygonmark',
@ -1749,8 +1765,16 @@
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() {
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;

View File

@ -48,9 +48,7 @@
></el-table-column>
<el-table-column label="部门" prop="belong_dept" width="180">
<template #default="scope">
<span v-if="scope.row.belong_dept_">{{
scope.row.belong_dept_.name
}}</span>
<span v-if="scope.row.belong_dept_">{{scope.row.belong_dept_.name}}</span>
</template>
</el-table-column>
<el-table-column
@ -66,26 +64,23 @@
size="small"
@click="Addcertificate(scope.row)"
>绑定证书
</el-button
>
</el-button>
<el-button
text
type="success"
size="small"
@click="handleForm('show', scope.row)"
>查看
</el-button
>
</el-button>
<el-button
text
type="warning"
size="small"
@click="handleForm('edit', scope.row)"
>编辑
</el-button
>
</el-button>
<el-button
v-if="scope.row.third_info.id"
v-if="scope.row.blt_"
text
type="primary"
size="small"
@ -126,7 +121,7 @@
{{bindBltName}}
</el-form-item>
<el-form-item label="绑定卡号">
<el-select v-model="form.blt" style="width: 100%">
<el-select v-model="form.blt" style="width: 100%" :disabled="dis">
<el-option
v-for="item in bltList"
:key="item.id"
@ -159,10 +154,12 @@
},
apiObj: this.$API.hrm.employee.list,
query: {},
tdevice: [],
selection: [],
search: {
keyword: null,
},
dis: false,
showBindBlt: false,
bltList: [],
bindBltName: '',
@ -302,23 +299,35 @@
this.query = {};
},
getBltList() {
this.$API.third.tdevice.list.req({type:30,page:0}).then(res=>{
this.bltList = res/*.filter(item=>{
return item.my_info.code === undefined
})*/
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) {
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=>{
})
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();
}
})
},
},