fuchengshen
2022-07-09 3a25c05b5ab837714f30469cdcb1e2a77d8d7f6c
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
<template>
  <mars-pannel :visible="true" right="10" top="10" width="355">
    <div class="f-mb">Tip: The default language is Chinese中文简体, you can switch to English, etc.</div>
 
    <div class="f-mb">
      <a-row>
        <a-col :span="7">Plot:</a-col>
        <a-col :span="17">
          <div class="lang-button-contain">
            <mars-button :key="item" v-for="item in typeArrPlot" @click="onStartDraw(item)">
              {{ item }}
            </mars-button>
          </div>
        </a-col>
      </a-row>
    </div>
    <div class="f-mb">
      <a-row>
        <a-col :span="7">Measurement:</a-col>
        <a-col :span="17">
          <div class="lang-button-contain">
            <mars-button size="middle" @click="onClickCoordinate">coordinate</mars-button>
            <mars-button size="middle" @click="onClickDistance">distance</mars-button>
            <mars-button size="middle" @click="onClickHeight">height</mars-button>
            <mars-button size="middle" @click="onClickArea">area</mars-button>
            <mars-button size="middle" @click="onClickAngle">angle</mars-button>
          </div>
        </a-col>
      </a-row>
    </div>
  </mars-pannel>
</template>
 
<script lang="ts" setup>
import * as mapWork from "./map.js"
 
const typeArrPlot = ["rectangle", "polyline", "polygon", "cylinder", "point", "circle", "wall"]
 
const onStartDraw = (e: any) => {
  mapWork.startDraw(e)
}
 
const onClickDistance = () => {
  mapWork.distance()
}
const onClickArea = () => {
  mapWork.area()
}
const onClickHeight = () => {
  mapWork.height()
}
const onClickCoordinate = () => {
  mapWork.coordinate()
}
const onClickAngle = () => {
  mapWork.angle()
}
</script>
<style lang="less" scoped>
.lang-button-contain {
  .mars-button {
    margin-right: 8px;
    margin-bottom: 8px;
  }
}
</style>