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
<template>
  <mars-pannel :visible="true" right="10" top="10">
    <div class="f-mb">
      <span class="fontMsg">提示:插值数大时分析略慢,请耐心等待。</span>
    </div>
 
    <a-form>
      <a-form-item>
        <a-space>
          <span>插值数:</span>
          <mars-input style="width: 100px" v-model:value="formState.inputNumberPolygon" :step="1"></mars-input>
          <mars-button @click="interPolygon">面插值</mars-button>
          <mars-button @click="removeAll">清除</mars-button>
        </a-space>
      </a-form-item>
 
      <a-form-item>
        <a-space>
          <span>插值数:</span>
          <mars-input style="width: 100px" v-model:value="formState.inputNumberPolyline" :step="1"></mars-input>
          <mars-button @click="interPolyline">线插值</mars-button>
          <mars-button @click="interLine">线插值(高度等分)</mars-button>
        </a-space>
      </a-form-item>
    </a-form>
  </mars-pannel>
</template>
 
<script lang="ts" setup>
import { reactive } from "vue"
import type { UnwrapRef } from "vue"
import * as mapWork from "./map.js"
 
interface FormState {
  inputNumberPolygon: number
  inputNumberPolyline: number
}
 
const formState: UnwrapRef<FormState> = reactive({
  inputNumberPolygon: 10,
  inputNumberPolyline: 100
})
 
const removeAll = () => {
  mapWork.removeAll()
}
const interPolygon = () => {
  mapWork.interPolygon(formState.inputNumberPolygon)
}
const interPolyline = () => {
  mapWork.interPolyline(formState.inputNumberPolyline)
}
const interLine = () => {
  mapWork.interLine(formState.inputNumberPolyline)
}
</script>
<style scoped lang="less">
.fontMsg {
  color: #cad1d1;
  font-size: 12px;
}
.mars-pannel-item-label {
  width: 40px;
}
</style>