Skip to content

对接带侧边导航的布局组件

jsers edited this page Sep 29, 2020 · 1 revision

对接带侧边导航的布局组件

接入方式:

1、cd 子系统
2、git clone https://github.com/n9e/fe-packages.git src/packages
3、子系统 gitignore 添加 src/packages
4、安装依赖
5、本地 mock 一些接口

依赖列表

"antd": "^3.26.18",
"classnames": "^2.2.6",
"lodash": "^4.17.11",
"query-string": "^5.0.1",
"react": "16.8.6",
"react-intl": "^3.2.1",
"react-router-dom": "4.x",
"single-spa": "^5.5.5",
"single-spa-react": "^2.14.0",
"three": "^0.56.0"

mock 用户信息接口

GET: /api/rdb/self/profile
RES: {"dat":{"id":1,"uuid":"bded0ecb942fe7840da9ac83733f6c46","username":"root","dispname":"超管","phone":"","email":"","im":"","portrait":"","intro":"","is_root":1,"leader_id":0,"leader_name":""},"err":""}

mock 权限接口

GET: /api/rdb/self/perms/global
RES: {"dat":{},"err":""}

布局组件

https://github.com/n9e/fe-packages/blob/master/Layout/Main.tsx

interface Menu {
  name: string;
  path: string;
  icon?: string;
  chidren: Menu[];
}
interface LayoutMainProps {
  menus: Menu[];
  treeVisible: boolean; // 是否显示服务树
  systemName: string; // 系统标识名字
  systemNameChn: string; // 系统标题,左侧菜单上方显示的名字
  children: React.ReactNode; // 系统主要内容
}