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
| <template>
| <div v-drag="true" class="searchBox">
| <div @click="setCloseSlopeQuerty" style="float: right;">
| <el-icon :size="20">
| <Close />
| </el-icon>
| </div>
| <div>
| 坡度值:{{ queryVal }}
| </div>
| </div>
| </template>
|
| <script lang="ts" setup>
|
| import {
| ref,
| onMounted,
| onBeforeUnmount,
| reactive,
| defineProps,
| defineEmits,
| nextTick,
| watch,
| } from "vue";
| import store from "@/store";
| const queryVal = ref(null)
| const setCloseSlopeQuerty = () => {
| store.state.showSlopeQuey = false;
| store.state.slopeQueyValue = null;
| }
| const changeSlopQueryValue = (res) => {
| queryVal.value = res
| }
|
|
| onMounted(() => {
| changeSlopQueryValue(store.state.slopeQueyValue)
| })
| watch(
| () => store.state.slopeQueyValue,
| (nVal, oVal) => {
| if (nVal) {
| changeSlopQueryValue(nVal);
| }
| },
| { deep: true }
| );
|
|
|
|
|
| </script>
| <style lang="less" scoped>
| .searchBox {
| position: absolute;
| z-index: 30;
| width: 200px;
| top: 8vh;
| right: 24vh;
| padding: 10px;
| background: rgba(7, 8, 14, 0.8);
| border: 1px solid #d6e4ff;
| box-shadow: inset 0px 10px 40px 10px rgba(38, 47, 71, 1);
| border-radius: 5px;
| font-family: Source Han Sans SC;
| font-size: 12px;
| color: white;
| }
| </style>
|
|
|