@@ -331,9 +377,11 @@ export default class index extends Component {
}
- onClick={() => this.onOpen(this.addForm)}
+ onClick={() =>
+ this.onOpen({ modal: this.addForm, addType: [0, 1] })
+ }
>
- 新增{name}
+ 新增目录/菜单
}
diff --git a/web-react/src/pages/system/user/index.jsx b/web-react/src/pages/system/user/index.jsx
index 7418764..f40c684 100644
--- a/web-react/src/pages/system/user/index.jsx
+++ b/web-react/src/pages/system/user/index.jsx
@@ -21,6 +21,7 @@ import getDictData from 'util/dic'
import FormBody from './form'
import RoleForm from './role'
import DataForm from './data'
+import auth from 'components/authorized/handler'
// 配置页面所需接口函数
const apiAction = {
@@ -209,25 +210,25 @@ export default class index extends Component {
this.onResetPassword(record)}>重置密码
,
-
+
-
-
+ {auth('sysUser:grantRole') && (
+
this.onOpen(this.roleForm, record)}>
授权角色
-
-
-
+ )}
+ {auth('sysUser:grantData') && (
+
this.onOpen(this.dataForm, record)}>
授权额外数据
-
+ )}
}
>
diff --git a/web-react/src/store/reducer/layout.js b/web-react/src/store/reducer/layout.js
index 7f2fa41..1441e84 100644
--- a/web-react/src/store/reducer/layout.js
+++ b/web-react/src/store/reducer/layout.js
@@ -1,6 +1,21 @@
-const layout = (state = {
- siderCollapsed: false
-}, action) => {
+import { SETTING_KEY } from "common/storage"
+import { SIDER_BREAK_POINT } from "util/global"
+
+const defaultState = {
+ siderCollapsed: false,
+ allowSiderCollapsed: true
+}
+
+const localStorageState = () => {
+ return JSON.parse(window.localStorage.getItem(SETTING_KEY)) || {}
+}
+
+const mergeState = {
+ ...defaultState,
+ ...localStorageState()
+}
+
+const layout = (state = mergeState, action) => {
switch (action.type) {
// 打开窗口
case 'OPEN_WINDOW':
@@ -13,8 +28,23 @@ const layout = (state = {
return state
// 侧边收起状态
case 'TOGGLE_COLLAPSED':
- const _state = { ...state, siderCollapsed: action.siderCollapsed }
- return _state
+ {
+ if (window.innerWidth <= SIDER_BREAK_POINT) {
+ return state
+ }
+ const _state = { ...state, siderCollapsed: action.siderCollapsed }
+ window.localStorage.setItem(SETTING_KEY, JSON.stringify(_state))
+ return _state
+ }
+ case 'AUTO_TOGGLE_COLLAPSED':
+ {
+ const _state = {
+ ...state,
+ siderCollapsed: localStorageState().siderCollapsed || action.siderCollapsed,
+ allowSiderCollapsed: !action.siderCollapsed
+ }
+ return _state
+ }
default:
return state
}
diff --git a/web-react/src/util/global/index.js b/web-react/src/util/global/index.js
index 2543e20..918cb47 100644
--- a/web-react/src/util/global/index.js
+++ b/web-react/src/util/global/index.js
@@ -36,4 +36,6 @@ export const RSA_PUBLIC_KEY = '-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQU
/**
* 城市名称
*/
-export const CITY = '黄石市'
\ No newline at end of file
+export const CITY = '黄石市'
+
+export const SIDER_BREAK_POINT = 1366
\ No newline at end of file
diff --git a/web-react/src/views/main/_layout/content/index.jsx b/web-react/src/views/main/_layout/content/index.jsx
index 73f2ad5..e52b045 100644
--- a/web-react/src/views/main/_layout/content/index.jsx
+++ b/web-react/src/views/main/_layout/content/index.jsx
@@ -20,7 +20,6 @@ class ComponentDynamic extends Component {
if (this.props.onRef) {
this.props.onRef(this)
}
-
return true
}
@@ -73,6 +72,40 @@ class ComponentDynamic extends Component {
}
}
+class Iframe extends Component {
+ shouldComponentUpdate() {
+ if (this.props.onRef) {
+ this.props.onRef(this)
+ }
+ return true
+ }
+
+ componentDidMount() {
+ if (this.props.onRef) {
+ this.props.onRef(this)
+ }
+ this.loadComponent()
+ }
+
+ loadComponent() {
+ NProgress.start()
+ const iframe = this.refs.content
+ iframe.onload = () => {
+ NProgress.done()
+ }
+ iframe.onerror = () => {
+ NProgress.done()
+ }
+ iframe.src = this.props.src
+ }
+
+ render() {
+ const { title } = this.props
+
+ return
+ }
+}
+
export default class index extends Component {
state = {
actived: '',
@@ -191,14 +224,23 @@ export default class index extends Component {
' yo-tab-external-tabpane'
}
>
- this.panes.push(p)}
- />
+ {pane.openType === 1 ? (
+ this.panes.push(p)}
+ />
+ ) : pane.openType === 2 ? (
+
)
})}
diff --git a/web-react/src/views/main/_layout/header/index.jsx b/web-react/src/views/main/_layout/header/index.jsx
index c0e0b01..ccf9f9d 100644
--- a/web-react/src/views/main/_layout/header/index.jsx
+++ b/web-react/src/views/main/_layout/header/index.jsx
@@ -33,13 +33,20 @@ export default class index extends Component {
}
render() {
+ const { allowSiderCollapsed } = this.state
+
return (