surprise
2023-12-05 6ecef4176f6d9df60cd1a753a36e09cd96bce9b8
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
<template>
  <Popup ref="pop" :title="form.title" left="calc(100% - 330px)" width="360px">
    <div class="flood">
      <el-form ref="form" :model="form" label-width="120px">
        <el-form-item label="速度(m/s):">
          <el-input-number
            v-model="form.input"
            controls-position="right"
            @change="handleChange"
            :min="1"
            :max="500"
          ></el-input-number>
 
          <el-button type="primary" @click="add">开始分析</el-button>
        </el-form-item>
      </el-form>
    </div>
  </Popup>
</template>
<script>
import Popup from "@tools/Popup.vue";
let spood;
export default {
  name: "flood",
  components: {
    Popup,
  },
  data() {
    return {
      form: {
        title: "淹没分析",
        input: 100,
      },
    };
  },
  computed: {},
  mounted() {},
  methods: {
    // 关闭弹窗
    close() {
      this.$refs.pop.close();
    },
    // 打开弹窗
    open() {
      this.$refs.pop.open();
    },
    // 输入框数据修改
    handleChange() {
      spood = this.form.input;
    },
    // 绘制多边形淹没区
    add() {
      this.clear();
      spood = this.form.input;
      var method = {
        pointSelect: true,
        spood: parseFloat(spood),
        GroupID: 0,
        url: window.SmartEarthRootUrl + "Workers/image/waterNormals.jpg",
      };
      window.AnalysisFlood = sgworld.Command.execute(
        2,
        2,
        method,
        (value) => {}
      );
    },
 
    clear() {
      window.AnalysisFlood && window.AnalysisFlood.endWater();
    },
  },
};
</script>
<style lang="less">
.flood {
  .el-input-number {
    width: 100px !important;
  }
  .el-button {
    margin-left: 10px;
  }
}
</style>