Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_home
杨树明 5 years ago
commit e31e2fa55f

@ -1539,7 +1539,7 @@ class CoursesController < ApplicationController
end
def course_statistics course, max_exp, limit
max_rate = 20.0 / max_exp
max_rate = max_exp.nil? ? 0 : 20.0 / max_exp
sql_select = %Q{ SELECT a.*, (message_num*0.2 + message_reply_num*0.1 + resource_num*0.5 + homework_journal_num*0.1 + graduation_num +
homework_num + exercise_num + poll_num*0.7 + exercise_score * 0.7 + graduation_score * 0.7 + homework_score * 0.7 + exp*#{max_rate})

@ -28,6 +28,7 @@ class AccountBasicEditItem extends Component {
label="职业"
className="formItemInline fl"
>
<ConditionToolTip title={() => (<div><p>已提交职业认证</p><p><a href="/account/certification" className="color-blue"></a></p></div>)} condition= { professionalFlag }>
{getFieldDecorator('job', {
rules: [{
initialValue:"teacher",
@ -41,6 +42,7 @@ class AccountBasicEditItem extends Component {
<Option value="professional">专业人士</Option>
</Select>
)}
</ConditionToolTip>
</Form.Item>
{
identity && identity=="student" &&
@ -50,6 +52,7 @@ class AccountBasicEditItem extends Component {
style={{ 'margin-top': '3px'}}
// style={{display:identity && identity=="student" ? "block":"none"}}
>
<ConditionToolTip title={() => (<div><p>已提交职业认证</p><p><a href="/account/certification" className="color-blue"></a></p></div>)} condition= { professionalFlag }>
{getFieldDecorator('student_No', {
rules: [{
required: true,
@ -58,6 +61,7 @@ class AccountBasicEditItem extends Component {
})(
<Input type="text" placeholder="请输入学号" style={{width:"190px"}} disabled={professionalFlag}></Input>
)}
</ConditionToolTip>
</Form.Item>
}
{
@ -67,6 +71,7 @@ class AccountBasicEditItem extends Component {
className="formItemInline fl"
// style={{display:identity && identity=="teacher" ? "block":"none"}}
>
<ConditionToolTip title={() => (<div><p>已提交职业认证</p><p><a href="/account/certification" className="color-blue"></a></p></div>)} condition= { professionalFlag }>
{getFieldDecorator('job1', {
rules: [{
initialValue:"教授",
@ -81,6 +86,7 @@ class AccountBasicEditItem extends Component {
<Option value="助教">助教</Option>
</Select>
)}
</ConditionToolTip>
</Form.Item>
}
{
@ -90,6 +96,7 @@ class AccountBasicEditItem extends Component {
className="formItemInline fl mb0"
// style={{display:identity && identity=="professional" ? "block":"none"}}
>
<ConditionToolTip title={() => (<div><p>已提交职业认证</p><p><a href="/account/certification" className="color-blue"></a></p></div>)} condition= { professionalFlag }>
{getFieldDecorator('job2', {
rules: [{
initialValue:"企业管理者",
@ -105,6 +112,7 @@ class AccountBasicEditItem extends Component {
<Option value="助理工程师">助理工程师</Option>
</Select>
)}
</ConditionToolTip>
</Form.Item>
}
</div>
@ -112,6 +120,7 @@ class AccountBasicEditItem extends Component {
label="学校/单位"
className="formItemInline mb0"
>
<ConditionToolTip title={() => (<div><p>已提交职业认证</p><p><a href="/account/certification" className="color-blue"></a></p></div>)} condition= { professionalFlag }>
{getFieldDecorator('org', {
rules: [{
// initialValue: this.state.cityDefaultValue,
@ -138,6 +147,7 @@ class AccountBasicEditItem extends Component {
}
</AutoComplete>
)}
</ConditionToolTip>
</Form.Item>
{!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school &&
@ -148,39 +158,40 @@ class AccountBasicEditItem extends Component {
</span>
</div>
}
<Form.Item
label="院系/部门"
className="formItemInline mb0"
style={{ 'margin-top': '10px'}}
>
{getFieldDecorator('org2', {
rules: [{
// initialValue: this.state.cityDefaultValue,
// type: 'array',
required: true,
message: '请先选择院系/部门',
// validator: (rule, value, callback) => {
// if (this.this_department_id) {
// callback();
// return;
// }
// callback('请先选择院系/部门');
// }
}],
})(
<AutoComplete width={400} showSearch onSearch={this.props.searchDepartment} onChange={this.props.changeDepartment} disabled={professionalFlag}>
{
filterDepartments && filterDepartments.map((item,key)=>{
return(
<Option value={item.name} key={item.name}>{item.name}</Option>
)
})
}
</AutoComplete>
)}
</Form.Item>
<Form.Item
label="院系/部门"
className="formItemInline mb0"
style={{ 'margin-top': '10px'}}
>
<ConditionToolTip title={() => (<div><p>已提交职业认证</p><p><a href="/account/certification" className="color-blue"></a></p></div>)} condition= { professionalFlag }>
{getFieldDecorator('org2', {
rules: [{
// initialValue: this.state.cityDefaultValue,
// type: 'array',
required: true,
message: '请先选择院系/部门',
// validator: (rule, value, callback) => {
// if (this.this_department_id) {
// callback();
// return;
// }
// callback('请先选择院系/部门');
// }
}],
})(
<AutoComplete width={400} showSearch onSearch={this.props.searchDepartment} onChange={this.props.changeDepartment} disabled={professionalFlag}>
{
filterDepartments && filterDepartments.map((item,key)=>{
return(
<Option value={item.name} key={item.name}>{item.name}</Option>
)
})
}
</AutoComplete>
)}
</ConditionToolTip>
</Form.Item>
{
filterDepartments != undefined && ( (filterDepartments && filterDepartments.length==0 )
|| (departmentsName == '' && ! department_id

@ -53,6 +53,7 @@ class RealNameCertificationModal extends Component{
schoolList:undefined,
departments:undefined,
showRealName:true,
realName:undefined
}
}
@ -137,16 +138,7 @@ class RealNameCertificationModal extends Component{
})
}
// 将名字隐藏起来
hideRealName=(name)=>{
this.setState({ realName: name })
const newName = getHiddenName(name)
this.props.form.setFieldsValue({
name: newName
})
return newName
}
getDepartments=(e,flag)=>{
let arr=this.state.schoolList.filter(function(item){
@ -257,11 +249,12 @@ class RealNameCertificationModal extends Component{
onSendOk = () => {
this.props.form.validateFieldsAndScroll((err, values) => {
// console.log(values);
// console.log(this.state.realName);
console.log(values);
console.log(this.state.showRealName ? values.name : this.state.realName);
// return;
if(!err){
let{imageUrl2,showRealName}=this.state;
let{current_user,basicInfo}=this.props;
let{ imageUrl2 , showRealName , realName }=this.state;
let{ current_user , basicInfo }=this.props;
if(imageUrl2){
let { certification } = this.props;
if(certification == 1){
@ -275,7 +268,7 @@ class RealNameCertificationModal extends Component{
}
axios.post((url),{
name:this.state.realName || basicInfo.name,
name:this.state.showRealName ? values.name : realName,
gender:parseInt(values.sex),
id_number:values.credentials,
show_realname:showRealName,
@ -422,6 +415,16 @@ class RealNameCertificationModal extends Component{
name: this.state.realName
})
}
}
// 将名字隐藏起来
hideRealName=(name)=>{
this.setState({ realName: name })
const newName = getHiddenName(name)
this.props.form.setFieldsValue({
name: newName
})
return newName
}
// 选择部门、学院
changeDepartment=(e)=>{
@ -463,7 +466,7 @@ class RealNameCertificationModal extends Component{
// /api/users/accounts/${this.props.current_user.login}/auth_attachment.json
// 已职业认证的账户不能修改职业,学校/单位,院系/部门true为disable
const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ;
// const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ;
let{ basicInfo }=this.props
let common={
@ -645,7 +648,7 @@ class RealNameCertificationModal extends Component{
label="姓名"
className="formItemInline"
>
{basicInfo && basicInfo.authentication == 'uncertified' ? <React.Fragment>{getFieldDecorator('name', {
<React.Fragment>{getFieldDecorator('name', {
rules: [{
// initialValue: this.state.cityDefaultValue,
required: true,
@ -659,16 +662,16 @@ class RealNameCertificationModal extends Component{
}></Input>
)}
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
</React.Fragment> :
<div className="df" style={{}}>
<Tooltip title="已完成实名认证,不能修改">
<span className="mr8" >{showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)}</span>
</Tooltip>
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
onClick={()=>this.showOrHide(showRealName)}></i>
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
</div>
}
</React.Fragment>
{/* // <div className="df" style={{}}>
// <Tooltip title="已完成实名认证,不能修改">
// <span className="mr8" >{showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)}</span>
// </Tooltip>
// <i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
// onClick={()=>this.showOrHide(showRealName)}></i>
// <span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
// </div> */}
</Form.Item>
<Form.Item
@ -682,10 +685,8 @@ class RealNameCertificationModal extends Component{
}],
})(
<RadioGroup>
<ConditionToolTip title="已完成实名认证,不能修改" condition={basicInfo.authentication != 'uncertified'} >
<Radio value="0" disabled={basicInfo.authentication != 'uncertified'}></Radio>
<Radio value="1" disabled={basicInfo.authentication != 'uncertified'}></Radio>
</ConditionToolTip>
<Radio value="0"></Radio>
<Radio value="1"></Radio>
</RadioGroup>
)}
</Form.Item>
@ -708,7 +709,7 @@ class RealNameCertificationModal extends Component{
<AccountBasicEditItem
identity={identity}
getFieldDecorator={getFieldDecorator}
professionalFlag={professionalFlag}
professionalFlag={false}
basicInfo={basicInfo}
{...this.props}
{...this.state}

@ -165,7 +165,7 @@ class InfosBank extends Component{
<li className={type=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("publicly")}>{is_current ? "我":"TA"}的题库</a></li>
<li className={type=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("personal")}>公共题库</a></li>
</div>
<div className="edu-back-white padding20-30 bor-top-greyE">
<div className="edu-back-white padding10-30 bor-top-greyE">
<ul className="clearfix secondNav">
<li className={category=="common" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("common")}>普通作业</a></li>
<li className={category=="group" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("group")}>分组作业</a></li>

@ -238,7 +238,7 @@ class InfosCourse extends Component{
</style>
{
is_current &&
<div className="edu-back-white padding20-30 clearfix secondNavs bor-top-greyE">
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className="w32">全部</a></li>

@ -227,7 +227,7 @@ class InfosPackage extends Component{
</style>
{
category=="manage"?
<div className="edu-back-white padding20-30 clearfix secondNavs bor-top-greyE">
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a
onClick={() => this.changeStatus()} className="w32">全部</a></li>
<li className={status == "unpublished " ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
@ -237,7 +237,7 @@ class InfosPackage extends Component{
<li className={status == "finished" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("finished")} className="w60">已完成</a></li>
</div>: category=="bidden"?
<div className="edu-back-white padding20-30 clearfix secondNavs bor-top-greyE">
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a
onClick={() => this.changeStatus()} className="w32">全部</a></li>
<li className={status == "bidding_lost" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a

@ -240,7 +240,7 @@ class InfosPath extends Component{
</style>
{
category && category == "manage" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNavs bor-top-greyE">
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className="w32">全部</a></li>
@ -254,7 +254,7 @@ class InfosPath extends Component{
}
{
category && category == "study" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNavs bor-top-greyE">
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className="w32">全部</a></li>

@ -240,7 +240,7 @@ class InfosProject extends Component{
</style>
{
is_current &&
<div className="edu-back-white padding20-30 clearfix secondNavs bor-top-greyE">
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className=" w32">全部</a></li>

@ -241,7 +241,7 @@ class InfosShixun extends Component{
{
category && category == "manage" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNavs bor-top-greyE">
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className="w32">全部</a></li>
@ -257,7 +257,7 @@ class InfosShixun extends Component{
}
{
category && category == "study" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNavs bor-top-greyE">
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className="w32">全部</a></li>

Loading…
Cancel
Save