feat: add BigScreen 2D/3D links to sidebar navigation
Added "可视化大屏" submenu with "2D 能源大屏" and "3D 园区大屏" entries. BigScreen pages open in new browser tabs since they are full-screen views. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
FileTextOutlined, CloudOutlined, SettingOutlined, UserOutlined,
|
||||
MenuFoldOutlined, MenuUnfoldOutlined, LogoutOutlined, BellOutlined,
|
||||
ThunderboltOutlined, AppstoreOutlined, WarningOutlined, CloseCircleOutlined,
|
||||
InfoCircleOutlined,
|
||||
InfoCircleOutlined, FundProjectionScreenOutlined, GlobalOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { Outlet, useNavigate, useLocation } from 'react-router-dom';
|
||||
import { getUser, removeToken } from '../utils/auth';
|
||||
@@ -22,6 +22,12 @@ const menuItems = [
|
||||
{ key: '/alarms', icon: <AlertOutlined />, label: '告警管理' },
|
||||
{ key: '/carbon', icon: <CloudOutlined />, label: '碳排放管理' },
|
||||
{ key: '/reports', icon: <FileTextOutlined />, label: '报表管理' },
|
||||
{ key: 'bigscreen-group', icon: <FundProjectionScreenOutlined />, label: '可视化大屏',
|
||||
children: [
|
||||
{ key: '/bigscreen', icon: <FundProjectionScreenOutlined />, label: '2D 能源大屏' },
|
||||
{ key: '/bigscreen-3d', icon: <GlobalOutlined />, label: '3D 园区大屏' },
|
||||
],
|
||||
},
|
||||
{ key: '/system', icon: <SettingOutlined />, label: '系统管理',
|
||||
children: [
|
||||
{ key: '/system/users', label: '用户管理' },
|
||||
@@ -103,7 +109,13 @@ export default function MainLayout() {
|
||||
selectedKeys={[location.pathname]}
|
||||
defaultOpenKeys={['/system']}
|
||||
items={menuItems}
|
||||
onClick={({ key }) => navigate(key)}
|
||||
onClick={({ key }) => {
|
||||
if (key === '/bigscreen' || key === '/bigscreen-3d') {
|
||||
window.open(key, '_blank');
|
||||
} else {
|
||||
navigate(key);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Sider>
|
||||
<Layout>
|
||||
|
||||
Reference in New Issue
Block a user