From 86340fa35f2e2c5e666ea560d1d844425211b3a6 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 19 Jul 2019 13:49:42 +0800 Subject: [PATCH 1/7] ccc --- public/react/src/App.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/react/src/App.css b/public/react/src/App.css index a9d02d4f0..c41e039c4 100644 --- a/public/react/src/App.css +++ b/public/react/src/App.css @@ -35,6 +35,10 @@ .editormd .CodeMirror-linenumbers { padding: 0; } +.editormd-html-preview hr, .editormd-preview-container hr { + /* 颜色加深 */ + border-top: 1px solid #ccc; +} /* 重置掉antd的一些样式 */ html, body { From 1ca57dcc6aaf36cd2c2fb5c452b0e746d9512cf4 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 19 Jul 2019 13:55:09 +0800 Subject: [PATCH 2/7] css --- public/react/src/modules/user/account/AccountBasicEdit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 7d1986bd0..e4db50d51 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -360,7 +360,7 @@ class AccountBasic extends Component { font-size:14px; } .resetCityStyle .ant-form-item-control{ - width:190px; + width:220px; } `}
基本信息
From 7d9d2581d77711edc635239f91ac477b18ed7f52 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 19 Jul 2019 14:10:45 +0800 Subject: [PATCH 3/7] def --- public/react/src/modules/user/account/AccountBasicEdit.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index e4db50d51..2362437fb 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -251,6 +251,9 @@ class AccountBasic extends Component { this.props.form.setFieldsValue({ org2:result.data.departments[0].name }) + this.setState({ + department_id: result.data.departments[0].id + }) } } }).catch((error)=>{ From 3e648171683162a75e98bc85ea705686cac5d214 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 19 Jul 2019 15:18:58 +0800 Subject: [PATCH 4/7] city --- .../react/src/common/components/form/City.js | 13 +++++-- .../modules/user/account/AccountBasicEdit.js | 35 ++++++++++--------- .../modules/user/modal/ApplyForAddOrgModal.js | 12 ++++--- 3 files changed, 37 insertions(+), 23 deletions(-) diff --git a/public/react/src/common/components/form/City.js b/public/react/src/common/components/form/City.js index dea65877b..b397c8b59 100644 --- a/public/react/src/common/components/form/City.js +++ b/public/react/src/common/components/form/City.js @@ -1719,6 +1719,10 @@ const options = [{ label: '其他' }], }]; + +function filter(inputValue, path) { + return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1); +} class City extends Component{ constructor(props){ super(props); @@ -1739,11 +1743,16 @@ class City extends Component{ } } render(){ - const { defaultValue } = this.props + const { defaultValue, matchInputWidth, className, popupClassName } = this.props const { value } = this.state + // 这里用请选择所在省市的话,会触发chrome的地址选择 return( - ) } diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 2362437fb..182730170 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -110,11 +110,7 @@ class AccountBasic extends Component { this.props.form.validateFieldsAndScroll((err, values) => { console.log(values); let {basicInfo}=this.props; - // TODO 为什么modal里的form影响到这里的了 - if (err) { - delete err.depart - } - if(!err || Object.keys(err).length == 0){ + if(!err ){ let url=`/users/accounts/${basicInfo.id}.json` axios.put((url),{ nickname:values.nickname, @@ -202,16 +198,18 @@ class AccountBasic extends Component { } //搜索部门 searchDepartment=(e)=>{ - this.props.form.setFieldsValue({ - org2:e - }) - let arr = this.state.departments.filter(function(item){ - return item.name.indexOf(e) > -1 - }) - this.setState({ - filterDepartments:arr, - departmentsName:e - }) + if (e) { + this.props.form.setFieldsValue({ + org2:e + }) + let arr = this.state.departments.filter(function(item){ + return item.name.indexOf(e) > -1 + }) + this.setState({ + filterDepartments:arr, + departmentsName:e + }) + } } // 选择部门、学院 @@ -306,12 +304,15 @@ class AccountBasic extends Component { const { getFieldDecorator } = this.props.form; let{basicInfo}=this.props + // form合并了 + const propsWithoutForm = Object.assign({}, this.props) + delete propsWithoutForm.form return (
this.applyForAddOrgForm = form} schoolName={school} - {...this.props}> + {...propsWithoutForm}> this.applyForAddChildOrgForm = form} > + {...propsWithoutForm} wrappedComponentRef={(form) => this.applyForAddChildOrgForm = form} >
+ )} From 7aabf036f836a8b6cc320f1cffc8bfb350e7d4c7 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 19 Jul 2019 15:33:41 +0800 Subject: [PATCH 5/7] load --- public/react/src/modules/user/AccountPage.js | 16 +++++++++++ .../src/modules/user/account/AccountNav.js | 2 +- .../react/src/modules/user/account/common.css | 27 +++++-------------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/public/react/src/modules/user/AccountPage.js b/public/react/src/modules/user/AccountPage.js index 25c9f7198..3d34b3e13 100644 --- a/public/react/src/modules/user/AccountPage.js +++ b/public/react/src/modules/user/AccountPage.js @@ -79,6 +79,22 @@ class AccountPage extends Component { .accountPage { display: flex; } + .basicFormWrap{ + flex:1; + width: 0; + } + + /* 左侧 */ + .accountNav { + width: 290px; + box-shadow: 0px 4px 9px 0px rgba(11,62,120,0.21); + border-radius: 2px; + padding-top: 8px; + padding-bottom: 30px; + margin-bottom:30px; + margin-right:20px; + height:418px; + } `}
diff --git a/public/react/src/modules/user/account/AccountNav.js b/public/react/src/modules/user/account/AccountNav.js index 5117eacc2..1ebbf3355 100644 --- a/public/react/src/modules/user/account/AccountNav.js +++ b/public/react/src/modules/user/account/AccountNav.js @@ -22,7 +22,7 @@ class AccountNav extends Component { return (
{ - basicInfo && + basicInfo && basicInfo.id &&
diff --git a/public/react/src/modules/user/account/common.css b/public/react/src/modules/user/account/common.css index d84686f59..6d1207325 100644 --- a/public/react/src/modules/user/account/common.css +++ b/public/react/src/modules/user/account/common.css @@ -45,29 +45,14 @@ button.ant-btn.ant-btn-primary.grayBtn { display: none; } -.basicFormWrap{ - flex:1; - width: 0; -} -/* .basicForm .ant-form-item-label { - width: 100px; - padding-right: 10px; -} - .basicForm .ant-form-item-label label { - color: #979797 - } */ - /* 左侧 */ - .accountNav { - width: 290px; - box-shadow: 0px 4px 9px 0px rgba(11,62,120,0.21); - border-radius: 2px; - padding-top: 8px; - padding-bottom: 30px; - margin-bottom:30px; - margin-right:20px; - height:418px; + /* .basicForm .ant-form-item-label { + width: 100px; + padding-right: 10px; } + .basicForm .ant-form-item-label label { + color: #979797 + } */ .accountInfo { text-align: center; display: flex; From 8b6ca86a83c69e0506a24166e33907b29c0294b0 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 19 Jul 2019 15:57:29 +0800 Subject: [PATCH 6/7] hidden --- .../src/modules/user/account/AccountBasic.js | 4 ++-- .../modules/user/account/AccountBasicEdit.js | 21 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/user/account/AccountBasic.js b/public/react/src/modules/user/account/AccountBasic.js index 80eee8fc7..aef66e5c2 100644 --- a/public/react/src/modules/user/account/AccountBasic.js +++ b/public/react/src/modules/user/account/AccountBasic.js @@ -3,7 +3,7 @@ import React, { Component } from 'react'; import { SnackbarHOC, getImageUrl, City } from 'educoder'; import { Form, Button, Input, Radio, Select, Tooltip, Icon } from 'antd' import './common.css' - +import { getHiddenName } from './AccountBasicEdit' const RadioGroup = Radio.Group; const Option = Select.Option @@ -70,7 +70,7 @@ class AccountBasicEdit extends Component { label="姓名" className="display formItemInline" > - {basicInfo && basicInfo.name} + {basicInfo && (basicInfo.show_realname == true ? basicInfo.name : getHiddenName(basicInfo.name))} { this.setState({ realName: name }) - const newName = this.getHiddenName(name) + const newName = getHiddenName(name) this.props.form.setFieldsValue({ name: newName @@ -406,7 +405,7 @@ class AccountBasic extends Component { { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' } :
- {showRealName ? this.props.basicInfo.name : this.getHiddenName(this.props.basicInfo.name)} + {showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)} this.showOrHide(showRealName)}> { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' } From 95037fa4cb22505f7a4604c01c2710dd462adbd7 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 19 Jul 2019 16:03:16 +0800 Subject: [PATCH 7/7] load --- .../src/modules/user/account/AccountNav.js | 52 +++++++++++++++++++ .../src/modules/user/account/AccountSecure.js | 23 ++++---- .../react/src/modules/user/account/common.css | 50 +----------------- 3 files changed, 65 insertions(+), 60 deletions(-) diff --git a/public/react/src/modules/user/account/AccountNav.js b/public/react/src/modules/user/account/AccountNav.js index 1ebbf3355..b0038e43b 100644 --- a/public/react/src/modules/user/account/AccountNav.js +++ b/public/react/src/modules/user/account/AccountNav.js @@ -21,6 +21,58 @@ class AccountNav extends Component { const isSecure = path.indexOf('secure') != -1 return (
+ { basicInfo && basicInfo.id && diff --git a/public/react/src/modules/user/account/AccountSecure.js b/public/react/src/modules/user/account/AccountSecure.js index 6cff4d901..29abf22e4 100644 --- a/public/react/src/modules/user/account/AccountSecure.js +++ b/public/react/src/modules/user/account/AccountSecure.js @@ -35,6 +35,9 @@ class AccountSecure extends Component { // 获取验证码倒计时 remainTime=()=>{ + this.setState({ + seconds: 60 + }) this.timer = setInterval(() => { let { seconds } =this.state; let s = parseInt(seconds)-1; @@ -53,7 +56,7 @@ class AccountSecure extends Component { // 获取验证码 getCode=(index)=>{ - let url=`/account/get_verification_code.json` + let url=`/accounts/get_verification_code.json` let login = ''; let values=this.props.form.getFieldsValue(); if(index == 3){ @@ -199,9 +202,11 @@ class AccountSecure extends Component { InputNewPassword=(rule,value,callback)=>{ const { form } = this.props; - if (value.length<8 || value.length>12) { - callback("请输入8-12个字符的新密码,区分大小写!"); - }else { + if (!value) { + callback("请输入8-16位字符的新密码,区分大小写!"); + } else if (value.length<8 || value.length>16) { + callback("请输入8-16位字符的新密码,区分大小写!"); + } else { callback(); } } @@ -283,7 +288,7 @@ class AccountSecure extends Component { : 未绑定 } - 绑定手机号码,将获得500金币的奖励哟~,手机号码仅自己可见~ + {basicInfo.phone ? '仅自己可见,可用手机号码登录EduCoder' : '绑定手机号码,将获得500金币的奖励哟~,手机号码仅自己可见~'}
{ updating != PHONE && @@ -305,10 +310,10 @@ class AccountSecure extends Component { rules: [{ // initialValue: this.state.cityDefaultValue, required: true, - message: '请输入要绑定的手机号码', + message: `请输入要${basicInfo.phone ? '更换' : '绑定'}的手机号码`, }], })( - + )} @@ -442,10 +447,6 @@ class AccountSecure extends Component { > {getFieldDecorator('p_new', { rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: '请输入8~16位的新密码,区分大小写', - },{ validator:this.InputNewPassword }], })( diff --git a/public/react/src/modules/user/account/common.css b/public/react/src/modules/user/account/common.css index 6d1207325..113b39e07 100644 --- a/public/react/src/modules/user/account/common.css +++ b/public/react/src/modules/user/account/common.css @@ -18,9 +18,7 @@ .flexRow { display: flex; } -.color-green-light{ - color: #45E660!important; -} + .mb15{margin-bottom: 15px!important;} /* BUTTOn */ .ant-btn { @@ -53,49 +51,3 @@ button.ant-btn.ant-btn-primary.grayBtn { .basicForm .ant-form-item-label label { color: #979797 } */ - .accountInfo { - text-align: center; - display: flex; - flex-direction: column; - align-items: center; - } - .accountInfo .name { - color: #05101A; - font-size: 24px; - height: 36px; - } - .accountInfo .role { - color: #666666; - font-size: 14px; - } - .accountManagement .title { - color: #05101A; - font-size: 18px; - font-weight: 400; - padding: 10px 28px; - margin-top: 6px; - } - .accountManagement .navItem { - font-size: 16px; - padding: 6px 0px; - padding-left: 30px; - border-left: 2px solid #fff; - cursor: pointer; - color:#4D4D4D; - } - .accountManagement .navItem i{ - margin-top: -4px; - display: inline-block; - margin-right: 7px; - } - .accountManagement .navItem i.status{ - margin-top: 1px; - margin-right: 24px; - } - .accountManagement .navItem.active { - border-left: 2px solid #4CACFF; - background: #E6F3FF; - } - .accountManagement .navItem.active i:first-child{ - color:#4CACFF!important; - } \ No newline at end of file