guonan
2025-04-14 9e860a560c5a4b81abe2042b8d8698e253730502
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<template>
  <div class="listInfo">
    <span class="listInfo-title">降雨等级</span>
    <div class="level-list">
      <div v-for="item in levelList" :key="item.name" @click="handleClick(item)" class="level-item" :class="item.name == currentLevel ? 'active' : ''">
        {{ item.name }}
      </div>
    </div>
    <span class="listInfo-title">模拟方案</span>
 
    <el-form :model="form" label-width="70px">
      <el-form-item label="方案名称">
        <el-input placeholder="请输入内容" v-model="form.name" ></el-input>
      </el-form-item>
      <el-form-item label="模拟区域">
        <el-input placeholder="请输入内容" v-model="form.qy" ></el-input>
      </el-form-item>
      <!-- <el-form-item label="数据类型">
                <el-select
                    size="mini"
                    style="width: 100%"
                    v-model="form.region"
                    placeholder="请选择活动区域"
                >
                    <el-option v-for="region in regionList" :label="region" :value="region"></el-option>
                </el-select>
            </el-form-item> -->
 
      <el-form-item label="输出间隔">
        <el-radio-group v-model="form.interval" :value="form.interval">
          <el-radio :value="15">15分钟</el-radio>
          <el-radio :value="30">30分钟</el-radio>
          <el-radio :value="60">1小时</el-radio>
          <el-radio :value="120">2小时</el-radio>
          <el-radio :value="240">4小时</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="预警时间">
        <el-date-picker size="small" v-model="form.date" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期">
        </el-date-picker>
      </el-form-item>
    </el-form>
    <div class="listinfo-btns">
      <div class="listinfo-btn" @click="openfilie">打开方案</div>
      <div class="listinfo-btn" @click="endPlay">结束模拟</div>
      <div class="listinfo-btn listinfo-btn-ac" @click="startPlay">开始模拟</div>
    </div>
  </div>
</template>
 
<script setup>
import { ref, reactive, onMounted, onBeforeUnmount } from "vue"
const currentLevel = ref("10年一遇")
const form = ref({
  name: `孙胡沟${currentLevel.value}降雨模拟`,
  interval: 15,
  qy: "孙胡沟",
  region: "",
  jy: "",
  jg: "",
  date: "",
})
const levelList = ref([
  {
    name: "10年一遇",
  },
  {
    name: "20年一遇",
  },
  {
    name: "50年一遇",
  },
  {
    name: "100年一遇",
  },
])
 
function handleClick (item) {
  currentLevel.value = item.name
}
function endPlay () { }
function startPlay () {
  createWaterPrimitive()
}
let water = null
function createWaterPrimitive () {
  console.log('createWaterPrimitive')
  if (water) {
    water.destroy()
    water = null
  }
  water = earthCtrl.analysis.createWaterSimulateGPU({
    //isDraw: true, // 是否绘制水面
    height: -5,
    maxHeight: 2000,
    coordinates: [116.59934879285792, 40.57756658974129, 0, 116.59934879285792, 40.5436798121795, 0, 116.58050836969261, 40.5436798121795, 0, 116.58050836969261, 40.57756658974129, 0]
  })
  water.rainfall = 10
  // water.rainfall = 0.0001;    // 调节雨量
  // water.rainPointMax = 2.0;   // 渗水阈值
  // water.attenuation = 0.995;  // 衰减
  // water.strenght = 0.25    // 水流强度
}
</script>
 
<style lang="less" scoped>
@import url("../../assets/css/infobox.css");
 
.listInfo-title {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-top: 20px;
}
 
.listInfo {
  font-size: 12px;
  display: flex;
  flex-direction: column;
 
  :last-child {
    flex: 1;
    color: white !important;
  }
 
  /deep/.el-select__selected-item .el-select__placeholder {
    span {
      color: white !important;
    }
  }
}
 
/deep/.el-form-item__label {
  color: #78cda4;
  font-size: 14px;
  // width: 84px;
}
 
/deep/.el-form-item {
  margin: 10px 0px;
}
 
/deep/.el-input {
  width: calc(100% - 80px);
}
 
/deep/.el-input__inner {
  background: rgba(8, 75, 66, 1);
  color: white;
}
 
/deep/.el-form-item__content {
  width: 100%;
}
 
/deep/.el-input-group__append,
.el-input-group__prepend {
  padding: 0 6px;
  background: rgba(8, 75, 66, 1) !important;
  color: #ffffff;
}
 
/deep/.el-form-item__content .el-input-group {
  vertical-align: middle;
}
 
/deep/.el-date-editor--daterange.el-input,
.el-date-editor--daterange.el-input__inner,
.el-date-editor--timerange.el-input,
.el-date-editor--timerange.el-input__inner {
  width: calc(100% - 80px) !important;
  background: rgba(8, 75, 66, 1) !important;
}
 
/deep/.el-date-editor .el-range-separator {
  color: white;
}
 
/deep/.el-range-input {
  background: transparent !important;
  color: white !important;
}
</style>
<style>
.el-select-dropdown {
  background: rgba(8, 75, 66, 1) !important;
  color: white !important;
}
 
.el-picker-panel__body {
  color: white !important;
}
 
.el-picker-panel__body div {
  background: transparent !important;
}
 
.el-picker-panel {
  background: rgba(8, 75, 66, 1) !important;
}
 
.el-select-dropdown__item {
  color: white !important;
  font-size: 12px !important;
}
 
.el-date-table th {
  color: white !important;
}
 
.el-select-dropdown__item.hover,
.el-select-dropdown__item:hover {
  color: #409eff !important;
}
.el-input__wrapper {
  background: rgba(8, 75, 66, 1) !important;
  border: 2px solid #437a74 !important;
  box-shadow: none !important;
}
.el-select__wrapper {
  background: rgba(8, 75, 66, 1) !important;
  border: 2px solid #437a74 !important;
  box-shadow: none !important;
}
.level-list {
  display: flex;
  margin-top: 10px;
  flex-wrap: wrap;
  .level-item {
    width: 150px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background: rgba(8, 75, 66, 1);
    color: white;
    margin-right: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    border-radius: 5px;
    &.active {
      background: #11b6a6;
    }
  }
}
</style>