diff --git a/ShadowEditor.Web/locales/zh-CN.json b/ShadowEditor.Web/locales/zh-CN.json index f5a05b7e..779485a2 100644 --- a/ShadowEditor.Web/locales/zh-CN.json +++ b/ShadowEditor.Web/locales/zh-CN.json @@ -741,5 +741,5 @@ "Department Management": "组织机构管理", "User Management": "用户管理", "Role Management": "角色管理", - "Authority management": "权限管理" + "Authority Management": "权限管理" } \ No newline at end of file diff --git a/ShadowEditor.Web/src/editor/menu/SystemMenu.jsx b/ShadowEditor.Web/src/editor/menu/SystemMenu.jsx index 95fd1e26..41109a4d 100644 --- a/ShadowEditor.Web/src/editor/menu/SystemMenu.jsx +++ b/ShadowEditor.Web/src/editor/menu/SystemMenu.jsx @@ -1,4 +1,7 @@ import { classNames, PropTypes, MenuBar, MenuItem, MenuItemSeparator } from '../../third_party'; +import UserManagementWindow from './window/UserManagementWindow.jsx'; +import RoleManageWindow from './window/RoleManageWindow.jsx'; +import AuthorityManagementWindow from './window/AuthorityManagementWindow.jsx'; /** * 系统菜单 @@ -8,7 +11,6 @@ class SystemMenu extends React.Component { constructor(props) { super(props); - this.handleDepartment = this.handleDepartment.bind(this); this.handleUser = this.handleUser.bind(this); this.handleRole = this.handleRole.bind(this); this.handleAuthority = this.handleAuthority.bind(this); @@ -18,24 +20,23 @@ class SystemMenu extends React.Component { return - + ; } - handleDepartment() { - - } - handleUser() { - + const win = app.createElement(UserManagementWindow); + app.addElement(win); } handleRole() { - + const win = app.createElement(RoleManageWindow); + app.addElement(win); } handleAuthority() { - + const win = app.createElement(AuthorityManagementWindow); + app.addElement(win); } } diff --git a/ShadowEditor.Web/src/editor/menu/window/AuthorityManagementWindow.jsx b/ShadowEditor.Web/src/editor/menu/window/AuthorityManagementWindow.jsx new file mode 100644 index 00000000..36265aae --- /dev/null +++ b/ShadowEditor.Web/src/editor/menu/window/AuthorityManagementWindow.jsx @@ -0,0 +1,67 @@ +import './css/AuthorityManagementWindow.css'; +import { PropTypes, Window, Content, Buttons, Form, FormControl, Label, Input, Button } from '../../../third_party'; +import Ajax from '../../../utils/Ajax'; + +/** + * 权限管理窗口 + * @author tengge / https://github.com/tengge1 + */ +class AuthorityManagementWindow extends React.Component { + constructor(props) { + super(props); + + this.state = { + username: '', + password: '', + }; + + this.handleChange = this.handleChange.bind(this); + this.handleSave = this.handleSave.bind(this, props.callback); + this.handleClose = this.handleClose.bind(this); + } + + render() { + const { username, password } = this.state; + + return + +
+ + + + + + + + +
+
+ + + + +
; + } + + handleChange(name, value) { + this.setState({ + [name]: value, + }); + } + + handleSave() { + this.handleClose(); + app.toast(_t('Login successfully!')); + } + + handleClose() { + app.removeElement(this); + } +} + +export default AuthorityManagementWindow; \ No newline at end of file diff --git a/ShadowEditor.Web/src/editor/menu/window/RoleManageWindow.jsx b/ShadowEditor.Web/src/editor/menu/window/RoleManageWindow.jsx index fca70bb5..a448a139 100644 --- a/ShadowEditor.Web/src/editor/menu/window/RoleManageWindow.jsx +++ b/ShadowEditor.Web/src/editor/menu/window/RoleManageWindow.jsx @@ -24,8 +24,8 @@ class RoleManageWindow extends React.Component { const { username, password } = this.state; return diff --git a/ShadowEditor.Web/src/editor/menu/window/UserManagementWindow.jsx b/ShadowEditor.Web/src/editor/menu/window/UserManagementWindow.jsx new file mode 100644 index 00000000..ee3e55c1 --- /dev/null +++ b/ShadowEditor.Web/src/editor/menu/window/UserManagementWindow.jsx @@ -0,0 +1,67 @@ +import './css/UserManagementWindow.css'; +import { PropTypes, Window, Content, Buttons, Form, FormControl, Label, Input, Button } from '../../../third_party'; +import Ajax from '../../../utils/Ajax'; + +/** + * 用户管理窗口 + * @author tengge / https://github.com/tengge1 + */ +class UserManagementWindow extends React.Component { + constructor(props) { + super(props); + + this.state = { + username: '', + password: '', + }; + + this.handleChange = this.handleChange.bind(this); + this.handleSave = this.handleSave.bind(this, props.callback); + this.handleClose = this.handleClose.bind(this); + } + + render() { + const { username, password } = this.state; + + return + +
+ + + + + + + + +
+
+ + + + +
; + } + + handleChange(name, value) { + this.setState({ + [name]: value, + }); + } + + handleSave() { + this.handleClose(); + app.toast(_t('Login successfully!')); + } + + handleClose() { + app.removeElement(this); + } +} + +export default UserManagementWindow; \ No newline at end of file diff --git a/ShadowEditor.Web/src/editor/menu/window/css/AuthorityManagementWindow.css b/ShadowEditor.Web/src/editor/menu/window/css/AuthorityManagementWindow.css new file mode 100644 index 00000000..e69de29b diff --git a/ShadowEditor.Web/src/editor/menu/window/css/RoleManageWindow.css b/ShadowEditor.Web/src/editor/menu/window/css/RoleManageWindow.css new file mode 100644 index 00000000..e69de29b diff --git a/ShadowEditor.Web/src/editor/menu/window/css/UserManagementWindow.css b/ShadowEditor.Web/src/editor/menu/window/css/UserManagementWindow.css new file mode 100644 index 00000000..e69de29b