Merge branches 'dev_aliyun', 'dev_cs' and 'develop' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_cs

dev_cs
杨树明 5 years ago
commit 730a9c719a

@ -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, "更新成功")

@ -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

@ -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 (

Loading…
Cancel
Save