1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
| <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 }"
| >
| {{ item }}
| </li>
| </ul>
| </div>
| </div>
| </template>
|
| <script>
| 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([4.606512, 2.621472]);
| addHistoryLayer(this.currentValue);
| },
| methods: {
| changeLeftMap(item) {
| this.currentValue = item;
| addHistoryLayer(this.currentValue);
| },
| close() {
| store.setHistoryShow(false);
| window.mapapi.removeLayer(this.$global.historyLayer);
| window.mapapi.getView().setCenter([116.505348, 39.795592]);
| store.setNavigatorShow(true);
| store.setMapToolShow(true);
| },
| },
| };
| </script>
| <style scoped>
| .colseBtn {
| position: absolute;
| top: 3vh;
| right: 20px;
| }
|
| .searchBtn {
| width: 40px;
| height: 40px;
| }
|
| .listBox {
| position: absolute;
| right: 20px;
| bottom: 0.5rem;
| background-color: #373737;
| }
|
| .listBox li {
| padding: 2px;
| border: 1px solid #000;
| color: white;
| }
|
| .listBox li:hover {
| background-color: #00e1ff;
| }
|
| .mapLeft {
| float: left;
| position: absolute;
| width: 100vw;
| height: 100vh;
| }
|
| .active {
| background-color: #4590d7;
| }
| </style>
|
|