Newer
Older
Nanping_sponge_HHDP / src / views / Sponge_screen / HaiMianScreen / index.vue
@liyingjing’ liyingjing’ on 1 Dec 7 KB 1
<template>
  <div id="index">
    <div id="screenHeader">
      <!-- 标题 -->
      <div class="TitleFont" @click="TitleClick()">海绵一张图</div>
      <!-- 菜单 -->
      <div class="MenuBox">
        <div
          v-for="item in AllData.MenuData"
          :key="item.key"
          class="MenuList"
          :class="{ MenuActive: AllData.ActiveKey == item.key }"
          @click="MenuClick(item)"
        >
          {{ item.name }}
        </div>
      </div>

      <!-- 右侧信息 -->
      <div class="RightBox">
        <el-tooltip content="返回首页" effect="dark" placement="bottom">
          <back-home id="screenfull" class="right-menu-item hover-effect"></back-home>
        </el-tooltip>
      </div>
    </div>
    <div id="screenBody">
      <!-- 地图 -->
      <Map></Map>
      <!-- 智慧海绵 -->
      <ZHHM v-if="AllData.ActiveKey == 0"></ZHHM>
      <!-- 工程评价 -->
      <GCPJ v-if="AllData.ActiveKey == 1" :key="isKEy"></GCPJ>
      <!-- 监测评价 -->
      <JCPJ v-if="AllData.ActiveKey == 2"></JCPJ>
      <!-- 绩效考核 -->
      <JXKH v-if="AllData.ActiveKey == 3"></JXKH>
      <!-- 图例 -->
      <TuLi
        v-show="AllData.ActiveKey == 2 || AllData.ActiveKey == 1"
        :Type="AllData.ActiveKey"
      ></TuLi>
      <!-- 综合弹窗 -->
      <el-dialog
        class="pmpSitNewDialog"
        v-model="AllData.GG_dialogVisible"
        :title="AllData.pmpSitNewDialogTitle"
        width="1400px"
        :append-to-body="true"
        :destroy-on-close="true"
        :close-on-press-escape="false"
      >
        <DialogTabs
          :dataID="AllData.getSiteId"
          :SiteNo="AllData.SiteNo"
          :comIDs="AllData.comIDs"
          :customComponents="AllData.customData"
          :RefName="AllData.RefName"
        ></DialogTabs>
      </el-dialog>
    </div>
  </div>
</template>

<script setup>
import { ref, reactive, toRefs, onMounted, markRaw } from "vue";
import BackHome from "@/components/BackHome";
import bus from "@/bus";
// 引入地图
import Map from "./../Map";
// 引入专题图组件
import ZHHM from "./../components/zhiHuiHaiMian";
import GCPJ from "./../components/gongChengPingJia";
import JCPJ from "./../components/jianCePingJia";
import JXKH from "./../components/jiXIaoKaoHe";
// 引用图例
import TuLi from "./../TuLi/index.vue";
// 引入弹窗
import DialogTabs from "./../DialogTabs/dialogTabs";
// 引入接口

import {
  // waterloggingPointList,
  rtuSiteInfoDynamicTab,
  projectlnfoNewDynamicTab,
} from "@/api/dataAnalysis/syntherticData";
const isKEy = ref(0);
const AllData = reactive({
  // 顶部专题切换
  MenuData: [
    // {
    //   name: "智慧海绵",
    //   key: 0,
    // },
    {
      name: "工程评价",
      key: 1,
    },
    {
      name: "监测评价",
      key: 2,
    },
    {
      name: "绩效考核",
      key: 3,
    },
  ],
  ActiveKey: 1,
  // 公共弹窗数据项
  GG_dialogVisible: false,
  getSiteId: "",
  SiteNo: "",
  comIDs: [],
  customData: [],
  RefName: "",
  pmpSitNewDialogTitle: "公共弹窗标题",
});
const MenuClick = (item) => {
  console.log(item, "item");
  AllData.ActiveKey = item.key;
  // isKEy.value++;
  newfiberMap.setAllFeaturesVisible(false);
};
// const BackHome = ref(null);
const TitleClick = () => {};
// 需要默认加载的图层数据
const initMapsData = () => {
  // 易涝点数据
  // waterloggingPointList().then((res) => {
  //   console.log(`这里拿到了内涝点数据`,'res');
  //   res.data.forEach((element) => {
  //     element.siteType = "waterlogging";
  //     element.stName = element.name;
  //   });
    // bus.emit("setProjects", res);
    // bus.emit("zeiLaoPoint", res);
  // });
};
/**
 *  获取tab页的数据
 * */
const getDialogTabsData = (row) => {
  console.log(row,7777);
  if (row?.gisType == "project") {
     sessionStorage.setItem('getProjectInfo',row.projectNo)
      projectlnfoNewDynamicTab(row?.id||0).then((res) => {
      if (res.code == 200) {
        AllData.comIDs = res?.data;
        AllData.GG_dialogVisible = true;
        AllData.getSiteId = row?.id;
        AllData.SiteNo = row?.stCode;
        AllData.pmpSitNewDialogTitle = row?.title;
        AllData.RefName = row?.RefName;
      }
    });
  }
  
  else if (row.gisType == "site") {
    rtuSiteInfoDynamicTab(row.stCode).then((res) => {
      if (res.code == 200) {
        AllData.comIDs = res.data;
        AllData.GG_dialogVisible = true;
        AllData.getSiteId = row.id;
        AllData.SiteNo = row.stCode;
        AllData.pmpSitNewDialogTitle = row.projectName;
        AllData.RefName = row.RefName;
      }
    });
  }
};
onMounted(() => {
  initMapsData();
  bus.on("mapClick", (row) => {
    getDialogTabsData(row);
  });
  // mitt事件监听
  // bus.off("OpenDialog_GongGong");
  // bus.on("OpenDialog_GongGong", (val) => {
  //   // AllData.GG_dialogVisible = true;
  //   console.log(`--`, val);
  //   // AllData.getSiteId = val.id;
  //   // AllData.SiteNo = val.stCode;
  //   // AllData.pmpSitNewDialogTitle = val.stName;
  // });
});
</script>

<style scoped lang="scss">
#index {
  width: 100%;
  height: 100%;
  background: #010e22;

  #screenHeader {
    width: 100%;
    height: 80px;
    background: url("@/assets/images/Sponge_screen/HeaderBG.png") 100% 100%;
    position: relative;

    .TitleFont {
      position: absolute;
      left: 0;
      top: 0;
      font-size: 36px;
      font-family: "PangMenZhengDao";
      font-weight: 400;
      font-style: italic;
      color: #eaeaff;
      height: 80px;
      line-height: 80px;
      width: 400px;
      text-align: center;
      cursor: pointer;
    }
    .MenuBox {
      position: absolute;
      left: 500px;
      top: 0;
      height: 80px;
      font-size: 18px;
      font-family: Source Han Sans CN;
      font-weight: 500;
      color: #a4bfd9;
      width: 800px;
      padding: 20px 0;

      .MenuList {
        float: left;
        margin-left: 50px;
        width: 120px;
        height: 42px;
        line-height: 40px;
        text-align: center;
        cursor: pointer;
      }
      .MenuActive {
        width: 120px;
        height: 42px;
        line-height: 40px;
        font-size: 18px;
        font-family: Source Han Sans CN;
        font-weight: 500;
        color: #ffffff;
        box-sizing: border-box;
        background: #051734;
        border: 1px solid #2593ff;
        border-radius: 20px;
        position: relative;

        &:after {
          content: "";
          position: absolute;
          width: 40px;
          height: 2px;
          background: #ffc901;
          border-radius: 1px;
          bottom: 4px;
          left: 50%;
          margin-left: -20px;
        }
      }
    }

    .RightBox {
      position: absolute;
      left: 1300px;
      text-align: right;
      box-sizing: border-box;
      padding-left: 550px;
      height: 80px;
      line-height: 80px;
    }
  }

  #screenBody {
    width: 100%;
    height: calc(100% - 80px);
    position: relative;
  }
}
</style>
<!-- 公共弹窗样式为全局 -->
<style lang="scss">
.pmpSitNewDialog {
  height: 830px;

  .el-dialog__header {
    height: 46px;
    border-bottom: none;
    padding: 10px 0px;
    width: 100%;
    background: linear-gradient(0deg, #021f56 0%, #042d7b 100%);
    position: relative;

    .el-dialog__title {
      font-size: 18px;
      font-family: Source Han Sans CN;
      font-weight: 500;
      color: #ffffff;
      margin-left: 20px;
      &:after {
        content: "";
        width: 7px;
        height: 46px;
        background: linear-gradient(90deg, #00b4ff 0%, #004ccb 100%);
        position: absolute;
        left: 0;
        top: 0;
      }
    }

    .el-dialog__headerbtn {
      width: 46px;
      height: 46px;
      top: 2px;
      .el-dialog__close {
        color: #1096db;
        font-size: 20px;
      }
    }

    &::after {
      display: none;
    }
  }

  .el-dialog__body {
    background: #021534;
    padding: 0px 24px 24px 10px;
    height: calc(100% - 46px);
    width: 100%;
  }
}
</style>