personmove

This commit is contained in:
shijing 2022-07-08 17:11:45 +08:00
parent 25e0cb4b13
commit 54ea10290c
3 changed files with 354 additions and 318 deletions

View File

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

View File

@ -903,6 +903,7 @@
mark: '1',
},
LBType: '1',
userMarker:{},
}
},
created() {
@ -1062,13 +1063,6 @@
} else {
}
});
/*
* <div class="v_title" style="width: 327px;height: 45px;padding: 10px 0;font-size: 16px;font-weight: 700;color: #fff;position: relative;padding-left: 8px;display: flex;justify-content: space-between">
<div>`+event.markers[0].text+`</div><div style="width: 16px;height: 16px;background: url(.//public/img/close.png) no-repeat;background-size: 100% 100%;" @click="closeVideo"></div>
</div>
<div class="v_masker" style="width: 327px;height: 183px;background: url(.//public/img/v_mask.png) no-repeat;background-size: 100% 100%;" @click="playVideo()"></div>
<div id="`+event.markers[0].id+`"></div>
* */
//
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();
}
})
} else {
that.userMaskerLayer.show = false;
}

View File

@ -60,34 +60,46 @@
></el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="170">
<template #default="scope">
<el-button-group>
<el-button
text
type="primary"
size="small"
@click="Addcertificate(scope.row)"
>绑定证书</el-button
>绑定证书
</el-button
>
<el-button
text
type="primary"
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-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
<template #reference>
<el-button text type="danger" size="small">删除</el-button>
</template>
</el-popconfirm> -->
</el-button-group>
<el-button
v-if="scope.row.third_info.id"
text
type="primary"
size="small"
@click="handleBindBlt(20, scope.row)"
>解绑
</el-button>
<el-button
v-else
text
type="primary"
size="small"
@click="handleBindBlt(10, scope.row)"
>绑定
</el-button>
</template>
</el-table-column>
</scTable>
@ -99,10 +111,42 @@
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<el-Dialog
title="绑定定位卡"
v-model="showBindBlt"
destroy-on-close
@closed="closeDrawer"
>
<el-form
ref="dialogForm"
:model="form"
label-width="120px"
>
<el-form-item label="姓名">
{{bindBltName}}
</el-form-item>
<el-form-item label="绑定卡号">
<el-select v-model="form.blt" style="width: 100%">
<el-option
v-for="item in bltList"
:key="item.id"
:label="item.id"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button v-if="form.type===10" type="primary" @click="submitBindBlt">绑定</el-button>
<el-button v-if="form.type===20" type="primary" @click="submitBindBlt">解绑</el-button>
<el-button @click="showBindBlt = false">取消</el-button>
</template>
</el-Dialog>
</template>
<script>
import saveDialog from "./ep_form.vue";
export default {
<script>
import saveDialog from "./ep_form.vue";
export default {
name: "employee",
components: {
saveDialog,
@ -119,8 +163,19 @@ export default {
search: {
keyword: null,
},
showBindBlt: false,
bltList:[],
bindBltName:'',
form:{
type: 10,
blt:'',
employee:'',
},
};
},
mounted(){
this.getBltList();
},
methods: {
//
Addcertificate(row) {
@ -197,7 +252,8 @@ export default {
loading.close();
this.$message.success("操作成功");
})
.catch(() => {});
.catch(() => {
});
},
//
selectionChange(selection) {
@ -214,10 +270,12 @@ export default {
}, 500);
},
//
upsearch() {},
upsearch() {
},
//ID
filterTree(id) {
var target = null;
function filter(tree) {
tree.forEach((item) => {
if (item.id == id) {
@ -228,6 +286,7 @@ export default {
}
});
}
filter(this.$refs.table.tableData);
return target;
},
@ -242,6 +301,26 @@ export default {
resetQuery() {
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
})*/
})
},
};
handleBindBlt(type,row) {
this.bindBltName = row.name;
this.form.type = type;
this.form.employee = row.id;
this.showBindBlt = true;
},
submitBindBlt(){
this.$API.third.tdevice.bltBind.req(this.form).then(res=>{
this.bltList = res.filter(item=>{
})
})
},
},
};
</script>