This commit is contained in:
parent
8768cd61f9
commit
b761c4fdc7
|
@ -41,6 +41,7 @@ import {
|
|||
resume,
|
||||
liaisonMan,
|
||||
} from "../../api/user";
|
||||
import { notice } from '../../assets/js/notice';
|
||||
|
||||
export default {
|
||||
name: "datav",
|
||||
|
@ -56,6 +57,8 @@ export default {
|
|||
name: "全部",
|
||||
},
|
||||
member_list: [],
|
||||
markers: [],
|
||||
polyline: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -115,7 +118,7 @@ export default {
|
|||
// 添加标记点
|
||||
res.data.forEach((item) => {
|
||||
if (item.positioning) {
|
||||
new AMap.Marker({
|
||||
let marker = new AMap.Marker({
|
||||
position: item.positioning.split(","),
|
||||
map: this.map,
|
||||
content: `
|
||||
|
@ -133,12 +136,15 @@ export default {
|
|||
`,
|
||||
offset: new AMap.Pixel(-20, -20),
|
||||
});
|
||||
this.markers.push(marker);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
initList() {
|
||||
if(!this.now_user.member_code||!this.now_date) return;
|
||||
this.map.remove(this.markers);
|
||||
if(this.polyline)this.polyline.setMap(null);
|
||||
positioningMember({
|
||||
code: this.now_user.member_code,
|
||||
date: this.formatDate(new Date(this.now_date||Date.now())),
|
||||
|
@ -147,10 +153,9 @@ export default {
|
|||
return item.split(",");
|
||||
})||[];
|
||||
|
||||
if(path.length==0)return;
|
||||
|
||||
if(path.length==0) return notice({title: '该成员当日无轨迹信息'}, 'error', 3000);
|
||||
// 绘制轨迹
|
||||
let polyline = new AMap.Polyline({
|
||||
this.polyline = new AMap.Polyline({
|
||||
path: path,
|
||||
strokeColor: "#52c41a",
|
||||
strokeWeight: 5,
|
||||
|
@ -158,7 +163,10 @@ export default {
|
|||
strokeStyle: "solid",
|
||||
zIndex: 50,
|
||||
});
|
||||
polyline.setMap(this.map);
|
||||
this.polyline.setMap(this.map);
|
||||
}).catch(err=>{
|
||||
console.log(err);
|
||||
return notice({title: '该成员当日无轨迹信息'}, 'error', 3000);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
</ul>
|
||||
</section>
|
||||
<div class="project-nav-footer">
|
||||
<a class="footer-item" @click.stop="addTask()">
|
||||
<a class="footer-item" v-if="userInfo.authorize!=4" @click.stop="addTask()">
|
||||
<a-icon type="plus-circle"></a-icon>
|
||||
<span> 创建任务</span>
|
||||
</a>
|
||||
|
|
Loading…
Reference in New Issue