Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f02d39ace0 | ||
|
|
4d32829445 | ||
|
|
5438e04fc5 | ||
|
|
54bbe4d70a | ||
|
|
78ece0c9fb | ||
|
|
3407f9a0c1 | ||
|
|
f1b78e8d1f | ||
|
|
df2fc9c32e | ||
|
|
cc5c319332 | ||
|
|
43ef09dfed | ||
|
|
0c95751b8d | ||
|
|
843bd1a088 | ||
|
|
a0db71e571 | ||
|
|
7fc14eddd9 | ||
|
|
7f2fdc383b | ||
|
|
ff2caecb3a | ||
|
|
d01df1ef13 | ||
|
|
cd55df3a15 | ||
|
|
ce59f3e7b2 | ||
|
|
4d722f103a | ||
|
|
c1bc6f27b1 | ||
|
|
ed88c087bf | ||
|
|
4e337caa07 | ||
|
|
ea3929b4c2 | ||
|
|
9eff4ca129 | ||
|
|
d6d94e2121 | ||
|
|
737c0236d6 | ||
|
|
69571f2916 | ||
|
|
6dffa7378c | ||
|
|
c2a7bc7106 | ||
|
|
e752750c9e | ||
|
|
32bde8f69e | ||
|
|
b5f9ef51f1 | ||
|
|
8c10be6ee6 | ||
|
|
c1e3872792 |
@@ -1,26 +1,71 @@
|
||||
import {resolve} from "path";
|
||||
|
||||
export default {
|
||||
// for query-string@6 https://github.com/sorrycc/blog/issues/68
|
||||
es5ImcompatibleVersions: true,
|
||||
plugins: [
|
||||
'umi-plugin-dva',
|
||||
[
|
||||
'umi-plugin-routes',
|
||||
'umi-plugin-react',
|
||||
{
|
||||
exclude: [
|
||||
/model\.(j|t)sx?$/,
|
||||
/service\.(j|t)sx?$/,
|
||||
/models\//,
|
||||
/components\//,
|
||||
/services\//,
|
||||
/chart\/Container\.js$/,
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
'umi-plugin-dll',
|
||||
{
|
||||
exclude: [],
|
||||
include: ["dva", "dva/router", "dva/saga", "dva/fetch", "antd/es"],
|
||||
dva: true,
|
||||
antd: true,
|
||||
routes: {
|
||||
exclude: [
|
||||
/model\.(j|t)sx?$/,
|
||||
/service\.(j|t)sx?$/,
|
||||
/models\//,
|
||||
/components\//,
|
||||
/services\//,
|
||||
/chart\/Container\.js$/,
|
||||
/chart\/ECharts\/.+Component\.js$/,
|
||||
/chart\/ECharts\/.+ComPonent\.js$/,
|
||||
/chart\/ECharts\/theme\/.+\.js$/,
|
||||
/chart\/highCharts\/.+Component\.js$/,
|
||||
/chart\/highCharts\/mapdata\/.+\.js$/,
|
||||
/chart\/Recharts\/.+Component\.js$/,
|
||||
/chart\/Recharts\/Container\.js$/,
|
||||
],
|
||||
},
|
||||
dll: {
|
||||
exclude: [],
|
||||
include: ["dva", "dva/router", "dva/saga", "dva/fetch", "antd/es"],
|
||||
},
|
||||
hardSource: /* isMac */process.platform === 'darwin',
|
||||
},
|
||||
],
|
||||
],
|
||||
theme: "./theme.config.js",
|
||||
// 接口代理示例
|
||||
proxy: {
|
||||
"/api/v1/weather": {
|
||||
"target": "https://api.seniverse.com/",
|
||||
"changeOrigin": true,
|
||||
"pathRewrite": { "^/api/v1/weather": "/v3/weather" }
|
||||
},
|
||||
// "/api/v2": {
|
||||
// "target": "http://192.168.0.110",
|
||||
// "changeOrigin": true,
|
||||
// "pathRewrite": { "^/api/v2" : "/api/v2" }
|
||||
// }
|
||||
},
|
||||
alias: {
|
||||
themes: resolve(__dirname, './src/themes'),
|
||||
components: resolve(__dirname,"./src/components"),
|
||||
utils: resolve(__dirname,"./src/utils"),
|
||||
config: resolve(__dirname,"./src/utils/config"),
|
||||
enums: resolve(__dirname,"./src/utils/enums"),
|
||||
services: resolve(__dirname,"./src/services"),
|
||||
models: resolve(__dirname,"./src/models"),
|
||||
routes: resolve(__dirname,"./src/routes"),
|
||||
},
|
||||
urlLoaderExcludes: [
|
||||
/\.svg$/,
|
||||
],
|
||||
ignoreMomentLocale: true,
|
||||
chainWebpack(config) {
|
||||
config.module.rule('svg')
|
||||
.test(/\.svg$/i)
|
||||
.use('svg-sprite-loader')
|
||||
.loader(require.resolve('svg-sprite-loader'));
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
|
||||
export default {
|
||||
...require('./mock/common'),
|
||||
...require('./mock/dashboard'),
|
||||
...require('./mock/menu'),
|
||||
...require('./mock/post'),
|
||||
...require('./mock/user'),
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import { resolve } from 'path';
|
||||
|
||||
export default {
|
||||
theme: "./theme.config.js",
|
||||
// 接口代理示例
|
||||
proxy: {
|
||||
"/api/v1/weather": {
|
||||
"target": "https://api.seniverse.com/",
|
||||
"changeOrigin": true,
|
||||
"pathRewrite": { "^/api/v1/weather": "/v3/weather" }
|
||||
},
|
||||
// "/api/v2": {
|
||||
// "target": "http://192.168.0.110",
|
||||
// "changeOrigin": true,
|
||||
// "pathRewrite": { "^/api/v2" : "/api/v2" }
|
||||
// }
|
||||
},
|
||||
alias: {
|
||||
themes: resolve(__dirname, './src/themes'),
|
||||
components: resolve(__dirname,"./src/components"),
|
||||
utils: resolve(__dirname,"./src/utils"),
|
||||
config: resolve(__dirname,"./src/utils/config"),
|
||||
enums: resolve(__dirname,"./src/utils/enums"),
|
||||
services: resolve(__dirname,"./src/services"),
|
||||
models: resolve(__dirname,"./src/models"),
|
||||
routes: resolve(__dirname,"./src/routes"),
|
||||
},
|
||||
urlLoaderExcludes: [
|
||||
/\.svg$/,
|
||||
],
|
||||
ignoreMomentLocale: true,
|
||||
}
|
||||
@@ -13,89 +13,99 @@
|
||||
|
||||
## 特性
|
||||
|
||||
- 基于[react](https://github.com/facebook/react),[ant-design](https://github.com/ant-design/ant-design),[dva](https://github.com/dvajs/dva),[Mock](https://github.com/nuysoft/Mock) 企业级后台管理系统最佳实践。
|
||||
- 基于Antd UI 设计语言,提供后台管理系统常见使用场景。
|
||||
- 基于[dva](https://github.com/dvajs/dva)动态加载 Model 和路由,按需加载。
|
||||
- 使用[roadhog](https://github.com/sorrycc/roadhog)本地调试和构建,其中Mock功能实现脱离后端独立开发。
|
||||
- 浅度响应式设计。
|
||||
* 基于[react](https://github.com/facebook/react),[ant-design](https://github.com/ant-design/ant-design),[dva](https://github.com/dvajs/dva),[Mock](https://github.com/nuysoft/Mock) 企业级后台管理系统最佳实践。
|
||||
* 基于 Antd UI 设计语言,提供后台管理系统常见使用场景。
|
||||
* 基于[dva](https://github.com/dvajs/dva)动态加载 Model 和路由,按需加载。
|
||||
* 使用[umi](https://github.com/umijs/umi)本地调试和构建,其中 Mock 功能实现脱离后端独立开发。
|
||||
* 浅度响应式设计。
|
||||
|
||||
## 更新日志
|
||||
|
||||
### 5.0.0-beta
|
||||
|
||||
`2018-6-20`
|
||||
|
||||
* 感谢@sorrycc、@xiaohuoni [PR](https://github.com/zuiidea/antd-admin/pull/770)
|
||||
|
||||
* 更新`roadhog`至`umi`
|
||||
详见 [使用 umi 改进 dva 项目开发](https://github.com/sorrycc/blog/issues/66#issuecomment-408596579) | [umi model 用法](https://github.com/umijs/umi/issues/171)
|
||||
|
||||
### 4.3.9
|
||||
|
||||
`2017-12-27`
|
||||
|
||||
- 更新`antd`至`3.0.3`,以及其它主要库,并解决升级带来的兼容问题。
|
||||
- 尽可能的保持`antd`的设计语言。
|
||||
* 更新`antd`至`3.0.3`,以及其它主要库,并解决升级带来的兼容问题。
|
||||
* 尽可能的保持`antd`的设计语言。
|
||||
|
||||
### 4.3.7
|
||||
|
||||
`2017-10-30`
|
||||
|
||||
- 更新`chart`,新增[ECharts](https://github.com/ecomfe/echarts),[highCharts](https://github.com/highcharts/highcharts),[Recharts](https://github.com/recharts/recharts)演示。
|
||||
|
||||
* 更新`chart`,新增[ECharts](https://github.com/ecomfe/echarts),[highCharts](https://github.com/highcharts/highcharts),[Recharts](https://github.com/recharts/recharts)演示。
|
||||
|
||||
### 4.3.5
|
||||
|
||||
`2017-09-04`
|
||||
|
||||
- 更新[dva](https://github.com/dvajs/dva)至`2.0.1`,感谢[@yangbin1994](https://github.com/yangbin1994)的[PR](https://github.com/zuiidea/antd-admin/pull/567)。
|
||||
* 更新[dva](https://github.com/dvajs/dva)至`2.0.1`,感谢[@yangbin1994](https://github.com/yangbin1994)的[PR](https://github.com/zuiidea/antd-admin/pull/567)。
|
||||
|
||||
### 4.3.4
|
||||
|
||||
`2017-09-04`
|
||||
|
||||
- 更新[roadhog](https://github.com/sorrycc/roadhog)至`1.2.1`,修复闪屏问题。
|
||||
- 修复build css未压缩[#529](https://github.com/zuiidea/antd-admin/issues/529),classname未Hash[#477](https://github.com/zuiidea/antd-admin/issues/477)。
|
||||
- 更新登录成功使用router跳转[#479](https://github.com/zuiidea/antd-admin/issues/479)。
|
||||
* 更新[roadhog](https://github.com/sorrycc/roadhog)至`1.2.1`,修复闪屏问题。
|
||||
* 修复 build css 未压缩[#529](https://github.com/zuiidea/antd-admin/issues/529),classname 未 Hash[#477](https://github.com/zuiidea/antd-admin/issues/477)。
|
||||
* 更新登录成功使用 router 跳转[#479](https://github.com/zuiidea/antd-admin/issues/479)。
|
||||
|
||||
### 4.3.0
|
||||
|
||||
`2017-07-30`
|
||||
|
||||
- 更新[roadhog](https://github.com/sorrycc/roadhog)至`1.0.0-beta.7`,得益于`webpack@3.4`,编译速度不减。
|
||||
- 基于使用roadhog的dll插件,开发时编译耗时减半。
|
||||
- 新增打包时按项目版本号生成文件目录。[#449](https://github.com/zuiidea/antd-admin/issues/449)
|
||||
- 更新`eslint`,并适当修改了`.eslintrc`。
|
||||
|
||||
* 更新[roadhog](https://github.com/sorrycc/roadhog)至`1.0.0-beta.7`,得益于`webpack@3.4`,编译速度不减。
|
||||
* 基于使用 roadhog 的 dll 插件,开发时编译耗时减半。
|
||||
* 新增打包时按项目版本号生成文件目录。[#449](https://github.com/zuiidea/antd-admin/issues/449)
|
||||
* 更新`eslint`,并适当修改了`.eslintrc`。
|
||||
|
||||
[More Change Log](https://github.com/zuiidea/antd-admin/wiki/Change-Log)
|
||||
|
||||
## 开发构建
|
||||
|
||||
### 目录结构
|
||||
### 目录结构
|
||||
|
||||
```bash
|
||||
├── /dist/ # 项目输出目录
|
||||
├── /mock/ # 数据mock
|
||||
├── /public/ # 公共文件,编译时copy至dist目录
|
||||
├── /src/ # 项目源码目录
|
||||
│ ├── /public/ # 公共文件,编译时copy至dist目录
|
||||
│ ├── /components/ # UI组件及UI相关方法
|
||||
│ │ ├── skin.less # 全局样式
|
||||
│ │ └── vars.less # 全局样式变量
|
||||
│ ├── /routes/ # 路由组件
|
||||
│ │ └── app.js # 路由入口
|
||||
│ ├── /layouts/ # 全局组件
|
||||
│ │ └── app.js # 页面入口
|
||||
│ │ └── index.js # 入口文件
|
||||
│ ├── /models/ # 数据模型
|
||||
│ ├── /pages/ # 页面组件
|
||||
│ │ └── document.ejs # html模版
|
||||
│ ├── /services/ # 数据接口
|
||||
│ ├── /themes/ # 项目样式
|
||||
│ ├── /mock/ # 数据mock
|
||||
│ │ ├── default.less # 全局样式
|
||||
│ │ └── vars.less # 全局样式变量
|
||||
│ ├── /utils/ # 工具函数
|
||||
│ │ ├── config.js # 项目常规配置
|
||||
│ │ ├── menu.js # 菜单及面包屑配置
|
||||
│ │ ├── config.js # 项目常规配置
|
||||
│ │ ├── request.js # 异步请求函数
|
||||
│ │ ├── request.js # 异步请求函数(axios)
|
||||
│ │ └── theme.js # 项目需要在js中使用到样式变量
|
||||
│ ├── route.js # 路由配置
|
||||
│ ├── index.js # 入口文件
|
||||
│ └── index.html
|
||||
├── package.json # 项目信息
|
||||
├── .eslintrc # Eslint配置
|
||||
└── .roadhogrc.js # roadhog配置
|
||||
└── .umirc.js # umi配置
|
||||
└── .umirc.mock.js # mock配置
|
||||
└── .theme.config.js # 主题less编译配置
|
||||
```
|
||||
pages中可参考 [duck 模式](https://medium.freecodecamp.org/scaling-your-redux-app-with-ducks-6115955638be)
|
||||
|
||||
文件夹命名说明:
|
||||
|
||||
- components:组件(方法)为单位以文件夹保存,文件夹名组件首字母大写(如`DataTable`),方法首字母小写(如`layer`),文件夹内主文件与文件夹同名,多文件以`index.js`导出对象(如`./src/components/Layout`)。
|
||||
- routes:页面为单位以文件夹保存,文件夹名首字母小写(特殊除外,如`UIElement`),文件夹内主文件以`index.js`导出,多文件时可建立`components`文件夹(如`./src/routes/dashboard`),如果有子路由,依次按照路由层次建立文件夹(如`./src/routes/UIElement`)。
|
||||
* components:组件(方法)为单位以文件夹保存,文件夹名组件首字母大写(如`DataTable`),方法首字母小写(如`layer`),文件夹内主文件与文件夹同名,多文件以`index.js`导出对象(如`./src/components/Layout`)。
|
||||
* routes:页面为单位以文件夹保存,文件夹名首字母小写(特殊除外,如`UIElement`),文件夹内主文件以`index.js`导出,多文件时可建立`components`文件夹(如`./src/routes/dashboard`),如果有子路由,依次按照路由层次建立文件夹(如`./src/routes/UIElement`)。
|
||||
|
||||
### 快速开始
|
||||
|
||||
@@ -108,36 +118,20 @@ git clone https://github.com/zuiidea/antd-admin.git
|
||||
进入目录安装依赖:
|
||||
|
||||
```bash
|
||||
<<<<<<< HEAD
|
||||
#开始前请确保没有安装roadhog、webpack到NPM全局目录, 国内用户推荐yarn或者cnpm
|
||||
npm i 或者 yarn install
|
||||
=======
|
||||
#开始前请确保没有安装roadhog、webpack到NPM全局目录
|
||||
yarn install或者 npm i
|
||||
>>>>>>> develop
|
||||
```
|
||||
|
||||
开发:
|
||||
|
||||
```bash
|
||||
npm run build:dll #第一次npm run dev时需运行此命令,使开发时编译更快
|
||||
npm run dev
|
||||
npm run start
|
||||
打开 http://localhost:8000 #端口在package.json中cross-env后加上 PORT=8000指定
|
||||
```
|
||||
|
||||
构建:
|
||||
[详情](https://github.com/zuiidea/antd-admin/issues/269)
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
|
||||
将会打包至dist/{version}目录 #package.json里version字段
|
||||
|
||||
npm run build:new
|
||||
|
||||
将会打包至dist/{version增加1}目录 #package.json里version字段
|
||||
```
|
||||
|
||||
代码检测:
|
||||
|
||||
```bash
|
||||
@@ -146,29 +140,33 @@ npm run lint
|
||||
|
||||
## FAQ
|
||||
|
||||
- 项目打包后如何部署? [#269](https://github.com/zuiidea/antd-admin/issues/269)
|
||||
- 如何做权限管理? [#384](https://github.com/zuiidea/antd-admin/issues/384)
|
||||
- 如何使用mock.js模拟接口,怎么使用线上接口? [#348](https://github.com/zuiidea/antd-admin/issues/348)
|
||||
- 如何使用Iconfont,如何使用本地的svg图标? [#270](https://github.com/zuiidea/antd-admin/issues/270)
|
||||
- 怎么按版本打包,上线时不影响正在访问的用户? [#449](https://github.com/zuiidea/antd-admin/issues/449)
|
||||
- windows处理CRLF?[参考](http://blog.csdn.net/lysc_forever/article/details/42835203)
|
||||
* 项目打包后如何部署? [#269](https://github.com/zuiidea/antd-admin/issues/269)
|
||||
* 如何做权限管理? [#384](https://github.com/zuiidea/antd-admin/issues/384)
|
||||
* 如何使用 mock.js 模拟接口,怎么使用线上接口? [#348](https://github.com/zuiidea/antd-admin/issues/348)
|
||||
* 如何使用 Iconfont,如何使用本地的 svg 图标? [#270](https://github.com/zuiidea/antd-admin/issues/270)
|
||||
* 怎么按版本打包,上线时不影响正在访问的用户? [#449](https://github.com/zuiidea/antd-admin/issues/449)
|
||||
* windows 处理 CRLF?[参考](http://blog.csdn.net/lysc_forever/article/details/42835203)
|
||||
|
||||
```bash
|
||||
git config --global core.autocrlf false
|
||||
```
|
||||
```bash
|
||||
git config --global core.autocrlf false
|
||||
```
|
||||
|
||||
## 参考
|
||||
|
||||
用户列表:<https://github.com/dvajs/dva/tree/master/examples/user-dashboard>
|
||||
|
||||
dashboard设计稿:<https://dribbble.com/shots/3108122-Dashboard-Admin> (已征得作者同意)
|
||||
dashboard 设计稿:<https://dribbble.com/shots/3108122-Dashboard-Admin> (已征得作者同意)
|
||||
|
||||
## 截屏
|
||||
|
||||
web
|
||||
|
||||

|
||||

|
||||
|
||||
移动
|
||||
|
||||

|
||||

|
||||
|
||||
效果图
|
||||
|
||||

|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 MiB |
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 645 KiB |
@@ -50,14 +50,14 @@ let database = [
|
||||
icon: 'heart-o',
|
||||
route: '/UIElement/iconfont',
|
||||
},
|
||||
// {
|
||||
// id: '42',
|
||||
// bpid: '4',
|
||||
// mpid: '4',
|
||||
// name: 'DataTable',
|
||||
// icon: 'database',
|
||||
// route: '/UIElement/dataTable',
|
||||
// },
|
||||
{
|
||||
id: '42',
|
||||
bpid: '4',
|
||||
mpid: '4',
|
||||
name: 'DataTable',
|
||||
icon: 'database',
|
||||
route: '/UIElement/dataTable',
|
||||
},
|
||||
{
|
||||
id: '43',
|
||||
bpid: '4',
|
||||
@@ -74,22 +74,22 @@ let database = [
|
||||
icon: 'search',
|
||||
route: '/UIElement/search',
|
||||
},
|
||||
// {
|
||||
// id: '45',
|
||||
// bpid: '4',
|
||||
// mpid: '4',
|
||||
// name: '56pxor',
|
||||
// icon: 'edit',
|
||||
// route: '/UIElement/editor',
|
||||
// },
|
||||
// {
|
||||
// id: '46',
|
||||
// bpid: '4',
|
||||
// mpid: '4',
|
||||
// name: 'layer (Function)',
|
||||
// icon: 'credit-card',
|
||||
// route: '/UIElement/layer',
|
||||
// },
|
||||
{
|
||||
id: '45',
|
||||
bpid: '4',
|
||||
mpid: '4',
|
||||
name: '56pxor',
|
||||
icon: 'edit',
|
||||
route: '/UIElement/editor',
|
||||
},
|
||||
{
|
||||
id: '46',
|
||||
bpid: '4',
|
||||
mpid: '4',
|
||||
name: 'layer (Function)',
|
||||
icon: 'credit-card',
|
||||
route: '/UIElement/layer',
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
bpid: '1',
|
||||
|
||||
@@ -173,7 +173,7 @@ module.exports = {
|
||||
})
|
||||
},
|
||||
|
||||
[`DELETE ${apiPrefix}/users`] (req, res) {
|
||||
[`POST ${apiPrefix}/users/delete`] (req, res) {
|
||||
const { ids } = req.body
|
||||
database = database.filter(item => !ids.some(_ => _ === item.id))
|
||||
res.status(204).end()
|
||||
|
||||
@@ -3,63 +3,61 @@
|
||||
"name": "antd-admin",
|
||||
"version": "5.0.0-beta",
|
||||
"dependencies": {
|
||||
"@babel/polyfill": "^7.0.0-beta.44",
|
||||
"antd": "^3.5.3",
|
||||
"@babel/polyfill": "^7.0.0",
|
||||
"antd": "^3.9.0",
|
||||
"axios": "^0.18.0",
|
||||
"classnames": "^2.2.5",
|
||||
"d3-shape": "^1.2.0",
|
||||
"classnames": "^2.2.6",
|
||||
"d3-shape": "^1.2.2",
|
||||
"draftjs-to-html": "^0.8.4",
|
||||
"draftjs-to-markdown": "^0.5.1",
|
||||
"dva-model-extend": "^0.1.2",
|
||||
"echarts": "^4.1.0",
|
||||
"echarts-for-react": "^2.0.11",
|
||||
"echarts-for-react": "^2.0.14",
|
||||
"echarts-gl": "^1.1.1",
|
||||
"echarts-liquidfill": "^2.0.0",
|
||||
"echarts-liquidfill": "^2.0.2",
|
||||
"highcharts-exporting": "^0.1.7",
|
||||
"highcharts-more": "^0.1.7",
|
||||
"jsonp": "^0.2.1",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"lodash.isequal": "^4.5.0",
|
||||
"nprogress": "^0.2.0",
|
||||
"path-to-regexp": "^2.2.0",
|
||||
"prop-types": "^15.6.1",
|
||||
"path-to-regexp": "^2.4.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"qs": "^6.5.2",
|
||||
"query-string": "^5.1.1",
|
||||
"rc-tween-one": "^1.7.8",
|
||||
"react-adsense": "^0.0.5",
|
||||
"react-countup": "^3.0.3",
|
||||
"query-string": "^6.1.0",
|
||||
"rc-tween-one": "^2.2.3",
|
||||
"react-adsense": "^0.0.6",
|
||||
"react-countup": "^4.0.0-alpha.6",
|
||||
"react-draft-wysiwyg": "^1.12.13",
|
||||
"react-helmet": "^5.2.0",
|
||||
"react-highcharts": "^16.0.2",
|
||||
"recharts": "^1.0.0-beta.10"
|
||||
"recharts": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-dev-expression": "^0.2.1",
|
||||
"babel-plugin-module-resolver": "^3.1.0",
|
||||
"cross-env": "^5.1.6",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-config-umi": "^0.1.4",
|
||||
"eslint-plugin-flowtype": "^2.47.1",
|
||||
"eslint-plugin-import": "^2.12.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.0.3",
|
||||
"eslint-plugin-react": "^7.8.2",
|
||||
"js-beautify": "^1.7.5",
|
||||
"less-vars-to-js": "^1.1.2",
|
||||
"babel-plugin-module-resolver": "^3.1.1",
|
||||
"cross-env": "^5.2.0",
|
||||
"eslint": "^5.5.0",
|
||||
"eslint-config-umi": "^0.1.5",
|
||||
"eslint-plugin-flowtype": "^2.50.0",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.1.1",
|
||||
"eslint-plugin-react": "^7.11.1",
|
||||
"js-beautify": "^1.8.1",
|
||||
"less-vars-to-js": "^1.3.0",
|
||||
"mockjs": "^1.0.1-beta3",
|
||||
"svg-sprite-loader": "^3.7.3",
|
||||
"umi": "^1.3.4",
|
||||
"umi-plugin-dll": "^0.2.1",
|
||||
"umi-plugin-dva": "^0.7.3",
|
||||
"umi-plugin-routes": "^0.1.4"
|
||||
"svg-sprite-loader": "^3.9.2",
|
||||
"umi": "^2.0.0",
|
||||
"umi-plugin-react": "^1.0.0"
|
||||
},
|
||||
"pre-commit": [
|
||||
"lint"
|
||||
],
|
||||
"scripts": {
|
||||
"analyze": "cross-env ANALYZE=1 BABELRC=1 umi build",
|
||||
"start": "cross-env BABELRC=1 COMPILE_ON_DEMAND=none BROWSER=none HOST=0.0.0.0 umi dev",
|
||||
"analyze": "cross-env ANALYZE=1 umi build",
|
||||
"start": "umi dev",
|
||||
"lint": "eslint --fix --ext .js src",
|
||||
"build": "cross-env BABELRC=1 umi build",
|
||||
"build": "umi build",
|
||||
"test": "umi test"
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 901 KiB |
|
Before Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 997 KiB |
@@ -58,11 +58,6 @@
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
&.ant-switch-checked:after,
|
||||
&.ant-switch-checked:before {
|
||||
margin-left: -23px;
|
||||
}
|
||||
}
|
||||
|
||||
.flex-vertical-center {
|
||||
@@ -103,6 +98,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
.sidemenu {
|
||||
:global{
|
||||
.ant-menu-item {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.switchtheme {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Menu, Icon } from 'antd'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { arrayToTree, queryArray } from 'utils'
|
||||
import pathToRegexp from 'path-to-regexp'
|
||||
import styles from './Layout.less'
|
||||
|
||||
const { SubMenu } = Menu
|
||||
let openKeysFlag = false
|
||||
@@ -98,8 +99,12 @@ const Menus = ({
|
||||
let result = [String(current[id])]
|
||||
const getPath = (item) => {
|
||||
if (item && item[pid]) {
|
||||
result.unshift(String(item[pid]))
|
||||
getPath(queryArray(array, item[pid], id))
|
||||
if (item[pid] === '-1') {
|
||||
result.unshift(String(item['bpid']))
|
||||
} else {
|
||||
result.unshift(String(item[pid]))
|
||||
getPath(queryArray(array, item[pid], id))
|
||||
}
|
||||
}
|
||||
}
|
||||
getPath(current)
|
||||
@@ -119,6 +124,7 @@ const Menus = ({
|
||||
mode={siderFold ? 'vertical' : 'inline'}
|
||||
theme={darkTheme ? 'dark' : 'light'}
|
||||
selectedKeys={defaultSelectedKeys}
|
||||
className={styles.sidemenu}
|
||||
>
|
||||
{menuItems}
|
||||
</Menu>
|
||||
|
||||
@@ -45,7 +45,7 @@ class DataTablePage extends React.Component {
|
||||
{ title: 'Phone', dataIndex: 'phone' },
|
||||
{ title: 'Gender', dataIndex: 'gender' },
|
||||
],
|
||||
rowKey: 'registered',
|
||||
rowKey: 'email',
|
||||
}
|
||||
|
||||
const caseChangeDataTableProps = {
|
||||
@@ -63,7 +63,7 @@ class DataTablePage extends React.Component {
|
||||
{ title: 'Phone', dataIndex: 'phone' },
|
||||
{ title: 'Gender', dataIndex: 'gender' },
|
||||
],
|
||||
rowKey: 'registered',
|
||||
rowKey: 'email',
|
||||
}
|
||||
|
||||
return (<div className="content-inner">
|
||||
@@ -131,6 +131,7 @@ class DataTablePage extends React.Component {
|
||||
desciption: '远程获取数据的参数',
|
||||
type: 'Object',
|
||||
default: '后面有空加上',
|
||||
key: 'basetable'
|
||||
}]}
|
||||
/>
|
||||
</Col>
|
||||
|
||||
@@ -4,7 +4,6 @@ import { convertToRaw } from 'draft-js'
|
||||
import { Row, Col, Card } from 'antd'
|
||||
import draftToHtml from 'draftjs-to-html'
|
||||
import draftToMarkdown from 'draftjs-to-markdown'
|
||||
// https://github.com/jpuri/react-draft-wysiwyg/blob/master/docs/src/components/Demo/index.js
|
||||
|
||||
export default class EditorPage extends React.Component {
|
||||
constructor (props) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react'
|
||||
import { Radio } from 'antd'
|
||||
import { Page } from 'components'
|
||||
import EchartsComponent from './EchartsComponent'
|
||||
import styles from './page.less'
|
||||
import styles from './index.less'
|
||||
|
||||
const RadioGroup = Radio.Group
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react'
|
||||
import { Radio } from 'antd'
|
||||
import { Page } from 'components'
|
||||
import ReChartsComponent from './ReChartsComponent'
|
||||
import styles from './page.less'
|
||||
import styles from './index.less'
|
||||
|
||||
const RadioGroup = Radio.Group
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react'
|
||||
import { Radio } from 'antd'
|
||||
import { Page } from 'components'
|
||||
import HighChartsComponent from './HighChartsComponent'
|
||||
import styles from './page.less'
|
||||
import styles from './index.less'
|
||||
|
||||
const RadioGroup = Radio.Group
|
||||
|
||||
@@ -21,7 +21,7 @@ function Cpu ({
|
||||
<div className={styles.item}>
|
||||
<p>usage</p>
|
||||
<p><CountUp
|
||||
end={usage}
|
||||
end={usage || 0}
|
||||
suffix="GB"
|
||||
{...countUpProps}
|
||||
/></p>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
@import "~themes/vars";
|
||||
|
||||
.sales {
|
||||
overflow: hidden;
|
||||
.title {
|
||||
margin-left: 32px;
|
||||
font-size: 16px;
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 MiB |
@@ -7,8 +7,6 @@
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
height: 200px;
|
||||
background-image: ~ "url(./user-background.png)";
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
align-items: center;
|
||||
|
||||
@@ -18,7 +16,7 @@
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
background: @purple;
|
||||
background: #caa2d6;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
|
||||
@@ -13,8 +13,8 @@ export function query (params) {
|
||||
|
||||
export function remove (params) {
|
||||
return request({
|
||||
url: users,
|
||||
method: 'delete',
|
||||
url: users + '/delete',
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@ const fetch = (options) => {
|
||||
const cloneData = cloneDeep(data)
|
||||
|
||||
try {
|
||||
let domin = ''
|
||||
let domain = ''
|
||||
if (url.match(/[a-zA-z]+:\/\/[^/]*/)) {
|
||||
[domin] = url.match(/[a-zA-z]+:\/\/[^/]*/)
|
||||
url = url.slice(domin.length)
|
||||
[domain] = url.match(/[a-zA-z]+:\/\/[^/]*/)
|
||||
url = url.slice(domain.length)
|
||||
}
|
||||
const match = pathToRegexp.parse(url)
|
||||
url = pathToRegexp.compile(url)(data)
|
||||
@@ -30,7 +30,7 @@ const fetch = (options) => {
|
||||
delete cloneData[item.name]
|
||||
}
|
||||
}
|
||||
url = domin + url
|
||||
url = domain + url
|
||||
} catch (e) {
|
||||
message.error(e.message)
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
export default function (webpackConfig) {
|
||||
webpackConfig.module.rules.push({
|
||||
test: /\.svg$/i,
|
||||
use: [
|
||||
{
|
||||
loader: require.resolve('svg-sprite-loader'),
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
return webpackConfig
|
||||
};
|
||||