import {
BugOutlined,
DatabaseOutlined,
DashboardOutlined,
FileTextOutlined,
LineChartOutlined,
RobotOutlined,
SnippetsOutlined,
UnorderedListOutlined,
MessageOutlined,
SafetyCertificateOutlined,
PhoneOutlined,
} from '@ant-design/icons'
import { Layout, Menu, Typography, theme } from 'antd'
import type { MenuProps } from 'antd'
import { useMemo, useState } from 'react'
import { Link, Outlet, useLocation } from 'react-router-dom'
const { Header, Content, Sider } = Layout
const menuItems: MenuProps['items'] = [
{
key: '/dashboard',
icon: ,
label: 健康概览,
},
{
key: '/tasks',
icon: ,
label: 任务中心,
},
{
key: '/resources',
icon: ,
label: '资源池',
children: [
{
key: '/resources/accounts',
label: 账号池,
},
{
key: '/resources/sessions',
label: 会话池,
},
{
key: '/resources/proxies',
label: 代理池,
},
],
},
{
key: '/errors',
icon: ,
label: 错误中心,
},
{
key: '/content/raw-notes',
icon: ,
label: 原始快照,
},
{
key: '/content/cleaned-notes',
icon: ,
label: 清洗笔记库,
},
{
key: '/ai/generation',
icon: ,
label: AI 生产内容,
},
{
key: '/compliance/review',
icon: ,
label: 合规检测,
},
{
key: '/leads',
icon: ,
label: 线索转化池,
},
{
key: '/rpa',
icon: ,
label: RPA 兜底,
},
{
key: '/metrics',
icon: ,
label: 监控指标,
},
]
export default function AppLayout() {
const location = useLocation()
const {
token: { colorBgContainer, borderRadiusLG, colorBorderSecondary },
} = theme.useToken()
const selectedKeys = useMemo(() => {
if (location.pathname.startsWith('/tasks')) return ['/tasks']
if (location.pathname.startsWith('/errors')) return ['/errors']
return [location.pathname]
}, [location.pathname])
const defaultOpenKeys = useMemo(() => {
if (location.pathname.startsWith('/resources')) return ['/resources']
return []
}, [location.pathname])
const [openKeys, setOpenKeys] = useState(defaultOpenKeys)
const onOpenChange = (keys: string[]) => {
setOpenKeys(keys)
}
return (
Spider XHS
)
}