<template>
  <el-tag :type="type">{{statusName}}</el-tag>
</template>

<script>
export default {
  props: {
    status: {
      type: Number,
      required: true
    }
  },
  computed: {
    statusName() {
      if (this.status === 0) {
        return this.$t('message.nouse')
      } else if (this.status === 1) {
        return this.$t('message.used')
      } else if (this.status === 2) {
        return this.$t('message.canceld')
      } else {
        return this.$t('message.nosign')
      }
    },
    type() {
      if (this.status === 1) {
        return 'success'
      } else if (this.status === 0) {
        return 'warning'
      } else {
        return 'danger'
      }
    }
  }
}
</script>
