<template>
|
<div class="historyBox">
|
<div class="colseBtn">
|
<img class="searchBtn" @click="close" src="@/assets/closeinput1.png" />
|
</div>
|
<div class="listBox">
|
<ul>
|
<li
|
v-for="(item, index) in arr"
|
:key="index"
|
@click="changeLeftMap(item)"
|
:class="{ active: currentValue == item }"
|
>
|
<span>
|
{{ item }}
|
</span>
|
</li>
|
</ul>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import _GLOBAL from "@/assets/GLOBAL";
|
import store from "@/utils/store2";
|
import { addHistoryLayer } from "@/utils/tool";
|
export default {
|
name: "historyBox",
|
components: {},
|
data() {
|
return {
|
arr: [
|
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
|
2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021,
|
],
|
currentValue: 2021,
|
};
|
},
|
mounted() {
|
store.setNavigatorShow(false);
|
store.setMapToolShow(false);
|
// window.mapapi.getView().setCenter(ol.proj.fromLonLat([4.606512, 2.621472]));
|
window.mapapi.getView().setCenter(ol.proj.fromLonLat([116.505348, 39.795592]));
|
addHistoryLayer(this.currentValue);
|
if (_GLOBAL.GPSMarker) {
|
window.mapapi.removeLayer(_GLOBAL.GPSMarker);
|
}
|
},
|
methods: {
|
changeLeftMap(item) {
|
this.currentValue = item;
|
addHistoryLayer(this.currentValue);
|
},
|
close() {
|
store.setHistoryShow(false);
|
window.mapapi.removeLayer(this.$global.historyLayer);
|
window.mapapi.getView().setCenter(ol.proj.fromLonLat([116.505348, 39.795592]));
|
store.setNavigatorShow(true);
|
store.setMapToolShow(true);
|
},
|
},
|
};
|
</script>
|
<style scoped>
|
.colseBtn {
|
position: absolute;
|
top: 20px;
|
right: 9px;
|
}
|
|
.searchBtn {
|
width: 0.4rem;
|
/* height: 40px; */
|
}
|
|
.listBox {
|
position: absolute;
|
right: 10px;
|
bottom: 18px;
|
width: 48px;
|
background: #ffffff;
|
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.21);
|
border-radius: 13px;
|
}
|
|
.listBox ul {
|
margin-top: 3px;
|
}
|
.listBox li {
|
font-weight: bold;
|
font-size: 0.12rem;
|
line-height: 0.25rem;
|
color: #1c222f;
|
border-bottom: 1px solid #e5e5e5;
|
text-align: center;
|
}
|
.listBox li:last-child {
|
border: none;
|
}
|
|
.listBox li:hover {
|
/* background-color: #00e1ff; */
|
color: #127dff;
|
}
|
|
|
.active {
|
/* background-color: #4590d7; */
|
color: #127dff;
|
}
|
</style>
|