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

<script>
export default {
  props: {
    status: {
      type: Number,
      required: true
    }
  },
  computed: {
    statusName() {
      if (this.status === 1) {
        return this.$t('message.pass')
      } else if (this.status === 0) {
        return this.$t('message.passing')
      } else if (this.status === -1) {
        return this.$t('message.refuse')
      } else {
        return this.$t('message.unknow')
      }
    },
    type() {
      if (this.status === 1) {
        return 'success'
      } else if (this.status === -1) {
        return 'danger'
      } else {
        return 'warning'
      }
    }
  }
}
</script>
