Newer
Older
Nanping_sponge_SJJC / src / views / dataAnalysis / syntheticData / index.vue
@liyingjing liyingjing on 3 Nov 7 KB 2
<template>
  <!-- 综合监测分析 -->
  <div class="syntherticData app-container">
    <!-- 头部 -->
    <div class="synHead">
      <div
        :class="['part', checkedKey == item.key ? 'changed' : '']"
        v-for="item in headArr"
        :key="item.key"
        @click="changeHeadData(item.key)"
      >
        <img :src="getImgMonitorIcon(item.imgUrl)" :alt="item.name" />
        <p>{{ item.name }}</p>
        <p class="value">{{ item.value }}</p>
      </div>
    </div>
    <div class="content">
      <!-- 左侧 -->
      <div class="synLeft">
        <EquipLeft :monitorTargetType="checkedKey" @getDialogData="getDialogData"></EquipLeft>
      </div>
      <!-- 右侧 -->
      <div class="synRight">
        <EquipRight></EquipRight>
      </div>
    </div>
    <!-- 弹窗 v-divDrag-->
    <div
      class="dialogDetail"
      v-divDrag="dialogType == 'dialogVideo' ? false : true"
      v-if="showDialogSelf"
      :style="{
        bottom: ifExpend ? '' : '20px',
        right: ifExpend ? '' : '20px',
        top: ifExpend ? '' : 'auto',
        left: ifExpend ? '' : 'auto',
        height: ifExpend ? '330px' : '40px',
      }"
    >
      <div class="dialogTitle">
        <p>{{ dialogName }}</p>
        <p>
          <el-icon title="收起" @click="dialogMinus"><Bottom /></el-icon>
          <el-icon title="展开" @click="dialogPlus"><Top /></el-icon>
          <el-icon title="关闭" @click="dialogClose"><Close /></el-icon>
        </p>
      </div>
      <div
        :class="['dialogCont', 'animate__animated', ifExpend ? 'animate__fadeInUp' : 'animate__fadeOutDown']"
        :style="{ height: ifExpend ? '280px' : '0px' }"
      >
        <!-- 数据状态- 故障及离线设备分析-->
        <EquipFault v-if="dialogType == 'dialogFault'" :stationRow="stationRow"></EquipFault>
        <!-- 数据状态- 数据异常分析-->
        <DataError v-if="dialogType == 'dialogSjyc'" :stationRow="stationRow"></DataError>
        <!-- 站点状态- 运维派单-->
        <EquipRepair v-if="dialogType == 'dialogOrder'" @closeRightLayer="dialogClose"></EquipRepair>
        <!-- 站点- 查看视频监控-->
        <EquipVideo v-if="dialogType == 'dialogVideo'"></EquipVideo>
      </div>
    </div>
  </div>
</template>
<script setup name="syntherticData">
import { getSiteInfoCountZH } from '@/api/dataAnalysis/syntherticData';
import { getImgMonitorIcon } from '@/utils/validate';
import EquipLeft from './equipLeft.vue'; //左侧内容
import EquipRight from './equipRight.vue'; //右侧内容

import EquipFault from './equipFault.vue'; //数据状态- 故障及离线设备分析
import DataError from './dataError.vue'; //数据状态- 数据异常分析
import EquipRepair from './equipRepair.vue'; //站点状态- 运维派单
import EquipVideo from './equipVideo.vue'; //站点- 查看视频监控

const { proxy } = getCurrentInstance();

// 变量声明
const headArr = reactive([
  { name: '全部', value: '', imgUrl: 'all_icon.png', key: '' },
  {
    name: '典型项目',
    value: '(4水质、4水位自建 市局20处共享)',
    imgUrl: 'river_icon.png',
    key: 'river',
  },
  {
    name: '典型片区',
    value: '(4水质、4水位自建 市局20处共享)',
    imgUrl: 'lake_icon.png',
    key: 'lake',
  },
  { name: '海绵设施', value: '', imgUrl: 'gqjc_icon.png', key: 'pipeline' },
  { name: '片区雨量', value: '', imgUrl: 'line_icon.png', key: 'channel' },
  // { name: '管网', value: '', imgUrl: 'line_icon.png', key: 'pipeline' },
  // { name: '典型地块', value: '', imgUrl: 'land_icon.png', key: 'typicalLand' },
]);
const checkedKey = ref('');
const showDialogSelf = ref(false); //弹窗显示隐藏
const ifExpend = ref(true); //弹窗是否放大缩小
const dialogName = ref(''); //弹窗标题
const dialogType = ref(''); //弹窗具体显示内容
const stationRow = ref({}); //弹窗具体参数
// 方法
function changeHeadData(key) {
  checkedKey.value = key;
}
// 获取不同监测类型对应数量
const getStationCount = async () => {
  let res = await getSiteInfoCountZH();
  if (res && res.code == 200) {
    let datas = res.data;
    headArr[0].value = datas.total; //全部
    headArr[1].value = datas.river; //河道
    headArr[2].value = datas.lake; //湖泊监测
    headArr[3].value = datas.pipeline; //港渠监测
    headArr[4].value = datas.channel; //管网
    headArr[5].value = datas.typical_land; //典型地块
  }
};
// 缩小
function dialogMinus() {
  ifExpend.value = false;
  // 海康视频打开时要隐藏
  if (window.videoWebControl != null) {
    window.videoWebControl.JS_HideWnd();
  }
}
// 放大
function dialogPlus() {
  ifExpend.value = true;
  // 海康视频打开时要显示
  if (window.videoWebControl != null) {
    window.videoWebControl.JS_ShowWnd();
  }
}
// 关闭
function dialogClose() {
  showDialogSelf.value = false;
}
// 左侧列表点击弹窗,获取子组件传值
function getDialogData(param) {
  // console.log('接收子组件传值--', showDialogSelf.value);
  dialogName.value = param.name;
  dialogType.value = param.type;
  stationRow.value = param.obj;
  ifExpend.value = true;
  // 左侧列表,其他站点点击时也加载对应内容
  if (showDialogSelf.value) {
    showDialogSelf.value = false;
  }
  setTimeout(() => {
    showDialogSelf.value = true;
  });
}

// 初始化
onMounted(() => {
  getStationCount(); //获取不同监测类型对应数量
  changeHeadData(''); //默认显示全部
});
// 页面销毁
onBeforeUnmount(() => {
  localStorage.removeItem('searchDateRangeEquip');
});
</script>
<style lang="scss" scoped>
.syntherticData {
  width: 100%;
  height: calc(100vh - 84px);
  background: #f5f7fe;
  position: relative;
  .synHead {
    width: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 10px 0px;
    margin-top: -10px;
    .part {
      line-height: 25px;
      display: flex;
      align-items: center;
      cursor: pointer;
      height: 40px;
      padding: 5px 8px;
      img {
        margin-right: 6px;
      }
      .value {
        color: #3782ff;
      }
      &:hover {
        background: #e4eeff;
      }
    }
    .changed {
      background: #e4eeff;
      border: 1px solid #3782ff;
      border-radius: 2px;
      animation-duration: 1s;
    }
  }
  .content {
    display: flex;
    margin-top: 10px;
    height: 93%;
    .synLeft {
      width: 320px;
      background: #eef1fb;
    }
    .synRight {
      flex: 1;
      margin-left: 10px;
      width: 100%;
      overflow-x: auto;
    }
  }
  .dialogDetail {
    position: absolute;
    z-index: 999;
    right: 20px;
    bottom: 10px;
    background: #fff;
    box-shadow: 0px 2px 26px 0px rgba(28, 52, 92, 0.3);
    width: 900px;
    border-radius: 8px;
    .dialogTitle {
      width: 100%;
      height: 50px;
      line-height: 50px;
      background: #0f69ff;
      color: #fff;
      border-radius: 8px 8px 0 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0 15px;
      p {
        font-size: 17px;
      }
      .el-icon {
        font-size: 30px;
        cursor: pointer;
        margin-top: 20px;
        margin-left: 15px;
        &:hover {
          transform: scale(1.05);
        }
      }
    }
    .dialogCont {
      overflow: auto;
      padding: 10px;
    }
  }
}
</style>