feat(frontend): Day 7 - frontend complete layout finished

This commit is contained in:
AI Clinical Dev Team
2025-10-10 17:52:47 +08:00
parent df20300190
commit fef8feb9db
11 changed files with 872 additions and 129 deletions

View File

@@ -0,0 +1,167 @@
import { useParams } from 'react-router-dom'
import { Card, Typography, Input, Button, Space, Select, Upload, Tag, Alert, Divider } from 'antd'
import {
SendOutlined,
PaperClipOutlined,
RobotOutlined,
FolderOpenOutlined,
SyncOutlined,
} from '@ant-design/icons'
import { AGENTS } from '../layouts/MainLayout'
const { Title, Paragraph } = Typography
const { TextArea } = Input
const AgentChatPage = () => {
const { agentId } = useParams()
const agent = AGENTS.find((a) => a.id === agentId)
if (!agent) {
return (
<Alert
message="智能体不存在"
description="请从首页选择一个智能体"
type="error"
showIcon
/>
)
}
if (!agent.enabled) {
return (
<Alert
message="该智能体正在开发中"
description="敬请期待后续版本..."
type="warning"
showIcon
/>
)
}
return (
<div style={{ height: '100%', display: 'flex', flexDirection: 'column' }}>
{/* 标题栏 */}
<Card style={{ marginBottom: 16 }}>
<Space align="center">
<span style={{ fontSize: 32 }}>{agent.icon}</span>
<div>
<Title level={3} style={{ marginBottom: 4 }}>
{agent.name}
</Title>
<Paragraph type="secondary" style={{ marginBottom: 0 }}>
DeepSeek-V3
</Paragraph>
</div>
</Space>
</Card>
{/* 聊天区域 */}
<Card
style={{
flex: 1,
display: 'flex',
flexDirection: 'column',
overflow: 'hidden',
}}
bodyStyle={{
flex: 1,
display: 'flex',
flexDirection: 'column',
padding: 0,
}}
>
{/* 消息列表区域(占位符) */}
<div
style={{
flex: 1,
padding: 24,
overflowY: 'auto',
background: '#fafafa',
}}
>
<div style={{ textAlign: 'center', padding: '60px 0', color: '#999' }}>
<RobotOutlined style={{ fontSize: 64, marginBottom: 16 }} />
<div></div>
</div>
{/* 消息示例(占位符) */}
<div style={{ maxWidth: 800, margin: '0 auto' }}>
<div style={{ marginBottom: 24 }}>
<Tag color="blue" style={{ marginBottom: 8 }}>
</Tag>
<Card size="small">
<Paragraph style={{ marginBottom: 0 }}>
...
</Paragraph>
</Card>
</div>
<div style={{ marginBottom: 24 }}>
<Tag color="green" style={{ marginBottom: 8 }}>
AI助手
</Tag>
<Card size="small">
<Paragraph style={{ marginBottom: 0 }}>
AI的回复示例...
</Paragraph>
</Card>
</div>
</div>
</div>
<Divider style={{ margin: 0 }} />
{/* 输入区域 */}
<div style={{ padding: 16, background: '#fff' }}>
{/* 工具栏 */}
<Space style={{ marginBottom: 12, width: '100%', justifyContent: 'space-between' }}>
<Space>
<Upload showUploadList={false}>
<Button icon={<PaperClipOutlined />}></Button>
</Upload>
<Button icon={<FolderOpenOutlined />}>
@
</Button>
<Select
defaultValue="deepseek-v3"
style={{ width: 180 }}
options={[
{ label: 'DeepSeek-V3', value: 'deepseek-v3' },
{ label: 'Qwen3-72B', value: 'qwen3-72b' },
{ label: 'Gemini Pro', value: 'gemini-pro' },
]}
/>
</Space>
<Tag color="orange" icon={<SyncOutlined spin />}>
...
</Tag>
</Space>
{/* 输入框 */}
<Space.Compact style={{ width: '100%' }}>
<TextArea
placeholder="输入您的问题... (功能开发中)"
autoSize={{ minRows: 2, maxRows: 6 }}
disabled
/>
<Button
type="primary"
icon={<SendOutlined />}
style={{ height: 'auto' }}
disabled
>
</Button>
</Space.Compact>
</div>
</Card>
</div>
)
}
export default AgentChatPage