<template>
  <div class="percent-card">
    <percent-pie-chart width="7.407vh" height="7.407vh" :value="value" :color="color" class="card-chart" />
    <div class="card-info">
      <div class="card-value" :class="color">{{ value }}%</div>
      <div class="card-text gray">{{ title }}</div>
    </div>
  </div>
</template>

<script>
// 百分比卡片
// 使用位置 电量分析 饼图 + 百分比 + 标题

import PercentPieChart from "../../chart/pie/percent-pie-chart.vue";
export default {
  components: {
    PercentPieChart,
  },
  props: {
    title: {
      type: String,
      default: "标题",
    },
    value: {
      type: Number,
      default: 0,
    },
    color: {
      type: String,
      default: "green",
    },
  },
  computed: {},
};
</script>

<style lang="less" scoped>
.percent-card {
  display: flex;

  .card-chart {
    flex: 0 0 5.926vh;
  }

  .card-info {
    flex: auto;
    align-self: center;
    margin-left: 1.481vh;

    .card-value {
      font-size: @fontsize-l;
      font-weight: 600;
    }

    .card-text {
      font-size: @fontsize;
    }
  }
}
</style>
