<!--
 * @Author: 李佐宁
 * @Description: 
 * @Date: 2023-01-06 11:21:20
 * @LastEditTime: 2023-09-01 15:22:06
 * @LastEditors: 曹文丽
-->
<template>
  <div class="ya-box" :class="{ anhui: mapData?.en === 'anhui' }">
    <slot></slot>
    <div class="ya-box-title">{{ title }}{{ state.title }}</div>

    <div class="ya-box-total" :class="{ yaBoxTotal1: mapData?.en === 'anhui' }">
      <div style="margin-right: 9px; width: 36px; height: 41px">
        <img style="width: 100%; height: 100%" src="../../../assets/image/screen/icon_find.png" alt="" />
      </div>
      <div class="ya-box-time">
        <div class="ya-box-total-num">{{ total || 0 }}</div>
        <div style="font-size: 16px; white-space: nowrap">
          {{ state.subTitle }}（次）
        </div>
      </div>
    </div>
    <div class="ya-box-top">{{ state.top }}</div>
    <div class="ya-box-list">
      <div class="ya-item" v-for="(item, i) in list" :key="i">
        <div class="ya-item-num">
          {{ item.value
          }}<span style="font-size: 12px; padding-left: 3px">次</span>
        </div>
        <span>{{ item.name }}</span>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { defineProps, withDefaults, reactive } from "vue";
import Circel from "../../../components/process/circel.vue";
import { mapMapping } from "../../../assets/map/provinceData";
const mapData = reactive(mapMapping());
interface listType {
  name: string;
  percentage: number;
}
interface propType {
  title: string;
  total: number;
  state: object;
  list: listType[];
}

const propsData = withDefaults(defineProps<propType>(), {
  list: () => [],
  total: 0,
});
</script>

<style lang="scss" scoped>
.ya-box {
  width: 220px;
  height: 550px;
  background-image: url("../../../assets/image/screen/icon_bg_box_1.png");
  background-size: 100% 100%;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 18px;

  &.anhui {
    background-image: url("../../../assets/image/screen/icon_bg_box1_anhui.png");
  }

  .ya-box-title {
    width: 100%;
    text-align: center;
    padding-top: 32px;
    padding-left: 5px;
  }

  .ya-box-total {
    line-height: 1;
    background-image: url("../../../assets/image/screen/title_icon_bg.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    padding: 10px;
    text-align: left;
    margin: 0 10px;
    margin-top: 28px;
    display: flex;

    .ya-box-time {
      display: flex;
      flex-direction: column;
      justify-content: space-around;
    }

    .ya-box-total-num {
      color: #00effe;
      font-size: 20px;
    }
  }

  // .yaBoxTotal1 {
  //   background-image: url("@/assets/image/screen/title_icon_bg1.png");
  // }
  .ya-box-top {
    // text-align: center;
    font-size: 16px;
    color: #28f7ff;
    padding-left: 8px;
    position: relative;
    margin: 34px 10px 0;

    &::before {
      position: absolute;
      left: 0;
      content: "";
      top: 50%;
      width: 3px;
      height: 16px;
      background-color: rgba(116, 248, 253, 1);
      transform: translateY(-50%);
    }
  }

  .ya-box-list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: right;
    margin: 5px 10px 0;
    overflow: auto;

    .ya-item {
      align-items: center;
      justify-content: center;
      display: flex;
      flex-direction: column;
      width: 100%;
      background-image: url("../../../assets/image/screen/icon_attack_bg.png");
      background-size: 100% 100%;
      padding: 15px 0 30px;
      font-size: 18px;
      margin-bottom: 25px;

      span {
        font-size: 14px;
      }

      &:nth-last-child(1) {
        margin-bottom: 0;
      }

      .ya-item-num {
        color: rgba(0, 239, 254, 1);
      }
    }

    .ya-item-top {
      font-size: 12px;
      display: inline-block;
      background: rgba(255, 255, 255, 0.32);
      border-radius: 8px;
      padding: 2px 4px;
      margin-bottom: 3px;
    }

    // .ya-item-name {
    //   max-width: 130px;
    // }
    // .ya-item-num {
    //   font-size: 28px;
    //   color: #00effe;
    // }
  }
}
</style>
