diff --git a/app/views/student_work/_upload_attachment.html.erb b/app/views/student_work/_upload_attachment.html.erb index 7bc78f2dc..9fb1ba565 100644 --- a/app/views/student_work/_upload_attachment.html.erb +++ b/app/views/student_work/_upload_attachment.html.erb @@ -46,11 +46,10 @@
-

-
注意:暂不支持IE浏览器的上传,请更换浏览器
+

确定 取消
diff --git a/app/views/student_work/show.html.erb b/app/views/student_work/show.html.erb index 50557319a..b029c79d8 100644 --- a/app/views/student_work/show.html.erb +++ b/app/views/student_work/show.html.erb @@ -283,7 +283,6 @@ function regex_des() { if ($.trim($("#attachment_des").val()) == "") { $("#hint_message").text("补交理由不能为空"); - $("#hint_message").css('color','#ff0000'); return false; } else { $("#hint_message").text(""); diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index a468f9b37..95f569297 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -552,18 +552,24 @@ function uploadAndAttachReviseFiles(files, inputEl,btnId) { var maxFileSizeExceeded = $(inputEl).data('max-file-size-message'); var sizeExceeded = false; - $.each(files, function() { - if (this.size && maxFileSize != null && this.size > parseInt(maxFileSize)) { - sizeExceeded = true; - } - }); - if (sizeExceeded) { - notice_sure_box(maxFileSizeExceeded); - } else { + if(files.length > 1){ + $("#hint_message").html("只能上传一个附件").show(); + } else{ + $("#hint_message").html("只能上传一个附件").hide(); $.each(files, function() { - addReviseFile(inputEl, this, true,btnId); + if (this.size && maxFileSize != null && this.size > parseInt(maxFileSize)) { + sizeExceeded = true; + } }); + if (sizeExceeded) { + notice_sure_box(maxFileSizeExceeded); + } else { + $.each(files, function() { + addReviseFile(inputEl, this, true,btnId); + }); + } } + } function uploadAndAttachFiles(files, inputEl,btnId) {