wangjuncheng
2025-04-28 f54c45de2ec6dfadc825c064b75e6707513bd094
src/components/monifangzhen/RiverLevel.vue
@@ -2,7 +2,8 @@
  <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' : ''">
      <div v-for="item in levelList" :key="item.name" @click="handleClick(item)" class="level-item"
        :class="item.name == currentLevel ? 'active' : ''">
        {{ item.name }}
      </div>
    </div>
@@ -10,10 +11,10 @@
    <el-form :model="form" label-width="70px">
      <el-form-item label="方案名称">
        <el-input placeholder="请输入内容" v-model="form.name" ></el-input>
        <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-input placeholder="请输入内容" v-model="form.qy"></el-input>
      </el-form-item>
      <!-- <el-form-item label="数据类型">
            <el-select
@@ -36,7 +37,8 @@
        </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 size="small" v-model="form.date" type="daterange" range-separator="-" start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
      </el-form-item>
    </el-form>
@@ -75,26 +77,37 @@
  },
])
function handleClick (item) {
function handleClick(item) {
  currentLevel.value = item.name
}
function endPlay () { }
function startPlay () {
function endPlay() { }
function startPlay() {
  createWaterPrimitive()
}
let water = null
function createWaterPrimitive () {
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 = 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 = earthCtrl.simulate.createWaterSimulateLayer({
    // baseUrl: "http://192.168.10.187:81/20250412",
    // baseUrl: "http://192.168.56.107:8088/simu/c2h1d", //仿真服务url
    baseUrl: "/simu/c2h1d", //仿真服务url
    interval: 100,   //两帧请求的时间间隔,单位ms
    // color: new SmartEarth.Cesium.Color.fromCssColorString('#f4a460'),
    //清水色
    color: new SmartEarth.Cesium.Color.fromCssColorString('#D4F2E7'),
    //浑水色
    // color: new SmartEarth.Cesium.Color.fromCssColorString('#DEB887'),
  });
  water.rainfall = 10
  // water.rainfall = 0.0001;    // 调节雨量
  // water.rainPointMax = 2.0;   // 渗水阈值
@@ -212,20 +225,24 @@
.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;
@@ -237,6 +254,7 @@
    margin-bottom: 10px;
    cursor: pointer;
    border-radius: 5px;
    &.active {
      background: #11b6a6;
    }