mirror of
https://github.com/zuiidea/antd-admin.git
synced 2026-10-20 18:54:33 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
557f6022f3 | ||
|
|
d0a56169e3 | ||
|
|
f7d6e2b4ed | ||
|
|
df82ee42fd | ||
|
|
a29d761483 | ||
|
|
713a86b9d6 | ||
|
|
d6250f16b0 | ||
|
|
1c5d5c3788 | ||
|
|
699e9d9ff1 | ||
|
|
fad0cb931a | ||
|
|
5d7ff55869 | ||
|
|
642ccb5b82 | ||
|
|
51a7ce0827 | ||
|
|
157a54b11d | ||
|
|
be083d81fc | ||
|
|
f6c869ad47 | ||
|
|
bef5b26509 | ||
|
|
59cfe24178 | ||
|
|
87d0d58ae8 | ||
|
|
de8b6c972d | ||
|
|
0ac4839e94 | ||
|
|
565bce6d8b | ||
|
|
b278b028cf | ||
|
|
33abd9369e | ||
|
|
e6b2f7f271 | ||
|
|
0bd1e9cf59 | ||
|
|
693625bf2c | ||
|
|
3a6c587569 | ||
|
|
bd85eaf0a0 | ||
|
|
29aa0f416e | ||
|
|
5b32607911 | ||
|
|
76e5359752 | ||
|
|
5ec4efbb6e | ||
|
|
f8bb7b421a | ||
|
|
887c169aa8 | ||
|
|
8c10dcc6c2 | ||
|
|
671da6b5fa | ||
|
|
7fdb2f4ea8 | ||
|
|
67388b31f5 | ||
|
|
2379cca765 | ||
|
|
34be6651e5 | ||
|
|
10f8e3e8ef | ||
|
|
0c6ea8eb5c | ||
|
|
6e69b06e61 | ||
|
|
98ba383a68 | ||
|
|
4e6d81a9bf | ||
|
|
0e2c206023 | ||
|
|
285f06d1e7 | ||
|
|
6aead03f3e | ||
|
|
7eb9e06452 | ||
|
|
fab06d5005 | ||
|
|
16860f93ad | ||
|
|
6ba45d5bc3 |
+13
-9
@@ -1,10 +1,10 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- node
|
||||
- node
|
||||
script:
|
||||
- npm run build
|
||||
- npm run build
|
||||
before_install:
|
||||
- |
|
||||
- |
|
||||
if [ "$TRAVIS_BRANCH" = "develop" ]; then
|
||||
for prefixed_envvar in ${!DEV_*}; do
|
||||
eval export ${prefixed_envvar#DEV_}="${!prefixed_envvar}"
|
||||
@@ -13,11 +13,15 @@ before_install:
|
||||
for prefixed_envvar in ${!PROD_*}; do
|
||||
eval export ${prefixed_envvar#PROD_}="${!prefixed_envvar}"
|
||||
done
|
||||
else
|
||||
for prefixed_envvar in ${!TEST_*}; do
|
||||
eval export ${prefixed_envvar#TEST_}="${!prefixed_envvar}"
|
||||
done
|
||||
fi
|
||||
- openssl aes-256-cbc -K $encrypted_18b2305b78c9_key -iv $encrypted_18b2305b78c9_iv -in config/id_rsa.enc -out ~/.ssh/id_rsa -d
|
||||
- chmod 600 ~/.ssh/id_rsa
|
||||
- echo -e "Host $HOST\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
||||
- yarn global add now
|
||||
- openssl aes-256-cbc -K $encrypted_18b2305b78c9_key -iv $encrypted_18b2305b78c9_iv -in config/id_rsa.enc -out ~/.ssh/id_rsa -d
|
||||
- chmod 600 ~/.ssh/id_rsa
|
||||
- echo -e "Host $HOST\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
||||
- yarn global add now
|
||||
after_script:
|
||||
- scp -o stricthostkeychecking=no -r ./dist root@$HOST:$BUILD_DIR
|
||||
- cd ./docs && now -A $DOC_NOW_CONFIG -t $NOW_TOKEN && now alias -A $DOC_NOW_CONFIG -t $NOW_TOKEN
|
||||
- scp -o stricthostkeychecking=no -r ./dist root@$HOST:$BUILD_DIR
|
||||
- cd ./docs && now -A $DOC_NOW_CONFIG -t $NOW_TOKEN && now alias -A $DOC_NOW_CONFIG -t $NOW_TOKEN
|
||||
|
||||
@@ -5,6 +5,7 @@ import { i18n } from './src/utils/config'
|
||||
export default {
|
||||
ignoreMomentLocale: true,
|
||||
targets: { ie: 9 },
|
||||
treeShaking: true,
|
||||
plugins: [
|
||||
[
|
||||
// https://umijs.org/plugin/umi-plugin-react.html
|
||||
@@ -57,7 +58,6 @@ export default {
|
||||
dll: {
|
||||
include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch', 'antd/es'],
|
||||
},
|
||||
hardSource: /* isMac */ process.platform === 'darwin',
|
||||
pwa: {
|
||||
manifestOptions: {
|
||||
srcPath: 'manifest.json'
|
||||
|
||||
+2
-2
@@ -71,11 +71,11 @@ npm run start
|
||||
|
||||
## 支持环境
|
||||
|
||||
现代浏览器及 IE9。
|
||||
现代浏览器。
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera |
|
||||
| --------- | --------- | --------- | --------- | --------- |
|
||||
| IE9, IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions
|
||||
|IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions
|
||||
|
||||
## 参与贡献
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
A excellent front-end solution for enterprise applications.
|
||||
An excellent front-end solution for enterprise applications.
|
||||
|
||||
[](https://github.com/ant-design/ant-design)
|
||||
[](https://github.com/umijs/umi)
|
||||
@@ -71,11 +71,11 @@ npm run start
|
||||
|
||||
## Browsers support
|
||||
|
||||
Modern browsers and IE9.
|
||||
Modern browsers.
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera |
|
||||
| --------- | --------- | --------- | --------- | --------- |
|
||||
| IE9, IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions
|
||||
|IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
A excellent front-end solution for enterprise applications.
|
||||
An excellent front-end solution for enterprise applications.
|
||||
|
||||
[](https://github.com/ant-design/ant-design)
|
||||
[](https://github.com/umijs/umi)
|
||||
@@ -68,11 +68,11 @@ npm run start
|
||||
|
||||
## Browsers support
|
||||
|
||||
Modern browsers and IE9.
|
||||
Modern browsers.
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera |
|
||||
| --------- | --------- | --------- | --------- | --------- |
|
||||
| IE9, IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions
|
||||
|IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
+10
-10
@@ -6,23 +6,23 @@ Take a new layout named `secondary` as an example to make the route starting wit
|
||||
|
||||
1. Add related configuration in `src/utils/config.js`. For details, please refer to [layouts](/configuration?id=layouts).
|
||||
|
||||
```javascript
|
||||
```javascript
|
||||
layouts: [
|
||||
{
|
||||
name: 'primary',
|
||||
include: [/.*/],
|
||||
exlude: [/(\/(en|zh))*\/login/, /(\/(en|zh))*\/seconday\/(.*)/],
|
||||
exclude: [/(\/(en|zh))*\/login/, /(\/(en|zh))*\/seconday\/(.*)/],
|
||||
},
|
||||
{
|
||||
name: 'secondary',
|
||||
include: [/(\/(en|zh))*\/seconday\/(.*)/],
|
||||
},
|
||||
],
|
||||
```
|
||||
```
|
||||
|
||||
2. Add the `secondary` layout component to the `src/layouts/BaseLayout.js` file.
|
||||
|
||||
```javascript
|
||||
```javascript
|
||||
import SecondaryLayout from './SecondaryLayout'
|
||||
|
||||
const LayoutMap = {
|
||||
@@ -30,11 +30,11 @@ Take a new layout named `secondary` as an example to make the route starting wit
|
||||
Public: PublicLayout,
|
||||
Secondary: SecondaryLayout,
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
3. Add the `SecondaryLayout.js` file to the `src/layouts/` directory.
|
||||
|
||||
```javascript
|
||||
```javascript
|
||||
import React from 'react'
|
||||
|
||||
export default ({ children }) => {
|
||||
@@ -45,16 +45,16 @@ Take a new layout named `secondary` as an example to make the route starting wit
|
||||
</div>
|
||||
)
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
4. Add a `seconday/index.js` file to the `src/pages/` directory.
|
||||
|
||||
```javascript
|
||||
```javascript
|
||||
import React from 'react'
|
||||
|
||||
export default ({ children }) => {
|
||||
Return <div>Seconday page Content</div>
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
5. Finally, start the development mode `npm run start`, open [http://localhost:7000/seconday/](http://localhost:7000/seconday/) and you will see the page for the `seconday` layout.
|
||||
5. Finally, start the development mode `npm run start`, open [http://localhost:7000/seconday/](http://localhost:7000/seconday/) and you will see the page for the `seconday` layout.
|
||||
|
||||
@@ -68,11 +68,11 @@ npm run start
|
||||
|
||||
## 支持环境
|
||||
|
||||
现代浏览器及 IE9。
|
||||
现代浏览器。
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera |
|
||||
| --------- | --------- | --------- | --------- | --------- |
|
||||
| IE9, IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions
|
||||
|IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions
|
||||
|
||||
## 参与贡献
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
{
|
||||
name: 'primary',
|
||||
include: [/.*/],
|
||||
exlude: [/(\/(en|zh))*\/login/],
|
||||
exclude: [/(\/(en|zh))*\/login/],
|
||||
},
|
||||
],
|
||||
```
|
||||
@@ -55,9 +55,9 @@
|
||||
|
||||
- `include` - 指定使用该布局的路由规则列表,规则可为正则表达式或者字符串;
|
||||
|
||||
- `exlude` - 指定不使用该布局的路由规则列表,规则可为正则表达式或者字符串。
|
||||
- `exclude` - 指定不使用该布局的路由规则列表,规则可为正则表达式或者字符串。
|
||||
|
||||
> 注意:`exlude` 优先级高于 `include`,前面的布局优先级高于后面的布局。开发过程中可能需要结合`src/layouts`目录下的布局使用,具体方法可查看 [使用布局](./layout.md)。
|
||||
> 注意:`exclude` 优先级高于 `include`,前面的布局优先级高于后面的布局。开发过程中可能需要结合`src/layouts`目录下的布局使用,具体方法可查看 [使用布局](./layout.md)。
|
||||
|
||||
## i18n
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ File sizes after gzip:
|
||||
|
||||
`build` 命令会打包所有的资源,包含 JavaScript, CSS, web fonts, images, html 等。你可以在 `dist/` 目录下找到这些文件。
|
||||
|
||||
> 如果 有使用 HashHistory 、 部署 html 到非根目录、静态化等需求,请查看[Umi 部署](https://umijs.org/zh/guide/deploy.html)。
|
||||
> 如果有使用 HashHistory 、 部署 html 到非根目录、静态化等需求,请查看[Umi 部署](https://umijs.org/zh/guide/deploy.html)。
|
||||
|
||||
## 本地验证
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{
|
||||
name: 'primary',
|
||||
include: [/.*/],
|
||||
exlude: [/(\/(en|zh))*\/login/, /(\/(en|zh))*\/seconday\/(.*)/],
|
||||
exclude: [/(\/(en|zh))*\/login/, /(\/(en|zh))*\/seconday\/(.*)/],
|
||||
},
|
||||
{
|
||||
name: 'secondary',
|
||||
|
||||
+66
-11
@@ -6,14 +6,24 @@ const database = [
|
||||
id: '1',
|
||||
icon: 'dashboard',
|
||||
name: 'Dashboard',
|
||||
zhName: '仪表盘',
|
||||
zh: {
|
||||
name: '仪表盘'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Dashboard'
|
||||
},
|
||||
route: '/dashboard',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
breadcrumbParentId: '1',
|
||||
name: 'Users',
|
||||
zhName: '用户管理',
|
||||
zh: {
|
||||
name: '用户管理'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Usuário'
|
||||
},
|
||||
icon: 'user',
|
||||
route: '/user',
|
||||
},
|
||||
@@ -21,7 +31,12 @@ const database = [
|
||||
id: '7',
|
||||
breadcrumbParentId: '1',
|
||||
name: 'Posts',
|
||||
zhName: '文章管理',
|
||||
zh: {
|
||||
name: '用户管理'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Posts'
|
||||
},
|
||||
icon: 'shopping-cart',
|
||||
route: '/post',
|
||||
},
|
||||
@@ -30,14 +45,24 @@ const database = [
|
||||
menuParentId: '-1',
|
||||
breadcrumbParentId: '2',
|
||||
name: 'User Detail',
|
||||
zhName: '用户详情',
|
||||
zh: {
|
||||
name: '用户详情'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Detalhes do usuário'
|
||||
},
|
||||
route: '/user/:id',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
breadcrumbParentId: '1',
|
||||
name: 'Request',
|
||||
zhName: 'Request',
|
||||
zh: {
|
||||
name: 'Request'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Requisição'
|
||||
},
|
||||
icon: 'api',
|
||||
route: '/request',
|
||||
},
|
||||
@@ -45,7 +70,12 @@ const database = [
|
||||
id: '4',
|
||||
breadcrumbParentId: '1',
|
||||
name: 'UI Element',
|
||||
zhName: 'UI组件',
|
||||
zh: {
|
||||
name: 'UI组件'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Elementos UI'
|
||||
},
|
||||
icon: 'camera-o',
|
||||
},
|
||||
{
|
||||
@@ -53,7 +83,12 @@ const database = [
|
||||
breadcrumbParentId: '4',
|
||||
menuParentId: '4',
|
||||
name: 'Editor',
|
||||
zhName: 'Editor',
|
||||
zh: {
|
||||
name: 'Editor'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Editor'
|
||||
},
|
||||
icon: 'edit',
|
||||
route: '/UIElement/editor',
|
||||
},
|
||||
@@ -61,7 +96,12 @@ const database = [
|
||||
id: '5',
|
||||
breadcrumbParentId: '1',
|
||||
name: 'Charts',
|
||||
zhName: 'Charts',
|
||||
zh: {
|
||||
name: 'Charts'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Graficos'
|
||||
},
|
||||
icon: 'code-o',
|
||||
},
|
||||
{
|
||||
@@ -69,7 +109,12 @@ const database = [
|
||||
breadcrumbParentId: '5',
|
||||
menuParentId: '5',
|
||||
name: 'ECharts',
|
||||
zhName: 'ECharts',
|
||||
zh: {
|
||||
name: 'ECharts'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'ECharts'
|
||||
},
|
||||
icon: 'line-chart',
|
||||
route: '/chart/ECharts',
|
||||
},
|
||||
@@ -78,7 +123,12 @@ const database = [
|
||||
breadcrumbParentId: '5',
|
||||
menuParentId: '5',
|
||||
name: 'HighCharts',
|
||||
zhName: 'HighCharts',
|
||||
zh: {
|
||||
name: 'HighCharts'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'HighCharts'
|
||||
},
|
||||
icon: 'bar-chart',
|
||||
route: '/chart/highCharts',
|
||||
},
|
||||
@@ -87,7 +137,12 @@ const database = [
|
||||
breadcrumbParentId: '5',
|
||||
menuParentId: '5',
|
||||
name: 'Rechartst',
|
||||
zhName: 'Rechartst',
|
||||
zh: {
|
||||
name: 'Rechartst'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Rechartst'
|
||||
},
|
||||
icon: 'area-chart',
|
||||
route: '/chart/Recharts',
|
||||
},
|
||||
|
||||
+40
-43
@@ -1,20 +1,19 @@
|
||||
{
|
||||
"name": "antd-admin",
|
||||
"version": "5.0.1",
|
||||
"private": true,
|
||||
"version": "5.1.0",
|
||||
"license": "MIT",
|
||||
"description": "An admin dashboard application demo built upon Ant Design and UmiJS",
|
||||
"dependencies": {
|
||||
"@lingui/react": "^2.7.1",
|
||||
"ant-design-pro": "^2.1.1",
|
||||
"antd": "^3.10.7",
|
||||
"axios": "^0.18.0",
|
||||
"babel-core": "7.0.0-bridge.0",
|
||||
"@lingui/react": "^2.8.0",
|
||||
"ant-design-pro": "^2.3.0",
|
||||
"antd": "^3.19.0",
|
||||
"axios": "^0.19.0",
|
||||
"classnames": "^2.2.6",
|
||||
"d3-shape": "^1.2.2",
|
||||
"d3-shape": "^1.3.0",
|
||||
"draftjs-to-html": "^0.8.4",
|
||||
"draftjs-to-markdown": "^0.5.1",
|
||||
"dva-model-extend": "^0.1.2",
|
||||
"echarts": "^4.2.0-rc.2",
|
||||
"echarts": "^4.2.0",
|
||||
"echarts-for-react": "^2.0.15-beta.0",
|
||||
"echarts-gl": "^1.1.1",
|
||||
"echarts-liquidfill": "^2.0.2",
|
||||
@@ -25,49 +24,47 @@
|
||||
"lodash": "^4.17.11",
|
||||
"md5": "^2.2.1",
|
||||
"nprogress": "^0.2.0",
|
||||
"path-to-regexp": "^2.4.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"qs": "^6.5.2",
|
||||
"rc-tween-one": "^2.2.17",
|
||||
"react-adsense": "^0.0.6",
|
||||
"react-countup": "^4.0.0-alpha.6",
|
||||
"react-draft-wysiwyg": "^1.12.13",
|
||||
"path-to-regexp": "^3.0.0",
|
||||
"prop-types": "^15.7.0",
|
||||
"qs": "^6.7.0",
|
||||
"react-adsense": "^0.1.0",
|
||||
"react-countup": "^4.1.0",
|
||||
"react-draft-wysiwyg": "^1.13.0",
|
||||
"react-helmet": "^5.2.0",
|
||||
"react-highcharts": "^16.0.2",
|
||||
"react-perfect-scrollbar": "^1.4.2",
|
||||
"recharts": "^1.3.6",
|
||||
"store": "^2.0.12"
|
||||
"react-perfect-scrollbar": "^1.5.0",
|
||||
"recharts": "^1.6.0",
|
||||
"store": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@lingui/babel-preset-react": "^2.7.1",
|
||||
"@lingui/cli": "^2.7.1",
|
||||
"@lingui/loader": "^2.7.1",
|
||||
"@lingui/babel-preset-react": "^2.8.2",
|
||||
"@lingui/cli": "^2.8.2",
|
||||
"@lingui/loader": "^2.8.2",
|
||||
"babel-core": "7.0.0-bridge.0",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-plugin-dev-expression": "^0.2.1",
|
||||
"babel-plugin-import": "^1.10.0",
|
||||
"babel-plugin-macros": "^2.4.2",
|
||||
"babel-plugin-module-resolver": "^3.1.1",
|
||||
"babel-plugin-import": "^1.12.0",
|
||||
"babel-plugin-macros": "^2.5.0",
|
||||
"babel-plugin-module-resolver": "^3.2.0",
|
||||
"cross-env": "^5.2.0",
|
||||
"eslint": "^5.9.0",
|
||||
"eslint-config-react-app": "^3.0.5",
|
||||
"eslint-plugin-flowtype": "^3.0.0",
|
||||
"eslint-plugin-import": "^2.6.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.1.1",
|
||||
"eslint-plugin-react": "^7.1.0",
|
||||
"husky": "^1.1.4",
|
||||
"eslint": "^5.15.0",
|
||||
"eslint-config-react-app": "^4.0.0",
|
||||
"eslint-plugin-flowtype": "^3.4.0",
|
||||
"eslint-plugin-import": "^2.17.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.1",
|
||||
"eslint-plugin-react": "^7.13.0",
|
||||
"eslint-plugin-react-hooks": "^1.6.0",
|
||||
"husky": "^2.3.0",
|
||||
"less-vars-to-js": "^1.3.0",
|
||||
"lint-staged": "^8.0.4",
|
||||
"lint-staged": "^8.1.0",
|
||||
"mockjs": "^1.0.1-beta3",
|
||||
"module": "^1.2.5",
|
||||
"prettier": "^1.15.2",
|
||||
"stylelint": "^9.8.0",
|
||||
"stylelint-config-prettier": "^4.0.0",
|
||||
"stylelint-config-standard": "^18.2.0",
|
||||
"umi": "^2.2.8",
|
||||
"umi-plugin-react": "^1.2.3"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"puppeteer": "^1.10.0"
|
||||
"prettier": "^1.16.0",
|
||||
"stylelint": "^10.0.0",
|
||||
"stylelint-config-prettier": "^5.2.0",
|
||||
"stylelint-config-standard": "^18.3.0",
|
||||
"umi": "^2.8.1",
|
||||
"umi-plugin-react": "^1.9.1"
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.js": [
|
||||
@@ -105,7 +102,7 @@
|
||||
"lint:style": "stylelint \"src/**/*.less\" --syntax less",
|
||||
"start": "umi dev",
|
||||
"test": "cross-env BABELRC=none umi test",
|
||||
"prettier": "prettier --write 'src/**/*.(js|less)'",
|
||||
"prettier": "prettier --write 'src/**/*.{js,less}'",
|
||||
"precommit": "lint-staged",
|
||||
"add-locale": "lingui add-locale",
|
||||
"extract": "lingui extract",
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Breadcrumb, Icon } from 'antd'
|
||||
import Link from 'umi/navlink'
|
||||
import withRouter from 'umi/withRouter'
|
||||
import { withI18n } from '@lingui/react'
|
||||
import { pathMatchRegexp, queryAncestors } from 'utils'
|
||||
import { pathMatchRegexp, queryAncestors, addLangPrefix } from 'utils'
|
||||
import styles from './Bread.less'
|
||||
|
||||
@withI18n()
|
||||
@@ -12,7 +12,7 @@ import styles from './Bread.less'
|
||||
class Bread extends PureComponent {
|
||||
generateBreadcrumbs = paths => {
|
||||
return paths.map((item, key) => {
|
||||
const content = (
|
||||
const content = item && (
|
||||
<Fragment>
|
||||
{item.icon ? (
|
||||
<Icon type={item.icon} style={{ marginRight: 4 }} />
|
||||
@@ -22,13 +22,15 @@ class Bread extends PureComponent {
|
||||
)
|
||||
|
||||
return (
|
||||
<Breadcrumb.Item key={key}>
|
||||
{paths.length - 1 !== key ? (
|
||||
<Link to={item.route || '#'}>{content}</Link>
|
||||
) : (
|
||||
content
|
||||
)}
|
||||
</Breadcrumb.Item>
|
||||
item && (
|
||||
<Breadcrumb.Item key={key}>
|
||||
{paths.length - 1 !== key ? (
|
||||
<Link to={addLangPrefix(item.route) || '#'}>{content}</Link>
|
||||
) : (
|
||||
content
|
||||
)}
|
||||
</Breadcrumb.Item>
|
||||
)
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: ~'calc(100% - 256px)';
|
||||
z-index: 9;
|
||||
z-index: 29;
|
||||
transition: width 0.2s;
|
||||
|
||||
&.collapsed {
|
||||
|
||||
@@ -89,13 +89,17 @@ class SiderMenu extends PureComponent {
|
||||
? queryAncestors(menus, currentMenu, 'menuParentId').map(_ => _.id)
|
||||
: []
|
||||
|
||||
const menuProps = collapsed
|
||||
? {}
|
||||
: {
|
||||
openKeys: this.state.openKeys,
|
||||
}
|
||||
|
||||
return (
|
||||
<Menu
|
||||
mode="inline"
|
||||
theme={theme}
|
||||
onOpenChange={this.onOpenChange}
|
||||
openKeys={this.state.openKeys}
|
||||
inlineCollapsed={collapsed}
|
||||
selectedKeys={selectedKeys}
|
||||
onClick={
|
||||
isMobile
|
||||
@@ -104,6 +108,7 @@ class SiderMenu extends PureComponent {
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
{...menuProps}
|
||||
>
|
||||
{this.generateMenus(menuTree)}
|
||||
</Menu>
|
||||
@@ -115,7 +120,6 @@ SiderMenu.propTypes = {
|
||||
menus: PropTypes.array,
|
||||
theme: PropTypes.string,
|
||||
isMobile: PropTypes.bool,
|
||||
collapsed: PropTypes.bool,
|
||||
onCollapseChange: PropTypes.func,
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class Sider extends PureComponent {
|
||||
|
||||
<div className={styles.menuContainer}>
|
||||
<ScrollBar
|
||||
option={{
|
||||
options={{
|
||||
// Disabled horizontal scrolling, https://github.com/utatti/perfect-scrollbar#options
|
||||
suppressScrollX: true,
|
||||
}}
|
||||
@@ -49,7 +49,6 @@ class Sider extends PureComponent {
|
||||
menus={menus}
|
||||
theme={theme}
|
||||
isMobile={isMobile}
|
||||
collapsed={collapsed}
|
||||
onCollapseChange={onCollapseChange}
|
||||
/>
|
||||
</ScrollBar>
|
||||
|
||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
|
||||
import classNames from 'classnames'
|
||||
import styles from './Loader.less'
|
||||
|
||||
const Loader = ({ spinning = true, fullScreen }) => {
|
||||
const Loader = ({ spinning = false, fullScreen }) => {
|
||||
return (
|
||||
<div
|
||||
className={classNames(styles.loader, {
|
||||
|
||||
@@ -11,6 +11,7 @@ import { enquireScreen, unenquireScreen } from 'enquire-js'
|
||||
import { config, pathMatchRegexp, langFromPath } from 'utils'
|
||||
import Error from '../pages/404'
|
||||
import styles from './PrimaryLayout.less'
|
||||
import store from 'store'
|
||||
|
||||
const { Content } = Layout
|
||||
const { Header, Bread, Sider } = MyLayout
|
||||
@@ -46,25 +47,23 @@ class PrimaryLayout extends PureComponent {
|
||||
|
||||
render() {
|
||||
const { app, location, dispatch, children } = this.props
|
||||
const {
|
||||
user,
|
||||
theme,
|
||||
routeList,
|
||||
collapsed,
|
||||
permissions,
|
||||
notifications,
|
||||
} = app
|
||||
const { theme, collapsed, notifications } = app
|
||||
const user = store.get('user') || {}
|
||||
const permissions = store.get('permissions') || {}
|
||||
const routeList = store.get('routeList') || []
|
||||
const { isMobile } = this.state
|
||||
const { onCollapseChange } = this
|
||||
|
||||
// Localized route name.
|
||||
|
||||
const lang = langFromPath(location.pathname)
|
||||
const newRouteList =
|
||||
langFromPath(location.pathname) === 'zh'
|
||||
lang !== 'en'
|
||||
? routeList.map(item => {
|
||||
const { zhName, ...other } = item
|
||||
const { name, ...other } = item
|
||||
return {
|
||||
...other,
|
||||
name: zhName,
|
||||
name: (item[lang] || {}).name || name,
|
||||
}
|
||||
})
|
||||
: routeList
|
||||
@@ -145,7 +144,7 @@ class PrimaryLayout extends PureComponent {
|
||||
</Content>
|
||||
<BackTop
|
||||
className={styles.backTop}
|
||||
target={() => document.querySelector('#primaryLayout>div')}
|
||||
target={() => document.querySelector('#primaryLayout')}
|
||||
/>
|
||||
<GlobalFooter
|
||||
className={styles.footer}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"/dashboard": "/dashboard",
|
||||
"Add Param": "Add Parametro",
|
||||
"Address": "Endereço",
|
||||
"Age": "Ano",
|
||||
"Are you sure delete this record?": "Tem certeza de excluir este registro?",
|
||||
"Author": "Autor",
|
||||
"Avatar": "Avatar",
|
||||
"Categories": "Categorias",
|
||||
"Clear notifications": "limpar notificações",
|
||||
"Comments": "Comentarios",
|
||||
"Create": "Criar",
|
||||
"Create User": "Criar Usuário",
|
||||
"CreateTime": "CreateTime",
|
||||
"Dark": "Escuro",
|
||||
"Delete": "Deletar",
|
||||
"Email": "Email",
|
||||
"Female": "Feminino",
|
||||
"Gender": "Genero",
|
||||
"Hi,": "Olá,",
|
||||
"Image": "Imagem",
|
||||
"Light": "Claro",
|
||||
"Male": "masculino",
|
||||
"Name": "Nome",
|
||||
"NickName": "NickName",
|
||||
"Not Found": "Não Encontrado",
|
||||
"Operation": "Operation",
|
||||
"Params": "Parametros",
|
||||
"Password": "Senha",
|
||||
"Phone": "Fone",
|
||||
"Pick an address": "Escolha um endereço",
|
||||
"Please pick an address": "Por favor, escolha um endereço",
|
||||
"Publised": "Publicado",
|
||||
"Publish Date": "Data de publicação",
|
||||
"Reset": "Reset",
|
||||
"Search": "procurar",
|
||||
"Search Name": "Search Name",
|
||||
"Send": "Enviar",
|
||||
"Sign in": "Sign in",
|
||||
"Sign out": "Sign out",
|
||||
"Switch Theme": "Trocar tema",
|
||||
"Tags": "Tags",
|
||||
"The input is not valid E-mail!": "Não é um E-mail valido!",
|
||||
"The input is not valid phone!": "Não é um telefone Valido!",
|
||||
"Title": "Titulo",
|
||||
"Total {total} Items": "Total {total} Items",
|
||||
"Unpublished": "Não publicado",
|
||||
"Update": "Atualizar",
|
||||
"Update User": "Atualizar Usuário",
|
||||
"Username": "Usuário",
|
||||
"Views": "visualizações",
|
||||
"Visibility": "Visibilidade",
|
||||
"You have viewed all notifications.": "Você visualizou todas as notificações."
|
||||
}
|
||||
+13
-34
@@ -6,16 +6,14 @@ import store from 'store'
|
||||
import { ROLE_TYPE } from 'utils/constant'
|
||||
import { queryLayout, pathMatchRegexp } from 'utils'
|
||||
import { CANCEL_REQUEST_MESSAGE } from 'utils/constant'
|
||||
import { queryRouteList, logoutUser, queryUserInfo } from 'api'
|
||||
import api from 'api'
|
||||
import config from 'config'
|
||||
|
||||
const { queryRouteList, logoutUser, queryUserInfo } = api
|
||||
|
||||
export default {
|
||||
namespace: 'app',
|
||||
state: {
|
||||
user: {},
|
||||
permissions: {
|
||||
visit: [],
|
||||
},
|
||||
routeList: [
|
||||
{
|
||||
id: '1',
|
||||
@@ -41,6 +39,9 @@ export default {
|
||||
],
|
||||
},
|
||||
subscriptions: {
|
||||
setup({ dispatch }) {
|
||||
dispatch({ type: 'query' })
|
||||
},
|
||||
setupHistory({ dispatch, history }) {
|
||||
history.listen(location => {
|
||||
dispatch({
|
||||
@@ -65,10 +66,6 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
setup({ dispatch }) {
|
||||
dispatch({ type: 'query' })
|
||||
},
|
||||
},
|
||||
effects: {
|
||||
*query({ payload }, { call, put, select }) {
|
||||
@@ -96,15 +93,10 @@ export default {
|
||||
return cases.every(_ => _)
|
||||
})
|
||||
}
|
||||
yield put({
|
||||
type: 'updateState',
|
||||
payload: {
|
||||
user,
|
||||
permissions,
|
||||
routeList,
|
||||
},
|
||||
})
|
||||
if (pathMatchRegexp('/login', window.location.pathname)) {
|
||||
store.set('routeList', routeList)
|
||||
store.set('permissions', permissions)
|
||||
store.set('user', user)
|
||||
if (pathMatchRegexp(['/', '/login'], window.location.pathname)) {
|
||||
router.push({
|
||||
pathname: '/dashboard',
|
||||
})
|
||||
@@ -122,22 +114,9 @@ export default {
|
||||
*signOut({ payload }, { call, put }) {
|
||||
const data = yield call(logoutUser)
|
||||
if (data.success) {
|
||||
yield put({
|
||||
type: 'updateState',
|
||||
payload: {
|
||||
user: {},
|
||||
permissions: { visit: [] },
|
||||
menu: [
|
||||
{
|
||||
id: '1',
|
||||
icon: 'laptop',
|
||||
name: 'Dashboard',
|
||||
zhName: '仪表盘',
|
||||
router: '/dashboard',
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
store.set('routeList', [])
|
||||
store.set('permissions', { visit: [] })
|
||||
store.set('user', {})
|
||||
yield put({ type: 'query' })
|
||||
} else {
|
||||
throw data
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
User,
|
||||
} from './components'
|
||||
import styles from './index.less'
|
||||
import store from 'store'
|
||||
|
||||
const bodyStyle = {
|
||||
bodyStyle: {
|
||||
@@ -26,14 +27,14 @@ const bodyStyle = {
|
||||
}
|
||||
|
||||
@connect(({ app, dashboard, loading }) => ({
|
||||
avatar: app.user.avatar,
|
||||
username: app.user.username,
|
||||
dashboard,
|
||||
loading,
|
||||
}))
|
||||
class Dashboard extends PureComponent {
|
||||
render() {
|
||||
const { avatar, username, dashboard, loading } = this.props
|
||||
const userDetail = store.get('user')
|
||||
const { avatar, username } = userDetail
|
||||
const { dashboard, loading } = this.props
|
||||
const {
|
||||
weather,
|
||||
sales,
|
||||
@@ -154,8 +155,6 @@ class Dashboard extends PureComponent {
|
||||
}
|
||||
|
||||
Dashboard.propTypes = {
|
||||
avatar: PropTypes.string,
|
||||
username: PropTypes.string,
|
||||
dashboard: PropTypes.object,
|
||||
loading: PropTypes.object,
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { parse } from 'qs'
|
||||
import modelExtend from 'dva-model-extend'
|
||||
import { queryDashboard, queryWeather } from 'api'
|
||||
import api from 'api'
|
||||
import { pathMatchRegexp } from 'utils'
|
||||
import { model } from 'utils/model'
|
||||
|
||||
const { queryDashboard, queryWeather } = api
|
||||
|
||||
export default modelExtend(model, {
|
||||
namespace: 'dashboard',
|
||||
state: {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { router, pathMatchRegexp } from 'utils'
|
||||
import { loginUser } from 'api'
|
||||
import api from 'api'
|
||||
|
||||
const { loginUser } = api
|
||||
|
||||
export default {
|
||||
namespace: 'login',
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import modelExtend from 'dva-model-extend'
|
||||
import { queryPostList } from 'api'
|
||||
import api from 'api'
|
||||
import { pathMatchRegexp } from 'utils'
|
||||
import { pageModel } from 'utils/model'
|
||||
|
||||
const { queryPostList } = api
|
||||
|
||||
export default modelExtend(pageModel, {
|
||||
namespace: 'post',
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { pathMatchRegexp } from 'utils'
|
||||
import { queryUser } from 'api'
|
||||
import api from 'api'
|
||||
|
||||
const { queryUser } = api
|
||||
|
||||
export default {
|
||||
namespace: 'userDetail',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* global document */
|
||||
import React, { PureComponent } from 'react'
|
||||
import React, { Component } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import moment from 'moment'
|
||||
import { FilterItem } from 'components'
|
||||
@@ -25,7 +25,7 @@ const TwoColProps = {
|
||||
|
||||
@withI18n()
|
||||
@Form.create()
|
||||
class Filter extends PureComponent {
|
||||
class Filter extends Component {
|
||||
handleFields = fields => {
|
||||
const { createTime } = fields
|
||||
if (createTime.length) {
|
||||
|
||||
+32
-24
@@ -13,9 +13,30 @@ import Modal from './components/Modal'
|
||||
@withI18n()
|
||||
@connect(({ user, loading }) => ({ user, loading }))
|
||||
class User extends PureComponent {
|
||||
componentDidMount() {
|
||||
this.handleRefresh({ page: 1, pageSize: 10 })
|
||||
}
|
||||
|
||||
handleRefresh = newQuery => {
|
||||
const { location, dispatch } = this.props
|
||||
const { query, pathname } = location
|
||||
const payload = {
|
||||
...query,
|
||||
...newQuery,
|
||||
}
|
||||
dispatch({
|
||||
type: 'user/query',
|
||||
payload,
|
||||
})
|
||||
router.push({
|
||||
pathname,
|
||||
search: stringify(payload, { arrayFormat: 'repeat' }),
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const { location, dispatch, user, loading, i18n } = this.props
|
||||
const { query, pathname } = location
|
||||
const { query } = location
|
||||
const {
|
||||
list,
|
||||
pagination,
|
||||
@@ -25,34 +46,22 @@ class User extends PureComponent {
|
||||
selectedRowKeys,
|
||||
} = user
|
||||
|
||||
const handleRefresh = newQuery => {
|
||||
router.push({
|
||||
pathname,
|
||||
search: stringify(
|
||||
{
|
||||
...query,
|
||||
...newQuery,
|
||||
},
|
||||
{ arrayFormat: 'repeat' }
|
||||
),
|
||||
})
|
||||
}
|
||||
|
||||
const modalProps = {
|
||||
item: modalType === 'create' ? {} : currentItem,
|
||||
visible: modalVisible,
|
||||
destroyOnClose: true,
|
||||
maskClosable: false,
|
||||
confirmLoading: loading.effects[`user/${modalType}`],
|
||||
title: `${
|
||||
modalType === 'create' ? i18n.t`Create User` : i18n.t`Update User`
|
||||
}`,
|
||||
wrapClassName: 'vertical-center-modal',
|
||||
centered: true,
|
||||
onOk(data) {
|
||||
dispatch({
|
||||
type: `user/${modalType}`,
|
||||
payload: data,
|
||||
}).then(() => {
|
||||
handleRefresh()
|
||||
this.handleRefresh()
|
||||
})
|
||||
},
|
||||
onCancel() {
|
||||
@@ -66,8 +75,8 @@ class User extends PureComponent {
|
||||
dataSource: list,
|
||||
loading: loading.effects['user/query'],
|
||||
pagination,
|
||||
onChange(page) {
|
||||
handleRefresh({
|
||||
onChange: page => {
|
||||
this.handleRefresh({
|
||||
page: page.current,
|
||||
pageSize: page.pageSize,
|
||||
})
|
||||
@@ -77,7 +86,7 @@ class User extends PureComponent {
|
||||
type: 'user/delete',
|
||||
payload: id,
|
||||
}).then(() => {
|
||||
handleRefresh({
|
||||
this.handleRefresh({
|
||||
page:
|
||||
list.length === 1 && pagination.current > 1
|
||||
? pagination.current - 1
|
||||
@@ -111,10 +120,9 @@ class User extends PureComponent {
|
||||
filter: {
|
||||
...query,
|
||||
},
|
||||
onFilterChange(value) {
|
||||
handleRefresh({
|
||||
onFilterChange: value => {
|
||||
this.handleRefresh({
|
||||
...value,
|
||||
page: 1,
|
||||
})
|
||||
},
|
||||
onAdd() {
|
||||
@@ -134,7 +142,7 @@ class User extends PureComponent {
|
||||
ids: selectedRowKeys,
|
||||
},
|
||||
}).then(() => {
|
||||
handleRefresh({
|
||||
this.handleRefresh({
|
||||
page:
|
||||
list.length === selectedRowKeys.length && pagination.current > 1
|
||||
? pagination.current - 1
|
||||
@@ -163,7 +171,7 @@ class User extends PureComponent {
|
||||
</Row>
|
||||
)}
|
||||
<List {...listProps} />
|
||||
{modalVisible && <Modal {...modalProps} />}
|
||||
<Modal {...modalProps} />
|
||||
</Page>
|
||||
)
|
||||
}
|
||||
|
||||
+5
-17
@@ -1,14 +1,16 @@
|
||||
/* global window */
|
||||
import modelExtend from 'dva-model-extend'
|
||||
import { pathMatchRegexp } from 'utils'
|
||||
import {
|
||||
import api from 'api'
|
||||
import { pageModel } from 'utils/model'
|
||||
|
||||
const {
|
||||
queryUserList,
|
||||
createUser,
|
||||
removeUser,
|
||||
updateUser,
|
||||
removeUserList,
|
||||
} from 'api'
|
||||
import { pageModel } from 'utils/model'
|
||||
} = api
|
||||
|
||||
export default modelExtend(pageModel, {
|
||||
namespace: 'user',
|
||||
@@ -20,20 +22,6 @@ export default modelExtend(pageModel, {
|
||||
selectedRowKeys: [],
|
||||
},
|
||||
|
||||
subscriptions: {
|
||||
setup({ dispatch, history }) {
|
||||
history.listen(location => {
|
||||
if (pathMatchRegexp('/user', location.pathname)) {
|
||||
const payload = location.query || { page: 1, pageSize: 10 }
|
||||
dispatch({
|
||||
type: 'query',
|
||||
payload,
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
effects: {
|
||||
*query({ payload = {} }, { call, put }) {
|
||||
const data = yield call(queryUserList, payload)
|
||||
|
||||
@@ -35,4 +35,4 @@ APIFunction.queryWeather = params => {
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = APIFunction
|
||||
export default APIFunction
|
||||
|
||||
@@ -63,21 +63,6 @@ body {
|
||||
box-shadow: 0 0 20px rgba(100, 100, 100, 0.2);
|
||||
}
|
||||
|
||||
.vertical-center-modal {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.ant-modal {
|
||||
top: 0;
|
||||
|
||||
.ant-modal-body {
|
||||
max-height: 80vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-form-item-control {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
+1
-1
@@ -4052,4 +4052,4 @@ let DICT_FIXED = (function() {
|
||||
return tree(fixed)
|
||||
})()
|
||||
|
||||
module.exports = DICT_FIXED
|
||||
export default DICT_FIXED
|
||||
|
||||
+6
-1
@@ -10,7 +10,7 @@ module.exports = {
|
||||
{
|
||||
name: 'primary',
|
||||
include: [/.*/],
|
||||
exlude: [/(\/(en|zh))*\/login/],
|
||||
exclude: [/(\/(en|zh))*\/login/],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -18,6 +18,11 @@ module.exports = {
|
||||
i18n: {
|
||||
/* Countrys flags: https://www.flaticon.com/packs/countrys-flags */
|
||||
languages: [
|
||||
{
|
||||
key: 'pt-br',
|
||||
title: 'Português',
|
||||
flag: '/brazil.svg',
|
||||
},
|
||||
{
|
||||
key: 'en',
|
||||
title: 'English',
|
||||
|
||||
@@ -4,4 +4,4 @@ export const ROLE_TYPE = {
|
||||
DEVELOPER: 'developer',
|
||||
}
|
||||
|
||||
export const CANCEL_REQUEST_MESSAGE = 'cancle request'
|
||||
export const CANCEL_REQUEST_MESSAGE = 'cancel request'
|
||||
|
||||
+5
-5
@@ -211,7 +211,7 @@ export function queryLayout(layouts, pathname) {
|
||||
|
||||
for (const item of layouts) {
|
||||
let include = false
|
||||
let exlude = false
|
||||
let exclude = false
|
||||
if (item.include) {
|
||||
for (const regepx of item.include) {
|
||||
if (isMatch(regepx)) {
|
||||
@@ -221,16 +221,16 @@ export function queryLayout(layouts, pathname) {
|
||||
}
|
||||
}
|
||||
|
||||
if (include && item.exlude) {
|
||||
for (const regepx of item.exlude) {
|
||||
if (include && item.exclude) {
|
||||
for (const regepx of item.exclude) {
|
||||
if (isMatch(regepx)) {
|
||||
exlude = true
|
||||
exclude = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (include && !exlude) {
|
||||
if (include && !exclude) {
|
||||
result = item.name
|
||||
break
|
||||
}
|
||||
|
||||
@@ -33,11 +33,8 @@ export default function request(options) {
|
||||
message.error(e.message)
|
||||
}
|
||||
|
||||
options.url =
|
||||
method.toLocaleLowerCase() === 'get'
|
||||
? `${url}${isEmpty(cloneData) ? '' : '?'}${qs.stringify(cloneData)}`
|
||||
: url
|
||||
|
||||
options.url = url
|
||||
options.params = cloneData
|
||||
options.cancelToken = new CancelToken(cancel => {
|
||||
window.cancelRequest.set(Symbol(Date.now()), {
|
||||
pathname: window.location.pathname,
|
||||
|
||||
Reference in New Issue
Block a user