Newer
Older
KaiFengPC / src / views / sponeScreen / gisMF / cesiumPopup.vue
@zhangdeliang zhangdeliang on 14 Aug 13 KB update
<template>
  <!-- 厂站设施弹窗 -->
  <div class="cesiumPopup" id="cesiumPopupID" v-show="allData.popupShow">
    <div class="title">
      <div class="titleNamePP" v-if="allData.dataList.pumpName">{{ allData.dataList.pumpName }}</div>
      <div class="titleNamePP" v-if="allData.dataList.sewageName">{{ allData.dataList.sewageName }}</div>
      <div class="titleNamePP" v-if="allData.dataList.roadName">{{ allData.dataList.roadName }}</div>
      <div class="titleNamePP" v-if="allData.dataList.name">{{ allData.dataList.name }}</div>
      <div class="titleNamePP" v-if="allData.dataList.stName">{{ allData.dataList.stName }}</div>
      <div class="PopupClosed">
        <el-icon :size="18" @click="closePopupCES"><Close /></el-icon>
      </div>
    </div>
    <div class="dividerLine"></div>
    <!-- 泵站 -->
    <div class="basicInfo" v-if="allData.dataList.pumpCode">
      <div class="basicContentCP">
        <div class="contentInfo">
          <div class="contentName">厂站编码:</div>
          <div class="contentValue">{{ allData.dataList.pumpCode }}</div>
          <div class="contentName">厂站类型:</div>
          <div class="contentValue">
            {{
              allData.dataList.pumpType == 'rain_water' ? '雨水泵站' : allData.dataList.pumpType == 'sewage_water' ? '污水泵站' : '雨污合建'
            }}
          </div>
        </div>
        <div class="contentInfo">
          <div class="contentName">建筑面积:</div>
          <div class="contentValue">{{ allData.dataList.buildArea }} ㎡</div>
          <div class="contentName">设计规模:</div>
          <div class="contentValue">{{ allData.dataList.rainpump.designScaleSecond }} m³/s</div>
        </div>
        <div class="contentInfo">
          <div class="contentName">泵机台数:</div>
          <div class="contentValue">{{ allData.dataList.rainpump.deviceCount }}台</div>
          <div class="contentName">建设单位:</div>
          <div class="contentValue" :title="allData.dataList.unitDep">{{ allData.dataList.unitDep }}</div>
        </div>
        <div class="contentInfo" style="width: 100%">
          <div class="contentName">地址:</div>
          <div class="contentValue" style="width: 100%">{{ allData.dataList.address }}</div>
        </div>
        <el-button type="warning" @click="checkGYT" style="margin: 20px 0px 0px 5%">查看工况图</el-button>
      </div>
    </div>

    <!-- 污水处理厂 -->
    <div class="basicInfo" v-if="allData.dataList.sewageCode">
      <div class="basicContentCP">
        <div class="contentInfo">
          <div class="contentName">厂站编码:</div>
          <div class="contentValue">{{ allData.dataList.sewageCode }}</div>
          <div class="contentName">出水标准:</div>
          <div class="contentValue">{{ allData.dataList.standard }}</div>
        </div>
        <div class="contentInfo">
          <div class="contentName">核心工艺:</div>
          <div class="contentValue" style="width: 100%">{{ allData.dataList.workmanship }}</div>
        </div>
        <div class="contentInfo">
          <div class="contentName">设计规模:</div>
          <div class="contentValue">{{ allData.dataList.planScale }}万吨/日</div>
          <div class="contentName">排放水体:</div>
          <div class="contentValue">{{ allData.dataList.intoWater }}</div>
        </div>
        <div class="contentInfo">
          <div class="contentName">地址:</div>
          <div class="contentValue" style="width: 100%">{{ allData.dataList.address }}</div>
        </div>
        <el-button type="warning" @click="checkWSC" style="margin: 20px 0px 0px 5%">查看工况图</el-button>
      </div>
    </div>
    <!-- 排口 -->
    <div class="basicInfo" v-if="allData.dataList.pointType">
      <div class="basicContentCP">
        <div class="contentInfo">
          <div class="contentName">排口编码:</div>
          <div class="contentValue">{{ allData.dataList.pointNumber }}</div>
          <div class="contentName">所在道路:</div>
          <div class="contentValue">{{ allData.dataList.roadName }}</div>
        </div>
        <!-- <div class="contentInfo">
          <div class="contentName">排口类型:</div>
          <div class="contentValue">雨水排口</div>
          <div class="contentName">管线点高程:</div>
          <div class="contentValue">{{ allData.dataList.pipelinePointElevation }}</div>
        </div> -->
        <div class="contentInfo">
          <div class="contentName">管点材质:</div>
          <div class="contentValue">{{ allData.dataList.pointTexture }}</div>
          <div class="contentName">地面高程:</div>
          <div class="contentValue">{{ allData.dataList.groundElevation }}m</div>
        </div>
        <div class="contentInfo">
          <div class="contentName">井底深度:</div>
          <div class="contentValue">{{ allData.dataList.bottomBuriedDepth }}</div>
          <div class="contentName">普查单位:</div>
          <div class="contentValue">{{ allData.dataList.operationalUnits }}</div>
        </div>
      </div>
    </div>

    <!-- 积水点 -->
    <div class="basicInfo" v-if="allData.dataList.originType">
      <div class="basicContentCP">
        <div class="contentInfo">
          <div class="contentName">内涝地址:</div>
          <div class="contentValue">{{ allData.dataList.address }}</div>
          <div class="contentName">行政辖区:</div>
          <div class="contentValue">{{ allData.dataList.jurisdiction }}</div>
        </div>
        <div class="contentInfo">
          <div class="contentName">所属街道:</div>
          <div class="contentValue">{{ allData.dataList.belongsStreet }}</div>
          <div class="contentName">风险级别:</div>
          <div class="contentValue">{{ allData.dataList.riskLevel }}</div>
        </div>
        <div class="contentInfo">
          <div class="contentName">内涝原因:</div>
          <div class="contentValue">{{ allData.dataList.originTypeName }}</div>
          <div class="contentName">积水次数 :</div>
          <div class="contentValue">{{ allData.dataList.yearHappenCount }}次</div>
        </div>
        <div class="contentInfo">
          <div class="contentName">最大深度:</div>
          <div class="contentValue">{{ allData.dataList.yearMaxDepth }}mm</div>
          <div class="contentName">退水时长 :</div>
          <div class="contentValue">{{ allData.dataList.yearMaxHour }}h</div>
        </div>
      </div>
    </div>

    <!-- 河道水位监测 -->
    <div class="basicInfo" v-if="allData.dataList.type == 'YSBZ'">
      <div class="basicContentCP">
        <div class="contentInfo">
          <div class="contentName">泵机台数:</div>
          <div class="contentValue">{{ allData.dataList.ysNumber }}台</div>
          <div class="contentName">抽排量:</div>
          <div class="contentValue">{{ allData.dataList.yswater }}m³/s</div>
        </div>
        <div class="contentInfo">
          <div class="contentName">泵站类型:</div>
          <div class="contentValue">{{ allData.dataList.Layer }}</div>
        </div>
      </div>
    </div>

    <!-- 雨量站 -->
    <div class="basicInfo" v-if="allData.dataList.siteType == 'rain'">
      <div class="mt-10">
        <el-date-picker
          v-model="allData.dateTime"
          type="daterange"
          value-format="YYYY-MM-DD"
          start-placeholder="开始时间"
          end-placeholder="结束时间"
          size="small"
          style="width: 240px"
          @change="changeDate"
        />
        <el-select v-model="selectCode" style="margin: -7px 0px 0px 10px" size="small" @change="changeRainType">
          <el-option v-for="item in dataOption" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
        <div id="chartPopupRainC"></div>
      </div>
    </div>
  </div>
</template>

<script setup name="CesiumPopup">
import bus from '@/bus';
import chartOption from '@/components/Echarts/pieChart_1.js';
import { graphicReport } from '@/api/dataAnalysis/syntherticData';
import * as echarts from 'echarts';
import { realtimeDataList } from '@/api/scada/monitor';

const { proxy } = getCurrentInstance();
const allData = reactive({
  dataList: {},
  popupShow: false,
  dateTime: [proxy.moment(new Date()).subtract(7, 'days').format('YYYY-MM-DD'), proxy.moment().format('YYYY-MM-DD')],
});
const dataOption = ref([]);
const selectData = ref([]);
const selectCode = ref('');
const seleceName = ref('');
const unitName = ref('');
const propertyMonitorXList = ref([]);

//
function closePopupCES() {
  allData.popupShow = false;
  bus.emit('closeCesiumPopup');
}

// 雨量站弹窗内容
const changeDate = () => {
  getSuperViseData();
};
// 降雨趋势折线图
let chartPopupRain = null;
const initEchartsPopup = () => {
  if (!!chartPopupRain) chartPopupRain.dispose();
  chartPopupRain = echarts.init(document.getElementById('chartPopupRainC'));
  chartOption.popupRainTrend.legend.data = [seleceName.value];
  chartOption.popupRainTrend.yAxis.name = unitName.value;
  chartOption.popupRainTrend.xAxis.data = propertyMonitorXList.value;
  chartOption.popupRainTrend.series.name = seleceName.value;
  chartOption.popupRainTrend.series.data = selectData.value;
  // 设置鼠标滚轮放大缩小展示数据区间
  chartOption.popupRainTrend.dataZoom = [{ type: 'inside', startValue: propertyMonitorXList.value[propertyMonitorXList.value.length / 2] }];
  if (propertyMonitorXList.value.length > 0) {
    chartOption.popupRainTrend.graphic.invisible = true; //暂无数据
  } else {
    chartOption.popupRainTrend.graphic.invisible = false; //暂无数据
  }
  chartPopupRain.clear();
  chartPopupRain.setOption(chartOption.popupRainTrend);
};
// 切换因子点击
const changeRainType = val => {
  selectCode.value = val;
  let obj = dataOption.value.filter(item => item.value == val)[0];
  selectCode.value = obj.value;
  seleceName.value = obj.label;
  unitName.value = obj.propertyUnit;
  selectData.value = obj.ylist;
  initEchartsPopup();
};
//获取监测数据
const getSuperViseData = async () => {
  let params = {
    startTime: allData.dateTime[0],
    endTime: allData.dateTime[1],
    stCode: allData.dataList['stCode'],
  };
  dataOption.value = [];
  let res = await graphicReport(params);
  if (res && res.code == 200) {
    let datas = res.data;
    if (datas.propertyMonitorXList.length == 0) return;
    datas.propertyMonitorList.map(item => {
      dataOption.value.push({
        value: item.stCode + item.monitorPropertyName,
        label: item.monitorPropertyName,
        propertyUnit: item.propertyUnit,
        ylist: item.ylist,
      });
    });
    if (Boolean(datas.propertyMonitorXList.length)) {
      propertyMonitorXList.value = [];
      datas.propertyMonitorXList.forEach(i => {
        propertyMonitorXList.value.push(i.substr(0, 16));
      });
    }
    selectCode.value = dataOption.value[0].value;
    seleceName.value = dataOption.value[0].label;
    // propertyMonitorXList.value = datas.propertyMonitorXList;
    unitName.value = datas.propertyMonitorList[0].propertyUnit;
    selectData.value = datas.propertyMonitorList[0].ylist;
    initEchartsPopup();
  }
};

// 泵站工况图查看
function checkGYT() {
  closePopupCES(); //关闭弹窗
  bus.emit('checkBZGYT', allData.dataList);
}

// 污水厂工艺图查看
function checkWSC() {
  closePopupCES(); //关闭弹窗
  bus.emit('checkWSCGYT', allData.dataList);
}

onMounted(() => {
  bus.on('popupcontent', data => {
    allData.dataList = data.popupInfo;
    console.log(allData.dataList, 9999);
    if (allData.dataList.siteType == 'rain') changeDate(); //雨量站曲线图
  });
});
onBeforeUnmount(() => {
  bus.off('popupcontent');
  bus.off('closeCesiumPopup');
});
</script>
<style lang="scss">
.cesiumPopup {
  position: absolute;
  width: 500px;
  height: 300px;
  padding: 10px;
  background: #003b6d;
  border: 1px solid #6acefe;
  #chartPopupRainC {
    width: 100%;
    height: 200px;
    margin-top: 10px;
  }
  .title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    .titleNamePP {
      display: flex;
      align-items: center;
      height: 22px;
      font-size: 16px;
      font-family: PingFang SC;
      font-weight: 400;
      color: #b8ecff;
      line-height: 22px;
      margin: 5px;
      width: 330px;
      &:before {
        display: block;
        content: '';
        width: 3px;
        height: 16px;
        background: #00d1ff;
        margin-right: 10px;
      }
    }
    .PopupClosed {
      position: absolute;
      margin-left: 450px;
      height: 22px;
      z-index: 9999;
      cursor: pointer;
    }
  }

  .basicContentCP {
    .contentInfo {
      display: flex;
      align-items: center;
      margin-left: 10px;
      .contentName {
        margin: 3px;
        width: 100px;
        font-size: 14px;
        font-weight: 400;
        line-height: 20px;
        color: #b8ecff;
      }
      .contentName1 {
        margin: 3px;
        width: 185px;
        font-size: 14px;
        font-weight: 400;
        line-height: 20px;
        color: #b8ecff;
      }
      .contentValue {
        margin: 3px;
        width: 100px;
        font-size: 14px;
        font-weight: 400;
        color: #b8ecff;
        word-wrap: break-word;
      }
    }
  }
}
</style>