ActivityRate.vue 1.83 KB
<!--
 * @Author: 前端 qianduan01@didihu.com.cn
 * @Date: 2024-01-26 16:23:12
 * @LastEditors: 前端 qianduan01@didihu.com.cn
 * @LastEditTime: 2025-02-13 14:10:27
 * @FilePath: \glsk-data-view-scene\src\views\lifeSceneDataPage\components\ActivityRate.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="rate-box">
    <BoxTitle :title="'各活动类型占比'" :fontSize="14"></BoxTitle>
    <pie-chart
      :id="chart.id"
      :keys="chart.keys"
      :list="activityListData"
      :formatter="'total'"
      :formatterName="'累计营销活动'"
      :formtUnit="'场'"
      :height="chart.height"
      :colors="chart.colors"
    ></pie-chart>
    <Legend class="legend" :list="activityListData" :legentList="legentList" :colors="chart.colors"></Legend>
  </div>
</template>

<script>
import { activityListData } from '../const/index'
export default {
  name: 'ActivityRate',

  data() {
    return {
      chart: {
        id: 'shadowPie',
        keys: ['isused', 'num'],
        height: '17.7vh',
        colors: ['#6578FF', '#16E193', '#FFE73C', '#EB6001']
      },
      activityListData,
      legentList: [
        {
          name: 'isused',
          width: '4vw'
        },
        {
          name: 'rate',
          type: 'decimal',
          width: '2.5vw'
        },
        {
          name: 'num',
          width: '2.25vw',
          unitIcon: '场'
        }
      ]
    }
  },

  mounted() {},

  methods: {}
}
</script>

<style lang="scss" scoped>
.rate-box {
  box-sizing: border-box;
  width: 15vw;
  height: 34.23vh;
  background-image: url(../../../assets/images/rate-bg.png);
  background-size: 100% 100%;
  padding: 3.61vh 1.59vw 2.69vh 1.04vw;
}
.legend {
  margin-top: 2vh;
}
</style>