Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_local

dev_local_2
杨树林 6 years ago
commit 36cb9180b7

@ -922,14 +922,16 @@ class CoursesController < ApplicationController
school_name = params[:school_name] school_name = params[:school_name]
# REDO:Extension # REDO:Extension
@users = User.joins(user_extension: :school) @users = User.where(status: User::STATUS_ACTIVE)
.where("CONCAT(users.lastname, users.firstname) like ? and schools.name like ?", "%#{name}%", "%#{school_name}%") @users = @users.where("concat(users.lastname, users.firstname) like '%#{name}%'") if name.present?
# REDO:Extension
@users = @users.joins(user_extension: :school).where("schools.name like '%#{school_name}%'") if school_name.present?
@users_count = @users.size @users_count = @users.size
limit = params[:limit] || 20 limit = params[:limit] || 20
page = params[:page] || 1 page = params[:page] || 1
@users = @users.page(page).per(limit) @users = @users.includes(user_extension: :school).page(page).per(limit)
end end
# 申请加入课堂 # 申请加入课堂

@ -4,7 +4,7 @@ class Ecs::SubitemSupportStandardsController < Ecs::BaseController
def show def show
@graduation_standards = EcGraduationStandard.all @graduation_standards = EcGraduationStandard.all
@graduation_subitems = current_year.ec_graduation_subitems @graduation_subitems = current_year.ec_graduation_subitems.includes(:ec_graduation_requirement)
ids = @graduation_subitems.map(&:id) ids = @graduation_subitems.map(&:id)
@subitem_support_standards = EcRequireSubVsStandard.where(ec_graduation_subitem_id: ids, status: true) @subitem_support_standards = EcRequireSubVsStandard.where(ec_graduation_subitem_id: ids, status: true)
@ -36,18 +36,18 @@ class Ecs::SubitemSupportStandardsController < Ecs::BaseController
private private
def check_record_exists! def check_record_exists!
unless current_year.ec_graduation_subitems.exists?(id: params[:graduation_subitem_id]) unless current_year.ec_graduation_subitems.exists?(id: params[:ec_graduation_subitem_id])
render_not_found render_not_found
return return
end end
unless EcGraduationStandard.exists?(id: params[:graduation_standard_id]) unless EcGraduationStandard.exists?(id: params[:ec_graduation_standard_id])
render_not_found render_not_found
return return
end end
end end
def permit_params def permit_params
params.require(%i[graduation_subitem_id graduation_standard_id]) params.permit(%i[ec_graduation_subitem_id ec_graduation_standard_id])
end end
end end

@ -360,7 +360,7 @@ class GraduationTasksController < ApplicationController
tasks.each do |task| tasks.each do |task|
task.end_time = Time.now task.end_time = Time.now
task.status = task.allow_late ? 2 : 3 task.status = 2
task.save! task.save!
end end
normal_status(0, "更新成功") normal_status(0, "更新成功")

@ -890,9 +890,10 @@ class ShixunsController < ApplicationController
user_name = "%#{params[:user_name].to_s.strip}%" user_name = "%#{params[:user_name].to_s.strip}%"
school_name = "%#{params[:school_name].to_s.strip}%" school_name = "%#{params[:school_name].to_s.strip}%"
if user_name.present? || school_name.present? if user_name.present? || school_name.present?
@users = User.joins(user_extension: :school).where("users.id not in #{member_ids} AND users.status = 1 AND @users = User.where("users.id not in #{member_ids} AND users.status = 1 AND
(LOWER(concat(users.lastname, users.firstname)) LIKE ? or users.phone like ?) (LOWER(concat(users.lastname, users.firstname)) LIKE ? or users.phone like ?)",
AND LOWER(schools.name) LIKE ?", user_name, user_name, school_name) user_name, user_name)
@users = @users.joins(user_extension: :school).where("schools.name like '%#{school_name}%'") if params[:school_name].present?
else else
@users = User.none @users = User.none
end end

@ -10,6 +10,8 @@ class Admins::UpdateUserService < ApplicationService
def call def call
user.assign_attributes(user_attributes) user.assign_attributes(user_attributes)
user.mail = params[:mail].to_s.presence
user.phone = params[:phone].to_s.presence
user.firstname = '' user.firstname = ''
user.password = params[:password] if params[:password].present? user.password = params[:password] if params[:password].present?

@ -74,7 +74,7 @@
<div class="form-row"> <div class="form-row">
<%= f.input :mail, as: :email, label: '邮箱地址', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %> <%= f.input :mail, as: :email, label: '邮箱地址', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %>
<%= f.input :phone, as: :tel, label: '手机号', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %> <%= f.input :phone, as: :tel, label: '手机号', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11', autocomplete: 'off' } %>
</div> </div>
<div class="form-row province-city-select"> <div class="form-row province-city-select">
@ -124,8 +124,8 @@
</div> </div>
<div class="form-row"> <div class="form-row">
<%= f.input :password, as: :password, label: '修改密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %> <%= f.input :password, as: :password, label: '修改密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11', autocomplete: 'new-password' } %>
<%= f.input :password_confirmation, as: :password, label: '确认密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %> <%= f.input :password_confirmation, as: :password, label: '确认密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11', autocomplete: 'new-password' } %>
</div> </div>
</div> </div>

@ -1,4 +1,9 @@
json.graduation_standards @graduation_standards, partial: 'ecs/shared/ec_graduation_standard', as: :ec_graduation_standard json.graduation_standards @graduation_standards, partial: 'ecs/shared/ec_graduation_standard', as: :ec_graduation_standard
json.graduation_subitems @graduation_subitems, partial: 'ecs/shared/ec_graduation_subitem', as: :ec_graduation_subitem json.graduation_subitems do
json.array! @graduation_subitems do |graduation_subitem|
json.partial! 'ecs/shared/ec_graduation_subitem', ec_graduation_subitem: graduation_subitem
json.graduation_requirement_position graduation_subitem.ec_graduation_requirement.position
end
end
json.subitem_support_standards @subitem_support_standards, partial: 'ecs/subitem_support_standards/shared/subitem_support_standard', as: :subitem_support_standard json.subitem_support_standards @subitem_support_standards, partial: 'ecs/subitem_support_standards/shared/subitem_support_standard', as: :subitem_support_standard

@ -232,9 +232,7 @@ class Fileslistitem extends Component{
{ {
this.props.isNotMember===true? this.props.isNotMember===true?
discussMessage.is_lock === true ? discussMessage.is_lock === true ?
<Tooltip title={"私有属性,非课堂成员不能访问"} placement="bottom"> <span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" title={"私有属性,非课堂成员不能访问"}>{discussMessage.title}</span>
<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer">{discussMessage.title}</span>
</Tooltip>
:<a :<a
onClick={()=>this.showfiles(discussMessage)} onClick={()=>this.showfiles(discussMessage)}
title={discussMessage.title} title={discussMessage.title}

@ -62,12 +62,11 @@ class BoardsListItem extends Component{
</a> </a>
<div className="clearfix ds pr pt5 contentSection" onClick={() => onItemClick(discussMessage)}> <div className="clearfix ds pr pt5 contentSection" onClick={() => onItemClick(discussMessage)}>
<h6> <h6>
<Tooltip title={canNotLink?"私有属性,非课堂成员不能访问":`${discussMessage.subject.length > 40 ? discussMessage.subject : ''}`} placement="bottom"> {canNotLink?<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" title={canNotLink?"私有属性,非课堂成员不能访问":`${discussMessage.subject}`}>{discussMessage.subject}</span>:<a className="panel-list-title hide fl mt5 color-dark font-bd pointer"
<a className="panel-list-title hide fl mt5 color-dark font-bd pointer" style={{ fontWeight: 'bold', maxWidth: '700px' }}
style={{ fontWeight: 'bold', cursor: (canNotLink ? 'poninter' : 'poninter'), maxWidth: '700px' }} title={discussMessage.subject}
onClick={canNotLink ? () => {} : () => this.onTitleClick(discussMessage)} onClick={canNotLink ? () => {} : () => this.onTitleClick(discussMessage)}
>{discussMessage.subject}</a> >{discussMessage.subject}</a>}
</Tooltip>
{ !!discussMessage.sticky && <span className="btn-cir btn-cir-red fl mt5 ml5">置顶</span> } { !!discussMessage.sticky && <span className="btn-cir btn-cir-red fl mt5 ml5">置顶</span> }
{ {

@ -144,6 +144,9 @@ class CommonWorkItem extends Component{
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
a:hover{
color: #4cacff;
}
` `
} }
</style> </style>
@ -158,13 +161,17 @@ class CommonWorkItem extends Component{
mainList && isAdmin && mainList && isAdmin &&
<span className="fl mr12"><Checkbox value={item.homework_id} key={item.homework_id}></Checkbox></span> <span className="fl mr12"><Checkbox value={item.homework_id} key={item.homework_id}></Checkbox></span>
} }
<div className="flex1" onClick={() => this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }> <div className="flex1" onClick={() => this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>
<p className="clearfix mb20"> <p className="clearfix mb20">
<Tooltip title={ canNotLink ? "私有属性,非课堂成员不能访问" : item.name} placement="bottom" > {canNotLink?<span className={"fl font-16 font-bd mt2 comnonwidth580 pointer color-grey-name"}
<span className="fl font-16 font-bd mt2 comnonwidth580 pointer" style={{cursor: canNotLink ? 'poninter' : 'poninter'}} title={ canNotLink ? "私有属性,非课堂成员不能访问" : item.name}
>
{item.name}
</span>:<a className={"fl font-16 font-bd mt2 comnonwidth580 pointer"}
onClick={ canNotLink ? () => {} : () => this.onItemClick(item)} onClick={ canNotLink ? () => {} : () => this.onItemClick(item)}
>{item.name}</span> title={item.name}
</Tooltip> >{item.name}</a>}
{/* 只有非课堂成员且作业是私有的情况下才会为true */} {/* 只有非课堂成员且作业是私有的情况下才会为true */}
{ {
item.private_icon===true ? item.private_icon===true ?

@ -128,9 +128,7 @@ class ExerciseListItem extends Component{
{ {
this.props.isNotMember()? item.lock_status === 0 ? this.props.isNotMember()? item.lock_status === 0 ?
<Tooltip title={"私有属性,非课堂成员不能访问"} placement="bottom"> <span className="fl mt3 font-16 font-bd color-dark comnonwidth580 pointer" title={"私有属性,非课堂成员不能访问"}>{item.exercise_name}</span>
<span className="fl mt3 font-16 font-bd color-dark comnonwidth580 pointer" title={item.exercise_name}>{item.exercise_name}</span>
</Tooltip>
: <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580 pointer" title={item.exercise_name} onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}</a>:"" : <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580 pointer" title={item.exercise_name} onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}</a>:""
} }

@ -247,9 +247,7 @@ class GraduateTaskItem extends Component{
{ {
this.props.isNotMember===true?this.props.discussMessage.private_icon===true? this.props.isNotMember===true?this.props.discussMessage.private_icon===true?
<Tooltip title={"私有属性,非课堂成员不能访问"} placement="bottom"> <span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" title={"私有属性,非课堂成员不能访问"}>{discussMessage.name}</span>
<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" >{discussMessage.name}</span>
</Tooltip>
:<a onClick={()=>this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list")} :<a onClick={()=>this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list")}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""

@ -129,7 +129,7 @@ class GraduationTasks extends Component{
let {checkBoxValues,checkAllValue}=this.state; let {checkBoxValues,checkAllValue}=this.state;
if(checkAllValue===false){ if(checkAllValue===false){
if(checkBoxValues.length===0){ if(checkBoxValues.length===0||checkAllValue===undefined){
return true return true
} }
} }
@ -612,7 +612,6 @@ class GraduationTasks extends Component{
const category_id=this.props.match.params.Id; const category_id=this.props.match.params.Id;
const graduationId=this.props.match.params.graduationId; const graduationId=this.props.match.params.graduationId;
// console.log(this.props.isCourseidentity()===isNotMember) // console.log(this.props.isCourseidentity()===isNotMember)
// console.log(category_id)
return( return(
<React.Fragment> <React.Fragment>
{/*提示*/} {/*提示*/}
@ -710,7 +709,7 @@ class GraduationTasks extends Component{
{this.props.isAdmin()?all_count===undefined?'' :all_count===0?"": <div className="mt20 edu-back-white padding20-30"> {this.props.isAdmin()?all_count===undefined?'' :all_count===0?"": <div className="mt20 edu-back-white padding20-30">
<div className="clearfix"> <div className="clearfix">
<Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} 不支持跨页勾选</Checkbox> <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues===undefined?0:checkBoxValues.length} 不支持跨页勾选</Checkbox>
<div className="studentList_operation_ul"> <div className="studentList_operation_ul">
<li className="li_line"><a className="color-grey-9" onClick={this.onDelete}>删除</a></li> <li className="li_line"><a className="color-grey-9" onClick={this.onDelete}>删除</a></li>
@ -737,7 +736,7 @@ class GraduationTasks extends Component{
border-radius: 2px; border-radius: 2px;
} }
`}</style> `}</style>
<Spin size="large" spinning={this.state.isSpin}> <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}> <Spin size="large" spinning={this.state.isSpin}> <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues===undefined?[]:checkBoxValues}>
{ tasks&&tasks.map((item, index) => { { tasks&&tasks.map((item, index) => {
// console.log(item) // console.log(item)
return ( return (

@ -83,21 +83,23 @@ class GraduateTopicItem extends Component{
text-overflow:ellipsis; text-overflow:ellipsis;
white-space:nowrap white-space:nowrap
} }
a:hover{
color: #4cacff;
}
`}</style> `}</style>
<h6> <h6>
{ {
isNotMember? isNotMember?
<Tooltip title={ discussMessage.private_icon===true?"私有属性,非课堂成员不能访问":discussMessage.name} placement="bottom"> discussMessage.private_icon===true?<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" title={ discussMessage.private_icon===true?"私有属性,非课堂成员不能访问":discussMessage.name}>{discussMessage.name}</span>:
<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer">{discussMessage.name}</span> <a className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" title={discussMessage.name}>{discussMessage.name}</a>
</Tooltip>:"" :""
} }
{ {
isStudent?<a onClick={() => this.toDetailPage(`${discussMessage.id}`)} isStudent?<a onClick={() => this.toDetailPage(`${discussMessage.id}`)}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</a>:""
} }
{ {
isAdmin?<a onClick={() => this.toDetailPage(`${discussMessage.id}`)} className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:"" isAdmin?<a onClick={() => this.toDetailPage(`${discussMessage.id}`)} className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</a>:""
} }
{ {
discussMessage.private_icon===true? discussMessage.private_icon===true?

@ -57,9 +57,7 @@ class PollListItem extends Component{
<div className="flex1 pr"> <div className="flex1 pr">
<p className="clearfix mb30"> <p className="clearfix mb30">
{ canNotLink ? { canNotLink ?
<Tooltip title={courseType.user_permission == 0?"私有属性,非课堂成员不能访问":item.polls_name} placement="bottom"> <span className="fl font-16 font-bd mt2 color-grey-3 task-hide pointer" style={{"maxWidth":"600px"}} title={courseType.user_permission == 0?"私有属性,非课堂成员不能访问":item.polls_name}>{item.polls_name}</span>
<span className="fl font-16 font-bd mt2 color-grey-3 task-hide pointer" style={{"maxWidth":"600px"}} >{item.polls_name}</span>
</Tooltip>
: :
<a onClick={()=>this.toDetailPage(`/courses/${coursesId}/polls/${item.id}/detail`)} className="fl font-16 font-bd mt2 color-grey-3 task-hide pointer" style={{"maxWidth":"600px"}} title={item.polls_name}>{item.polls_name}</a> <a onClick={()=>this.toDetailPage(`/courses/${coursesId}/polls/${item.id}/detail`)} className="fl font-16 font-bd mt2 color-grey-3 task-hide pointer" style={{"maxWidth":"600px"}} title={item.polls_name}>{item.polls_name}</a>
} }

@ -328,9 +328,7 @@ class ShixunhomeWorkItem extends Component{
{ {
this.props.isNotMember===true? this.props.discussMessage.private_icon===true? this.props.isNotMember===true? this.props.discussMessage.private_icon===true?
<Tooltip title={"私有属性,非课堂成员不能访问"} placement="bottom"> <span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" title={"私有属性,非课堂成员不能访问"}>{discussMessage.name}</span>
<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer">{discussMessage.name}</span>
</Tooltip>
: <a onClick={()=>this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)} : <a onClick={()=>this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""

@ -41,7 +41,8 @@ class CaseNew extends Component{
loading: false, loading: false,
checkTag:false, checkTag:false,
checkFile:false, checkFile:false,
coverID:undefined coverID:undefined,
library_tags:undefined
} }
} }
@ -132,6 +133,17 @@ class CaseNew extends Component{
if(this.props.match.params.caseID){ if(this.props.match.params.caseID){
this.InitEditData(); this.InitEditData();
} }
let url=`/library_tags.json`;
axios.get(url).then((result) => {
console.log(result)
if(result.data.status===0){
this.setState({
library_tags:result.data.library_tags
})
}
}).catch((error) => {
console.log(error);
})
} }
componentDidUpdate=(prevState)=>{ componentDidUpdate=(prevState)=>{
@ -263,7 +275,7 @@ class CaseNew extends Component{
render(){ render(){
let { caseID } = this.props.match.params; let { caseID } = this.props.match.params;
let { CaseDetail } = this.props; let { CaseDetail } = this.props;
let { casesTags , contentFileList , imageUrl , checkTag , checkFile } = this.state; let { casesTags , contentFileList , imageUrl , checkTag , checkFile,library_tags } = this.state;
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
@ -301,8 +313,8 @@ class CaseNew extends Component{
action:`${getUploadActionUrl()}`, action:`${getUploadActionUrl()}`,
onChange:this.handleChange, onChange:this.handleChange,
} }
console.log('111'); // console.log('111');
console.log(!caseID || (CaseDetail && CaseDetail.status == "pending")); // console.log(!caseID || (CaseDetail && CaseDetail.status == "pending"));
return( return(
<div className="educontent mt10 mb50"> <div className="educontent mt10 mb50">
<style> <style>
@ -380,9 +392,11 @@ class CaseNew extends Component{
<div className={checkTag==true ? "clearfix mb20 pr has-error" : "clearfix mb20"} id="tagFormItem"> <div className={checkTag==true ? "clearfix mb20 pr has-error" : "clearfix mb20"} id="tagFormItem">
<span className="upload_Title must">标签</span> <span className="upload_Title must">标签</span>
<ul className="fl libraries_tab"> <ul className="fl libraries_tab">
<li className={ casesTags.indexOf(1) > -1 ? "active" :"" } onClick={()=>this.changeType(1)}>获奖案例</li> {library_tags&&library_tags.map((item,key)=>{
<li className={ casesTags.indexOf(2) > -1 ? "active" :"" } onClick={()=>this.changeType(2)}>入库案例</li> return(
<li className={ casesTags.indexOf(3) > -1 ? "active" :"" } onClick={()=>this.changeType(3)}>企业案例</li> <li key={key} className={ casesTags.indexOf(item.id) > -1 ? "active" :"" } onClick={()=>this.changeType(item.id)}>{item.name}</li>
)
})}
</ul> </ul>
{ {
checkTag && <div class="ant-form-explain">请选择标签</div> checkTag && <div class="ant-form-explain">请选择标签</div>

@ -21,8 +21,9 @@ class CaseTags extends Component{
: :
item.name == "入库案例" ? item.name == "入库案例" ?
<span key={key} className="edu-filter-btn fl cdefault edu-activity-blue ml10">{item.name}</span> <span key={key} className="edu-filter-btn fl cdefault edu-activity-blue ml10">{item.name}</span>
: :item.name =='企业案例'?
<span key={key} className="edu-filter-btn fl cdefault edu-activity-orange-sub ml10">{item.name}</span> <span key={key} className="edu-filter-btn fl cdefault edu-activity-orange-sub ml10">{item.name}</span>
: <span key={key} className="edu-filter-btn fl cdefault edu-activity-36c53c-sub ml10">{item.name}</span>
} }
</React.Fragment> </React.Fragment>
) )

@ -69,7 +69,13 @@
border: 1px solid #ff6800; border: 1px solid #ff6800;
line-height: 17px; line-height: 17px;
} }
.edu-activity-36c53c-sub {
background-color: #36c53c;
color: #fff!important;
cursor: pointer;
border: 1px solid #36c53c;
line-height: 17px;
}
.pointsBtn { .pointsBtn {
width: 70px; width: 70px;
height: 70px; height: 70px;

Loading…
Cancel
Save