Newer
Older
DH_Apicture / src / views / pictureOnMap / page / DrainageSystem / BengZhanRight.vue
@ZZJ ZZJ 8 days ago 15 KB 单位更改
<template>
  <div id="BengZhanRight">
    <div class="modular1_right">
      <div class="ListInfo100">
        <div class="ListInfo_label">泵站名称:</div>
        <div class="ListInfo_value">
          {{ AllData.bengZhanInfo.name ? AllData.bengZhanInfo.name : '--' }}
        </div>
      </div>
      <div class="ListInfo100">
        <div class="ListInfo_label">泵站类型:</div>
        <div class="ListInfo_value">
          {{ Datatype == 'sewage_pump_station_info' ? '污水泵站' : '雨水泵站' }}
          <!-- <dict-tag :options="pump_station_type" :value="AllData.bengZhanInfo.type" /> -->
        </div>
      </div>
      <div class="ListInfo100">
        <div class="ListInfo_label">所属水系:</div>
        <div class="ListInfo_value">
          <!-- {{ AllData.bengZhanInfo.pointNumber ? AllData.bengZhanInfo.pointNumber : "--" }} -->
          {{ selectArrListLabel(alllist, AllData.bengZhanInfo.waterRegionCode, 'id', 'name') }}
        </div>
      </div>
      <div class="ListInfo100">
        <div class="ListInfo_label">设计规模:</div>
        <div class="ListInfo_value">
          {{ AllData.bengZhanInfo.designFlowRate ? AllData.bengZhanInfo.designFlowRate + 'm³/s' : '--' }}
        </div>
      </div>
      <div class="ListInfo100">
        <div class="ListInfo_label">泵机个数:</div>
        <div class="ListInfo_value">
          {{ AllData.bengZhanInfo.pumpNumber ? AllData.bengZhanInfo.pumpNumber + '个' : '--' }}
        </div>
      </div>
      <div class="ListInfo100">
        <div class="ListInfo_label">装机功率:</div>
        <div class="ListInfo_value">
          {{ AllData.bengZhanInfo.power ? AllData.bengZhanInfo.power + 'kw' : '--' }}
        </div>
      </div>
      <div class="ListInfo100">
        <div class="ListInfo_label">起抽水位:</div>
        <div class="ListInfo_value">
          {{ AllData.bengZhanInfo.startLevel ? AllData.bengZhanInfo.startLevel + 'm' : '--' }}
        </div>
      </div>
      <div class="ListInfo100">
        <div class="ListInfo_label">停抽水位:</div>
        <div class="ListInfo_value">
          {{ AllData.bengZhanInfo.controlLevel ? AllData.bengZhanInfo.controlLevel + 'm' : '--' }}
        </div>
      </div>
      <div class="ListInfo100">
        <div class="ListInfo_label">汇入管网:</div>
        <div class="ListInfo_value">
          {{ AllData.bengZhanInfo.entrance ? AllData.bengZhanInfo.entrance : '--' }}
        </div>
      </div>
      <div class="ListInfo100">
        <div class="ListInfo_label">排出管网:</div>
        <div class="ListInfo_value">
          {{ AllData.bengZhanInfo.discharge ? AllData.bengZhanInfo.discharge : '--' }}
        </div>
      </div>
      <div class="ListInfo100">
        <div class="ListInfo_label">流入场站:</div>
        <div class="ListInfo_value">
          {{ AllData.bengZhanInfo.flowInto ? AllData.bengZhanInfo.flowInto : '--' }}
        </div>
      </div>
    </div>
    <div class="modular2_right">
      <div class="leve2Title">进站水量</div>
      <div class="modularBody">
        <div class="SLList">
          <div class="SlList1P">
            <el-tooltip :content="AllData.jinZhan.nowDay + '万吨'" placement="top">
              <span class="SlListNum">{{ AllData.jinZhan.nowDay }}</span>
            </el-tooltip>
            <span class="SlListUnit">万吨</span>
          </div>
          <div class="SlList2P">今日水量</div>
        </div>
        <div class="SLList">
          <div class="SlList1P">
            <el-tooltip :content="AllData.jinZhan.yesterday + '万吨'" placement="top">
              <span class="SlListNum">{{ AllData.jinZhan.yesterday }}</span>
            </el-tooltip>
            <span class="SlListUnit">万吨</span>
          </div>
          <div class="SlList2P">昨日水量</div>
        </div>
        <div class="SLList">
          <div class="SlList1P">
            <el-tooltip :content="AllData.jinZhan.average + '万吨'" placement="top">
              <span class="SlListNum">{{ AllData.jinZhan.average }}</span>
            </el-tooltip>
            <span class="SlListUnit">万吨</span>
          </div>
          <div class="SlList2P">7日平均水量</div>
        </div>
      </div>
    </div>
    <!-- 一级泵站 展示出水量 -->
    <div class="modular2_right" v-if="AllData.ChuShuiShow">
      <div class="leve2Title">入厂水量</div>
      <div class="modularBody">
        <div class="SLList">
          <div class="SlList1P">
            <el-tooltip :content="AllData.ChuZhan.nowDay + '万吨'" placement="top">
              <span class="SlListNum">{{ AllData.ChuZhan.nowDay }}</span>
            </el-tooltip>
            <span class="SlListUnit">万吨</span>
          </div>
          <div class="SlList2P">今日水量</div>
        </div>
        <div class="SLList">
          <div class="SlList1P">
            <el-tooltip :content="AllData.ChuZhan.yesterday + '万吨'" placement="top">
              <span class="SlListNum">{{ AllData.ChuZhan.yesterday }}</span>
            </el-tooltip>
            <span class="SlListUnit">万吨</span>
          </div>
          <div class="SlList2P">昨日水量</div>
        </div>
        <div class="SLList">
          <div class="SlList1P">
            <el-tooltip :content="AllData.ChuZhan.average + '万吨'" placement="top">
              <span class="SlListNum">{{ AllData.ChuZhan.average }}</span>
            </el-tooltip>
            <span class="SlListUnit">万吨</span>
          </div>
          <div class="SlList2P">7日平均水量</div>
        </div>
      </div>
    </div>
    <!-- 二级泵站 展示泵机状态 -->
    <div class="modular3_right" v-if="!AllData.ChuShuiShow">
      <div class="leve2Title">泵机状态</div>
      <div class="modularBody">
        <div class="bengjibox">
          <div class="bengji" v-for="item in AllData.BengjiObj.pumpStates" :key="item">
            <div class="icon" :class="item.pumpSate == 1 ? 'kai' : item.pumpSate == -1 ? 'yichang' : ''"></div>
            <div class="name">{{ item.pumpNum }}泵</div>
          </div>
        </div>
        <div class="mianban">
          <div class="mianban1">实时液位</div>
          <div class="mianban2">
            {{ AllData.BengjiObj.waterlevel || '-' }}
            <span class="unit">米</span>
          </div>
        </div>
      </div>
    </div>
    <div class="modular4_right">
      <div class="leve2Title">实时水量</div>
      <div class="modularBody" v-loading="chartInfo3.loading" element-loading-background="rgba(122, 122, 122, 0.2)">
        <shuiliang
          :refresh="chartInfo3.refresh"
          :XAxis="chartInfo3.XAxis"
          :YAxis="chartInfo3.YAxis"
          :typeName="chartInfo3.typeName"
        ></shuiliang>
      </div>
    </div>
  </div>
</template>

<script setup name="BengZhanRight">
import { ref, reactive, toRefs, onMounted } from 'vue';
import {
  listwaterRegionInfo,
  getBaseDetail,
  SWgetPumpDetail,
  RaingetPumpDetail,
  rainEcharts,
  sewageEcharts,
} from '@/api/MonitorAssetsOnMap';
import shuiliang from './components/shuiliang.vue';

const { proxy } = getCurrentInstance();
const AllData = reactive({
  // 泵站基础信息
  bengZhanInfo: {},
  // 是否展示出水量
  ChuShuiShow: true,
  // 进站水量
  jinZhan: {
    nowDay: '0',
    yesterday: '0',
    average: '0',
  },
  // 入厂水量
  ChuZhan: {
    nowDay: '0',
    yesterday: '0',
    average: '0',
  },
  BengjiObj: {
    pumpStates: [],
    waterlevel: '',
  },
});
const props = defineProps({
  // 专题
  TypeID: {
    default: '',
  },
  //类型
  Datatype: {
    type: String,
    default: '',
  },
  //id
  DataId: {
    default: '',
  },
});

const chartInfo3 = ref({
  refresh: 1,
  // XAxis: ['1', '2', '3', '4', '5'],
  // YAxis: [4, 5, 4, 6, 5, 1, 3],
  XAxis: [],
  YAxis: [],
  typeName: 'm³',
  loading: true,
});

const { pump_station_type } = proxy.useDict('pump_station_type');
// 获取基础数据信息 下面的进行变化
const getBengZhanInfo = () => {
  AllData.bengZhanInfo = {};
  getBaseDetail({
    dataId: props.DataId,
    dataCode: props.Datatype,
  }).then(res => {
    if (res && res.code == 200) {
      AllData.bengZhanInfo = res.data;
      Getbottominfo();
      GetEcharts();
    }
  });
};

//获取进站水量/入厂水量/泵机状态等数据
const Getbottominfo = () => {
  AllData.BengjiObj = {
    pumpStates: [],
    waterlevel: '',
  };
  AllData.jinZhan = {
    nowDay: '0',
    yesterday: '0',
    average: '0',
  };
  AllData.ChuZhan = {
    nowDay: '0',
    yesterday: '0',
    average: '0',
  };
  if (props.TypeID == 'rain') {
    AllData.ChuShuiShow = false;
    // 雨水
    RaingetPumpDetail({
      id: props.DataId,
    }).then(res => {
      if (res && res.code == 200) {
        AllData.BengjiObj = res.data.pumpStateDto;
        AllData.jinZhan = res.data.inFlow;
      }
    });
  } else {
    SWgetPumpDetail({
      id: props.DataId,
    }).then(res => {
      if (res && res.code == 200) {
        if (AllData.bengZhanInfo.grade == 1) {
          // 污水一级泵站
          AllData.ChuShuiShow = true;
          AllData.jinZhan = res.data.inFlow;
          AllData.ChuZhan = res.data.outFlow;
        } else {
          // 污水二级
          AllData.BengjiObj = res.data.pumpStateDto;
          AllData.jinZhan = res.data.inFlow;
          AllData.ChuShuiShow = false;
        }
      }
    });
    // 污水
    // 一级泵站 ChuShuiShow:true,二级泵站 ChuShuiShow:false
  }
};

// 获取雨水/污水Echarts
const GetEcharts = () => {
  chartInfo3.value.loading = true;
  chartInfo3.value.XAxis = [];
  chartInfo3.value.YAxis = [];
  chartInfo3.value.refresh = Math.random();

  let params = {
    id: props.DataId,
    start: proxy.moment(new Date().getTime()).format('YYYY-MM-DD 00:00:00'),
    end: proxy.moment(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss'),
  };
  if (props.TypeID == 'rain') {
    // 雨水
    rainEcharts(params).then(res => {
      if (res && res.code == 200) {
        chartInfo3.value.XAxis = res.data.times;
        chartInfo3.value.YAxis = res.data.datas;
        chartInfo3.value.loading = false;
        chartInfo3.value.refresh = Math.random();
      }
    });
  } else {
    sewageEcharts(params).then(res => {
      if (res && res.code == 200) {
        chartInfo3.value.XAxis = res.data.times;
        chartInfo3.value.YAxis = res.data.datas;
        chartInfo3.value.loading = false;
        chartInfo3.value.refresh = Math.random();
      }
    });
  }
};

// 获取水系信息
const alllist = ref([]);
function getListlast() {
  listwaterRegionInfo().then(response => {
    alllist.value = response.data;
  });
}
watch(
  () => props.DataId,
  val => {
    console.log('BengZhanRight组件的泵站id编号变了', val);
    getBengZhanInfo();
  },
  { immediate: true, deep: true }
);
onMounted(() => {
  getListlast();
});
</script>

<style lang="scss" scoped>
#BengZhanRight {
  width: 100%;
  height: 100%;

  .modular1_right {
    width: 100%;
    height: auto;
    overflow: auto;
    .ListInfo100 {
      width: 100%;
      height: auto;
      float: left;
      margin-top: 5px;
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      align-items: center;
      justify-content: flex-start;
      // box-sizing: border-box;
      // padding: 0 20px 0 10px;
    }
    .ListInfo_label {
      width: 75px;
      height: auto;
      line-height: 26px;
      text-align: center;
      font-family: Source Han Sans CN;
      font-weight: bold;
      font-size: 14px;
      color: #ccdfff;
    }
    .ListInfo_value {
      width: calc(100% - 75px);
      min-height: 26px;
      height: auto;
      line-height: 18px;
      background: #0d2359;
      border-radius: 6px;
      border: 1px solid #0b9bff;
      box-sizing: border-box;
      padding: 5px 5px 5px 10px;
      font-family: Source Han Sans CN;
      font-weight: 400;
      font-size: 14px;
      color: #00fcff;
    }
  }
  .modular2_right {
    width: 100%;
    height: 120px;
    .modularBody {
      width: 100%;
      height: calc(100% - 50px);
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      justify-content: space-evenly;
      align-items: center;
      .SLList {
        display: inline-block;
        width: 33.33%;
        height: 80px;
        box-sizing: border-box;
        padding: 15px 0;
        background-image: url('@/assets/images/pictureOnMap/SLFX2.png');
        background-repeat: no-repeat;
        background-size: contain;
        .SlList1P {
          width: 100%;
          height: 25px;
          line-height: 25px;
          text-align: center;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          .SlListNum {
            font-family: DINPro;
            font-weight: bold;
            font-size: 22px;
            color: #00fcff;
          }
          .SlListUnit {
            font-family: Source Han Sans CN;
            font-weight: 400;
            font-size: 16px;
            color: #ccdfff;
          }
        }
        .SlList2P {
          font-family: Source Han Sans CN;
          font-weight: 400;
          font-size: 16px;
          color: #ffffff;
          height: 25px;
          line-height: 25px;
          text-align: center;
        }
      }
    }
  }

  .modular3_right {
    width: 100%;
    height: 180px;
    .modularBody {
      width: 100%;
      height: calc(100% - 50px);

      .bengjibox {
        height: 90px;
        display: flex;
        margin-left: 2.5%;
        .bengji {
          margin-right: 5px;
          .icon {
            width: 63px;
            height: 60px;
            background-image: url('@/assets/images/pictureOnMap/bengzhan-chang.png');
            background-size: 100% 100%;

            &.kai {
              background-image: url('@/assets/images/pictureOnMap/bengzhan-kai.png');
              background-size: 100% 100%;
            }
            &.yichang {
              background-image: url('@/assets/images/pictureOnMap/bengzhan-yichang.png');
              background-size: 100% 100%;
            }
          }

          .name {
            font-family: Source Han Sans CN;
            font-weight: 400;
            font-size: 16px;
            color: #ccdfff;
            text-align: center;
          }
        }
      }

      .mianban {
        position: relative;
        background-image: url('@/assets/images/pictureOnMap/mianban.png');
        background-size: 100% 100%;
        height: 32px;
        margin-left: 2.5%;
        width: 95%;

        .mianban1 {
          position: absolute;
          left: 40px;
          top: 44%;
          transform: translateY(-50%);
          font-family: Source Han Sans CN;
          font-weight: 400;
          font-size: 14px;
          color: #ffffff;
          line-height: 23px;
        }

        .mianban2 {
          position: absolute;
          font-family: DINPro;
          top: 44%;
          transform: translateY(-50%);
          right: 20px;
          font-weight: 500;
          font-size: 16px;
          color: #00fcff;
          line-height: 23px;

          .unit {
            margin-left: 5px;
            font-family: Source Han Sans CN;
            font-weight: 400;
            font-size: 14px;
            color: #ffffff;
            line-height: 23px;
          }
        }
      }
    }
  }
  .modular4_right {
    width: 100%;
    height: 220px;
    .modularBody {
      width: 100%;
      height: calc(100% - 50px);
    }
  }
}
</style>