feat(fulfillment): 支持共享账号操作并完善时间线

This commit is contained in:
yml
2026-11-18 22:32:45 +08:00
parent 86b586b96d
commit ddead2284d
23 changed files with 538 additions and 15 deletions
@@ -56,6 +56,12 @@ const CATEGORY_OPTIONS = [
{ value: 'ops', label: '人工操作' },
];
const ACTOR_TYPE_LABELS: Record<string, string> = {
user: '用户',
system: '系统',
public: '客户',
};
/** 生命周期状态 → 展示色(与账号列表页保持一致,取值域见后端 account_lifecycle)。 */
const STATUS_TONES: Record<string, string> = {
imported: 'default',
@@ -106,6 +112,16 @@ function eventTag(type: string) {
return <Tag color={style.color}>{style.label}</Tag>;
}
function actorLabel(item: AccountEventItem) {
if (item.actor_type === 'user') {
const name = item.actor_name || (item.actor_id ? `用户 #${item.actor_id}` : '用户');
const role = item.actor_role_label ? `(${item.actor_role_label})` : '';
const id = item.actor_id ? ` · ID ${item.actor_id}` : '';
return `${name}${role}${id}`;
}
return ACTOR_TYPE_LABELS[item.actor_type || 'system'] || item.actor_type || '系统';
}
const COMMODITY_STATE: Record<string, { label: string; color: string }> = {
available: { label: '可兑换', color: 'green' },
limited: { label: '已达上限', color: 'orange' },
@@ -296,6 +312,12 @@ export default function AccountDetailPage() {
width: 100,
render: (val: string) => eventTag(val),
},
{
title: '操作人',
key: 'actor',
width: 190,
render: (_value, record) => <Text>{actorLabel(record)}</Text>,
},
{ title: '说明', dataIndex: 'title', ellipsis: true },
{
title: '金额 / 变动',