Skip to content

Commit

Permalink
Merge branch '4.1-dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
zuiidea committed Apr 14, 2017
2 parents f7616d5 + 4f673b6 commit db8b283
Show file tree
Hide file tree
Showing 51 changed files with 531 additions and 729 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"no-eval": 0,
"react/jsx-no-bind": 0,
"no-unused-vars": [2, { "ignoreRestSiblings": true }],
"no-underscore-dangle": 0,
},
"parser": "babel-eslint",
"parserOptions": {
Expand Down
26 changes: 26 additions & 0 deletions .roadhogrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const path = require('path')

const svgSpriteDirs = [
path.resolve(__dirname, 'src/svg/'),
]

export default {
entry: 'src/index.js',
svgSpriteLoaderDirs: svgSpriteDirs,
"theme": "./theme.config.js",
"env": {
"development": {
"extraBabelPlugins": [
"dva-hmr",
"transform-runtime",
["import", { "libraryName": "antd", "style": true }]
]
},
"production": {
"extraBabelPlugins": [
"transform-runtime",
["import", { "libraryName": "antd", "style": true}]
]
}
}
}
5 changes: 5 additions & 0 deletions .roadhogrc.mock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const mock = {}
require('fs').readdirSync(require('path').join(__dirname + '/src/mock')).forEach(function(file) {
Object.assign(mock, require('./src/mock/' + file))
})
module.exports = mock
44 changes: 12 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,17 @@
- 基于[dva](https://github.com/dvajs/dva)动态加载 Model 和路由,按需加载
- 浅度响应式设计

## To do list

- [x] 登录页面
- [x] dashbord页面
- [x] 数字卡片
- [x] 实时天气卡片
- [x] 图表
- [x] 用户列表页面
- [x] 增删改查
- [x] 交互动效
- [x] 扩展UI组件
- [x] IconFont
- [x] DataTable
- [x] Search
- [x] DropOption
- [x] 基于Modal封装的layer方法
- [x] 加入dva-loading
- [x] 规范代码: EsLint; 自用[开发配置](assets/standard.md)
- [ ] 数据可视化页面
- [ ] 模拟消息收发
- [ ] 升级dva-cli

## 开发及构建
## 更新日志

### 4.1

`2017-04-14`

- 升级开发工具为[roadhog](https://github.com/sorrycc/roadhog)
- 使用`roadhog`的mock功能
- 增强`utils/request.js`跨域处理能力

## 开发构建

### 目录结构

Expand Down Expand Up @@ -84,6 +72,7 @@
进入目录安装依赖:

npm i 或者 yarn install
npm i [email protected] -g

开发:

Expand All @@ -107,15 +96,6 @@ npm run build
npm run lint
```

### 注意事项

- 生产环境中,已有数据接口,请将`src/utils/index.js`第四行 `require('./mock.js')`注释
- 开发环境中,如再mock目录新增文件,请在`src/utils/mock.js`第二行的`mockData`数组中添加
- 如需重写antd样式配置,请修改`src/theme.js`
- 项目配置文件在`src/utils/config.js`
- 如需重写异步请求函数,请修改`src/utils/request.js`
(关于为什么使用axios而不是fetch:在一个无服务器的环境中模拟数据请求,[Mock](https://github.com/nuysoft/Mock)不能拦截Fetch)

## 参考

用户列表:<https://github.com/dvajs/dva/tree/master/examples/user-dashboard>
Expand Down
78 changes: 0 additions & 78 deletions mock/app.js

This file was deleted.

111 changes: 0 additions & 111 deletions mock/users.js

This file was deleted.

30 changes: 10 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{
"private": true,
"entry": {
"index": "./src/index.js"
},
"dependencies": {
"antd": "^2.7.3",
"antd": "^2.9.1",
"classnames": "^2.2.5",
"draftjs-to-markdown": "^0.4.0",
"dva": "^1.1.0",
"dva-loading": "^0.2.0",
"js-cookie": "^2.1.3",
"lodash": "^4.17.4",
"qs": "^6.2.0",
"react": "^15.4.1",
Expand All @@ -20,40 +16,34 @@
"recharts": "^0.19.0"
},
"devDependencies": {
"atool-build": "^0.7.6",
"antd": "^2.9.1",
"axios": "^0.15.3",
"babel-eslint": "^6.0.4",
"babel-eslint": "^6.1.2",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-dva-hmr": "^0.1.0",
"babel-plugin-import": "^1.0.1",
"babel-plugin-dva-hmr": "^0.3.2",
"babel-plugin-import": "^1.1.1",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-polyfill": "^6.23.0",
"babel-runtime": "^6.9.2",
"dora": "^0.4.3",
"dora-plugin-browser-history": "^0.2.0",
"dora-plugin-proxy": "^0.8.5",
"dora-plugin-webpack": "^0.8.1",
"dora-plugin-webpack-hmr": "^0.2.1",
"draftjs-to-html": "^0.7.0",
"eslint": "^3.17.1",
"eslint-config-airbnb": "^9.0.1",
"eslint-plugin-import": "^1.16.0",
"eslint-plugin-jsx-a11y": "^1.4.2",
"eslint-plugin-react": "^5.1.1",
"glob": "^7.0.5",
"jsonp": "^0.2.1",
"less-vars-to-js": "^1.1.2",
"mockjs": "^1.0.1-beta3",
"rc-tween-one": "^1.0.0",
"redbox-react": "^1.2.10",
"watchjs": "^0.0.0"
"redbox-react": "^1.2.10"
},
"pre-commit": [
"lint"
],
"scripts": {
"start": "dora --plugins \"proxy,webpack?publicPath=/,webpack-hmr,browser-history?index=/src/index.html\"",
"dev": "dora --plugins \"webpack?publicPath=/,webpack-hmr,browser-history?index=/src/index.html\"",
"dev": "set BROWSER=none&&roadhog server",
"lint": "eslint --fix --ext .js src",
"build": "atool-build"
"build": "roadhog build"
},
"theme": "./src/theme.js",
"standard": {
Expand Down
7 changes: 0 additions & 7 deletions proxy.config.js

This file was deleted.

20 changes: 0 additions & 20 deletions src/_index.html

This file was deleted.

Loading

0 comments on commit db8b283

Please sign in to comment.