feat(douyu): 优化外部协作单详情抽屉
This commit is contained in:
@@ -150,6 +150,195 @@ const CK_META: Record<string, { label: string; color: string }> = {
|
||||
'': { label: '未检测', color: 'default' },
|
||||
};
|
||||
|
||||
const COLLAB_ACTION_LABELS: Record<string, string> = {
|
||||
'douyu:collab:create': '新建协作单',
|
||||
'douyu:collab:update': '编辑订单资料',
|
||||
'douyu:collab:account': '更换账号',
|
||||
'douyu:collab:account_unlink': '解除账号关联',
|
||||
'douyu:collab:verify': '校验账号',
|
||||
'douyu:collab:status': '修改订单状态',
|
||||
'douyu:collab:status_auto': '自动推进订单状态',
|
||||
'douyu:collab:void': '作废订单',
|
||||
'douyu:collab:void_restore': '恢复作废订单',
|
||||
'douyu:collab:points_error': '标记积分异常',
|
||||
'douyu:collab:role_error': '标记角色异常',
|
||||
'douyu:collab:activity': '查询兑换记录',
|
||||
'douyu:collab:ck_export': '导出账号与登录凭据',
|
||||
'douyu:collab:archive': '归档订单',
|
||||
'douyu:collab:unarchive': '取消归档',
|
||||
'douyu:collab:sync_from_platform_fulfillment': '同步直播履约单',
|
||||
'douyu:collab:lease_acquired': '建立账号占用',
|
||||
'douyu:collab:lease_released': '释放账号占用',
|
||||
'douyu:collab:lease_takeover': '接管账号占用',
|
||||
'douyu:collab:goods_refresh': '刷新活动商品',
|
||||
'douyu:collab:shop_update': '修改店铺',
|
||||
'douyu:collab:shop_delete': '删除店铺',
|
||||
'douyu:collab:gift_update': '修改礼包',
|
||||
'douyu:collab:gift_delete': '删除礼包',
|
||||
};
|
||||
|
||||
const COLLAB_DETAIL_LABELS: Record<string, string> = {
|
||||
order_no: '订单编号',
|
||||
orderNo: '平台订单编号',
|
||||
shop: '店铺',
|
||||
owner_id: '负责人编号',
|
||||
account_id: '内部账号编号',
|
||||
accountId: '内部账号编号',
|
||||
account_username: '斗鱼账号',
|
||||
accountName: '账号名称',
|
||||
account_uid: '斗鱼用户编号',
|
||||
account_nickname: '账号昵称',
|
||||
gift_name: '礼包',
|
||||
commodity_id: '商品编号',
|
||||
required_points: '所需积分',
|
||||
requiredPoints: '所需积分',
|
||||
home_images: '主页截图',
|
||||
bind_game_role: '绑定角色',
|
||||
role: '当前角色',
|
||||
ck_status: '登录凭据状态',
|
||||
ck: '登录凭据状态',
|
||||
fish_fin_balance: '鱼翅',
|
||||
points: '积分',
|
||||
points_balance: '当前积分',
|
||||
required_total: '同账号所需积分',
|
||||
surplus: '积分结余',
|
||||
message: '说明',
|
||||
scope: '查询范围',
|
||||
verdict: '查询判定',
|
||||
records: '兑换记录',
|
||||
records_matched: '命中记录',
|
||||
records_total: '记录总数',
|
||||
from: '原状态',
|
||||
to: '新状态',
|
||||
status: '状态',
|
||||
rollback: '是否回退',
|
||||
reason: '原因',
|
||||
taskId: '履约任务编号',
|
||||
created: '是否新建',
|
||||
released_lease: '是否释放账号占用',
|
||||
previous: '原账号信息',
|
||||
lease_id: '账号占用编号',
|
||||
purpose: '占用用途',
|
||||
batch_id: '批次编号',
|
||||
draft: '是否草稿',
|
||||
exchangeStatus: '兑换资格',
|
||||
softReasons: '后续处理',
|
||||
eliteOpened: '精英宝典已开通',
|
||||
limited: '是否达到限兑上限',
|
||||
limitedCount: '限兑商品数量',
|
||||
};
|
||||
|
||||
const COLLAB_DETAIL_VALUE_LABELS: Record<string, string> = {
|
||||
valid: '正常',
|
||||
invalid: '异常',
|
||||
error: '异常',
|
||||
unverified: '未检测',
|
||||
unknown: '无法判定',
|
||||
success: '成功',
|
||||
failed: '失败',
|
||||
incomplete: '待补资料',
|
||||
to_recharge: '待充值',
|
||||
recharged: '已充值',
|
||||
scripted: '已上脚本',
|
||||
done: '抢购成功',
|
||||
points_error: '积分异常',
|
||||
role_error: '账号角色异常',
|
||||
void: '已作废',
|
||||
allocated: '已分配',
|
||||
bound: '已绑定',
|
||||
ready: '待分配',
|
||||
manual_required: '已转人工',
|
||||
eligible: '资格正常',
|
||||
points_short: '积分不足',
|
||||
not_opened: '精英宝典未开通',
|
||||
activity: '兑换记录',
|
||||
balances: '鱼翅与积分',
|
||||
balance_manual: '人工查询鱼翅与积分',
|
||||
balance_batch: '批量查询鱼翅与积分',
|
||||
batch: '批量查询',
|
||||
platform_fulfillment: '直播账号履约',
|
||||
douyu_collab: '外部单协作',
|
||||
};
|
||||
|
||||
const COLLAB_DETAIL_PREFERRED_KEYS = Object.keys(COLLAB_DETAIL_LABELS);
|
||||
|
||||
function collabActionLabel(action: string): string {
|
||||
return COLLAB_ACTION_LABELS[action] || '其他操作';
|
||||
}
|
||||
|
||||
function collabCkLabel(status: string): string {
|
||||
if (status === 'valid') return '正常';
|
||||
if (status === 'invalid' || status === 'error') return '异常';
|
||||
return '未检测';
|
||||
}
|
||||
|
||||
function collabValueLabel(value: unknown): string {
|
||||
if (typeof value === 'boolean') return value ? '是' : '否';
|
||||
if (value === null || value === undefined || value === '') return '-';
|
||||
if (typeof value === 'number') return String(value);
|
||||
if (Array.isArray(value)) {
|
||||
return value.map((item) => collabValueLabel(item)).filter((item) => item !== '-').join('、') || '-';
|
||||
}
|
||||
if (typeof value === 'object') {
|
||||
const row = value as Record<string, unknown>;
|
||||
if ('old' in row || 'new' in row) {
|
||||
return `${collabValueLabel(row.old)} → ${collabValueLabel(row.new)}`;
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
const text = String(value);
|
||||
return COLLAB_DETAIL_VALUE_LABELS[text] || collabText(text);
|
||||
}
|
||||
|
||||
function collabText(value: string): string {
|
||||
return value
|
||||
.replace(/\bCookie\b/gi, '登录凭据')
|
||||
.replace(/\bCK\b/gi, '登录凭据')
|
||||
.replace(/\s*act=[^,,;;\s]+/gi, '')
|
||||
.trim();
|
||||
}
|
||||
|
||||
function collabTimelineDetailLines(detail: string): string[] {
|
||||
if (!detail) return [];
|
||||
let parsed: unknown;
|
||||
try {
|
||||
parsed = JSON.parse(detail);
|
||||
} catch {
|
||||
return ['明细格式无法识别'];
|
||||
}
|
||||
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
||||
return [collabValueLabel(parsed)];
|
||||
}
|
||||
const data = parsed as Record<string, unknown>;
|
||||
const lines: string[] = [];
|
||||
for (const key of COLLAB_DETAIL_PREFERRED_KEYS) {
|
||||
if (!(key in data)) continue;
|
||||
const value = data[key];
|
||||
if (key === 'previous' && value && typeof value === 'object' && !Array.isArray(value)) {
|
||||
const previous = value as Record<string, unknown>;
|
||||
const parts = [
|
||||
previous.account_username ? `账号 ${collabValueLabel(previous.account_username)}` : '',
|
||||
previous.bind_game_role ? `角色 ${collabValueLabel(previous.bind_game_role)}` : '',
|
||||
previous.status ? `状态 ${collabValueLabel(previous.status)}` : '',
|
||||
].filter(Boolean);
|
||||
if (parts.length) lines.push(`${COLLAB_DETAIL_LABELS[key]}:${parts.join(';')}`);
|
||||
continue;
|
||||
}
|
||||
if (key === 'ck_status' || key === 'ck') {
|
||||
lines.push(`${COLLAB_DETAIL_LABELS[key]}:${collabCkLabel(String(value || ''))}`);
|
||||
continue;
|
||||
}
|
||||
if (key === 'home_images') {
|
||||
const count = Array.isArray(value) ? value.length : Number(value || 0);
|
||||
lines.push(`${COLLAB_DETAIL_LABELS[key]}:${Number.isFinite(count) ? count : 0} 张`);
|
||||
continue;
|
||||
}
|
||||
const text = collabValueLabel(value);
|
||||
if (text !== '-') lines.push(`${COLLAB_DETAIL_LABELS[key]}:${text}`);
|
||||
}
|
||||
return lines;
|
||||
}
|
||||
|
||||
function formatTime(value?: string | null): string {
|
||||
if (!value) return '-';
|
||||
const date = new Date(value);
|
||||
@@ -2570,144 +2759,352 @@ export default function DouyuCollabPage() {
|
||||
</Modal>
|
||||
|
||||
<Drawer
|
||||
title={detail ? `协作单 ${detail.order_no}` : '协作单详情'}
|
||||
title={
|
||||
detail ? (
|
||||
<div>
|
||||
<Space size={8} wrap>
|
||||
<Text strong style={{ fontSize: 18 }}>
|
||||
{detail.order_no}
|
||||
</Text>
|
||||
<Tag color={STATUS_META[detail.status]?.color}>
|
||||
{detail.status_label}
|
||||
</Tag>
|
||||
{detail.is_archived && <Tag>已归档</Tag>}
|
||||
</Space>
|
||||
<div>
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>
|
||||
{detail.shop || '未填店铺'} · {detail.owner_name || '未指派负责人'}
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
'协作单详情'
|
||||
)
|
||||
}
|
||||
open={detailOpen}
|
||||
onClose={closeDetail}
|
||||
width={760}
|
||||
width="min(1180px, 96vw)"
|
||||
styles={{ body: { padding: 24, background: '#f5f7fa' } }}
|
||||
extra={
|
||||
detail && canEdit ? (
|
||||
<Space>
|
||||
<Space size={8} wrap>
|
||||
{detail.account_id && (
|
||||
<Button icon={<LinkOutlined />} onClick={() => navigate(`/accounts/${detail.account_id}`)}>
|
||||
<Button
|
||||
icon={<LinkOutlined />}
|
||||
onClick={() => navigate(`/accounts/${detail.account_id}`)}
|
||||
>
|
||||
账号详情
|
||||
</Button>
|
||||
)}
|
||||
<Button icon={<EditOutlined />} onClick={() => openEdit(detail)}>
|
||||
编辑
|
||||
编辑资料
|
||||
</Button>
|
||||
<Button icon={<SafetyCertificateOutlined />} onClick={() => void verifyOrder(detail)}>
|
||||
校验
|
||||
<Button
|
||||
icon={<SafetyCertificateOutlined />}
|
||||
onClick={() => void verifyOrder(detail)}
|
||||
>
|
||||
校验账号
|
||||
</Button>
|
||||
<Button icon={<SyncOutlined />} onClick={() => void queryOneBalances(detail)}>
|
||||
查鱼翅/积分
|
||||
<Button
|
||||
icon={<SyncOutlined />}
|
||||
onClick={() => void queryOneBalances(detail)}
|
||||
>
|
||||
查询鱼翅积分
|
||||
</Button>
|
||||
<Button icon={<SearchOutlined />} onClick={() => void queryOneRecords(detail)}>
|
||||
查兑换记录
|
||||
<Button
|
||||
icon={<SearchOutlined />}
|
||||
onClick={() => void queryOneRecords(detail)}
|
||||
>
|
||||
查询兑换记录
|
||||
</Button>
|
||||
</Space>
|
||||
) : undefined
|
||||
}
|
||||
>
|
||||
{detail ? (
|
||||
<Space direction="vertical" size={16} style={{ width: '100%' }}>
|
||||
<Descriptions bordered size="small" column={2}>
|
||||
<Descriptions.Item label="订单编号">{detail.order_no}</Descriptions.Item>
|
||||
<Space direction="vertical" size={18} style={{ width: '100%' }}>
|
||||
<Descriptions
|
||||
bordered
|
||||
size="small"
|
||||
column={{ xs: 1, sm: 2, lg: 3 }}
|
||||
title="订单概况"
|
||||
>
|
||||
<Descriptions.Item label="订单编号">
|
||||
<Text copyable>{detail.order_no}</Text>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="店铺">{detail.shop || '-'}</Descriptions.Item>
|
||||
<Descriptions.Item label="负责人">{detail.owner_name || '-'}</Descriptions.Item>
|
||||
<Descriptions.Item label="状态">
|
||||
<Tag color={STATUS_META[detail.status]?.color}>{detail.status_label}</Tag>
|
||||
<Descriptions.Item label="负责人">
|
||||
{detail.owner_name || '未指派'}
|
||||
</Descriptions.Item>
|
||||
{detail.source_type === 'platform_fulfillment' ? (
|
||||
<>
|
||||
<Descriptions.Item label="履约任务">
|
||||
#{detail.source_task_id ?? '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="来源订单">
|
||||
{detail.source_platform_order_id || detail.source_order_id || '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="最近同步" span={2}>
|
||||
{detail.last_synced_at ? formatTime(detail.last_synced_at) : '-'}
|
||||
</Descriptions.Item>
|
||||
</>
|
||||
) : null}
|
||||
<Descriptions.Item label="斗鱼账号">{detail.account_username || '-'}</Descriptions.Item>
|
||||
<Descriptions.Item label="账号昵称">{detail.account_nickname || '-'}</Descriptions.Item>
|
||||
<Descriptions.Item label="绑定角色">{detail.bind_game_role || '-'}</Descriptions.Item>
|
||||
<Descriptions.Item label="角色区服">{detail.bind_game_channel || '-'}</Descriptions.Item>
|
||||
<Descriptions.Item label="礼包">
|
||||
{detail.gift_name || '-'}({detail.required_points ?? '-'} 积分)
|
||||
<Descriptions.Item label="订单状态">
|
||||
<Tag color={STATUS_META[detail.status]?.color}>
|
||||
{detail.status_label}
|
||||
</Tag>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="鱼翅 / 积分">
|
||||
鱼翅 {detail.fish_fin_balance ?? '-'} / 积分 {detail.points_balance ?? '-'}
|
||||
<Descriptions.Item label="创建人">
|
||||
{detail.created_by_name || '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="同账号合计">
|
||||
需 {detail.points_required_total ?? '-'},结余 {detail.points_surplus ?? '-'}
|
||||
<Descriptions.Item label="创建时间">
|
||||
{formatTime(detail.created_at)}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="积分判定">
|
||||
{detail.points_check_message || '-'}
|
||||
<Descriptions.Item label="最近修改">
|
||||
{detail.updated_by_name || '-'} · {formatTime(detail.updated_at)}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="备注" span={2}>
|
||||
{detail.remark || '-'}
|
||||
<Descriptions.Item label="订单来源" span={2}>
|
||||
{detail.source_type === 'platform_fulfillment' ? (
|
||||
<Space size={6} wrap>
|
||||
<Tag color="blue">直播账号履约</Tag>
|
||||
<Text>履约任务 #{detail.source_task_id ?? '-'}</Text>
|
||||
{(detail.source_platform_order_id || detail.source_order_id) && (
|
||||
<Text type="secondary">
|
||||
来源订单 {detail.source_platform_order_id || detail.source_order_id}
|
||||
</Text>
|
||||
)}
|
||||
{detail.last_synced_at && (
|
||||
<Text type="secondary">
|
||||
最近同步 {formatTime(detail.last_synced_at)}
|
||||
</Text>
|
||||
)}
|
||||
</Space>
|
||||
) : (
|
||||
<Tag>人工录入</Tag>
|
||||
)}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="备注" span={3}>
|
||||
{detail.remark || '无'}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
|
||||
<div>
|
||||
<Descriptions
|
||||
bordered
|
||||
size="small"
|
||||
column={{ xs: 1, sm: 2, lg: 3 }}
|
||||
title="账号与绑定角色"
|
||||
>
|
||||
<Descriptions.Item label="斗鱼账号">
|
||||
{detail.account_username ? (
|
||||
<Text copyable>{detail.account_username}</Text>
|
||||
) : (
|
||||
<Text type="secondary">尚未关联账号</Text>
|
||||
)}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="账号昵称">
|
||||
{detail.account_nickname || '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="账号状态">
|
||||
<Space size={4} wrap>
|
||||
{!detail.account_exists ? (
|
||||
<Tag color="red">账号不存在</Tag>
|
||||
) : detail.has_cookie ? (
|
||||
<Tag color={CK_META[detail.account_ck_status]?.color || 'default'}>
|
||||
登录凭据{collabCkLabel(detail.account_ck_status)}
|
||||
</Tag>
|
||||
) : (
|
||||
<Tag color="red">未配置登录凭据</Tag>
|
||||
)}
|
||||
{detail.account_cluster && detail.account_cluster.total > 1 && (
|
||||
<Tag color="blue">同账号 {detail.account_cluster.total} 单</Tag>
|
||||
)}
|
||||
</Space>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="绑定角色">
|
||||
{detail.bind_game_role || '尚未读取'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="角色区服">
|
||||
{detail.bind_game_channel || '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="绑定信息时间">
|
||||
{formatTime(detail.bind_snapshot_at)}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
|
||||
<Descriptions
|
||||
bordered
|
||||
size="small"
|
||||
column={{ xs: 1, sm: 2, lg: 3 }}
|
||||
title="礼包与兑换资格"
|
||||
>
|
||||
<Descriptions.Item label="礼包">
|
||||
{detail.gift_name || '未选择礼包'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="本单所需积分">
|
||||
{detail.required_points ?? '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="鱼翅余额">
|
||||
{detail.fish_fin_balance ?? '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="当前积分">
|
||||
{detail.points_balance ?? '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="同账号所需积分">
|
||||
{detail.points_required_total ?? '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="积分结余">
|
||||
<Text
|
||||
type={
|
||||
detail.points_surplus !== null && detail.points_surplus < 0
|
||||
? 'danger'
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{detail.points_surplus ?? '-'}
|
||||
</Text>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="积分判定" span={2}>
|
||||
<Space size={6} wrap>
|
||||
{detail.points_check_reason ? (
|
||||
<Tag color={pointsReasonMeta(detail.points_check_reason).color}>
|
||||
{pointsReasonMeta(detail.points_check_reason).label}
|
||||
</Tag>
|
||||
) : (
|
||||
<Tag>未核账</Tag>
|
||||
)}
|
||||
<Text>{detail.points_check_message || '-'}</Text>
|
||||
</Space>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="核账时间">
|
||||
{formatTime(detail.points_checked_at)}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
|
||||
<div
|
||||
style={{
|
||||
background: '#fff',
|
||||
border: '1px solid #f0f0f0',
|
||||
borderRadius: 8,
|
||||
padding: 16,
|
||||
}}
|
||||
>
|
||||
<Text strong>主页截图</Text>
|
||||
<div style={{ marginTop: 8 }}>
|
||||
<div style={{ marginTop: 12 }}>
|
||||
{detail.home_image_urls.length ? (
|
||||
<Image.PreviewGroup items={detail.home_image_urls}>
|
||||
<Space wrap>
|
||||
<Space wrap size={10}>
|
||||
{detail.home_image_thumb_urls.map((url, index) => (
|
||||
<Image key={url} src={url} width={88} height={88} style={{ objectFit: 'cover', borderRadius: 4 }} alt={`主页截图${index + 1}`} />
|
||||
<Image
|
||||
key={url}
|
||||
src={url}
|
||||
width={120}
|
||||
height={120}
|
||||
style={{ objectFit: 'cover', borderRadius: 6 }}
|
||||
alt={`主页截图${index + 1}`}
|
||||
/>
|
||||
))}
|
||||
</Space>
|
||||
</Image.PreviewGroup>
|
||||
) : (
|
||||
<Text type="secondary">未上传</Text>
|
||||
<Empty
|
||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
description="未上传主页截图"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Text strong>查询时间线</Text>
|
||||
{detailLoading ? (
|
||||
<Text type="secondary">加载中…</Text>
|
||||
) : detailMetrics.length ? (
|
||||
<Timeline
|
||||
style={{ marginTop: 12 }}
|
||||
items={detailMetrics.map((metric) => ({
|
||||
color: metric.verdict === 'success' ? 'green' : metric.verdict === 'failed' ? 'red' : 'gray',
|
||||
children: (
|
||||
<Space direction="vertical" size={0}>
|
||||
<Text>
|
||||
{metric.verdict_label || '查询'} · {formatTime(metric.created_at)}
|
||||
</Text>
|
||||
<Text type="secondary">{metric.message}</Text>
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>
|
||||
鱼翅 {metric.fish_fin_balance ?? '-'} / 积分 {metric.points_balance ?? '-'} / 记录 {metric.records_matched}/{metric.records_total}
|
||||
</Text>
|
||||
</Space>
|
||||
),
|
||||
}))}
|
||||
/>
|
||||
) : (
|
||||
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="还没查询过" />
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Text strong>操作记录</Text>
|
||||
<Timeline
|
||||
style={{ marginTop: 12 }}
|
||||
items={detailTimeline.map((item) => ({
|
||||
children: (
|
||||
<Space direction="vertical" size={0}>
|
||||
<Text>
|
||||
{item.username || '-'} · {item.action}
|
||||
</Text>
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>
|
||||
{formatTime(item.created_at)}
|
||||
</Text>
|
||||
{item.detail && (
|
||||
<Text type="secondary" style={{ fontSize: 12, wordBreak: 'break-all' }}>
|
||||
{item.detail}
|
||||
</Text>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
<Row gutter={16}>
|
||||
<Col xs={24} xl={12}>
|
||||
<div
|
||||
style={{
|
||||
background: '#fff',
|
||||
border: '1px solid #f0f0f0',
|
||||
borderRadius: 8,
|
||||
padding: 16,
|
||||
minHeight: 260,
|
||||
}}
|
||||
>
|
||||
<Text strong>查询记录</Text>
|
||||
<div style={{ marginTop: 14, maxHeight: 460, overflowY: 'auto' }}>
|
||||
{detailLoading ? (
|
||||
<Text type="secondary">加载中…</Text>
|
||||
) : detailMetrics.length ? (
|
||||
<Timeline
|
||||
items={detailMetrics.map((metric) => ({
|
||||
color:
|
||||
metric.verdict === 'success'
|
||||
? 'green'
|
||||
: metric.verdict === 'failed'
|
||||
? 'red'
|
||||
: 'gray',
|
||||
children: (
|
||||
<Space direction="vertical" size={2}>
|
||||
<Text strong>{metric.verdict_label || '查询记录'}</Text>
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>
|
||||
{formatTime(metric.created_at)}
|
||||
</Text>
|
||||
<Text>{metric.message}</Text>
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>
|
||||
鱼翅 {metric.fish_fin_balance ?? '-'} · 积分{' '}
|
||||
{metric.points_balance ?? '-'} · 兑换记录{' '}
|
||||
{metric.records_matched}/{metric.records_total}
|
||||
</Text>
|
||||
</Space>
|
||||
),
|
||||
}))}
|
||||
/>
|
||||
) : (
|
||||
<Empty
|
||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
description="暂无查询记录"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col xs={24} xl={12}>
|
||||
<div
|
||||
style={{
|
||||
background: '#fff',
|
||||
border: '1px solid #f0f0f0',
|
||||
borderRadius: 8,
|
||||
padding: 16,
|
||||
minHeight: 260,
|
||||
}}
|
||||
>
|
||||
<Text strong>操作记录</Text>
|
||||
<div style={{ marginTop: 14, maxHeight: 460, overflowY: 'auto' }}>
|
||||
{detailLoading ? (
|
||||
<Text type="secondary">加载中…</Text>
|
||||
) : detailTimeline.length ? (
|
||||
<Timeline
|
||||
items={detailTimeline.map((item) => {
|
||||
const detailLines = collabTimelineDetailLines(item.detail);
|
||||
return {
|
||||
color: item.success === false ? 'red' : 'blue',
|
||||
children: (
|
||||
<Space direction="vertical" size={3}>
|
||||
<Space size={6} wrap>
|
||||
<Text strong>{collabActionLabel(item.action)}</Text>
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>
|
||||
{item.username || '系统'}
|
||||
</Text>
|
||||
</Space>
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>
|
||||
{formatTime(item.created_at)}
|
||||
</Text>
|
||||
{detailLines.map((line, index) => (
|
||||
<Text
|
||||
key={`${line}-${index}`}
|
||||
type="secondary"
|
||||
style={{ fontSize: 12, wordBreak: 'break-all' }}
|
||||
>
|
||||
{line}
|
||||
</Text>
|
||||
))}
|
||||
</Space>
|
||||
),
|
||||
};
|
||||
})}
|
||||
/>
|
||||
) : (
|
||||
<Empty
|
||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
description="暂无操作记录"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</Space>
|
||||
) : detailLoading ? (
|
||||
<Text type="secondary">加载中…</Text>
|
||||
|
||||
Reference in New Issue
Block a user