Newer
Older
Nanping_sponge_GCYPG / src / views / AlertService / index.vue
@liyingjing liyingjing on 25 Oct 3 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="synRight">
        <EquipRight :positionKey="checkedKey" @getDialogData="getDialogData"></EquipRight>
      </div>
    </div>
   
  </div>
</template>
<script setup name="syntherticData">
import {} from '@/api/dataAnalysis/syntherticData';
import { getImgMonitorIcon } from '@/utils/validate';
import EquipRight from './equipRight.vue'; //右侧内容
const { proxy } = getCurrentInstance();
// 变量声明
const headArr = [
  { name: '全部', value: '(合计97处)', imgUrl: 'all_icon.png', key: '1' },
  {
    name: '水位告警',
    value: '(4)',
    imgUrl: 'river_icon.png',
    key: '2',
  },
  { name: '流量告警', value: '(97处)', imgUrl: 'gqjc_icon.png', key: '3' },
  { name: '水质告警', value: '(合计7处)', imgUrl: 'line_icon.png', key: '4' },
  { name: '其他告警', value: '(合计197处)', 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 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>