<template>
  <div>
    <div class="map-container">
      <my-map id="Map" ref="MyMap" />
      <Vrmodel :Visible="centerDialogVisible" v-if="centerDialogVisible" />

      <Town :show="DialogVisible" :titles="title" />
      <!-- 搜索功能 -->
      <div class="search">
        <div class="search-div">
          <el-select class="el-select" v-model="prov" placeholder="县">
            <el-option v-for="item in province" :key="item.value" :label="item.label" :value="item.value"> </el-option>
          </el-select>
          <el-cascader
            ref="cascader"
            class="el-select"
            placeholder="镇/村"
            style="margin-left: 7px; width: 100px; margin-right: 15px"
            v-model="city"
            :options="citys"
            @change="handleChange"
          ></el-cascader>
          <el-button
            type="primary"
            class="btn"
            @click="
              centerDialogVisible = true;
              Visible = false;
              DialogVisible = false;
            "
            >查看全景</el-button
          >
          <el-button type="primary" class="btn" @click="isQuanPing = !isQuanPing">{{ isQuanPing ? "全屏" : "取消全屏" }}</el-button>
          <el-button
            type="primary"
            class="btn"
            @click.stop="
              Visible = true;
              DialogVisible = false;
              centerDialogVisible = false;
            "
            >乡镇分屏</el-button
          >
          <div class="box-card" v-if="Visible">
            <i class="el-icon-circle-close close" @click.stop="close"></i>
            <div class="card">
              <div v-for="v in townList" :key="v.name" @click.stop="showEl(v)">
                {{ v.name }}
              </div>
            </div>
          </div>
        </div>

        <!-- <el-date-picker class="el-select times" v-model="startTime" type="date" placeholder="开始日期">
        </el-date-picker>
        <div style="margin: 0 10px;margin-top: 10px;">—</div>
        <el-date-picker class="el-select times" v-model="endTime" type="date" placeholder="结束日期">
        </el-date-picker>
        <img style="margin-left: 20px;width: 123px;height: 40px;" src="@/assets/image/search_ic@2x.png" alt=""> -->
      </div>
      <!--     地图菜单左 开始    -->
      <div class="menu-left moveLeftCls" v-show="isQuanPing">
        <!-- 左侧菜单顶部容器 开始 -->
        <div class="left-head-container">
          <div>
            <div style="display: flex; width: 100%; height: 55%">
              <div style="width: 50%; margin-top: 10px">
                <LandInfor />
                <!-- <nyzcz /> -->
                <LandPercentagebg />
              </div>
              <div style="width: 50%; margin-top: 10px">
                <!-- <LandStatistics /> -->
                <!-- <LandPercentagebg /> -->
                <dcpInfors />
                <nyzjz />
              </div>
            </div>
            <newLeftBottom style="height: 55%" />
          </div>
        </div>
        <!-- 左侧菜单顶部容器 结束  -->
      </div>
      <rightLayout ref="rightLayout" v-show="isQuanPing" class="moveRightCls" />
      <div class="bottom-menu-container" v-if="false" style="width: calc(100% - 980px)">
        <div class="bottom-menu-contain">
          <div style="height: 490px">
            <CenterMpa />
          </div>
          <LandNum />
        </div>
      </div>
      <div class="bottom-bg-color">
        <div></div>
      </div>
    </div>
  </div>
</template>
<script>
import vueSeamlessScroll from "vue-seamless-scroll";
import "echarts-gl";
import rightLayout from "@/views/bigScreen/components/right";
import LandInfor from "@/components/land/infors";
import dcpInfors from "@/components/land/dcpInfors.vue";
import LandStatistics from "@/components/land/statistics";
import Town from "./town.vue";
import nyzcz from "@/components/land/nyzcz";
import nyzjz from "@/components/land/nyzjz";
import LandPercentagebg from "@/components/land/percentagebg";
import LandNum from "@/components/land/numbg";
import leftBottom from "@/components/land/leftBottom";
import newLeftBottom from "@/components/land/newLeftBottom";

import CenterMpa from "@/components/center/map";
import MyMap from "@/components/mapbox/index";
import Vrmodel from "./vrModel.vue";

export default {
  components: {
    dcpInfors,
    newLeftBottom,
    vueSeamlessScroll,
    rightLayout,
    MyMap,
    nyzcz,
    nyzjz,
    LandStatistics,
    LandInfor,
    LandPercentagebg,
    leftBottom,
    CenterMpa,
    LandNum,
    Town,
    Vrmodel,
  },
  data() {
    const self = this;
    return {
      isQuanPing: true,
      bobaoArr: [],
      navigationArr: [],
      statisticsArr: [],
      centerDialogVisible: false,
      DialogVisible: false,
      Visible: false,
      title: "",
      prov: 1,
      city: "2",
      province: [
        {
          label: "随县",
          value: 1,
        },
      ],
      citys: [
        {
          id: 1,
          label: "新街镇",
          value: 1,
          children: [
            {
              value: "2",
              label: "姚庙村",
            },
            {
              value: "3",
              label: "墩子湾村",
            },
          ],
        },
      ],
      townList: [
        {
          name: "新街镇",
        },
        {
          name: "厉山",
        },
        {
          name: "高城",
        },
        {
          name: "殷店",
        },
        {
          name: "草店",
        },
        {
          name: "小林",
        },
        {
          name: "淮河",
        },
        {
          name: "万和",
        },
        {
          name: "尚市",
        },
        {
          name: "唐镇",
        },
        {
          name: "吴山",
        },
        {
          name: "安居",
        },
        {
          name: "澴潭",
        },
        {
          name: "洪山",
        },
        {
          name: "长岗",
        },
        {
          name: "三里岗",
        },
        {
          name: "柳林",
        },
        {
          name: "均川",
        },
        {
          name: "万福店",
        },
      ],
    };
  },
  beforeDestroy() {},
  created() {
    /** 使用原生绑定事件 */
    window.closeWindow = () => {
      this.infoWindow.close();
    };
  },
  mounted() {},
  computed: {},

  methods: {
    handleChange() {
      let nodesInfo = this.$refs["cascader"].getCheckedNodes(true);
      if (nodesInfo[0].label == "墩子湾村") {
        this.$refs.MyMap.setCenter(31.846335, 113.175);
      } else if (nodesInfo[0].label == "姚庙村") {
        this.$refs.MyMap.setCenter(31.84, 113.223);
      }
    },
    showEl(v) {
      this.title = v.name;
      if (v.name == "新街镇") {
        this.DialogVisible = true;
        this.Visible = false;
      } else {
        this.DialogVisible = false;
      }
    },
    close() {
      this.DialogVisible = false;
      this.Visible = false;
    },
    handleClose() {
      this.centerDialogVisible = false;
    }
  },
};
</script>
<style lang="less" scoped>
@import "../../../styles/fonts/fontNum.less";
/deep/.el-dialog {
  background: rgba(21, 51, 115, 0.7);
  color: #02feff;
  margin: 0 auto;
}
/deep/ .el-dialog__title {
  color: #02feff;
}
/deep/ .el-dialog__header {
  color: #02feff;
  text-align: center;
}
/deep/.el-dialog__body {
  height: 80vh;
}
.btn {
  background: rgba(21, 51, 115, 0.7);
  border-radius: 5px 5px 5px 5px;
  opacity: 1;
  border: 1px solid #02feff;
  color: #02feff;
}
.map {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  z-index: 0;
}
// .map-container{
//   height: 100vh;
// }
@keyframes moveLeft {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes moveRight {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
.moveLeftCls {
  animation-name: moveLeft;
  animation-duration: 2s;
}
.moveRightCls {
  animation-name: moveRight;
  animation-duration: 2s;
}
.menu-left {
  top: 7%;
  left: 0%;
  position: absolute;
  width: 35%;
  // display: inline-block;
  height: 100%;
  // overflow: hidden;
  z-index: 222;
  background: linear-gradient(98deg, rgba(11, 37, 124, 0.7) 56%, rgba(15, 38, 98, 0) 96%);
  .left-head-container {
    top: 0;
    left: 5.4%;
    position: absolute;
    .search-box {
      margin-top: 11px;
      height: 40px;
      display: flex;
      position: relative;

      input {
        flex: 1;
        width: 150px;
        padding: 8px 20px;
        height: 50px;
        outline: none;
        background: rgba(0, 14, 15, 0.6);
        box-sizing: border-box;
        border: 1px solid #036a73;
        box-shadow: inset 0px 0px 10px 0px #02d9e4;
        font-size: 22px;
        color: #fff;
      }

      .search-select {
        z-index: 10;
        position: absolute;
        left: 0;
        border-radius: 10px;
        top: 54px;
        width: 370px;
        max-height: 300px;
        overflow-y: scroll;
        line-height: 32px;
        font-size: 14px;
        background: rgba(0, 14, 15, 0.8);
        text-align: left;
        padding: 0 10px;
        box-sizing: border-box;

        .search-select-title {
          padding-left: 20px;
          border-bottom: 1px solid #ffffff;
        }

        .search-select-list {
          cursor: pointer;
        }
      }

      input::-webkit-input-placeholder {
        color: rgba(255, 255, 255, 0.6);
      }

      .search-btn {
        width: 50px;
        height: 30px;
        line-height: 26px;
        background: #02ffc2;
        font-size: 16px;
        font-family: PingFangSC-Medium;
        font-weight: 500;
        color: #151b17;
        cursor: pointer;
      }

      .search-dis {
        color: #999999;
        background-color: #e2e2e2;
        cursor: not-allowed;
      }
    }

    .tree-box {
      margin-top: 20px;
      padding: 20px;
      height: 527px;
      background: rgba(0, 14, 15, 0.6);
      box-sizing: border-box;
      border: 1px solid #036a73;

      /deep/.ivu-tree {
        text-align: left;
        margin-top: 20px;
        height: 433px;
        overflow: auto;
        padding-left: 40px;

        ul {
          font-size: 18px;

          li {
            margin: 11px 0;
          }
        }

        .ivu-tree-title {
          font-family: PingFangSC-Semibold;
          font-weight: 600;
          color: #fff;

          &:hover {
            background: unset;
            color: #02ffc2;
          }
        }

        .ivu-tree-title-selected,
        .ivu-tree-title-selected:hover {
          background: unset;
          color: #02ffc2;
        }
      }
    }

    .tree-arrow {
      position: absolute;
      left: -10px;
      top: 312px;
      width: 20px;
      height: 77px;
      cursor: pointer;

      img {
        width: 100%;
      }
    }

    .info-box {
      margin-top: 20px;
      padding: 20px;
      height: 331px;
      background: rgba(0, 14, 15, 0.6);
      box-sizing: border-box;
      border: 1px solid #036a73;
      width: 100%;
      position: absolute;
      top: 608px;

      .scroll-container {
        overflow: hidden;
        margin: 20px 58px 0 0;

        .under-container {
          height: 238px;
          overflow: hidden;
        }
      }

      .scroll-container-new {
        margin-top: 0;

        .under-container {
          height: 191px;
        }
      }

      .fixed-container {
        margin: 10px 58px 10px 0;
        position: relative;
      }

      .table-item-box {
        .table-item {
          height: 47px;
          display: flex;
          justify-content: space-between;
          align-items: center;
          font-size: 18px;
          cursor: pointer;

          .select-img {
            display: block;
            width: 25px;
            margin-right: 10px;
            position: absolute;
            left: 8px;
          }

          .item-left {
            padding-left: 43px;
            display: flex;
            align-items: center;

            .avatar-img {
              display: block;
              width: 34px;
              height: 34px;
              object-fit: cover;
              border-radius: 50%;
            }

            .name {
              margin-left: 34px;
            }
          }

          .item-right {
            display: flex;
            align-items: center;

            .phone-img {
              display: block;
              width: 16px;
              height: 16px;
              object-fit: cover;
            }

            .phone {
              font-weight: 500;
              margin-left: 10px;
            }
          }
        }
      }

      .table-item-active {
        color: #02ffc2;
      }
    }

    .info-arrow {
      position: absolute;
      left: -10px;
      top: 755px;
      width: 20px;
      height: 77px;
      cursor: pointer;

      img {
        width: 100%;
      }
    }
  }
}

.menu-center {
  display: flex;
  align-items: center;
  height: 35px;
  background: rgba(2, 217, 228, 0.16);
  padding: 0 22px;
  box-sizing: border-box;
  width: calc(~"100% - 990px");
  position: absolute;
  left: 495px;
  right: 495px;
  top: 115px;

  img {
    width: 22px;
    margin-right: 12px;
  }

  .bo-bao-box {
    width: calc(~"100% - 34px");
    overflow: hidden;
    height: 35px;

    .text {
      font-size: 14px;
      font-weight: normal;
      line-height: 35px;
      color: #02ffc2;
      text-align: left;
      word-break: break-all;
    }
  }
}

.bottom-menu-container {
  .bottom-menu-contain {
    width: 100%;

    // height: 331px;
  }

  // width: calc(100% - 980px);
  position: absolute;
  left: 490px;
  height: calc(1080px - 110px);
  // transform: translateX(-470px);
  top: 9%;

  .bottom-menu-title {
    height: 34px;
    font-size: 22px;
    font-family: PingFang SC;
    font-weight: 600;
    line-height: 34px;
    text-align: left;
    padding-left: 83px;
    background-image: url("../../../assets/bigScreenHome/ic_zhuangshi_chang.png");
    background-size: 100%;
    background-position: left bottom;
    margin-bottom: 32px;

    span {
      background: linear-gradient(180deg, #03fcbe 0%, #02f3f7 100%);
      background-clip: text;
      -webkit-background-clip: text;
      color: transparent;
    }
  }

  .bottom-menu-con {
    flex: 1;
    height: 0;
    display: flex;
    align-items: center;

    .bottom-menu-list {
      flex: 1;
      height: 200px;
      display: flex;
      flex-direction: column;

      .bottom-menu-list-tr {
        cursor: pointer;
        height: 40px;
        line-height: 40px;
        display: flex;
        align-items: center;

        .bottom-menu-list-name,
        .bottom-menu-list-type,
        .bottom-menu-list-user {
          display: inline-block;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
          font-size: 18px;
          font-family: PingFang SC;
          font-weight: normal;
          color: #ffffff;
          line-height: 40px;
          // -webkit-background-clip: text;
          // -webkit-text-fill-color: transparent;
          text-align: center;
        }

        .bottom-menu-list-type {
          width: 210px;
        }

        .bottom-menu-list-user,
        .bottom-menu-list-name {
          flex: 1;
          width: 0;
        }
      }

      .bottom-menu-list-active {
        background: rgba(2, 216, 227, 0.16);
      }

      .bottom-menu-list-th {
        height: 35px;
        line-height: 35px;
        background: rgba(3, 252, 190, 0.5);

        .bottom-menu-list-name,
        .bottom-menu-list-type,
        .bottom-menu-list-user {
          font-size: 20px;
          font-weight: 600;
          line-height: 35px;
        }
      }

      .bottom-menu-list-body {
        flex: 1;
        box-sizing: border-box;
        padding-top: 5px;
        height: 165px;
        overflow: hidden;
      }
    }

    .bottom-menu-btns {
      height: 100%;
      overflow-y: scroll;
      padding: 20px 14px 0 40px;

      .bottom-menu-btns-list {
        width: 175px;
        height: 40px;
        border-radius: 6px 6px 6px 6px;
        opacity: 1;
        border: 1px solid #02ffc2;
        font-size: 18px;
        font-family: PingFang SC;
        font-weight: normal;
        color: #02ffc2;
        line-height: 40px;
        cursor: pointer;
        text-align: center;
        margin-bottom: 20px;
      }

      .bottom-menu-btns-active {
        background: linear-gradient(180deg, #03fcbe 0%, #02f3f7 100%);
        color: #000000;
      }
    }
  }

  .bottom-menu-close {
    display: block;
    height: 78px;
    width: 20px;
    position: absolute;
    bottom: -636px;
    left: 50%;
    transform: translateX(-39px);
    transform: rotate(-90deg);
    cursor: pointer;
  }

  .bottom-menu-top {
    bottom: -38px;
    transform: rotate(90deg);
  }
}

.bottom-menu-left-container {
  display: none;
  position: absolute;
  bottom: 32px;
  left: 456px;
  border: dashed 1px #01ceffa3;
  border-radius: 8px;
  padding: 12px 20px;

  .item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;

    img {
      display: inline-block;
      width: 28px;
      height: 40px;
      margin-right: 10px;
    }
  }
}
</style>
<style lang="less">
.model {
  position: absolute;
  top: 90px;
  left: calc(~"50% - 280px");
  background-color: #0a1a34cc;

  .pointLine {
    width: 123px;
    height: 85px;
    position: absolute;
    top: 0;
    left: -103px;
  }

  .button {
    cursor: pointer;

    img {
      padding: 0;
      width: 32px;
      height: 32px;
    }

    position: absolute;
    right: -15px;
    top: -10px;
  }

  &::before {
    width: 40px;
    height: 9px;
    content: "";
    background-image: url("../../../assets/bigScreenHome/model-icon.png");
    background-size: 100%;
    position: absolute;
    top: -3px;
    left: 0;
    background-repeat: no-repeat;
  }

  .title {
    text-align: left;
    padding: 10px 0px 10px 40px;
    background-image: url("../../../assets/bigScreenHome/box.png");
    background-size: 100%;
    background-repeat: no-repeat;
  }

  .image {
    border-radius: 2px;
    border: 1px solid #59aff9;
    margin: 0 10px;
    width: 400px;
  }

  .location-text {
    padding: 10px 10px;
    text-align: left;
    font-size: 16px;

    div {
      color: #59aff9;

      span {
        color: #e5ecf3;
      }
    }
  }
}
.search {
  position: absolute;
  top: 15%;
  left: 40%;
  // z-index: 2222;
  // width: calc(~"100% - 990px");
  display: flex;
  font-size: 14px;
  .search-div {
    position: relative;
  }
  .el-select {
    position: relative;
    width: 80px;
    background-color: #000000;
    background: rgba(21, 51, 115, 0.5);
    border-radius: 5px 5px 5px 5px;
    opacity: 1;
    // border: 1px solid rgba(2, 254, 255,1);

    .el-input__inner {
      background: rgba(21, 51, 115, 0.5) !important;
      border: 1px solid rgba(2, 254, 255, 1);
      color: #02feff !important;
      padding: 0;
      padding-left: 10px;
    }

    ::placeholder {
      color: #02feff !important;
      font-size: 12px;
    }

    .el-input__icon {
      color: #fff;
    }
  }

  .times {
    width: 100px;
    .el-input__icon {
      display: none;
    }
  }
}
.bottom-bg-color {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(359deg, rgba(11, 37, 124, 0.7) 56%, rgba(15, 38, 98, 0) 96%);
  height: 2vh;
  z-index: 1;
  > div {
    width: 100%;
    height: 100%;
    background: url("@/assets/image/db_ic@2x.png") no-repeat center;
    background-size: 100%;
  }
}
// 标题 全局样式
.common-title {
  height: 32px;
  font-size: 22px;
  font-family: PingFang SC;
  font-weight: 600;
  text-align: left;
  padding-left: 83px;
  position: relative;

  &::before {
    content: "";
    display: block;
    width: 100%;
    height: 32px;
    background-image: url("../../../assets/bigScreenHome/ic_zhuangshi_chang.png");
    background-size: cover;
    position: absolute;
    left: 0;
    top: 1px;
  }

  span {
    background: linear-gradient(180deg, #03fcbe 0%, #02f3f7 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
  }
}

/* 滚动条宽度 */
.scroll-bar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: #000e0f;
}

/* track滚动条未覆盖区域 */
.scroll-bar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.2);
}

/* thumb滚动条覆盖区域 */
.scroll-bar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #03fcad 0%, #02f3f7 100%);
}

@media (min-width: 1920px) {
  .left-head-container {
    left: 5.4%;
  }
}

@media (min-width: 2000px) {
  .left-head-container {
    left: 0 !important;
  }
}
.box-card {
  position: absolute;
  top: 45px;
  right: 0px;
  z-index: 999;
  width: 130px;
  overflow: hidden;

  padding: 20px 0;
  background: rgba(21, 51, 115, 0.7);
  border-radius: 5px 5px 5px 5px;
  .close {
    position: absolute;
    top: 11px;
    right: 8px;
  }
}
.card {
  overflow-y: scroll;
  height: 200px;

  &::-webkit-scrollbar {
    display: none;
  }
  > div {
    &:hover {
      color: #07e7ec;
    }
  }
}
</style>
