<template>
  <el-row class="map-warpper" :gutter="16">
    <el-col class="map-left" :span="8">
      <div class="performance-com card-item">
        <Performance />
      </div>
      <div class="performance-com card-item">
        <InvestmentProgress />
      </div>
    </el-col>
    <el-col :span="9">
      <div class="map-middle">
        <div class="card-item map-item">
          <Map @mapClick="mapClick"></Map>
          <div class="sfqx" v-if="curDataType == '2022Two'">
            <p>创新示范区县</p>
            <div class="text">
              <div v-for="(txt, index) in sfqx" :key="index">
                {{ txt }}
              </div>
            </div>
          </div>
        </div>
      </div>
    </el-col>
    <el-col :span="7">
      <div class="map-right">
        <div class="card-item rank-list">
          <RankList />
        </div>
        <div class="card-item incom-graphic">
          <IndicatorWarning />
        </div>
        <!-- <div class="card-item incom-graphic">
          <Income />
        </div> -->
      </div>
    </el-col>
  </el-row>

  <!-- 卡片信息展示 -->
  <div class="card-list" :gutter="16">
    <el-col class="card-item">
      <StrongArmyCard />
    </el-col>
    <el-col class="card-item">
      <CardItem
        title="军民协同创新"
        :infoList="list"
        :toPage="dataCenterRouter.INNOVATION"
      />
    </el-col>
    <el-col class="card-item">
      <Industrial />
    </el-col>
    <el-col class="card-item">
      <CardItem
        :infoList="list2x"
        title="资源开放共享"
        :toPage="dataCenterRouter.RESORCE_SHARE"
      />
    </el-col>
    <el-col class="card-item">
      <SystemConstruct />
    </el-col>
  </div>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import Performance from "./model/Performance/index.vue";
import RankList from "./model/RankList/index.vue";
import Map from "./model/Map/index.vue";
// import InvestmentProgress from "./model/InvestmentProgress/index.vue";
import InvestmentProgress from "./model/InvestmentProgress/new20220913.vue";
import Income from "./model/Income/index.vue";
import IndicatorWarning from "./model/indicatorWarning/index.vue";
import StrongArmyCard from "./model/CardList/strongArmy.vue";
import CardItem from "./model/CardList/index.vue";
import Industrial from "./model/CardList/industrial.vue";
import SystemConstruct from "./model/CardList/systemConstruct.vue";
import { DataCenterRouter } from "@/route/dataCenter";

import Mock from "./cradMock";
import { mapState } from "vuex";

export default defineComponent({
  components: {
    Performance,
    RankList,
    Map,
    InvestmentProgress,
    Income,
    IndicatorWarning,
    StrongArmyCard,
    CardItem,
    Industrial,
    SystemConstruct,
  },
  setup() {},
  computed: {
    ...mapState({
      curDataType: (state) => state.curDataType,
    }),
    list() {
      return Mock[this.curDataType].list;
    },
    list2x() {
      return Mock[this.curDataType].list2x;
    },
  },

  data() {
    return {
      dataCenterRouter: DataCenterRouter,
      sfqx: [
        "上城区,西湖区,萧山区",
        "海曙区,鄞州区,象山县",
        "南湖区,德清县,长兴县",
        "诸暨市,永康市,衢江区",
        "温岭市,缙云县,滨江区",
        "北仑区,海宁市,柯桥区",
        "普陀区",
      ],
    };
  },
});
</script>
<style lang="scss" scoped>
.sfqx {
  position: absolute;
  bottom: 5px;
  right: 5px;
  // height: 184px;
  width: 145px;
  background-color: rgba(25, 125, 237, 30%);
  padding: 10px;
  box-sizing: border-box;

  p {
    color: #19ecff;
    font-size: 16px;
    line-height: 19.2px;
    padding-left: 10px;
    position: relative;
    margin-bottom: 4px;
  }

  p::before {
    content: "";
    width: 4px;
    height: 14px;
    background-color: #19ecff;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    margin: auto;
  }

  .text {
    color: #ffffff;
    font-size: 13px;
    line-height: 22px;
  }
}

.card-item {
  // background: #fff;
  background-color: rgba(25, 125, 237, 15%);
  border-radius: 5px;
  padding: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 2px 2px 10px #04223d10;
  border: 1px solid #10529a;
  box-sizing: border-box;
  // &:hover {
  //   // transform: translateY(-5px);
  //   transition: all 0.2s;

  // }
}

.map-warpper {
  height: 640px;
  box-sizing: border-box;
  flex: 1;

  .map-left {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;

    .performance-com {
      flex: 1;
      max-height: calc(640px / 2 - 8px);
    }

    .performance-com:last-child {
      margin-top: 16px;
    }

    .rank-list {
      margin-top: 16px;
      height: 312px;
      box-sizing: border-box;
    }
  }

  .map-middle {
    height: 640px;
    box-sizing: border-box;
    display: flex;

    .card-item {
      padding: 0;
    }

    .map-item {
      width: 100%;
      position: relative;
    }
  }

  .map-right {
    box-sizing: border-box;

    .incom-graphic {
      margin-top: 16px;
      height: 312px;
      box-sizing: border-box;
    }
  }
}

// 卡片信息展示
.card-list {
  margin-top: 16px;
  box-sizing: border-box;
  display: flex;

  .el-col {
    flex: 1;
    margin-right: 16px;
    height: 310px;

    &:last-of-type {
      margin-right: 0;
    }
  }
}
</style>
