Skip to content

Commit c540b8e

Browse files
committed
dupi optimize webpack,add dll config
1 parent a0f7f37 commit c540b8e

File tree

15 files changed

+619
-423
lines changed

15 files changed

+619
-423
lines changed

app/configs/router.config.js

Lines changed: 65 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ import { Router, Route, IndexRoute, hashHistory/* , Redirect */ } from 'react-ro
33
import { isLogin } from '@configs/common'
44
import { set } from '@config'
55

6-
import * as base from '@pages/base' // 基础
7-
import * as sysSet from '@pages/setCenter' // 设置中心-系统设置
6+
// import * as base from '@pages/base' // 基础
7+
// import * as sysSet from '@pages/setCenter' // 设置中心-系统设置
88
// import * as menu from '@pages/menu' // 菜单
9+
// 图表
10+
const wrap = (location, cb) => {
11+
require.ensure([], (require) => {
12+
cb(null, require('../pages/base/app').default)
13+
}, 'wrap')
14+
}
915

1016
// 图表
1117
const echarts = (location, cb) => {
@@ -28,23 +34,72 @@ const editor = (location, cb) => {
2834
}, 'editor')
2935
}
3036

37+
// 示例页面
38+
const example = (location, cb) => {
39+
require.ensure([], (require) => {
40+
cb(null, require('../pages/base/example').default)
41+
}, 'example')
42+
}
43+
44+
// 用户管理
45+
const login = (location, cb) => {
46+
require.ensure([], (require) => {
47+
cb(null, require('../pages/base/login').default)
48+
}, 'login')
49+
}
50+
51+
// welcome
52+
const welcome = (location, cb) => {
53+
require.ensure([], (require) => {
54+
cb(null, require('../pages/base/welcome').default)
55+
}, 'welcome')
56+
}
57+
58+
// 用户管理
59+
const userManage = (location, cb) => {
60+
require.ensure([], (require) => {
61+
cb(null, require('../pages/setCenter/sys/userManage').default)
62+
}, 'userManage')
63+
}
64+
65+
// 角色管理
66+
const roleManage = (location, cb) => {
67+
require.ensure([], (require) => {
68+
cb(null, require('../pages/setCenter/sys/roleManage').default)
69+
}, 'roleManage')
70+
}
71+
72+
// 模块管理
73+
const moduleManage = (location, cb) => {
74+
require.ensure([], (require) => {
75+
cb(null, require('../pages/setCenter/sys/moduleManage').default)
76+
}, 'moduleManage')
77+
}
78+
79+
// 404
80+
const notfound = (location, cb) => {
81+
require.ensure([], (require) => {
82+
cb(null, require('../pages/base/notfound').default)
83+
}, 'notfound')
84+
}
85+
3186
export default () => (
3287
<Router history={hashHistory}>
33-
<Route path="/" component={base.app} onEnter={isLogin}>
34-
<IndexRoute component={base.welcome} />
35-
<Route path="/desk$/index" component={base.example} />
88+
<Route path="/" getComponent={wrap} onEnter={isLogin}>
89+
<IndexRoute getComponent={welcome} />
90+
<Route path="/desk$/index" getComponent={example} />
3691
{/** *菜单 开始 */}
3792
<Route path="/echarts" getComponent={echarts} />
3893
<Route path="/editor" getComponent={editor} />
3994
<Route path="/chat" getComponent={chat} />
4095
{/** *菜单 结束 */}
4196
{/** *系统设置 开始 */}
42-
<Route path={`/${set}/userManage`} component={sysSet.userManage} />
43-
<Route path={`/${set}/roleManage`} component={sysSet.roleManage} />
44-
<Route path={`/${set}/moduleManage`} component={sysSet.moduleManage} />
97+
<Route path={`/${set}/userManage`} getComponent={userManage} />
98+
<Route path={`/${set}/roleManage`} getComponent={roleManage} />
99+
<Route path={`/${set}/moduleManage`} getComponent={moduleManage} />
45100
{/** *系统设置 结束 */}
46101
</Route>
47-
<Route path="/login" component={base.login} />
48-
<Route path="*" component={base.notfound} />
102+
<Route path="/login" getComponent={login} />
103+
<Route path="*" getComponent={notfound} />
49104
</Router>
50105
)

app/pages/base/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react'
22
// import PropTypes from 'prop-types'
3-
import { } from 'antd'
3+
// import { } from 'antd'
44
// import {connect} from 'react-redux'
55
// import {} from '@actions/xxx'
66

app/pages/base/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22

33
import developing from './developing'
4-
import example from './example'
5-
import login from './login'
4+
// import example from './example'
5+
// import login from './login'
66
import notfound from './notfound'
77
import welcome from './welcome'
88
import app from './app'
99

10-
export { developing, example, login, notfound, welcome, app }
10+
export { developing, /* example, login, */notfound, welcome, app }

app/pages/base/login.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ export default class Login extends Component {
9292
console.log(this.props.loginResponse)
9393
return (
9494
<div className="login-container">
95-
<div className="extraLink">
96-
<a href="http://56.32.3.185:7777/pgis/html/prologue/prologue.html" target="_blank" rel="noopener noreferrer">数据承载</a>
97-
<a href="http://56.32.3.123:8080/search/sspt/datasearch/prologue.html" target="_blank" rel="noopener noreferrer">数据纽带</a>
98-
</div>
95+
<div className="extraLink" />
9996
<div className="flexcolumn">
10097
<div className="login-header" key="header">
10198
<div className="slogan">

app/pages/example.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

app/pages/setCenter/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
import '@styles/set.less'
3-
import userManage from './sys/userManage'
4-
import roleManage from './sys/roleManage'
5-
import moduleManage from './sys/moduleManage'
3+
// import userManage from './sys/userManage'
4+
// import roleManage from './sys/roleManage'
5+
// import moduleManage from './sys/moduleManage'
66

7-
export { userManage, roleManage, moduleManage }
7+
// export { userManage, roleManage, moduleManage }

app/pages/setCenter/sys/moduleManage/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
fetchModuleAdd, // 新增模块
1313
fetchButtonList, // 按钮权限列表
1414
} from '@apis/manage'
15+
import '@styles/set.less'
1516

1617
import ModuleList from './moduleList'
1718
import ModuleModal from './modal/moduleAdd' // 新增修改模块

app/pages/setCenter/sys/roleManage/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
fetchUpdateButton,
1919
fetchTreeList,
2020
} from '@apis/manage'
21+
import '@styles/set.less'
2122
import RolesList from './roleList'
2223
import RolesModule from './roleModuleList'
2324
import PeopleTree from './peopleTreeList'

app/pages/setCenter/sys/userManage/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
fetchRoleList,
1212
fetchChangeUserStatus,
1313
} from '@apis/manage'
14+
import '@styles/set.less'
1415
import TreeList from './treeList'
1516
import AddPolice from './modal/addPolice'
1617
import SelectRole from './modal/selectRole'

0 commit comments

Comments
 (0)