优化订单列表ui
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user