Merge branch 'dev_aliyun' into dev_cxt

dev_ec
cxt 5 years ago
commit f2bbd9e308

@ -321,11 +321,12 @@ class StudentWorksController < ApplicationController
ActiveRecord::Base.transaction do
begin
revise_attachment = @work.attachments.where(attachtype: 7).reorder("created_on desc").last
if revise_attachment.present? && @work.student_works_scores.where("created_at > '#{revise_attachment.created_on}'
and score is not null").count == 0
revise_attachment.destroy
end
# 补交作业附件不覆盖之前上传的附件
# revise_attachment = @work.attachments.where(attachtype: 7).reorder("created_on desc").last
# if revise_attachment.present? && @work.student_works_scores.where("created_at > '#{revise_attachment.created_on}'
# and score is not null").count == 0
# revise_attachment.destroy
# end
Attachment.associate_container(params[:attachment_ids], @work.id, @work.class, 7)
revise_attachment = Attachment.where(attachtype: 7, container_id: @work.id, container_type: "StudentWork").last
revise_attachment.update_attributes(description: params[:description]) if revise_attachment.present?

@ -248,7 +248,9 @@ class CommonWorkAppraise extends Component{
</div> }
<CommonWorkAppraiseReviseAttachments {...this.state}></CommonWorkAppraiseReviseAttachments>
<CommonWorkAppraiseReviseAttachments {...this.state}
onAttachmentRemove={this.onAttachmentRemove}
></CommonWorkAppraiseReviseAttachments>
{is_evaluation != true && project_info && project_info.name && <div className={"stud-class-set bor-top-greyE edu-back-white padding20-30"}>
<div className={"color-grey-6 mb10"}>

@ -33,7 +33,7 @@ function CommonWorkAppraiseReviseAttachments(props) {
{item.title}
</a>
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
{item.delete===true?<i className="font-14 iconfont icon-guanbi " style={{display: 'none'}} id={item.id} aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.id)}></i>:""}
{item.delete===true?<i className="font-14 iconfont icon-guanbi " style={{display: 'none'}} id={item.id} aria-hidden="true" onClick={()=>this.props.onAttachmentRemove(item.id)}></i>:""}
</div>
)
})}

@ -290,6 +290,7 @@ class TPIMonaco extends Component {
// theme: "vs-dark",
theme: "myCoolTheme",
insertSpaces: false,
fontSize: this.state.cmFontSize
});

Loading…
Cancel
Save