1
1
<template >
2
- <div class =" measure-control" >
3
- <fieldset >
4
- <legend >
5
- <div class =" form-check" >
6
- <label class =" form-check-label" for =" ck-measure" >测量</label >
7
- <input id =" ck-measure" type =" checkbox" v-model =" measureEnable" >
8
- </div >
9
- </legend >
10
-
11
- <div class =" measure-properties" >
12
- <RadioButton class =" measure-properties-tabs" :radios =" tabs" v-model:value =" currentTab" ></RadioButton >
13
-
14
- <div class =" measure-properties-controls visible" v-show =" currentTab === 'visible'" >
15
- <div >面线段方向</div >
16
- <input type =" checkbox" v-model =" direction" >
17
- <div >面线距离</div >
18
- <input type =" checkbox" v-model =" polygonLine" >
19
- <div >面线段距离</div >
20
- <input type =" checkbox" v-model =" polygonLineSegment" >
21
- <div >线段距离</div >
22
- <input type =" checkbox" v-model =" lineSegment" >
23
- </div >
2
+ <ExtendPannel title =" 测量" position =" top-left" :onToggle =" handleToggle" >
3
+ <div class =" measure-properties" >
4
+ <RadioButton class =" measure-properties-tabs" :radios =" tabs" v-model:value =" currentTab" ></RadioButton >
5
+
6
+ <div class =" measure-properties-controls visible" v-show =" currentTab === 'visible'" >
7
+ <div >面线段方向</div >
8
+ <input type =" checkbox" v-model =" direction" >
9
+ <div >面线距离</div >
10
+ <input type =" checkbox" v-model =" polygonLine" >
11
+ <div >面线段距离</div >
12
+ <input type =" checkbox" v-model =" polygonLineSegment" >
13
+ <div >线段距离</div >
14
+ <input type =" checkbox" v-model =" lineSegment" >
15
+ </div >
24
16
25
- <div class =" measure-properties-controls" v-show =" currentTab === 'units'" >
26
- <div >
27
- 面积
28
- </div >
29
- <select v-model =" areaUnit" >
30
- <option value =" M2" >平方米</option >
31
- <option value =" KM2" >平方千米</option >
32
- <option value =" MU" >亩</option >
33
- <option value =" M2KM2" >自动</option >
34
- </select >
35
-
36
- <div >
37
- 长度
38
- </div >
39
- <select v-model =" lengthUnit" >
40
- <option value =" M" >米</option >
41
- <option value =" KM" >千米</option >
42
- <option value =" MKM" >自动</option >
43
- </select >
17
+ <div class =" measure-properties-controls" v-show =" currentTab === 'units'" >
18
+ <div >
19
+ 面积
44
20
</div >
45
-
46
- <div class =" measure-properties-controls precision" v-show =" currentTab === 'precision'" >
47
- <div >米</div >
48
- <input type =" number" @keydown =" e => e.preventDefault()" v-model =" precisions[0]" :min =" 0" step =" 1" >
49
- <div >千米</div >
50
- <input type =" number" @keydown =" e => e.preventDefault()" v-model =" precisions[1]" :min =" 0" step =" 1" >
51
- <div >平方米</div >
52
- <input type =" number" @keydown =" e => e.preventDefault()" v-model =" precisions[2]" :min =" 0" step =" 1" >
53
- <div > 平方千米</div >
54
- <input type =" number" @keydown =" e => e.preventDefault()" v-model =" precisions[3]" :min =" 0" step =" 1" >
55
- <div >亩</div >
56
- <input type =" number" @keydown =" e => e.preventDefault()" v-model =" precisions[4]" :min =" 0" step =" 1" >
21
+ <select v-model =" areaUnit" >
22
+ <option value =" M2" >平方米</option >
23
+ <option value =" KM2" >平方千米</option >
24
+ <option value =" MU" >亩</option >
25
+ <option value =" M2KM2" >自动</option >
26
+ </select >
27
+
28
+ <div >
29
+ 长度
57
30
</div >
31
+ <select v-model =" lengthUnit" >
32
+ <option value =" M" >米</option >
33
+ <option value =" KM" >千米</option >
34
+ <option value =" MKM" >自动</option >
35
+ </select >
36
+ </div >
37
+
38
+ <div class =" measure-properties-controls precision" v-show =" currentTab === 'precision'" >
39
+ <div >米</div >
40
+ <input type =" number" @keydown =" e => e.preventDefault()" v-model =" precisions[0]" :min =" 0" step =" 1" >
41
+ <div >千米</div >
42
+ <input type =" number" @keydown =" e => e.preventDefault()" v-model =" precisions[1]" :min =" 0" step =" 1" >
43
+ <div >平方米</div >
44
+ <input type =" number" @keydown =" e => e.preventDefault()" v-model =" precisions[2]" :min =" 0" step =" 1" >
45
+ <div > 平方千米</div >
46
+ <input type =" number" @keydown =" e => e.preventDefault()" v-model =" precisions[3]" :min =" 0" step =" 1" >
47
+ <div >亩</div >
48
+ <input type =" number" @keydown =" e => e.preventDefault()" v-model =" precisions[4]" :min =" 0" step =" 1" >
58
49
</div >
59
- </fieldset >
60
- </div >
50
+ </div >
51
+ </ExtendPannel >
61
52
</template >
62
53
63
54
<script lang="ts" setup>
64
55
import { ref , watch } from ' vue' ;
65
56
import { MeasureManager , Units } from ' ../../../../packages/maplugin-core' ;
66
57
import RadioButton from ' ../base/RadioButton.vue' ;
58
+ import ExtendPannel from ' ../base/ExtendPannel.vue' ;
67
59
68
60
const tabs: Record <" visible" | " units" | " precision" , string > = {
69
61
' visible' : " 显示" ,
@@ -79,10 +71,10 @@ const props = defineProps<{
79
71
props .measureManager .setVisible (false );
80
72
props .measureManager .setDirectionSymbol (' >' , ' <' )
81
73
82
- const measureEnable = ref ( false );
83
- watch ( measureEnable , a => {
84
- props .measureManager .setVisible (a );
85
- });
74
+
75
+ function handleToggle( active : boolean ) {
76
+ props .measureManager .setVisible (active );
77
+ }
86
78
87
79
const direction = ref (true );
88
80
watch (direction , a => {
@@ -130,14 +122,6 @@ watch(precisions, a => {
130
122
</script >
131
123
132
124
<style scoped>
133
- .measure-control {
134
- background : var (--color-bg );
135
- color : var (--color-word );
136
- font-size : var (--size-word );
137
- padding : 8px ;
138
- border-radius : 6px ;
139
- width : 200px ;
140
- }
141
125
142
126
.form-check {
143
127
display : flex ;
@@ -156,6 +140,8 @@ watch(precisions, a => {
156
140
display : flex ;
157
141
flex-direction : column ;
158
142
gap : 8px ;
143
+ width : 146px ;
144
+ color : var (--color-word );
159
145
}
160
146
161
147
.measure-properties-tabs {
0 commit comments