fix(ai): ChatPage import/layout 修复 + 迁移表名列名修正 + 路由权限注册
- ChatPage: 图标从 antd 移到 @ant-design/icons,Layout/Sider 改为 div 布局避免 Header 遮挡 - routeConfig: 注册 /ai/chat 路由权限 (ai.chat.session.list/manage) - 迁移 153: ai_tenant_configs → ai_tenant_config 表名修正 - 迁移 154: menus.name/is_external/status → title/visible/menu_type 列名修正 - 迁移 151/152: AI 配置菜单父级修复 + AI Provider 权限 seed
This commit is contained in:
@@ -1,15 +1,10 @@
|
||||
import { useState, useRef, useEffect, useCallback } from 'react';
|
||||
import {
|
||||
Layout,
|
||||
List,
|
||||
Button,
|
||||
Input,
|
||||
Typography,
|
||||
Spin,
|
||||
PlusOutlined,
|
||||
MessageOutlined,
|
||||
DeleteOutlined,
|
||||
EditOutlined,
|
||||
theme,
|
||||
Modal,
|
||||
Space,
|
||||
@@ -17,6 +12,10 @@ import {
|
||||
import {
|
||||
SendOutlined,
|
||||
RobotOutlined,
|
||||
PlusOutlined,
|
||||
MessageOutlined,
|
||||
DeleteOutlined,
|
||||
EditOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import {
|
||||
aiChatApi,
|
||||
@@ -27,7 +26,6 @@ import {
|
||||
import RichMessage from '../../components/ai/RichMessage';
|
||||
import { useAuthStore } from '../../stores/auth';
|
||||
|
||||
const { Sider, Content } = Layout;
|
||||
const { Text } = Typography;
|
||||
const { TextArea } = Input;
|
||||
|
||||
@@ -183,13 +181,15 @@ export default function ChatPage() {
|
||||
const activeSession = sessions.find((s) => s.id === activeId);
|
||||
|
||||
return (
|
||||
<Layout style={{ height: 'calc(100vh - 64px)', background: token.colorBgContainer }}>
|
||||
<Sider
|
||||
width={260}
|
||||
<div style={{ display: 'flex', height: 'calc(100vh - 64px)', background: token.colorBgContainer }}>
|
||||
{/* 左侧会话列表 */}
|
||||
<div
|
||||
style={{
|
||||
width: 260,
|
||||
flexShrink: 0,
|
||||
background: token.colorBgLayout,
|
||||
borderRight: `1px solid ${token.colorBorderSecondary}`,
|
||||
overflow: 'auto',
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
>
|
||||
<div style={{ padding: 12 }}>
|
||||
@@ -254,9 +254,10 @@ export default function ChatPage() {
|
||||
</List.Item>
|
||||
)}
|
||||
/>
|
||||
</Sider>
|
||||
</div>
|
||||
|
||||
<Content style={{ display: 'flex', flexDirection: 'column' }}>
|
||||
{/* 右侧聊天区 */}
|
||||
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', minWidth: 0 }}>
|
||||
{/* 标题栏 */}
|
||||
<div
|
||||
style={{
|
||||
@@ -373,7 +374,7 @@ export default function ChatPage() {
|
||||
</Space.Compact>
|
||||
</div>
|
||||
)}
|
||||
</Content>
|
||||
</Layout>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -244,6 +244,12 @@ const ENTRIES: RoutePermissionEntry[] = [
|
||||
path: "/health/schedules",
|
||||
permissions: ["health.appointment.list", "health.appointment.manage"],
|
||||
},
|
||||
|
||||
// ===== AI 聊天 =====
|
||||
{
|
||||
path: "/ai/chat",
|
||||
permissions: ["ai.chat.session.list", "ai.chat.session.manage"],
|
||||
},
|
||||
];
|
||||
|
||||
/** 活跃路由的权限映射 — 自动从配置生成,供 PrivateRoute 使用 */
|
||||
|
||||
Reference in New Issue
Block a user