1、修改后台数据概览页面

2、增加对应是时间范围修改
This commit is contained in:
2026-06-15 16:17:00 +08:00
parent 1de11d93d0
commit 5ee682d06e
10 changed files with 648 additions and 218 deletions
@@ -763,81 +763,76 @@ const AdminGenerationAiRecords: React.FC = () => {
};
return (
<div style={{ padding: 24 }}>
<Card
title={(
<Space>
<FileImageOutlined />
<span></span>
</Space>
)}
extra={(
<Space wrap>
<Select
allowClear
placeholder="状态筛选"
value={filterStatus || undefined}
style={{ width: 140 }}
onChange={(v) => {
setFilterStatus(v || '');
setPage(1);
}}
options={[
{ value: 'generating', label: '生成中' },
{ value: 'completed', label: '已完成' },
{ value: 'failed', label: '失败' },
]}
/>
<Select
allowClear
placeholder="类型筛选"
value={filterGenType || undefined}
style={{ width: 120 }}
onChange={(v) => {
setFilterGenType(v || '');
setPage(1);
}}
options={[
{ value: 'image', label: '图片' },
{ value: 'video', label: '视频' },
]}
/>
<Input
placeholder="用户ID"
value={inputUserId}
onChange={(e) => setInputUserId(e.target.value)}
onPressEnter={handleSearch}
style={{ width: 180 }}
allowClear
/>
<Input
placeholder="用户名"
value={inputUserName}
onChange={(e) => setInputUserName(e.target.value)}
onPressEnter={handleSearch}
style={{ width: 160 }}
allowClear
/>
<Button icon={<SearchOutlined />} onClick={handleSearch}></Button>
</Space>
)}
bordered={false}
style={{ borderRadius: 16 }}
>
<div>
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16, flexWrap: 'wrap', gap: 12 }}>
<Space>
<PlayCircleOutlined style={{ fontSize: 18, color: '#6366f1' }} />
<Typography.Text strong style={{ fontSize: 16 }}></Typography.Text>
<Tag color="purple">{total} </Tag>
</Space>
<Space>
<Select
allowClear
placeholder="状态筛选"
value={filterStatus || undefined}
style={{ width: 140 }}
onChange={(v) => { setFilterStatus(v || ''); setPage(1); }}
options={[
{ value: 'generating', label: '生成中' },
{ value: 'completed', label: '已完成' },
{ value: 'failed', label: '失败' },
]}
/>
<Select
allowClear
placeholder="类型筛选"
value={filterGenType || undefined}
style={{ width: 120 }}
onChange={(v) => { setFilterGenType(v || ''); setPage(1); }}
options={[
{ value: 'image', label: '图片' },
{ value: 'video', label: '视频' },
]}
/>
<Input
placeholder="用户ID搜索"
prefix={<SearchOutlined style={{ color: '#94a3b8' }} />}
style={{ width: 180 }}
value={inputUserId}
onChange={(e) => setInputUserId(e.target.value)}
onPressEnter={handleSearch}
allowClear
/>
<Input
placeholder="用户名搜索"
prefix={<SearchOutlined style={{ color: '#94a3b8' }} />}
style={{ width: 160 }}
value={inputUserName}
onChange={(e) => setInputUserName(e.target.value)}
onPressEnter={handleSearch}
allowClear
/>
<Button type="primary" onClick={handleSearch} style={{ borderRadius: 8 }}>
</Button>
</Space>
</div>
<Table
rowKey="id"
loading={loading}
columns={columns as any}
dataSource={records}
scroll={{ x: 1180 }}
pagination={{
current: page,
pageSize: PAGE_SIZE,
total,
showSizeChanger: false,
showTotal: (t) => `${t}`,
onChange: (p) => setPage(p),
}}
rowKey="id"
loading={loading}
columns={columns as any}
dataSource={records}
scroll={{ x: 1180 }}
pagination={{
current: page,
pageSize: PAGE_SIZE,
total,
showSizeChanger: false,
showTotal: (t) => `${t}`,
onChange: (p) => setPage(p),
}}
/>
</Card>