diff --git a/.eslintrc b/.eslintrc index 4b64c8d3..8af3be8e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,9 @@ { /* See all the pre-defined configs here: https://www.npmjs.com/package/eslint-config-defaults */ - "extends": "defaults/configurations/eslint", + "extends": [ + "eslint:recommended", + "plugin:react/recommended" + ], "parser": "babel-eslint", "ecmaFeatures": { "jsx": true @@ -17,7 +20,6 @@ "worker": true }, "rules": { - "eqeqeq": 2, "comma-dangle": 1, "no-console": 0, @@ -31,11 +33,12 @@ "semi-spacing": 1, "valid-jsdoc": [ 2, - { "requireReturn": false } + { + "requireReturn": false + } ], - "react/display-name": 2, - "react/forbid-prop-types": 1, + "react/forbid-prop-types": 0, "react/jsx-boolean-value": 1, "react/jsx-closing-bracket-location": 1, "react/jsx-curly-spacing": 1, @@ -55,7 +58,7 @@ "react/no-multi-comp": 1, "react/no-set-state": 0, "react/no-unknown-property": 1, - "react/prop-types":0, + "react/prop-types": 0, "react/react-in-jsx-scope": 0, "react/require-extension": 0, "react/self-closing-comp": 1, diff --git a/ShadowEditor.Web/locales/zh-CN.json b/ShadowEditor.Web/locales/zh-CN.json index 47bcf67a..a0a2953f 100644 --- a/ShadowEditor.Web/locales/zh-CN.json +++ b/ShadowEditor.Web/locales/zh-CN.json @@ -839,5 +839,6 @@ "Delete User": "删除用户", "RoleID is not defined.": "RoleID未定义。", "Authorities is not defined.": "Authorities未定义。", - "Role": "角色" + "Role": "角色", + "Initialization": "初始化" } \ 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 df7fed7b..19c41d24 100644 --- a/ShadowEditor.Web/src/editor/menu/SystemMenu.jsx +++ b/ShadowEditor.Web/src/editor/menu/SystemMenu.jsx @@ -11,6 +11,7 @@ class SystemMenu extends React.Component { constructor(props) { super(props); + this.handleInitialization = this.handleInitialization.bind(this); this.handleUser = this.handleUser.bind(this); this.handleRole = this.handleRole.bind(this); this.handleAuthority = this.handleAuthority.bind(this); @@ -18,13 +19,19 @@ class SystemMenu extends React.Component { render() { return - - - - + + + + + + ; } + handleInitialization() { + debugger; + } + handleUser() { const win = app.createElement(UserManageWindow); app.addElement(win); diff --git a/ShadowEditor.Web/src/editor/system/LoginWindow.jsx b/ShadowEditor.Web/src/editor/system/LoginWindow.jsx index 9ff1edc8..2ecc2bc6 100644 --- a/ShadowEditor.Web/src/editor/system/LoginWindow.jsx +++ b/ShadowEditor.Web/src/editor/system/LoginWindow.jsx @@ -21,7 +21,7 @@ class LoginWindow extends React.Component { } render() { - const { username, password } = this.state; + const { username, password, passwordType } = this.state; return ; + onInput={this.handleInput} + />; + } + + handleFocus(onFocus, event) { + onFocus && onFocus(event); } handleChange(onChange, event) { @@ -79,8 +86,9 @@ Input.propTypes = { precision: PropTypes.number, disabled: PropTypes.bool, show: PropTypes.bool, + onFocus: PropTypes.func, onChange: PropTypes.func, - onInput: PropTypes.func, + onInput: PropTypes.func }; Input.defaultProps = { @@ -95,8 +103,9 @@ Input.defaultProps = { precision: 3, disabled: false, show: true, + onFocus: null, onChange: null, - onInput: null, + onInput: null }; export default Input; \ No newline at end of file