This commit is contained in:
mmc
2026-05-15 17:32:58 +08:00
parent 296c78dcd2
commit bb33714548
2 changed files with 107 additions and 109 deletions

View File

@@ -1,120 +1,119 @@
import React from 'react';
import {
Table,
Button,
DatePicker,
Space,
Typography,
Card,
Segmented,
Row,
Col,
import {
Table,
Button,
DatePicker,
Space,
Typography,
Card,
Segmented,
Row,
Col,
} from 'antd';
import {
DownloadOutlined,
VideoCameraOutlined,
CalendarOutlined,
SearchOutlined
import {
DownloadOutlined,
VideoCameraOutlined,
CalendarOutlined,
SearchOutlined
} from '@ant-design/icons';
import { VIDEOS } from '../constants';
const { Text, Title } = Typography;
const { RangePicker } = DatePicker;
export default function Downloads() {
const columns = [
{
title: '文件详情',
key: 'file',
render: (record: any) => (
<Space size="middle">
<div className="w-8 h-8 bg-blue-50 text-blue-500 rounded flex items-center justify-center border border-blue-100">
<VideoCameraOutlined style={{ fontSize: 16 }} />
</div>
<Space direction="vertical" size={0}>
<Text strong style={{ fontSize: 13 }}>ROB_{record.id}_RAW.mp4</Text>
<Text type="secondary" style={{ fontSize: 10, fontFamily: 'monospace', fontStyle: 'italic' }}>Cloud-Storage-01</Text>
</Space>
</Space>
),
},
{
title: '源设备',
dataIndex: 'deviceName',
key: 'deviceName',
render: (text: string) => <Text style={{ fontSize: 13 }}>{text}</Text>,
},
{
title: '起止时间',
key: 'duration',
render: (record: any) => (
<Space direction="vertical" size={0}>
<Text type="secondary" style={{ fontSize: 11, fontFamily: 'monospace' }}>{record.startTime.split(' ')[1]}</Text>
<div className="h-[1px] w-4 bg-gray-200" />
<Text type="secondary" style={{ fontSize: 11, fontFamily: 'monospace' }}>{record.endTime.split(' ')[1]}</Text>
</Space>
),
},
{
title: '容量',
dataIndex: 'size',
key: 'size',
render: (text: string) => <Text type="secondary" style={{ fontSize: 12 }}>{text}</Text>,
},
{
title: '操作',
key: 'action',
align: 'right' as const,
render: () => (
<Button
type="link"
icon={<DownloadOutlined />}
style={{ fontSize: 11, fontWeight: 'bold' }}
>
下载
</Button>
),
},
];
const columns = [
{
title: '文件详情',
key: 'file',
render: (record: any) => (
<Space size="middle">
<div className="w-8 h-8 bg-blue-50 text-blue-500 rounded flex items-center justify-center border border-blue-100">
<VideoCameraOutlined style={{ fontSize: 16 }} />
</div>
<Space direction="vertical" size={0}>
<Text strong style={{ fontSize: 13 }}>ROB_{record.id}_RAW.mp4</Text>
<Text type="secondary" style={{ fontSize: 10, fontFamily: 'monospace', fontStyle: 'italic' }}>Cloud-Storage-01</Text>
</Space>
</Space>
),
},
{
title: '源设备',
dataIndex: 'deviceName',
key: 'deviceName',
render: (text: string) => <Text style={{ fontSize: 13 }}>{text}</Text>,
},
{
title: '起止时间',
key: 'duration',
render: (record: any) => (
<Space direction="vertical" size={0}>
<Text type="secondary" style={{ fontSize: 11, fontFamily: 'monospace' }}>{record.startTime.split(' ')[1]}</Text>
<div className="h-[1px] w-4 bg-gray-200" />
<Text type="secondary" style={{ fontSize: 11, fontFamily: 'monospace' }}>{record.endTime.split(' ')[1]}</Text>
</Space>
),
},
{
title: '容量',
dataIndex: 'size',
key: 'size',
render: (text: string) => <Text type="secondary" style={{ fontSize: 12 }}>{text}</Text>,
},
{
title: '操作',
key: 'action',
align: 'right' as const,
render: () => (
<Button
type="link"
icon={<DownloadOutlined />}
style={{ fontSize: 11, fontWeight: 'bold' }}
>
下载
</Button>
),
},
];
return (
<div className="space-y-4">
<div className="flex items-center justify-between">
<Title level={5} style={{ margin: 0 }}>视频回放中心</Title>
<Segmented
options={['全部录像', '今日录像']}
defaultValue="全部录像"
style={{ borderRadius: 2 }}
/>
</div>
return (
<div className="space-y-4">
<div className="flex items-center justify-between">
<Title level={5} style={{ margin: 0 }}>视频回放中心</Title>
<Segmented
options={['全部录像', '今日录像']}
defaultValue="全部录像"
style={{ borderRadius: 2 }}
/>
</div>
<Card size="small" style={{ backgroundColor: '#fafafa', borderRadius: 2 }}>
<Row gutter={16} align="middle">
<Col>
<Space>
<CalendarOutlined style={{ color: 'rgba(0,0,0,0.45)' }} />
<Text strong type="secondary" style={{ fontSize: 11, textTransform: 'uppercase' }}>时间跨度</Text>
</Space>
</Col>
<Col>
<RangePicker size="small" style={{ borderRadius: 2 }} />
</Col>
<Col flex="auto" className="text-right">
<Button type="primary" size="small" icon={<SearchOutlined />} style={{ borderRadius: 2 }}>
联机检索
</Button>
</Col>
</Row>
</Card>
<Card size="small" style={{ backgroundColor: '#fafafa', borderRadius: 2 }}>
<Row gutter={16} align="middle">
<Col>
<Space>
<CalendarOutlined style={{ color: 'rgba(0,0,0,0.45)' }} />
<Text strong type="secondary" style={{ fontSize: 11, textTransform: 'uppercase' }}>时间跨度</Text>
</Space>
</Col>
<Col>
<RangePicker size="small" style={{ borderRadius: 2 }} />
</Col>
<Col flex="auto" className="text-right">
<Button type="primary" size="small" icon={<SearchOutlined />} style={{ borderRadius: 2 }}>
联机检索
</Button>
</Col>
</Row>
</Card>
<Card styles={{ body: { padding: 0 } }} className="overflow-hidden">
<Table
size="small"
columns={columns}
dataSource={VIDEOS.map(v => ({ ...v, key: v.id }))}
pagination={{ pageSize: 12, size: 'small' }}
/>
</Card>
</div>
);
<Card styles={{ body: { padding: 0 } }} className="overflow-hidden">
<Table
size="small"
columns={columns}
dataSource={VIDEOS.map(v => ({ ...v, key: v.id }))}
pagination={{ pageSize: 12, size: 'small' }}
/>
</Card>
</div>
);
}

View File

@@ -27,7 +27,6 @@ import {
AlertOutlined,
EyeOutlined
} from '@ant-design/icons';
import { DEVICES } from '../constants';
const { Text, Title } = Typography;