<!--
 * @Author: sjl
 * @Date: 2021-09-08 16:19:24
 * @Descripttion:
-->
<template>
  <div class="xtjc-left-side" v-show="mapStore.rightSideMenu">
    <div class="leafTotal">
      <i>当前预警</i>
    </div>
    <div class="total3">
      <a-tabs v-model:activeKey="activeKey" class="user">
        <a-tab-pane key="1">
          <template #tab>
            <span> 设备预警 </span>
          </template>
          <ul class="bjj">
            <li><span> </span><b>注意级</b></li>
            <li><span> </span><b>警示级</b></li>
            <li><span> </span><b>警戒级</b></li>
            <li><span> </span><b>警报级</b></li>
          </ul>
        </a-tab-pane>
        <a-tab-pane key="2">
          <template #tab>
            <span>综合预警 </span>
          </template>
          <ul class="bjj">
            <li><span> </span><b>注意级</b></li>
            <li><span> </span><b>警示级</b></li>
            <li><span> </span><b>警戒级</b></li>
            <li><span> </span><b>警报级</b></li>
          </ul>
        </a-tab-pane>
      </a-tabs>
    </div>
    <dzfxxxtj />
    <!-- <dzfxxxtjlb /> -->

    <div class="leafTotal leafTotal2">
      <i>工程列表</i>
    </div>
    <div class="total projectList">
      <template v-for="item in gcList" :key="item.id">
        <div class="imageItem" @click="changeProject(item)">
          <div class="imageItem2" :class="{ active: selectedOption === item.id }">
            <!-- fallback="./static/img/noData.png" -->
            <a-image
              :src="item.filePath || ''"
              :preview="false"
              fallback="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/E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oVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="
            />
            <span> {{ item.gcmc }}</span>
          </div>
        </div>
      </template>
    </div>
  </div>
</template>

<script>
import { defineComponent, reactive, ref, toRefs } from 'vue';
import { CaretRightOutlined } from '@ant-design/icons-vue';
import dzfxxxtj from './dzfxxxtj.vue';
import dzfxxxtjlb from './dzfxxxtjlb.vue';
import TFMapUitl from '/@/utils/TFMapUitl.ts';
import { getGcBaseinfoList, getloadImg } from '/@/api/map/getData.ts';
import { useGeologicalStore } from '/@/store/modules/geological';
import { useMapStore } from '/@/store/modules/map';
export default defineComponent({
  name: 'TotalStatis',
  components: {
    CaretRightOutlined,
    dzfxxxtj,
    dzfxxxtjlb,
  },
  setup() {
    const mapStore = useMapStore();
    const gcList = reactive([]);
    const geologicalStore = useGeologicalStore();
    getList();
    function getList() {
      TFMapUitl.clearArray(gcList);
      getGcBaseinfoList({ current: 1, size: 1000 }).then((e) => {
        if (e.code == 1 && e.result) {
          e.result.forEach((item) => {
            item.filePath = getloadImg(item.filePath);
          });
          gcList.push(...e.result);
        }
      });
    }
    // 工程点击事件
    function editStyle(i, d) {
      map.openInfoWindowHtml(TFMapUitl.gcdMarkerDom(i), { position: d }, () => {
        if (activeMarker) activeMarker.update();
        TFMapUitl.clearPointLocation_list(map);
      });
      map.popup.setOffset(-235, 80);
    }
    const selectedOption = ref(0);
    window.activeMarker = null;
    const changeProject = (i) => {
      selectedOption.value = i.id;
      let op = {
        destination: { x: i.x, y: i.y, z: 15000 },
        orientation: { heading: 6.283185307179586, pitch: -1.5688928482139568, roll: 0 },
      };
      console.log('工程点击事件:', i);
      if (activeMarker) activeMarker.update();
      activeMarker = map.findOverlay(`gcd&${i.id}`);
      if (activeMarker) activeMarker.update();
      geologicalStore
        .getVisualangle({
          type: 'gc',
          typeId: i.id + '',
        })
        .then((res) => {
          console.log('222222:', res);
          var d = [i.x, i.y, map.terrain ? i.z : 0];
          if (res) {
            map.flyTo(res, 1, () => TFMapUitl.trends(d, null, true), editStyle(i, d));
          } else {
            TFMapUitl.trends(d, () => editStyle(i, d));
          }
        });

      // var offX = -0.0011020644091672693;
      // var offY = -0.10000597031959854;
      // let op = {
      //   destination: { x: i.x + offX, y: i.y + offY, z: 15000 },
      //   orientation: { heading: 6.283185307179586, pitch: -0.8647515185678438, roll: 6.283185307179586 },
      // };

      // map.flyTo(op, 1, () => {
      //   var p = [i.x, i.y, i.z];
      //   TFMapUitl.mapPointLocation_list(p);
      //   var html = TFMapUitl.gcdMarkerDom(i);
      //   map.openInfoWindowHtml(html, { position: p }, () => {
      //     TFMapUitl.clearPointLocation_list(map);
      //   });
      //   map.popup.setOffset(0, -10);
      // });
      //new
      // var p = [i.x, i.y, i.z];
      // TFMapUitl.mapLocation(p, () => {
      //   var html = TFMapUitl.gcdMarkerDom(i);
      //   map.openInfoWindowHtml(html, { position: p }, () => {
      //     TFMapUitl.clearPointLocation_list(map);
      //   });
      //   map.popup.setOffset(0, -10);
      // });
    };

    return {
      mapStore,
      // geoList,
      gcList,
      activeKey: ref('1'),
      selectedOption,
      changeProject,
    };
  },
});
</script>

<style lang="less" scoped>
@font-face {
  font-family: 'AgencyFB';
  src: url('../../assets/font/AgencyFB-Bold.ttf');
}
@font-face {
  font-family: 'AlimamaShuHeiTi';
  src: url('../../assets/font/AlimamaShuHeiTi-Bold.ttf');
}
.xtjc-left-side {
  animation-name: move;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
}
@keyframes move {
  0% {
    right: -400px;
  }
  100% {
    right: 20px;
  }
}
::v-deep .ant-tabs-bar {
  border-bottom: 0px solid #303030 !important;
}
::v-deep .ant-tabs-nav .ant-tabs-tab-active {
  // color: #ffe75c !important;
}
::v-deep .ant-tabs-nav .ant-tabs-tab-active {
  // background: url('../../assets/images/sjx1.png') no-repeat 0px 10px;
}
::v-deep .ant-tabs-nav-animated > div {
  display: flex;
  justify-content: center;
}
::v-deep .ant-tabs-nav-animated > div > div {
  flex: 1;
  text-align: center;
}
::v-deep .total3 .ant-tabs-nav .ant-tabs-tab-active {
  // background: url('../../assets/images/sjx1.png') no-repeat 42px 9px;
  background: url('../../assets/images/tab.png') no-repeat;
  // width: 45px;
  background-position: 6px 3px;
  background-size: 100% 100%;
  height: 54px;
  line-height: 40px;
  margin-top: -6px;
}

::v-deep .ant-tabs-nav-wrap {
  z-index: 999;
  // height: 38px;
  // width: 300px;
  background-size: 100% 85% !important;
  // margin: 10px 15px;
  background: url('../../assets/images/tab-背景.png') no-repeat;
}
::v-deep span.anticon.anticon-caret-right svg path {
  box-shadow: 0 0 10px 5px yellow;
  background: linear-gradient(to right, yellow, #fff);
}
::v-deep .ant-tabs-nav .ant-tabs-tab {
  margin-left: -10px;
  // margin-right: 0px;
  padding: 6px 10px 4px 26px;
}
.bjj {
  display: flex;
  justify-content: space-evenly;
  margin-top: 10px;
}
.bjj li {
  display: inline-block;
}
.bjj li span {
  display: block;
  width: 65px;
  height: 65px;
  margin-bottom: 10px;
  font-family: 'AgencyFB';
  text-align: center;
  line-height: 32px;
  background: url('../../assets/images/yjn-04.png') no-repeat;
  background-size: 65px 65px;
  background-position: 3px 0px;
  font-size: 24px;
  font-weight: bold;
  font-style: italic;
}
.bjj li:nth-child(2) span {
  background: url('../../assets/images/yjn-03.png') no-repeat;
  background-size: 65px 65px;
  background-position: 3px 0px;
}
.bjj li:nth-child(3) span {
  background: url('../../assets/images/yjn-02.png') no-repeat;
  background-size: 65px 65px;
  background-position: 3px 0px;
}
.bjj li:nth-child(4) span {
  background: url('../../assets/images/yjn-01.png') no-repeat;
  background-size: 65px 65px;
  background-position: 3px 0px;
}
.bjj li b {
  color: #fff;
  width: 56px;
  display: block;
  text-align: center;
  font-size: 15px;
  font-family: 'AlimamaShuHeiTi';
  margin-left: 7px;
}
::v-deep .ant-tabs-ink-bar {
  visibility: hidden;
}

::v-deep .ant-tabs-top > .ant-tabs-nav::before,
.ant-tabs-bottom > .ant-tabs-nav::before,
.ant-tabs-top > div > .ant-tabs-nav::before,
.ant-tabs-bottom > div > .ant-tabs-nav::before {
  border-bottom: 0px;
}
::v-deep .ant-tabs {
  color: #69aeec !important;
}
::v-deep .ant-tabs-nav .ant-tabs-tab-active {
  color: #fff !important;
}
::v-deep .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
  // color: #ffe75c;
}
::v-deep .ant-tabs-tab {
  // font-size: 18px;
  // font-weight: bold;
  font-size: 16px;
  font-weight: normal !important;
}
.ant-tabs-tab-active {
  // background-color: yellow;
}
.tab-content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  font-size: 24px;
}

.icon {
  margin-right: 16px;
}

.text {
  color: #333;
}
::v-deep .ant-tabs > .ant-tabs-nav .ant-tabs-nav-list,
.ant-tabs > div > .ant-tabs-nav .ant-tabs-nav-list {
  height: 32px;
}
.total3 {
  position: relative;
  padding: 15px 20px;
  width: 400px;
  height: 200px;
  color: #fff;
  border: 1px solid transparent;
  background: rgba(3, 49, 79, 0.4);
  border-image: linear-gradient(to right, #134564, #2eb3ff, #134564) 1;
}
.total3:before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 1px;
  height: 100%;
  border-left: 1px solid transparent;
  border-radius: 5px;
  border-image: linear-gradient(rgba(39, 209, 238, 0.3) 0%, #00d0e3 50%, rgba(255, 255, 255, 0) 99%) 1;
  // background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1),rgba(253, 253, 253, 0.3));
}
.total3:after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 1px;
  height: 100%;
  border-right: 1px solid transparent;
  border-radius: 5px;
  border-image: linear-gradient(rgba(39, 209, 238, 0.3) 0%, #00d0e3 50%, rgba(255, 255, 255, 0) 99%) 1;
}
.xtjc-left-side {
  // position: fixed;
  position: absolute;
  right: 20px;
  top: 90px;
  z-index: 3;
  width: 400px;
  // height: 100%;
}
.leafTotal {
  width: 400px;
  height: 47px;
  background: url('../../assets/images/jcsbtj.png') no-repeat;
  // background: url('../../assets/images/panels.png') no-repeat;
  // background-position: -14px -13px;
  //   background-size: 101% 131%;
  font-size: 19px;
  font-weight: bold;
  color: #fff;
  line-height: 38px;
  margin: 0px 0px 5px 0px;
}
.leafTotal i {
  margin-left: 32px;
  font-family: 'AlimamaShuHeiTi';
  margin-right: 98px;
  font-weight: bold;
  // font-style: normal;
  margin-left: 32px;
  margin-right: 98px;

  // background-image:-webkit-linear-gradient(bottom,#6FCFFF,#fff);
  //   -webkit-background-clip:text;
  //   -webkit-text-fill-color:transparent;
}
.leafTotal b {
  font-weight: normal;
  font-size: 15px;
  color: #a7e6fa;
}

.leafTotal2 {
  margin: 20px 0px 20px 0px;
}

.leafTotal2 {
  margin: 20px 0px 5px 0px !important;
}

.projectList span {
  // width: 83px;
  // height: 29px;
  // margin: 8px 10px;
  // display: inline-block;
  // text-align: center;
  // line-height: 29px;
  // cursor: pointer;
  // background: url('../../assets/images/projectList2.png') no-repeat;
}

.projectList span.active {
  background: url('../../assets/images/projectList.png') no-repeat;
}

.total {
  // padding: 20px;
  // padding-top: 29px;
  width: 400px;
  // height: 184px;
  // height: calc(100% - 800px) !important;
  height: 275px;
  color: #fff;
  border: 1px solid transparent;
  background: rgba(3, 49, 79, 0.4);
  border-image: linear-gradient(to right, #134564, #2eb3ff, #134564) 1;
  display: flex;
  position: relative;
  flex-flow: row wrap;
  overflow-y: auto;
  padding-left: 10px;
  // align-items: ;
  align-items: flex-start;
  align-content: flex-start; /* 添加这行代码 */
}
.total:before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 1px;
  height: 100%;
  border-left: 1px solid transparent;
  border-radius: 5px;
  border-image: linear-gradient(rgba(39, 209, 238, 0.3) 0%, #00d0e3 50%, rgba(255, 255, 255, 0) 99%) 1;
  // background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1),rgba(253, 253, 253, 0.3));
}
.total:after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 1px;
  height: 100%;
  border-right: 1px solid transparent;
  border-radius: 5px;
  border-image: linear-gradient(rgba(39, 209, 238, 0.3) 0%, #00d0e3 50%, rgba(255, 255, 255, 0) 99%) 1;
}

.imageItem {
  width: 33%;
  position: relative;
  padding: 10px 10px 0px 0px;
  position: relative;
  .imageItem2 {
    height: 90px;
    width: 100%;
    position: relative;
  }
  .imageItem2.active {
    border: 3px solid #04f7fa !important;
  }
  /deep/ .ant-image {
    width: 100%;
    height: 100%;
    position: relative;
  }
  /deep/ .ant-image-img {
    width: 100%;
    height: 100%;
  }
  span {
    position: absolute;
    bottom: 0px;
    width: 100%;
    height: 20px;
    left: 0px;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
  }
}
.projectList::-webkit-scrollbar {
  width: 4px; /* 设置滚动条宽度 */
}
.projectList::-webkit-scrollbar-track {
  /* 设置滚动条背景颜色 */
}

.projectList::-webkit-scrollbar-thumb {
  background-color: #007e8f; /* 设置滚动条滑块颜色 */
  border-radius: 4px; /* 设置滚动条滑块圆角 */
}
.projectList::-webkit-scrollbar-thumb:hover {
  background-color: #007e8f; /* 设置滚动条滑块在鼠标悬停时的颜色 */
}
</style>
