Skip to content

Commit 292be96

Browse files
author
Philip Zhang
committed
resubmit UI
1 parent e704dec commit 292be96

File tree

3,872 files changed

+551755
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,872 files changed

+551755
-0
lines changed

bizui/.babelrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
plugins: [
3+
[
4+
'babel-plugin-module-resolver',
5+
{
6+
alias: {
7+
components: './src/components',
8+
},
9+
},
10+
],
11+
],
12+
};

bizui/.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
max_line_length = 80
11+
insert_final_newline = true
12+
13+
[*.md]
14+
trim_trailing_whitespace = false
15+
16+
[Makefile]
17+
indent_style = tab

bizui/.eslintrc

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "airbnb",
4+
"env": {
5+
"browser": true,
6+
"node": true,
7+
"es6": true,
8+
"mocha": true,
9+
"jest": true,
10+
"jasmine": true
11+
},
12+
"rules": {
13+
"arrow-parens": 0,
14+
"generator-star-spacing": [0],
15+
"consistent-return": [0],
16+
"react/forbid-prop-types": [0],
17+
"react/jsx-filename-extension": [1, { "extensions": [".js"] }],
18+
"global-require": [1],
19+
"import/prefer-default-export": [0],
20+
"react/jsx-no-bind": [0],
21+
"react/prop-types": [0],
22+
"react/prefer-stateless-function": [0],
23+
24+
"no-else-return": [0],
25+
"no-restricted-syntax": [0],
26+
"import/no-extraneous-dependencies": [0],
27+
"no-use-before-define": [0],
28+
"jsx-a11y/no-static-element-interactions": [0],
29+
"jsx-a11y/no-noninteractive-element-interactions": [0],
30+
"jsx-a11y/click-events-have-key-events": [0],
31+
"jsx-a11y/anchor-is-valid": [0],
32+
"no-nested-ternary": [0],
33+
"arrow-body-style": [0],
34+
"import/extensions": [0],
35+
"no-bitwise": [0],
36+
"no-cond-assign": [0],
37+
"import/no-unresolved": [0],
38+
"comma-dangle": ["error", {
39+
"arrays": "always-multiline",
40+
"objects": "always-multiline",
41+
"imports": "always-multiline",
42+
"exports": "always-multiline",
43+
"functions": "ignore"
44+
}],
45+
"object-curly-newline": [0],
46+
"function-paren-newline": [0],
47+
"no-restricted-globals": [0],
48+
"require-yield": [1],
49+
"no-underscore-dangle":[0],
50+
"no-multiple-empty-lines":[0],
51+
"no-trailing-spaces":[0],
52+
"semi": [1, "never"]
53+
},
54+
"parserOptions": {
55+
"ecmaFeatures": {
56+
"experimentalObjectRestSpread": true
57+
}
58+
}
59+
}

bizui/.eslintrc.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
module.exports = {
2+
parser: 'babel-eslint',
3+
extends: ['airbnb', 'prettier'],
4+
env: {
5+
browser: true,
6+
node: true,
7+
es6: true,
8+
mocha: true,
9+
jest: true,
10+
jasmine: true,
11+
},
12+
rules: {
13+
'generator-star-spacing': [0],
14+
'consistent-return': [0],
15+
'react/forbid-prop-types': [0],
16+
'react/jsx-filename-extension': [1, { extensions: ['.js'] }],
17+
'global-require': [1],
18+
'import/prefer-default-export': [0],
19+
'react/jsx-no-bind': [0],
20+
'react/prop-types': [0],
21+
'react/prefer-stateless-function': [0],
22+
'react/jsx-wrap-multilines': [
23+
'error',
24+
{
25+
declaration: 'parens-new-line',
26+
assignment: 'parens-new-line',
27+
return: 'parens-new-line',
28+
arrow: 'parens-new-line',
29+
condition: 'parens-new-line',
30+
logical: 'parens-new-line',
31+
prop: 'ignore',
32+
},
33+
],
34+
'no-else-return': [0],
35+
'no-restricted-syntax': [0],
36+
'import/no-extraneous-dependencies': [0],
37+
'no-use-before-define': [0],
38+
'jsx-a11y/no-static-element-interactions': [0],
39+
'jsx-a11y/no-noninteractive-element-interactions': [0],
40+
'jsx-a11y/click-events-have-key-events': [0],
41+
'jsx-a11y/anchor-is-valid': [0],
42+
'no-nested-ternary': [0],
43+
'arrow-body-style': [0],
44+
'import/extensions': [0],
45+
'no-bitwise': [0],
46+
'no-cond-assign': [0],
47+
'import/no-unresolved': [0],
48+
'comma-dangle': [
49+
'error',
50+
{
51+
arrays: 'always-multiline',
52+
objects: 'always-multiline',
53+
imports: 'always-multiline',
54+
exports: 'always-multiline',
55+
functions: 'ignore',
56+
},
57+
],
58+
'object-curly-newline': [0],
59+
'function-paren-newline': [0],
60+
'no-restricted-globals': [0],
61+
'require-yield': [1],
62+
},
63+
parserOptions: {
64+
ecmaFeatures: {
65+
experimentalObjectRestSpread: true,
66+
},
67+
},
68+
settings: {
69+
polyfills: ['fetch', 'promises'],
70+
},
71+
};

bizui/.ga

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"code":"UA-72788897-6"
3+
}

bizui/.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
# roadhog-api-doc ignore
6+
/coresrc/utils/request-temp.js
7+
8+
# production
9+
/dist
10+
11+
# misc
12+
.DS_Store
13+
npm-debug.log*
14+
15+
/coverage
16+
.idea

bizui/.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/*.md
2+
**/*.svg
3+
**/*.html
4+
package.json

bizui/.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5",
4+
"printWidth": 100,
5+
"overrides": [
6+
{
7+
"files": ".prettierrc",
8+
"options": { "parser": "json" }
9+
}
10+
]
11+
}

bizui/.roadhogrc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"entry": "src/index.js",
3+
"extraBabelPlugins": [
4+
"transform-runtime",
5+
"transform-decorators-legacy",
6+
"transform-class-properties",
7+
["import", { "libraryName": "antd", "libraryDirectory": "es", "style": true }]
8+
],
9+
"env": {
10+
"development": {
11+
"extraBabelPlugins": [
12+
"dva-hmr"
13+
]
14+
}
15+
},
16+
"externals": {
17+
"g2": "G2",
18+
"g-cloud": "Cloud",
19+
"g2-plugin-slider": "G2.Plugin.slider"
20+
},
21+
"ignoreMomentLocale": true,
22+
"theme": "./src/theme.js"
23+
}

bizui/.roadhogrc.mock.js

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import mockjs from 'mockjs';
2+
import { getRule, postRule } from './mock/rule';
3+
import { getActivities, getNotice, getFakeList } from './mock/api';
4+
import { getFakeChartData } from './mock/chart';
5+
import { imgMap } from './mock/utils';
6+
import { getProfileBasicData } from './mock/profile';
7+
import { getProfileAdvancedData } from './mock/profile';
8+
import { getNotices } from './mock/notices';
9+
import { format, delay } from 'roadhog-api-doc';
10+
11+
// 是否禁用代理
12+
const noProxy = process.env.NO_PROXY === 'true';
13+
14+
// 代码中会兼容本地 service mock 以及部署站点的静态数据
15+
const proxy = {
16+
// 支持值为 Object 和 Array
17+
'GET /api/currentUser': {
18+
$desc: "获取当前用户接口",
19+
$params: {
20+
pageSize: {
21+
desc: '分页',
22+
exp: 2,
23+
},
24+
},
25+
$body: {
26+
name: 'momo.zxy',
27+
avatar: imgMap.user,
28+
userid: '00000001',
29+
notifyCount: 12,
30+
},
31+
},
32+
// GET POST 可省略
33+
'GET /api/users': [{
34+
key: '1',
35+
name: 'John Brown',
36+
age: 32,
37+
address: 'New York No. 1 Lake Park',
38+
}, {
39+
key: '2',
40+
name: 'Jim Green',
41+
age: 42,
42+
address: 'London No. 1 Lake Park',
43+
}, {
44+
key: '3',
45+
name: 'Joe Black',
46+
age: 32,
47+
address: 'Sidney No. 1 Lake Park',
48+
}],
49+
'GET /api/project/notice': getNotice,
50+
'GET /api/activities': getActivities,
51+
'GET /api/rule': getRule,
52+
'POST /api/rule': {
53+
$params: {
54+
pageSize: {
55+
desc: '分页',
56+
exp: 2,
57+
},
58+
},
59+
$body: postRule,
60+
},
61+
'POST /api/forms': (req, res) => {
62+
res.send('Ok');
63+
},
64+
'GET /api/tags': mockjs.mock({
65+
'list|100': [{ name: '@city', 'value|1-100': 150, 'type|0-2': 1 }]
66+
}),
67+
'GET /api/fake_list': getFakeList,
68+
'GET /api/fake_chart_data': getFakeChartData,
69+
'GET /api/profile/basic': getProfileBasicData,
70+
'GET /api/profile/advanced': getProfileAdvancedData,
71+
'POST /api/login/account': (req, res) => {
72+
const { password, userName } = req.body;
73+
res.send({ status: password === '888888' && userName === 'admin' ? 'ok' : 'error', type: 'account' });
74+
},
75+
'POST /api/login/mobile': (req, res) => {
76+
res.send({ status: 'ok', type: 'mobile' });
77+
},
78+
'POST /api/register': (req, res) => {
79+
res.send({ status: 'ok' });
80+
},
81+
'GET /api/notices': getNotices,
82+
};
83+
84+
export default noProxy ? {} : delay(proxy, 0);

bizui/.stylelintrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": "stylelint-config-standard",
3+
"rules": {
4+
"selector-pseudo-class-no-unknown": null,
5+
"shorthand-property-no-redundant-values": null,
6+
"at-rule-empty-line-before": null,
7+
"at-rule-name-space-after": null,
8+
"comment-empty-line-before": null,
9+
"declaration-bang-space-before": null,
10+
"declaration-empty-line-before": null,
11+
"function-comma-newline-after": null,
12+
"function-name-case": null,
13+
"function-parentheses-newline-inside": null,
14+
"function-max-empty-lines": null,
15+
"function-whitespace-after": null,
16+
"number-leading-zero": null,
17+
"number-no-trailing-zeros": null,
18+
"rule-empty-line-before": null,
19+
"selector-combinator-space-after": null,
20+
"selector-list-comma-newline-after": null,
21+
"selector-pseudo-element-colon-notation": null,
22+
"unit-no-unknown": null,
23+
"value-list-max-empty-lines": null
24+
}
25+
}

bizui/.travis.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
language: node_js
2+
3+
node_js:
4+
- "8"
5+
6+
env:
7+
matrix:
8+
- TEST_TYPE=lint
9+
- TEST_TYPE=test-all
10+
- TEST_TYPE=test-dist
11+
12+
addons:
13+
apt:
14+
packages:
15+
- xvfb
16+
17+
install:
18+
- export DISPLAY=':99.0'
19+
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
20+
- npm install
21+
22+
script:
23+
- |
24+
if [ "$TEST_TYPE" = lint ]; then
25+
npm run lint
26+
elif [ "$TEST_TYPE" = test-all ]; then
27+
npm run test:all
28+
elif [ "$TEST_TYPE" = test-dist ]; then
29+
npm run site
30+
mv dist/* ./
31+
php -S localhost:8000 &
32+
npm test .e2e.js
33+
fi

bizui/.webpackrc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const path = require('path');
2+
3+
export default {
4+
entry: 'src/index.js',
5+
extraBabelPlugins: [
6+
['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }],
7+
],
8+
env: {
9+
development: {
10+
extraBabelPlugins: ['dva-hmr'],
11+
},
12+
},
13+
alias: {
14+
components: path.resolve(__dirname, 'src/components/'),
15+
},
16+
ignoreMomentLocale: true,
17+
theme: './src/theme.js',
18+
html: {
19+
template: './src/index.ejs',
20+
},
21+
disableDynamicImport: true,
22+
publicPath: '',
23+
hash: true,
24+
};

0 commit comments

Comments
 (0)