Newer
Older
Nanping_sponge_JXKH / src / views / projectCompletionStatus / components / facility_storage_capacity_p.vue
@liyingjing liyingjing on 25 Oct 1 KB 海绵绩效考个
<template>
  <div class="facility_storage_capacity_p">
    <pieChart
      :echartData="echartData"
      ref="barChartRef"
      :legend="{ show: false }"
      :radius="props.radius"
      v-if="echartData.length"
    />
    <div class="total" v-if="echartData.length">
      <div class="total_txt">设施调蓄量</div>
      <div class="total_val"><span class="val">120</span>m³</div>
    </div>
  </div>
</template>

<script setup>
import { } from 'vue'
import pieChart from '@/components/Echarts/pieChart.vue'
const props = defineProps({
  radius: {
    type: [Array, String],
    default: ["40%", "70%"]
  },
  data: {
    type: Array,
    default: () => ([])
  }
})
const echartData = props.data.map(item => ({
  name: item.name,
  value: item.value * 1
}))
</script>

<style lang="scss" scoped>
.facility_storage_capacity_p {
  height: 300px;
  position: relative;
  .total {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    .total_txt {
      font-size: 16px;
    }
    .total_val {
      margin-top: 6px;
      font-size: 18px;
      .val {
        font-size: 22px;
      }
    }
  }
}
</style>