Files
admin-web/src/shared/components/StatusBadge.vue
T

18 lines
803 B
Vue
Raw Normal View History

2026-07-30 17:59:43 +08:00
<script setup lang="ts">
import { computed } from 'vue'
const props = defineProps<{ status: string }>()
const tone = computed(() => {
2026-08-07 09:06:22 +08:00
if (['正常', '启用', '已完成', '已审核', '审核通过', '已入库', '装柜完成', '派送完成'].includes(props.status)) return 'success'
if (['待审核', '草稿', '待处理', '未提交', '未录入', '待测量数据', '待分柜'].includes(props.status)) return 'warning'
if (['已受理', '已订舱', '运输中', '处理中', '装柜中'].includes(props.status)) return 'info'
if (['停用', '已取消', '已驳回', '审核驳回', '失败'].includes(props.status)) return 'danger'
2026-07-30 17:59:43 +08:00
return 'neutral'
})
</script>
<template>
<span class="status-badge" :class="`is-${tone}`"><i aria-hidden="true" />{{ status }}</span>
</template>