Newer
Older
Nanping_sponge_GCYPG / src / views / dataAnalysis / syntheticData / index.vue
@liyingjing liyingjing on 25 Oct 2023 5 KB 工程预评估
<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 :positionKey="checkedKey" @getDialogData="getDialogData"></EquipLeft>
      </div>
      <!-- 右侧 -->
      <div class="synRight">
        <EquipRight :positionKey="checkedKey" @getDialogData="getDialogData"></EquipRight>
      </div>
    </div>
    <!-- 弹窗 v-divDrag-->
    <div
      class="dialogDetail"
      v-divDrag
      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' }"
      >
        <!-- 站点分析 -->
        <StationDialog v-if="dialogType == 'dialogDbfx'"></StationDialog>
        <!-- 数据状态- 故障及离线设备分析-->
        <EquipFault v-if="dialogType == 'dialogFault'"></EquipFault>
        <!-- 数据状态- 数据异常分析-->
        <DataError v-if="dialogType == 'dialogSjyc'"></DataError>
        <!-- 站点状态- 运维派单-->
        <EquipRepair v-if="dialogType == 'dialogOrder'"></EquipRepair>
        <!-- 站点- 查看视频监控-->
        <EquipVideo v-if="dialogType == 'dialogVideo'"></EquipVideo>
      </div>
    </div>
  </div>
</template>
<script setup name="syntherticData">
import {} from '@/api/dataAnalysis/syntherticData';
import { getImgMonitorIcon } from '@/utils/validate';
import EquipLeft from './equipLeft.vue'; //左侧内容
import EquipRight from './equipRight.vue'; //右侧内容
import StationDialog from './stationDialog.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 = [
  { name: '全部', value: '(合计97处)', imgUrl: 'all_icon.png', key: '1' },
  {
    name: '湖泊监测',
    value: '(4水质、4水位自建 市局20处共享)',
    imgUrl: 'river_icon.png',
    key: '2',
  },
  { name: '港渠监测', value: '(合计97处)', imgUrl: 'gqjc_icon.png', key: '3' },
  { name: '管网', value: '(合计97处)', imgUrl: 'line_icon.png', key: '4' },
  { name: '典型地块', value: '(合计97处)', imgUrl: 'land_icon.png', key: '5' },
];
const checkedKey = ref('1');
const showDialogSelf = ref(false); //弹窗显示隐藏
const ifExpend = ref(true); //弹窗是否放大缩小
const dialogName = ref(''); //弹窗标题
const dialogType = ref(''); //弹窗具体显示内容
// 方法
function changeHeadData(key) {
  checkedKey.value = key;
}
// 缩小
function dialogMinus() {
  ifExpend.value = false;
}
// 放大
function dialogPlus() {
  ifExpend.value = true;
}
// 关闭
function dialogClose() {
  showDialogSelf.value = false;
}
// 对比分析,获取子组件传值
function getDialogData(obj) {
  console.log('接收子组件传值--', obj);
  dialogName.value = obj.name;
  dialogType.value = obj.type;
  ifExpend.value = true;
  showDialogSelf.value = true;
}

// 初始化
onMounted(() => {
  changeHeadData('1'); //默认显示全部
});
// 页面销毁
onBeforeUnmount(() => {});
</script>
<style lang="scss" scoped>
.syntherticData {
  width: 100%;
  height: calc(100vh - 84px);
  background: #f5f7fe;
  position: relative;
  .synHead {
    width: 100%;
    height: 70px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-around;
    .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: 400px;
      background: #eef1fb;
    }
    .synRight {
      margin-left: 10px;
      width: 100%;
    }
  }
  .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;
      border: 1px solid red;
    }
  }
}
</style>