<!--
 * @Description: 根据审核状态值统一标签背景颜色
 * @Author: @liulin
 * @Date: 2023-03-29 10:08:39
 * @LastEditors: Do not edit
 * @LastEditTime: 2023-03-29 10:57:38
 * @byUse: <status-by-color :status="row.status" />
-->

<template>
  <div>
    <el-tag v-if="status == 0" type="info">
      {{ getDictName('shzt', status) }}
    </el-tag>
    <el-tag v-else-if="status == 1" class="status_1">
      {{ getDictName('shzt', status) }}
    </el-tag>
    <el-tag v-else-if="status == 2" type="danger">
      {{ getDictName('shzt', status) }}
    </el-tag>
    <el-tag v-else-if="status == 3">
      {{ getDictName('shzt', status) }}
    </el-tag>
    <el-tag v-else-if="status == 4" type="danger">
      {{ getDictName('shzt', status) }}
    </el-tag>
    <el-tag v-else-if="status == 5" type="success">
      {{ getDictName('shzt', status) }}
    </el-tag>
    <el-tag v-else type="info">
      {{ getDictName('shzt', status) }}
    </el-tag>
  </div>
</template>

<script>
import utils from '@/utils/utils.js'

export default {
  name: 'StatusByColor',
  props: {
    status: {
      type: String | Number,
      required: true
    }
  },
  methods: {
    getDictName(code, value) {
      return utils.getDictName(code, value)
    }
  }
}
</script>

<style lang="scss" scoped>
// 审核通过
.status_1 {
  background-color: rgba(1, 71, 235, 0.2);
  color: #0028ff;
}
</style>
