中文化任务状态标签
This commit is contained in:
@@ -7,49 +7,126 @@ type StatusTagProps = {
|
|||||||
|
|
||||||
const STATUS_LABELS: Record<string, string> = {
|
const STATUS_LABELS: Record<string, string> = {
|
||||||
active: '生效中',
|
active: '生效中',
|
||||||
|
admin: '管理员',
|
||||||
|
available: '可用',
|
||||||
|
binding_completed: '履约完成',
|
||||||
|
binding_confirmed: '已提交',
|
||||||
|
binding_exception: '履约异常',
|
||||||
|
binding_in_progress: '处理中',
|
||||||
|
canceled: '已取消',
|
||||||
|
cancelled: '已取消',
|
||||||
|
cdk_reserved: '资源已准备',
|
||||||
claimed: '已创建会话',
|
claimed: '已创建会话',
|
||||||
closed: '已关闭',
|
closed: '已关闭',
|
||||||
completed: '已完成',
|
completed: '已完成',
|
||||||
consumed: '已核销',
|
consumed: '已核销',
|
||||||
dispatched_pending_return: '待退号',
|
created: '已创建',
|
||||||
|
customer_completed: '履约完成',
|
||||||
|
customer_confirmed: '已提交',
|
||||||
|
customer_exception: '履约异常',
|
||||||
|
customer_processing: '处理中',
|
||||||
|
delivered: '已发放',
|
||||||
|
disabled: '已停用',
|
||||||
|
dispatched_pending_return: '待退还号码',
|
||||||
|
expired: '已过期',
|
||||||
failed: '失败',
|
failed: '失败',
|
||||||
|
invalid: '已作废',
|
||||||
link_generated: '已生成链接',
|
link_generated: '已生成链接',
|
||||||
|
link_opened: '已打开链接',
|
||||||
manual_review: '人工处理',
|
manual_review: '人工处理',
|
||||||
|
not_started: '未开始',
|
||||||
|
operator: '普通运营',
|
||||||
paid: '已支付',
|
paid: '已支付',
|
||||||
pending: '待处理',
|
pending: '待触发',
|
||||||
|
pending_binding: '待准备资源',
|
||||||
pending_binding_prepare: '待准备资源',
|
pending_binding_prepare: '待准备资源',
|
||||||
pending_claim: '待领取',
|
pending_claim: '待领取',
|
||||||
|
pending_config: '待配置',
|
||||||
pending_payment: '待支付',
|
pending_payment: '待支付',
|
||||||
|
pending_prepare: '待准备资源',
|
||||||
|
processing: '处理中',
|
||||||
redeemed: '已兑换',
|
redeemed: '已兑换',
|
||||||
redeeming: '兑换中',
|
redeeming: '兑换中',
|
||||||
refunded: '已退款',
|
refunded: '已退款',
|
||||||
|
refunding: '退款中',
|
||||||
|
reserved: '资源已准备',
|
||||||
|
resource_exception: '资源异常',
|
||||||
|
resource_ready: '资源已准备',
|
||||||
|
revoked: '已撤销',
|
||||||
retry_pending: '待重试',
|
retry_pending: '待重试',
|
||||||
role_confirmed: '已确认角色',
|
role_confirmed: '已确认角色',
|
||||||
|
skipped: '已跳过',
|
||||||
|
success: '成功',
|
||||||
|
support: '客服',
|
||||||
|
system_bound: '资源已准备',
|
||||||
unpaid: '未支付',
|
unpaid: '未支付',
|
||||||
waiting_binding: '待绑定',
|
user_binding: '客户处理中',
|
||||||
|
verified: '已校验',
|
||||||
|
waiting: '等待中',
|
||||||
|
waiting_binding: '待客户绑定',
|
||||||
|
waiting_customer: '待客户绑定',
|
||||||
|
waiting_user_claim: '待客户打开链接',
|
||||||
}
|
}
|
||||||
|
|
||||||
const STATUS_COLORS: Record<string, string> = {
|
const STATUS_COLORS: Record<string, string> = {
|
||||||
active: 'green',
|
active: 'green',
|
||||||
|
admin: 'purple',
|
||||||
|
available: 'green',
|
||||||
|
binding_completed: 'green',
|
||||||
|
binding_confirmed: 'blue',
|
||||||
|
binding_exception: 'red',
|
||||||
|
binding_in_progress: 'blue',
|
||||||
|
canceled: 'default',
|
||||||
|
cancelled: 'default',
|
||||||
|
cdk_reserved: 'green',
|
||||||
claimed: 'blue',
|
claimed: 'blue',
|
||||||
closed: 'default',
|
closed: 'default',
|
||||||
completed: 'green',
|
completed: 'green',
|
||||||
consumed: 'green',
|
consumed: 'green',
|
||||||
|
created: 'blue',
|
||||||
|
customer_completed: 'green',
|
||||||
|
customer_confirmed: 'blue',
|
||||||
|
customer_exception: 'red',
|
||||||
|
customer_processing: 'blue',
|
||||||
|
delivered: 'green',
|
||||||
|
disabled: 'red',
|
||||||
failed: 'red',
|
failed: 'red',
|
||||||
|
invalid: 'orange',
|
||||||
link_generated: 'cyan',
|
link_generated: 'cyan',
|
||||||
|
link_opened: 'blue',
|
||||||
manual_review: 'orange',
|
manual_review: 'orange',
|
||||||
|
not_started: 'gold',
|
||||||
|
operator: 'gold',
|
||||||
paid: 'green',
|
paid: 'green',
|
||||||
pending: 'gold',
|
pending: 'gold',
|
||||||
|
pending_binding: 'gold',
|
||||||
pending_binding_prepare: 'gold',
|
pending_binding_prepare: 'gold',
|
||||||
pending_claim: 'gold',
|
pending_claim: 'gold',
|
||||||
|
pending_config: 'gold',
|
||||||
pending_payment: 'default',
|
pending_payment: 'default',
|
||||||
|
pending_prepare: 'gold',
|
||||||
|
processing: 'blue',
|
||||||
redeemed: 'green',
|
redeemed: 'green',
|
||||||
redeeming: 'blue',
|
redeeming: 'blue',
|
||||||
refunded: 'purple',
|
refunded: 'purple',
|
||||||
|
refunding: 'purple',
|
||||||
|
reserved: 'green',
|
||||||
|
resource_exception: 'red',
|
||||||
|
resource_ready: 'green',
|
||||||
|
revoked: 'red',
|
||||||
retry_pending: 'volcano',
|
retry_pending: 'volcano',
|
||||||
role_confirmed: 'blue',
|
role_confirmed: 'blue',
|
||||||
|
skipped: 'gold',
|
||||||
|
success: 'green',
|
||||||
|
support: 'blue',
|
||||||
|
system_bound: 'green',
|
||||||
unpaid: 'default',
|
unpaid: 'default',
|
||||||
|
user_binding: 'blue',
|
||||||
|
verified: 'green',
|
||||||
|
waiting: 'blue',
|
||||||
waiting_binding: 'gold',
|
waiting_binding: 'gold',
|
||||||
|
waiting_customer: 'gold',
|
||||||
|
waiting_user_claim: 'blue',
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function StatusTag({ value, kind = 'plain' }: StatusTagProps) {
|
export default function StatusTag({ value, kind = 'plain' }: StatusTagProps) {
|
||||||
@@ -63,7 +140,11 @@ export default function StatusTag({ value, kind = 'plain' }: StatusTagProps) {
|
|||||||
const label = STATUS_LABELS[key] || normalized
|
const label = STATUS_LABELS[key] || normalized
|
||||||
const color = STATUS_COLORS[key] || resolveFallbackColor(kind)
|
const color = STATUS_COLORS[key] || resolveFallbackColor(kind)
|
||||||
|
|
||||||
return <Tag color={color}>{label === normalized ? normalized : `${label} (${normalized})`}</Tag>
|
return (
|
||||||
|
<Tag color={color} title={normalized}>
|
||||||
|
{label}
|
||||||
|
</Tag>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function resolveFallbackColor(kind: StatusTagProps['kind']) {
|
function resolveFallbackColor(kind: StatusTagProps['kind']) {
|
||||||
|
|||||||
Reference in New Issue
Block a user