From 141ee83bd7986cb25eaf613249c934033a41c3df Mon Sep 17 00:00:00 2001
From: tengge1 <930372551@qq.com>
Date: Tue, 17 Sep 2019 21:28:08 +0800
Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E3=80=81=E8=A7=92=E8=89=B2?=
=?UTF-8?q?=E3=80=81=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86=E7=AA=97=E5=8F=A3?=
=?UTF-8?q?=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ShadowEditor.Web/locales/zh-CN.json | 2 +-
.../src/editor/menu/SystemMenu.jsx | 19 +++---
.../menu/window/AuthorityManagementWindow.jsx | 67 +++++++++++++++++++
.../editor/menu/window/RoleManageWindow.jsx | 4 +-
.../menu/window/UserManagementWindow.jsx | 67 +++++++++++++++++++
.../window/css/AuthorityManagementWindow.css | 0
.../menu/window/css/RoleManageWindow.css | 0
.../menu/window/css/UserManagementWindow.css | 0
8 files changed, 147 insertions(+), 12 deletions(-)
create mode 100644 ShadowEditor.Web/src/editor/menu/window/AuthorityManagementWindow.jsx
create mode 100644 ShadowEditor.Web/src/editor/menu/window/UserManagementWindow.jsx
create mode 100644 ShadowEditor.Web/src/editor/menu/window/css/AuthorityManagementWindow.css
create mode 100644 ShadowEditor.Web/src/editor/menu/window/css/RoleManageWindow.css
create mode 100644 ShadowEditor.Web/src/editor/menu/window/css/UserManagementWindow.css
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