Newer
Older
KaiFengPC / src / views / sponeScreen / projectHM / projectSSDX.vue
@zhangdeliang zhangdeliang 26 days ago 10 KB update
<template>
  <!-- 典型项目设施分析 -->
  <div class="projectDXPage">
    <!-- 分析结果建议 -->
    <div class="suggest">
      <div class="autoCont">
        <div class="center">
          {{ rainDate }} 降雨起止时间<span v-for="(item, index) in detailDataRain.rainfallPeriods" :key="index">
            {{ item.rainStartTime }}-{{ item.rainEndTime }} </span
          >,24小时累计降雨量{{ detailDataRain.rainfallIntensity }}mm,降雨等级
          <span class="green">
            {{
              detailDataRain.rainfallIntensity <= 10
                ? '小雨'
                : detailDataRain.rainfallIntensity > 10 && detailDataRain.rainfallIntensity <= 25
                ? '中雨'
                : '大雨'
            }}
          </span>
        </div>
        <!-- <p>1,项目设计最大控制容积 <span class="green">3796.52m³</span></p> -->
        <div class="cont">
          <span class="numBg">1</span>
          海绵设施设计雨水控制容积 <span class="green">96.52m³</span>
        </div>
        <div class="cont">
          <span class="numBg">2</span>
          项目设计标准达标情况(年径流总量控制率{{ jlkzl }}%对应的设计降雨量{{ sjRain }}mm;本场降雨径流总量控制率
          <span class="green">{{ jlkzl + 0.3 }}%</span>,
          <span class="green">达标</span>
        </div>
        <div class="cont">
          <span class="numBg">3</span>
          雨水管网产流开始时间{{ detailDataRain.flowStartTime }},结束时间{{ detailDataRain.flowEndTime }},累计进口流量
          <!-- <span class="green">{{ detailDataRain.totalImportFlow - detailDataRain.totalOutFlow }}m³</span>, 最大水深 -->
          <span class="green">85.23m³</span>, 最大水深
          <span class="green"> {{ realSW || '--' }}m </span>
        </div>
      </div>
    </div>

    <!-- 降雨效果 -->
    <CanvasRainSS :width="1382" :height="800"></CanvasRainSS>

    <!-- 水位 水流 -->
    <img src="@/assets/newImgs/pumpGY/water.png" class="waterFlow" :style="{ height: (80 * realSW) / 1.1 + 'px' }" />

    <!-- 实时数据 -->
    <div class="realData">
      <p style="left: 700px; bottom: 95px">管径:2.4 x 1.1米</p>
      <p style="left: 500px; bottom: 95px" :class="[realSW >= 1.1 ? 'red' : '']">最大水深:{{ realSW || '--' }} 米</p>
      <p style="right: 230px; bottom: 65px">进口流速:{{ nameToData(station1.propertyMonitorList, '流速')[valIndex1] }} m/s</p>
      <p style="right: 230px; bottom: 25px" :class="[nameToData(station1.propertyMonitorList, 'SS')[valIndex1] >= 300 ? 'red' : '']">
        进口SS:{{ nameToData(station1.propertyMonitorList, 'SS')[valIndex1] || '--' }} mg/L
      </p>
      <p style="left: 60px; bottom: 65px">出口流速:{{ nameToData(station2.propertyMonitorList, '流速')[valIndex2] || '--' }} m/s</p>
      <p style="left: 60px; bottom: 25px" :class="[nameToData(station2.propertyMonitorList, 'SS')[valIndex2] >= 300 ? 'red' : '']">
        出口SS:{{ nameToData(station2.propertyMonitorList, 'SS')[valIndex2] || '--' }} mg/L
      </p>
      <p style="left: 20px; bottom: 155px; width: 200px">
        水位最深时间:{{ station2.propertyMonitorXList[valIndex2] ? station2.propertyMonitorXList[valIndex2].slice(11) : '--' }}
      </p>
    </div>

    <!-- 监测设备 -->
    <img src="@/assets/newImgs/pumpGY/equip.png" alt="设备左1" style="left: 250px; bottom: 35px" class="equipM" />
    <img src="@/assets/newImgs/pumpGY/equip.png" alt="设备右1" style="right: 420px; bottom: 35px" class="equipM" />

    <!-- 水流方向 -->
    <div class="waterFX">
      <img src="@/assets/newImgs/pumpGY/waterFlow.png" alt="左1" style="left: 220px; bottom: 425px; transform: rotate(50deg)" />

      <img src="@/assets/newImgs/pumpGY/waterFlow.png" alt="中间1" style="left: 320px; bottom: 625px; transform: rotate(80deg)" />
      <img src="@/assets/newImgs/pumpGY/waterFlow.png" alt="中间2" style="left: 360px; bottom: 425px; transform: rotate(80deg)" />
      <img src="@/assets/newImgs/pumpGY/waterFlow.png" alt="中间3" style="left: 385px; bottom: 195px; transform: rotate(90deg)" />

      <img src="@/assets/newImgs/pumpGY/waterFlow.png" alt="右1" style="right: 110px; bottom: 425px; transform: rotate(180deg)" />
      <img src="@/assets/newImgs/pumpGY/waterFlow.png" alt="右2" style="right: 350px; bottom: 355px; transform: rotate(120deg)" />
      <img src="@/assets/newImgs/pumpGY/waterFlow.png" alt="右3" style="left: 500px; bottom: 425px; transform: rotate(130deg)" />

      <img src="@/assets/newImgs/pumpGY/waterFlow.png" alt="下1" style="left: 350px; bottom: 5px; transform: rotate(180deg)" />
      <img src="@/assets/newImgs/pumpGY/waterFlow.png" alt="下2" style="right: 480px; bottom: 5px; transform: rotate(180deg)" />
    </div>
  </div>
</template>

<script setup>
import CanvasRainSS from '@/views/sponeScreen/projectHM/canvasRainSS.vue';
import { graphicReport, calculateAreaAnnualRunoff } from '@/api/dataAnalysis/syntherticData';

const rainDate = ref('');
const { proxy } = getCurrentInstance();
const timer = ref(null);
const station1 = ref({ propertyMonitorList: [{ ylist: [] }, { ylist: [] }, { ylist: [] }], propertyMonitorXList: [] });
const station2 = ref({ propertyMonitorList: [{ ylist: [] }, { ylist: [] }, { ylist: [] }], propertyMonitorXList: [] });
const valIndex1 = ref(0);
const valIndex2 = ref(0);
const realSW = ref(0); //最大水深
const detailDataRain = ref({ totalOutFlow: 0, totalImportFlow: 0 });
const jlkzl = ref(0);
const sjRain = ref(0);

// 获取实时数据
async function getRealData() {
  let params1 = {
    startTime: localStorage.getItem('setRainDateKF'),
    endTime: localStorage.getItem('setRainDateKF'),
    stCode: '0371000039',
  };
  let res1 = await graphicReport(params1);
  if (res1.data.propertyMonitorList.length > 0) {
    station1.value = res1.data;
    // 取最大的值
    let max = Math.max(...nameToData(station1.value.propertyMonitorList, '水位'));
    valIndex1.value = nameToData(station1.value.propertyMonitorList, '水位').findIndex(item => {
      return item == max;
    });
  }

  let params2 = {
    startTime: localStorage.getItem('setRainDateKF'),
    endTime: localStorage.getItem('setRainDateKF'),
    stCode: '0371000038',
  };
  let res2 = await graphicReport(params2);
  if (res2.data.propertyMonitorList.length > 0) {
    station2.value = res2.data;
    // 取最大的值
    let max = Math.max(...nameToData(station2.value.propertyMonitorList, '水位'));
    valIndex2.value = nameToData(station2.value.propertyMonitorList, '水位').findIndex(item => {
      return item == max;
    });
    // 最大水位出口
    realSW.value = nameToData(station2.value.propertyMonitorList, '水位')[valIndex2.value] || 0.2;
  }
}

// 公共方法,根据监测名称来匹配对应的数值
function nameToData(data, name) {
  let arr = data.filter(item => item.monitorPropertyName == name);
  let lists = arr[0] ? arr[0].ylist : [];
  return lists;
}

// 降雨场次相关
function getRainDetail() {
  // 关联雨量站是皮革厂雨量站,0371000003
  let params = {
    searchTime: localStorage.getItem('setRainDateKF'),
    rainStCode: '0371000003',
    projectNo: 'GW06',
  };
  calculateAreaAnnualRunoff(params).then(res => {
    detailDataRain.value = res.data || {};
    getRainBZ();
  });
}

// 年径流和降雨量关系
function getRainBZ() {
  let val = detailDataRain.value.rainfallIntensity || 0;
  if (val <= 3.04) {
    sjRain.value = 3.04;
    jlkzl.value = 20;
  } else if (val > 3.04 && val <= 5) {
    sjRain.value = 5;
    jlkzl.value = 30;
  } else if (val > 5 && val <= 7.56) {
    sjRain.value = 7.56;
    jlkzl.value = 40;
  } else if (val > 7.56 && val <= 10.9) {
    sjRain.value = 10.9;
    jlkzl.value = 50;
  } else if (val > 10.9 && val <= 15.2) {
    sjRain.value = 15.2;
    jlkzl.value = 60;
  } else if (val > 15.2 && val <= 19.84) {
    sjRain.value = 19.84;
    jlkzl.value = 68;
  } else if (val > 19.8) {
    sjRain.value = 19.8;
    jlkzl.value = 68;
  }
}

onMounted(() => {
  rainDate.value = localStorage.getItem('setRainDateKF');
  getRealData();
  getRainDetail();
  // 5分钟刷新一次数据
  timer.value = setInterval(() => {
    getRealData();
    getRainDetail();
  }, 5 * 60 * 1000);
});
onBeforeUnmount(() => {
  if (timer.value) clearInterval(timer.value);
});
</script>

<style lang="scss">
// prettier-ignore
.projectDXPage {
  width: 1382PX;
  height: 800PX;
  margin-bottom:20PX;
  background: url('@/assets/newImgs/pumpGY/dxxmBg.jpg') no-repeat;
  background-size: 100% 100%;
  position:relative;
  .equipM{
    position: absolute; 
    z-index: 30;
    width:10PX;
    height:73PX;
  }
  .progressP{
    width:50%;
    left: 433PX; 
    top: 15PX; 
    position: absolute; 
    z-index: 20
  }
  .suggest{
    position:absolute;
    z-index: 20;
    left:15PX;
    top:0PX;
    width:471PX;
    height:271PX;
    background: url('@/assets/newImgs/pumpGY/tipsBg.png') no-repeat;
    background-size: 100% 100%;
    font-size:14PX;
    font-family: Source Han Sans CN;
    font-weight: 400;
    color: #C1E8FF;
    line-height: 24PX;
    .autoCont{
      width:451PX;
      height:251PX;
      margin:10PX 0 0 10PX;
      padding:10PX;
      overflow: auto;
    }
    .iconSug{
      cursor: pointer;
      position:absolute;
      top:20PX;
      right:20PX;
      width: 25PX;
      height: 25PX;
      svg{
        width: 25PX;
        height: 25PX;
      }
    }
    .center{
      margin:10PX 30px 10PX 0px;
      text-align: center;
      font-size:15PX;
      color:#fff;
    }
    .cont{
      padding-bottom:5PX;
      margin-bottom:5PX;
      border-bottom: 1px dashed #6A8CAE;
      .numBg{
        width:24PX;
        height: 18PX;
        line-height: 18PX;
        display: inline-block;
        background: url('@/assets/newImgs/pumpGY/numBg.png') no-repeat;
        background-size: 100% 100%;
        text-align: center;
        color: #FFD200;
      }
    }
    span{
      font-weight: bold;
    }
  }
  .waterFlow{
    width:725PX;
    position:absolute;
    z-index: 10;
    left:243PX;
    bottom:28PX;
  }
  .waterFlowS{
    width:46PX;
    position:absolute;
    z-index: 10;
    left:247PX;
    bottom:105PX;
  }
  .realData{
    color:#fff;
    p{
      position:absolute;
      z-index: 10;
      width:160PX;
      height: 26PX;
      line-height: 26PX;
      text-align: center;
      background: #004DE0;
      border-radius: 13PX;
      font-size:16PX;
    }
  }
  .waterFX{
    img{
      position:absolute;
      z-index: 10;
    }
  }
}
</style>