All Projects → nemo-tree → react-antd-admin

nemo-tree / react-antd-admin

Licence: other
react-antd-admin 是一个后台集成解决方案,它基于 react 和 antd; 内置了动态路由,标签页缓存,权限验证、切换功能

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to react-antd-admin

react-cli
基于 create-react-app 搭建的前端脚手架
Stars: ✭ 18 (-57.14%)
Mutual labels:  react-redux, antd, react-router-v4
React Antd Admin
后台前端管理系统,基于react、typescript、antd、dva及一些特别优秀的开源库实现
Stars: ✭ 117 (+178.57%)
Mutual labels:  create-react-app, antd, react-router-v4
Reactspa
combination of react teconology stack
Stars: ✭ 911 (+2069.05%)
Mutual labels:  react-redux, antd, react-router-v4
Create React App Redux
React Router, Redux, Redux Thunk & Create React App boilerplate
Stars: ✭ 885 (+2007.14%)
Mutual labels:  create-react-app, react-redux, react-router-v4
React Admin
基于[email protected]的react动态权限后台管理系统模板
Stars: ✭ 151 (+259.52%)
Mutual labels:  create-react-app, react-redux, antd
hotlist
今日热榜(前端)
Stars: ✭ 51 (+21.43%)
Mutual labels:  create-react-app, antd, react-router-v4
React Social Network
Simple React Social Network
Stars: ✭ 409 (+873.81%)
Mutual labels:  create-react-app, react-redux, react-router-v4
react-project-tpl
react project template
Stars: ✭ 32 (-23.81%)
Mutual labels:  antd, react-router-v4
Epee React Admin Ts
🗡简洁、高效、易扩展的 React 快速开发模板,基于布局设计,纯 Hooks 开发,提供全链路类型检查及工具
Stars: ✭ 68 (+61.9%)
Mutual labels:  create-react-app, antd
react-you-do-you
How I use React + Redux + Material-UI + TypeScript – you do you 💖
Stars: ✭ 103 (+145.24%)
Mutual labels:  create-react-app, react-redux
React Easy Start
A lightweight ant-design-pro based on create-react-app.
Stars: ✭ 102 (+142.86%)
Mutual labels:  create-react-app, react-router-v4
Road Beyond React App
🌈 The Road beyond React - Thing you can use after learning plain React.js
Stars: ✭ 108 (+157.14%)
Mutual labels:  create-react-app, react-router-v4
React Mobx Firebase Authentication
🔥Boilerplate Project for Authentication with Firebase in React and MobX
Stars: ✭ 111 (+164.29%)
Mutual labels:  create-react-app, react-router-v4
React Redux Example
React Redux Example
Stars: ✭ 54 (+28.57%)
Mutual labels:  create-react-app, react-redux
React Antd Admin Template
一个基于React+Antd的后台管理模版,在线预览https://nlrx-wjc.github.io/react-antd-admin-template/
Stars: ✭ 1,022 (+2333.33%)
Mutual labels:  create-react-app, react-redux
Cra Boilerplate
Up to date: This project is an Create React App - v2.1.1 boilerplate with integration of Redux, React Router, Redux thunk & Reactstrap(Bootstrap v4)
Stars: ✭ 87 (+107.14%)
Mutual labels:  create-react-app, react-router-v4
React Firebase Authentication
🔥 Boilerplate Project for Authentication with Firebase in React.
Stars: ✭ 863 (+1954.76%)
Mutual labels:  create-react-app, react-router-v4
Todo Redux Saga
Todo app with Create-React-App • React-Redux • Redux-Saga • Firebase • OAuth
Stars: ✭ 184 (+338.1%)
Mutual labels:  create-react-app, react-redux
fixme
Easily find open source projects that are a good fit for your skills and abilities
Stars: ✭ 32 (-23.81%)
Mutual labels:  create-react-app, react-router-v4
promotion-web
基于React: v18.x.x/Webpack: v5.x.x/React Router v6.x.x/ Antd: v5..x.x/Fetch Api/ Typescript: v4.x.x 等最新版本进行构建...
Stars: ✭ 374 (+790.48%)
Mutual labels:  react-redux, antd

react-admin-antd

前言

基于react和antd的后台管理系统,支持响应式,IE10+

依赖模块

项目截图

首页

首页

标签页缓存功能

标签页缓存功能

权限切换

权限切换

登录页

登录页

表格编辑

表格编辑

代码目录

+-- build/                                  ---打包的文件目录
+-- config/                                 ---npm run eject 后的配置文件目录
+-- node_modules/                           ---npm下载文件目录
+-- public/                                 
|   --- index.html							---首页入口html文件
|   --- images							---项目图片
+-- src/                                    ---主要代码
|   +-- axios                               ---http请求库
|   |    --- index.js
|   +-- components                          ---所有可复用组件,公用组件
|   |    +-- backtotop                      ---返回顶部组件
|   |    |    --- ...   
|   |    +-- chart                         ---图表组件
|   |    |    --- ...   
|   |    +-- taglist                      --- 标签按钮
|   |    |    --- ...   
|   |    +-- map                      ---腾讯地图
|   |    |    --- ...   
|   |    +-- wysiwyg                          --- 富文本
|   +-- utils                               --- 工具文件存放目录
|   +-- views                               --- 路由页面,对应左侧菜单栏,每一个文件夹都是一个页面
|   +-- router                               --- 路由相关
|   |    +-- index.js                      --- content视图区的(src/views/layout/Content.jsx)的路由配置
|   |    |    --- ...   
|   |    +-- menus.js                         --- 左侧菜单栏的路由配置
|   |    |    --- ...   
|   +-- redux                               --- 状态管理
|   |    +-- store.js                      --- store对象
|   |    |    --- ...   
|   |    +-- action                         --- 所有action
|   |    |    --- ...   
|   |    +-- reducers                      --- 所有reducers
|   --- App.js                              --- 组件入口文件
|   --- index.js                            --- 项目入口文件
--- .env                                    --- 启动项目自定义端口配置文件
--- .eslintrc.js                               --- 自定义eslint配置文件,包括增加的react jsx语法限制
--- package.json                                    

文档

路由

  • 路由的跳转事件的三种获取方式

    1. withRouter 高阶函数
      import { withRouter } from 'react-router-dom'
      const Component = props=>{
          const {history} = props
          return (
            <div onClick={history.push('/')}>点击跳转路由</div>
          )
      }
      export default withRouter(Component)
    1. 通过context拿到history对象,实现跳转
      import PropTypes from 'prop-types'
      const Component = (props,context)=>{
          const {history} = context.router
          return (
             <div onClick={history.push('/')}>点击跳转路由</div>
          )
      }
      Component.contextTypes = {
        router: PropTypes.object.isRequired
      }
    
      export default Component

样式模块化

  • 全局样式 直接创建一个样式文件xxx.less
    import './index.less'
    <div className= 'box'></div>
  • css模块化 创建一个文件xxx.module.less的样式文件,以module.less会后缀的样式文件里的class,会自动添加hash值,从而实现样式模块化,避免class的命名冲突
    import CSSModules from 'react-css-modules'
    import styles from '../index.module.less'
    <div
        styleName='box'
    />
    export default CSSModules(Component,styles)

登录逻辑

发送登录请求后,后台验证返回token,接着再发送getUserInfo请求,获取用户信息(头像、姓名等)

权限验证

权限由前端控制,根据后台roles生成路由表和菜单栏

多环境

设置不同的环境变量

// package.json
"build:prod": "set REACT_APP_XXX= 'XXX' && npm run build",
"build:sit": "set REACT_APP_XXX= 'XXX' && npm run build"

之后可以在代码里自行判断 if(process.env.REACT_APP_XXX === 'xxx'){ ... }

安装运行,打包

npm i
启动项目
npm start
打包项目
npm run build
测试打包后的项目
serve -s build
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].