优化订单列表ui

This commit is contained in:
yml2213
2026-05-14 21:17:14 +08:00
parent a48fed16c7
commit a554fee36e
2 changed files with 165 additions and 107 deletions
@@ -1,9 +1,12 @@
<script setup lang="ts">
import { formatStatusWithRaw } from '@/utils/admin-display'
const props = defineProps<{
const props = withDefaults(defineProps<{
status: string
}>()
showRaw?: boolean
}>(), {
showRaw: true,
})
type ElTagType = 'success' | 'primary' | 'warning' | 'danger' | 'info'
@@ -85,12 +88,16 @@ function resolveLabel(status: string) {
user_binding: '用户绑定中',
}
if (!props.showRaw) {
return labelMap[normalized.toLowerCase()] || normalized
}
return formatStatusWithRaw(normalized, labelMap)
}
</script>
<template>
<el-tag :type="resolveType(props.status)" size="small">
<el-tag :type="resolveType(props.status)" size="small" :title="props.showRaw ? undefined : props.status">
{{ resolveLabel(props.status) }}
</el-tag>
</template>