<template>
  <a-col :lg="lg" :md="md" :sm="sm">
    <span style="color: rgba(0, 0, 0, 0.85);font-weight: 500;" :title="amount">{{ text }}: {{ amountFormat }}{{ suffix }}</span>
  </a-col>
</template>

<script>
export default {
  name: 'SumCol',
  props: {
    text: { // 按钮显示文本
      type: String,
      default: ''
    },
    amount: { // 金额
      type: Number,
      default: 0
    },
    type: {
      type: Number,
      default: 1
    },
    lg: {
      type: Number,
      default: 4
    },
    md: {
      type: Number,
      default: 24
    },
    sm: {
      type: Number,
      default: 24
    }
  },
  data () {
    return {
    }
  },
  computed: {
    amountFormat: function () {
      if (this.BaseTool.Object.isBlank(this.amount)) {
        return 0
      }
      if (this.type === 1) {
        return this.BaseTool.Amount.formatter(this.amount)
      }
      if (this.type === 2) {
        return this.BaseTool.Amount.divTenThousandFormatter(this.amount)
      }
      if (this.type === 3) {
        return this.amount
      }
      return ''
    },
    suffix: function () {
      if (this.type === 1) {
        return ''
      }
      if (this.type === 2) {
        return '万'
      }
      if (this.type === 3) {
        return '%'
      }
      return ''
    }
  },
  created () {

  }

}
</script>

<style scoped>

</style>
