⚡ 优化代码
This commit is contained in:
parent
d0dfdf456b
commit
b4b71f1a1e
|
|
@ -6,6 +6,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: npm install
|
- run: npm install
|
||||||
|
- run: npm run lint
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
test:
|
test:
|
||||||
docker:
|
docker:
|
||||||
|
|
@ -14,8 +15,8 @@ jobs:
|
||||||
- checkout
|
- checkout
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run:
|
- run:
|
||||||
command : npm run test:all
|
command: npm run test:all
|
||||||
no_output_timeout : 30m
|
no_output_timeout: 30m
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
build_and_test:
|
build_and_test:
|
||||||
|
|
|
||||||
2
LICENSE
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2018 Alipay.inc
|
Copyright (c) 2019 Alipay.inc
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
||||||
69
README.md
69
README.md
|
|
@ -1,5 +1,5 @@
|
||||||
## 简介
|
## 简介
|
||||||
Sword 是 [SpringBlade](https://gitee.com/smallc/SpringBlade) 前端UI项目,基于react 、ant design、dva,用于快速构建系统中后台业务。
|
Sword 是 SpringBlade前端UI项目,基于react 、ant design、dva,用于快速构建系统中后台业务。
|
||||||
|
|
||||||
## 特性
|
## 特性
|
||||||
|
|
||||||
|
|
@ -9,7 +9,7 @@ Sword 是 [SpringBlade](https://gitee.com/smallc/SpringBlade) 前端UI项目,
|
||||||
- :iphone: **响应式**:针对不同屏幕大小设计
|
- :iphone: **响应式**:针对不同屏幕大小设计
|
||||||
- :art: **主题**:可配置的主题满足多样化的品牌诉求
|
- :art: **主题**:可配置的主题满足多样化的品牌诉求
|
||||||
- :globe_with_meridians: **国际化**:内建业界通用的国际化方案
|
- :globe_with_meridians: **国际化**:内建业界通用的国际化方案
|
||||||
- :gear: **最佳实践**:良好的工程实践助您持续产出高质量代码
|
- :zap: **最佳实践**:良好的工程实践助您持续产出高质量代码
|
||||||
- :1234: **Mock 数据**:实用的本地数据调试方案
|
- :1234: **Mock 数据**:实用的本地数据调试方案
|
||||||
- :white_check_mark: **UI 测试**:自动化测试保障前端产品质量
|
- :white_check_mark: **UI 测试**:自动化测试保障前端产品质量
|
||||||
|
|
||||||
|
|
@ -40,29 +40,50 @@ $ npm install
|
||||||
# mock模式
|
# mock模式
|
||||||
$ npm start
|
$ npm start
|
||||||
# 服务模式
|
# 服务模式
|
||||||
$ npm start:no-mock
|
$ npm run start:no-mock
|
||||||
# 访问 http://localhost:88
|
# 访问 http://localhost:88
|
||||||
```
|
```
|
||||||
|
|
||||||
# 界面一览
|
# 界面一览
|
||||||

|
<table>
|
||||||

|
<tr>
|
||||||

|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-k8s.png"/></td>
|
||||||

|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-harbor.png"/></td>
|
||||||

|
</tr>
|
||||||

|
<tr>
|
||||||

|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-traefik.png"/></td>
|
||||||

|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-traefik-health.png"/></td>
|
||||||

|
</tr>
|
||||||

|
<tr>
|
||||||

|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-consul.png"/></td>
|
||||||

|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-consul-nodes1.png"/></td>
|
||||||

|
</tr>
|
||||||

|
<tr>
|
||||||

|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-admin1.png"/></td>
|
||||||

|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-admin2.png"/></td>
|
||||||

|
</tr>
|
||||||

|
<tr>
|
||||||

|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-swagger1.png"/></td>
|
||||||

|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-swagger2.png"/></td>
|
||||||

|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-main.png"/></td>
|
||||||
|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-menu.png"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-menu-edit.png"/></td>
|
||||||
|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-menu-icon.png"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-role.png"/></td>
|
||||||
|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-user.png"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-dict.png "/></td>
|
||||||
|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-log.png"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-locale-cn.png"/></td>
|
||||||
|
<td><img src="https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-locale-us.png"/></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
# Test against the latest version of this Node.js version
|
# Test against the latest version of this Node.js version
|
||||||
environment:
|
environment:
|
||||||
nodejs_version: "8"
|
nodejs_version: '10'
|
||||||
|
|
||||||
# this is how to allow failing jobs in the matrix
|
# this is how to allow failing jobs in the matrix
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
|
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
|
||||||
|
|
||||||
# Install scripts. (runs after repo cloning)
|
# Install scripts. (runs after repo cloning)
|
||||||
install:
|
install:
|
||||||
|
|
|
||||||
21
doc/文件更新.md
21
doc/文件更新.md
|
|
@ -1,21 +0,0 @@
|
||||||
#修改文件如下:
|
|
||||||
config/config.js [history:hash/proxy]
|
|
||||||
|
|
||||||
mock/menu.js
|
|
||||||
|
|
||||||
src/models/menu.js
|
|
||||||
src/models/login.js
|
|
||||||
|
|
||||||
src/services/menu.js
|
|
||||||
src/services/api.js [fakeAccountLogin]
|
|
||||||
|
|
||||||
src/utils/authority.js
|
|
||||||
src/utils/request.js
|
|
||||||
src/utils/utils.js
|
|
||||||
|
|
||||||
src/pages/User/Login.js
|
|
||||||
|
|
||||||
src/components/AdvancedTable
|
|
||||||
src/components/StandardTable
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// ps https://github.com/GoogleChrome/puppeteer/issues/3120
|
// ps https://github.com/GoogleChrome/puppeteer/issues/3120
|
||||||
module.exports = {
|
module.exports = {
|
||||||
launch: {
|
launch: {
|
||||||
headless: false,
|
headless: true,
|
||||||
args: [
|
args: [
|
||||||
'--disable-gpu',
|
'--disable-gpu',
|
||||||
'--disable-dev-shm-usage',
|
'--disable-dev-shm-usage',
|
||||||
|
|
|
||||||
24
package.json
24
package.json
|
|
@ -11,7 +11,8 @@
|
||||||
"site": "npm run presite && cross-env APP_TYPE=site npm run build && firebase deploy && npm run docker:push",
|
"site": "npm run presite && cross-env APP_TYPE=site npm run build && firebase deploy && npm run docker:push",
|
||||||
"analyze": "cross-env ANALYZE=1 umi build",
|
"analyze": "cross-env ANALYZE=1 umi build",
|
||||||
"lint:style": "stylelint \"src/**/*.less\" --syntax less",
|
"lint:style": "stylelint \"src/**/*.less\" --syntax less",
|
||||||
"lint": "eslint --ext .js src mock tests && npm run lint:style",
|
"lint:prettier": "check-prettier lint",
|
||||||
|
"lint": "eslint --ext .js src mock tests && npm run lint:style && npm run lint:prettier",
|
||||||
"lint:fix": "eslint --fix --ext .js src mock tests && npm run lint:style",
|
"lint:fix": "eslint --fix --ext .js src mock tests && npm run lint:style",
|
||||||
"lint-staged": "lint-staged",
|
"lint-staged": "lint-staged",
|
||||||
"lint-staged:js": "eslint --ext .js",
|
"lint-staged:js": "eslint --ext .js",
|
||||||
|
|
@ -31,9 +32,9 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/data-set": "^0.10.0",
|
"@antv/data-set": "^0.10.0",
|
||||||
"@babel/runtime": "^7.1.5",
|
"@babel/runtime": "^7.2.0",
|
||||||
"antd": "^3.11.6",
|
"antd": "^3.11.6",
|
||||||
"bizcharts": "^3.4.0",
|
"bizcharts": "^3.4.2",
|
||||||
"bizcharts-plugin-slider": "^2.1.1-beta.1",
|
"bizcharts-plugin-slider": "^2.1.1-beta.1",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"dva": "^2.4.0",
|
"dva": "^2.4.0",
|
||||||
|
|
@ -43,6 +44,7 @@
|
||||||
"lodash-decorators": "^6.0.0",
|
"lodash-decorators": "^6.0.0",
|
||||||
"memoize-one": "^5.0.0",
|
"memoize-one": "^5.0.0",
|
||||||
"moment": "^2.22.2",
|
"moment": "^2.22.2",
|
||||||
|
"npm": "^6.5.0",
|
||||||
"numeral": "^2.0.6",
|
"numeral": "^2.0.6",
|
||||||
"nzh": "^1.0.3",
|
"nzh": "^1.0.3",
|
||||||
"omit.js": "^1.0.0",
|
"omit.js": "^1.0.0",
|
||||||
|
|
@ -66,9 +68,10 @@
|
||||||
"antd-pro-merge-less": "^1.0.0",
|
"antd-pro-merge-less": "^1.0.0",
|
||||||
"antd-theme-webpack-plugin": "^1.1.8",
|
"antd-theme-webpack-plugin": "^1.1.8",
|
||||||
"babel-eslint": "^10.0.1",
|
"babel-eslint": "^10.0.1",
|
||||||
|
"check-prettier": "^1.0.1",
|
||||||
"cross-env": "^5.1.1",
|
"cross-env": "^5.1.1",
|
||||||
"cross-port-killer": "^1.0.1",
|
"cross-port-killer": "^1.0.1",
|
||||||
"enzyme": "^3.7.0",
|
"enzyme": "3.7.0",
|
||||||
"eslint": "^5.4.0",
|
"eslint": "^5.4.0",
|
||||||
"eslint-config-airbnb": "^17.0.0",
|
"eslint-config-airbnb": "^17.0.0",
|
||||||
"eslint-config-prettier": "^3.0.1",
|
"eslint-config-prettier": "^3.0.1",
|
||||||
|
|
@ -86,16 +89,16 @@
|
||||||
"mockjs": "^1.0.1-beta3",
|
"mockjs": "^1.0.1-beta3",
|
||||||
"prettier": "1.15.2",
|
"prettier": "1.15.2",
|
||||||
"pro-download": "^1.0.1",
|
"pro-download": "^1.0.1",
|
||||||
|
"slash2": "^2.0.0",
|
||||||
"stylelint": "^9.8.0",
|
"stylelint": "^9.8.0",
|
||||||
"stylelint-config-prettier": "^4.0.0",
|
"stylelint-config-prettier": "^4.0.0",
|
||||||
"stylelint-config-standard": "^18.0.0",
|
"stylelint-config-standard": "^18.0.0",
|
||||||
"tslint": "^5.10.0",
|
"tslint": "^5.10.0",
|
||||||
"tslint-config-prettier": "^1.10.0",
|
"tslint-config-prettier": "^1.10.0",
|
||||||
"tslint-react": "^3.6.0",
|
"tslint-react": "^3.6.0",
|
||||||
"umi": "^2.2.7",
|
"umi": "^2.3.1",
|
||||||
"umi-plugin-ga": "^1.1.3",
|
"umi-plugin-ga": "^1.1.3",
|
||||||
"umi-plugin-react": "^1.2.0",
|
"umi-plugin-react": "^1.2.0"
|
||||||
"slash2": "^2.0.0"
|
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"puppeteer": "^1.10.0"
|
"puppeteer": "^1.10.0"
|
||||||
|
|
@ -116,6 +119,13 @@
|
||||||
"last 2 versions",
|
"last 2 versions",
|
||||||
"not ie <= 10"
|
"not ie <= 10"
|
||||||
],
|
],
|
||||||
|
"checkFiles": [
|
||||||
|
"src/**/*.js*",
|
||||||
|
"src/**/*.ts*",
|
||||||
|
"src/**/*.less",
|
||||||
|
"config/**/*.js*",
|
||||||
|
"scripts/**/*.js"
|
||||||
|
],
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"pre-commit": "npm run lint-staged"
|
"pre-commit": "npm run lint-staged"
|
||||||
|
|
|
||||||
|
|
@ -9,26 +9,12 @@
|
||||||
const glob = require('glob');
|
const glob = require('glob');
|
||||||
const prettier = require('prettier');
|
const prettier = require('prettier');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const getPrettierFiles = require('./getPrettierFiles');
|
||||||
const prettierConfigPath = require.resolve('../.prettierrc');
|
const prettierConfigPath = require.resolve('../.prettierrc');
|
||||||
|
|
||||||
let didError = false;
|
let didError = false;
|
||||||
|
|
||||||
let files = [];
|
const files = getPrettierFiles();
|
||||||
const configFiles = glob.sync('config/**/*.js*', { ignore: ['**/node_modules/**', 'build/**'] });
|
|
||||||
const mockFiles = glob.sync('mock/**/*.js*', { ignore: ['**/node_modules/**', 'build/**'] });
|
|
||||||
const jsFiles = glob.sync('src/**/*.js*', { ignore: ['**/node_modules/**', 'build/**'] });
|
|
||||||
const scriptFiles = glob.sync('scripts/**/*.js');
|
|
||||||
const tsFiles = glob.sync('src/**/*.ts*', { ignore: ['**/node_modules/**', 'build/**'] });
|
|
||||||
const lessFiles = glob.sync('src/**/*.less*', { ignore: ['**/node_modules/**', 'build/**'] });
|
|
||||||
files = files.concat(configFiles);
|
|
||||||
files = files.concat(mockFiles);
|
|
||||||
files = files.concat(jsFiles);
|
|
||||||
files = files.concat(scriptFiles);
|
|
||||||
files = files.concat(tsFiles);
|
|
||||||
files = files.concat(lessFiles);
|
|
||||||
if (!files.length) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
files.forEach(file => {
|
files.forEach(file => {
|
||||||
const options = prettier.resolveConfig.sync(file, {
|
const options = prettier.resolveConfig.sync(file, {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ class LogApi extends PureComponent {
|
||||||
<div style={{ float: 'right' }}>
|
<div style={{ float: 'right' }}>
|
||||||
<Button type="primary" htmlType="submit">
|
<Button type="primary" htmlType="submit">
|
||||||
查询
|
查询
|
||||||
</Button>
|
</Button>{' '}
|
||||||
<Button style={{ marginLeft: 8 }} onClick={onReset}>
|
<Button style={{ marginLeft: 8 }} onClick={onReset}>
|
||||||
重置
|
重置
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;">
|
||||||
<title>Sword企业级开发平台</title>
|
<title>Sword企业级开发平台</title>
|
||||||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||||
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.data-set-0.9.6/dist/data-set.min.js"></script>
|
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.data-set-0.9.6/dist/data-set.min.js"></script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user