diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 7c8c07d01..915a4e22c 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -1256,6 +1256,8 @@ class ExercisesController < ApplicationController normal_status(-1,"试卷未发布") elsif (@exercise_users_size == 0) || ( @export_ex_users&.exercise_user_committed.size == 0) normal_status(-1,"暂无用户提交") + elsif params[:export].present? && params[:export] + normal_status(0,"正在下载中") else respond_to do |format| format.xlsx{ @@ -1281,7 +1283,11 @@ class ExercisesController < ApplicationController @exercise_questions = @exercise.exercise_questions.includes(:exercise_choices).order("question_number ASC") filename_ = "#{@exercise.user.real_name}_#{@course.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.pdf" stylesheets = "#{Rails.root}/app/templates/exercise_export/exercise_export.css" - render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets + if params[:export].present? && params[:export] + normal_status(0,"正在下载中") + else + render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets + end end #空白试卷预览页面,仅供测试使用,无其他任何用途 diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 5cccb3ee7..dfa6795fb 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -207,9 +207,12 @@ class HomeworkCommonsController < ApplicationController tip_exception(403, "无权限操作") elsif @work_excel.blank? || @work_excel.size == 0 normal_status(-1,"暂无用户提交!") + elsif params[:export].present? && params[:export] + normal_status(0,"正在下载中") else respond_to do |format| format.xlsx{ + cookies[:fileDownload] = true student_work_to_xlsx(@work_excel,@homework) exercise_export_name = "#{current_user.real_name}_#{@course.name}_#{@homework.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}" render xlsx: "#{exercise_export_name.strip}",template: "homework_commons/works_list.xlsx.axlsx",locals: @@ -220,6 +223,8 @@ class HomeworkCommonsController < ApplicationController elsif params[:format] == "zip" if @user_course_identity >= Course::STUDENT tip_exception(403, "无权限操作") + elsif params[:export].present? && params[:export] + normal_status(0,"正在下载中") else if @work_excel.present? zip_works = @work_excel&.where("work_status > 0") @@ -231,6 +236,7 @@ class HomeworkCommonsController < ApplicationController if status == 0 respond_to do |format| format.zip{ + cookies[:fileDownload] = true zipfile = zip_homework_common @homework, zip_works file = decode64(zipfile[0][:base64file]) send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip' diff --git a/app/controllers/zips_controller.rb b/app/controllers/zips_controller.rb index f4822b96b..bea5784c7 100644 --- a/app/controllers/zips_controller.rb +++ b/app/controllers/zips_controller.rb @@ -8,7 +8,13 @@ class ZipsController < ApplicationController def shixun_report service = BatchExportShixunReportService.new(@homework, @all_student_works) filename_ = filename_for_content_disposition(service.filename) - send_file service.zip, filename: filename_, type: 'application/zip' + if params[:export].present? && params[:export] + normal_status(0,"正在下载中") + else + cookies[:fileDownload] = true + send_file service.zip, filename: filename_, type: 'application/zip' + end + rescue BatchExportShixunReportService::Error => ex normal_status(-1, ex.message) end @@ -18,7 +24,11 @@ class ZipsController < ApplicationController exercises = ExportExercisesService.new(@exercise,@ex_users,@request_url) file_name_ = filename_for_content_disposition(exercises.filename) - send_file exercises.ex_zip, filename: file_name_, type: 'application/zip' + if params[:export].present? && params[:export] + normal_status(0,"正在下载中") + else + send_file exercises.ex_zip, filename: file_name_, type: 'application/zip' + end rescue Exception => e normal_status(-1, e.message) end diff --git a/public/images/educoder/path.png b/public/images/educoder/path.png new file mode 100644 index 000000000..d8b6f1715 Binary files /dev/null and b/public/images/educoder/path.png differ diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index 8b7c727a9..fad3568b4 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -420,7 +420,7 @@ table.text-file{} /*-------------------------------实训路径-------------------------------*/ -.path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.jpg");background-color: #081C4B;background-size: 100% 100%;} +.path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.png");background-color: #081C4B;background-size: 100% 100%;} .pathNavLine{position: absolute;bottom: -8px;width: 100%;} .path-nav li{float: left;padding: 0px 30px;height: 42px;} .path-nav li a{color:#fff;font-size: 16px;display: block; height: 40px;} diff --git a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js index 4788a7dc1..ac7c8a1a5 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js +++ b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js @@ -2,7 +2,7 @@ import React, {Component} from 'react'; import {Link} from "react-router-dom"; import axios from 'axios'; import { Input ,Icon,Button,Pagination,DatePicker,Breadcrumb} from 'antd'; -import { handleDateString,markdownToHTML,bytesToSize} from 'educoder'; +import { handleDateString,markdownToHTML,bytesToSize,getImageUrl} from 'educoder'; import NEITaskDetailsModel from './NEITaskDetailsModel'; import moment from 'moment'; import '../packageconcnet.css'; @@ -236,9 +236,9 @@ class PackageIndexNEITaskDetails extends Component { render() { let {overtype,data}=this.state; // console.log(data&&data.creator.login) - // console.log(this.props.current_user.login) + console.log(data) return ( -
{item.name}
{this.props.match.params.id!=undefined?"编辑":"新建"} + 返回
+ 共{0}个 + 发布时间 +
+ +