<template>
  <BusinessMainCom title="资源一张图">
    <div class="resources">
      <div class="__gis-business-main_title">
        类型分布
        <div class="area">
          <CusFormColumn
              labelWidth="44"
              :span="24"
              link="select"
              label="区域:"
              static
              v-model:param="area"
              :options="[]"
          />
        </div>
      </div>
      <FocusContentCom class="one">
        <div class="one-top">
          <img src="@/assets/images/gis-business/resource_icon1.png" alt=""/>
          <StatisticTitleCom title="总数" :num="lxfb.total" unit="台"/>
        </div>
        <div class="one-bottom">
          <div class="one-bottom-item">
            <div class="chart">
              <PieSimpleChartCom :num="lxfb.gal" :total="lxfb.total" color="#00FFFF"/>
            </div>
            <div class="text">公安类</div>
          </div>
          <div class="one-bottom-item">
            <div class="chart">
              <PieSimpleChartCom :num="lxfb.shl" :total="lxfb.total" color="#FFCC8F"/>
            </div>
            <div class="text">社会类</div>
          </div>
          <div class="one-bottom-item">
            <div class="chart">
              <PieSimpleChartCom :num="lxfb.myl" :total="lxfb.total" color="#EB90FF"/>
            </div>
            <div class="text">民用类</div>
          </div>
        </div>
        <div class="one-foot">
          <LxfbZxlChartCom :online="lxfb.online" :offline="lxfb.offline"/>
          <LxfbCxChartCom :value="lxfb.cx"/>
        </div>
      </FocusContentCom>
      <div class="__gis-business-main_title">全省TOP10</div>
      <FocusContentCom class="two">2</FocusContentCom>
    </div>
  </BusinessMainCom>
</template>

<script lang="ts">
import {
  defineComponent,
  computed,
  onMounted,
  ref,
  reactive,
  watch,
  getCurrentInstance,
  ComponentInternalInstance,
  toRefs,
  nextTick
} from 'vue'
import {useStore} from 'vuex'
import {useRouter, useRoute} from 'vue-router'
import {ElMessage, ElMessageBox} from "element-plus";
import BusinessMainCom from '../common/business-main.vue'
import FocusContentCom from '../common/focus-content.vue'
import StatisticTitleCom from "../common/statistic-title.vue";
import PieSimpleChartCom from "../common/pie-simple-chart.vue";
import LxfbZxlChartCom from "./lxfb-zxl-chart.vue";
import LxfbCxChartCom from "./lxfb-cx-chart.vue";

export default defineComponent({
  name: '',
  components: {
    PieSimpleChartCom,
    StatisticTitleCom,
    BusinessMainCom,
    FocusContentCom,
    LxfbZxlChartCom,
    LxfbCxChartCom,
  },
  props: {},
  setup(props, {emit}) {
    const store = useStore();
    const router = useRouter();
    const route = useRoute();
    const that = (getCurrentInstance() as ComponentInternalInstance).appContext.config.globalProperties
    const state = reactive({
      area: '',
      lxfb: {
        total: 35600,
        gal: 25988,
        shl: 9612,
        myl: 9612,
        online: 27768,
        offline: 7832,
        cx: 50
      }
    })
    onMounted(() => {
    })
    return {
      ...toRefs(state),
    }
  },
})
</script>

<style scoped lang="scss">
@import "../main";
.resources {
  flex: 1;
  padding: 0 12px 10px 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  .area {
    margin-left: auto;
    height: 36px;
    width: 200px;
  }
  .one {
    height: 410px;
    .one-top {
      display: flex;
      align-items: center;
      padding: 22px 22px 20px 23px;
      >img {
        margin-right: 16px;
      }
    }
    .one-bottom {
      display: flex;
      justify-content: space-between;
      padding: 6px 12px 0 12px;
      .one-bottom-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        .chart {
          width: 100px;
          height: 100px;
        }
        .text {
          margin-top: 8px;
          flex: 1;
          text-align: center;
          font-size: 12px;
          font-family: Microsoft YaHei;
          font-weight: 400;
          color: #434343;
          line-height: 14px;
          display: flex;
          align-items: center;
          justify-content: center;
        }
      }
    }
    .one-foot {
      display: flex;
      justify-content: space-between;
      padding: 22px 14px 0 26px;
      >div {
        width: 150px;
        height: 150px;
      }
    }
  }
  .two {
    flex: 1;
  }
}
</style>
