Aurora Admin v1.2.0: 79 components x 5 ends, doc site, contracts batch 1, playground, regression, deploy ready
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
import React, { useState } from 'react';
|
||||
import './MixedNavigation.css';
|
||||
|
||||
const DEFAULT_MENU = [
|
||||
{ name: '工作台', items: [{ name: '概览', desc: '数据看板总览' }, { name: '待办', desc: '我的待处理任务' }, { name: '报表', desc: '统计报表入口' }] },
|
||||
{ name: '系统管理', items: [{ name: '用户管理', desc: '用户增删改查' }, { name: '角色管理', desc: '角色与权限分配' }, { name: '菜单管理', desc: '导航菜单配置' }] },
|
||||
{ name: '业务中心', items: [{ name: '订单', desc: '订单列表与详情' }, { name: '商品', desc: '商品上下架' }, { name: '库存', desc: '库存预警' }] }
|
||||
];
|
||||
|
||||
export default function MixedNavigation({ menu = DEFAULT_MENU }) {
|
||||
const [topIdx, setTopIdx] = useState(0);
|
||||
const [sideIdx, setSideIdx] = useState(0);
|
||||
const cur = menu[topIdx];
|
||||
|
||||
return (
|
||||
<div className="aa-mixed">
|
||||
<div className="aa-mixed-top">
|
||||
{menu.map((m, i) => (
|
||||
<div
|
||||
key={i}
|
||||
className={'aa-mixed-topitem' + (topIdx === i ? ' is-active' : '')}
|
||||
onClick={() => {
|
||||
setTopIdx(i);
|
||||
setSideIdx(0);
|
||||
}}
|
||||
>
|
||||
{m.name}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="aa-mixed-body">
|
||||
<div className="aa-mixed-side">
|
||||
{cur.items.map((it, i) => (
|
||||
<div
|
||||
key={i}
|
||||
className={'aa-mixed-sideitem' + (sideIdx === i ? ' is-active' : '')}
|
||||
onClick={() => setSideIdx(i)}
|
||||
>
|
||||
{it.name}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="aa-mixed-content">
|
||||
<h4>
|
||||
{cur.name} / {cur.items[sideIdx].name}
|
||||
</h4>
|
||||
<div>{cur.items[sideIdx].desc}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user