diff --git a/app/assets/javascripts/colleges/statistics.js b/app/assets/javascripts/colleges/statistics.js index 3c26b5b46..6e2790df1 100644 --- a/app/assets/javascripts/colleges/statistics.js +++ b/app/assets/javascripts/colleges/statistics.js @@ -34,7 +34,7 @@ $(document).on('turbolinks:load', function() { $.get('/colleges/' + schoolId + '/shixun_chart_data', function(data){ $statisticBody.find('.shixun-chart-loading').hide(); if (data.data.length > 0) { - $shixunChart.css('height', '400px').css('width', '400px'); + $shixunChart.css('height', '400px').css('width', '100%'); initShixunChart(data.names, data.data); } else { $statisticBody.find('.shixun-chart-empty').show(); @@ -146,7 +146,7 @@ $(document).on('turbolinks:load', function() { $.get('/colleges/' + schoolId + '/student_hot_evaluations', function(data){ $statisticBody.find('.hot-chart-loading').hide(); if (data.names.length > 0) { - $statisticBody.find('.hot-chart').css('height', '400px').css('width', '400px'); + $statisticBody.find('.hot-chart').css('height', '400px').css('width', '100%'); initHotEvaluating(data.names.reverse(), data.values.reverse()); } else { $statisticBody.find('.hot-chart-empty').show(); diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index fb68f23bf..50e349bab 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1085,11 +1085,15 @@ class CoursesController < ApplicationController # 导出课堂信息 def export_couser_info - set_export_cookies - course_info_to_xlsx @course - filename_ = "#{current_user.real_name}_#{@course.name}_课堂信息_#{Time.now.strftime('%Y%m%d_%H%M%S')}" - render xlsx: "#{format_sheet_name filename_.strip}",template: "courses/export_course_info.xlsx.axlsx", - locals: {course_info: @course_info} + if params[:export].present? && params[:export] + normal_status(0,"正在下载中") + else + set_export_cookies + course_info_to_xlsx @course + filename_ = "#{current_user.real_name}_#{@course.name}_课堂信息_#{Time.now.strftime('%Y%m%d_%H%M%S')}" + render xlsx: "#{format_sheet_name filename_.strip}",template: "courses/export_course_info.xlsx.axlsx", + locals: {course_info: @course_info} + end end # 导出活跃度 diff --git a/app/controllers/exercise_bank_questions_controller.rb b/app/controllers/exercise_bank_questions_controller.rb index b64e71b59..fd1ffe9eb 100644 --- a/app/controllers/exercise_bank_questions_controller.rb +++ b/app/controllers/exercise_bank_questions_controller.rb @@ -372,7 +372,7 @@ class ExerciseBankQuestionsController < ApplicationController private def bank_admin - tip_exception(403, "无权限") unless (current_user.certification_teacher? && @bank.user_id == current_user.id) || current_user.admin? + tip_exception(403, "无权限") unless @bank.user_id == current_user.id || current_user.admin? end def get_exercise diff --git a/app/controllers/exercise_banks_controller.rb b/app/controllers/exercise_banks_controller.rb index 9aa589768..8602bb018 100644 --- a/app/controllers/exercise_banks_controller.rb +++ b/app/controllers/exercise_banks_controller.rb @@ -17,9 +17,9 @@ class ExerciseBanksController < ApplicationController end def update - tip_exception("试卷标题不能为空!") if params[:exercise_name].blank? + tip_exception("标题不能为空!") if params[:exercise_name].blank? @bank.update_attributes!(name: params[:exercise_name], description: params[:exercise_description]) - normal_status(0,"试卷更新成功!") + normal_status(0,"更新成功") end def choose_shixun @@ -58,11 +58,12 @@ class ExerciseBanksController < ApplicationController def find_bank @bank = ExerciseBank.find_by!(id: params[:id]) - tip_exception(403, "无权限") unless (current_user.certification_teacher? && (@bank.is_public || @bank.user_id == current_user.id)) || current_user.admin? + tip_exception(403, "无权限") unless @bank.user_id == current_user.id || current_user.admin? || + (current_user.certification_teacher? && @bank.is_public) end def bank_admin - tip_exception(403, "无权限") unless (current_user.certification_teacher? && @bank.user_id == current_user.id) || current_user.admin? + tip_exception(403, "无权限") unless @bank.user_id == current_user.id || current_user.admin? end #判断实训是否已选择 diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb index 8c3a04f61..57116a9e5 100644 --- a/app/controllers/exercise_questions_controller.rb +++ b/app/controllers/exercise_questions_controller.rb @@ -280,11 +280,12 @@ class ExerciseQuestionsController < ApplicationController if null_choice_text_count >= ex_answer_pre_count new_add_choice = null_choice_text_count_array - ex_answer_pre_count_array ex_answer_pre_count_array.each do |n| - standard_option = { - :exercise_question_id => @exercise_question.id, - :exercise_choice_id => null_choice_id, - :answer_text => null_choice_text[n-1] + @hash_symbol_null_ = { + :exercise_question_id => @exercise_question.id, + :exercise_choice_id => null_choice_id, + :answer_text => null_choice_text[n - 1] } + standard_option = @hash_symbol_null_ ex_answer_pre[n-1].update(standard_option) end if new_add_choice.count > 0 #表示有新增的 diff --git a/app/controllers/gtopic_banks_controller.rb b/app/controllers/gtopic_banks_controller.rb index 6269173ec..291302bc2 100644 --- a/app/controllers/gtopic_banks_controller.rb +++ b/app/controllers/gtopic_banks_controller.rb @@ -23,11 +23,12 @@ class GtopicBanksController < ApplicationController def find_bank @bank = GtopicBank.find_by!(id: params[:id]) - tip_exception(403, "无权限") unless (current_user.certification_teacher? && (@bank.is_public || @bank.user_id == current_user.id)) || current_user.admin? + tip_exception(403, "无权限") unless @bank.user_id == current_user.id || current_user.admin? || + (current_user.certification_teacher? && @bank.is_public) end def bank_admin - tip_exception(403, "无权限") unless (current_user.certification_teacher? && @bank.user_id == current_user.id) || current_user.admin? + tip_exception(403, "无权限") unless @bank.user_id == current_user.id || current_user.admin? end def gtopic_bank_params diff --git a/app/controllers/homework_banks_controller.rb b/app/controllers/homework_banks_controller.rb index 8c4d607a9..a812da751 100644 --- a/app/controllers/homework_banks_controller.rb +++ b/app/controllers/homework_banks_controller.rb @@ -39,11 +39,12 @@ class HomeworkBanksController < ApplicationController def find_bank @bank = HomeworkBank.find_by!(id: params[:id]) - tip_exception(403, "无权限") unless (current_user.certification_teacher? && (@bank.is_public || @bank.user_id == current_user.id)) || current_user.admin? + tip_exception(403, "无权限") unless @bank.user_id == current_user.id || current_user.admin? || + (current_user.certification_teacher? && @bank.is_public) end def bank_admin - tip_exception(403, "无权限") unless (current_user.certification_teacher? && @bank.user_id == current_user.id) || current_user.admin? + tip_exception(403, "无权限") unless @bank.user_id == current_user.id || current_user.admin? end def bank_params diff --git a/app/controllers/poll_bank_questions_controller.rb b/app/controllers/poll_bank_questions_controller.rb new file mode 100644 index 000000000..d90972dda --- /dev/null +++ b/app/controllers/poll_bank_questions_controller.rb @@ -0,0 +1,157 @@ +class PollBankQuestionsController < ApplicationController + before_action :require_login, :check_auth #用户需登陆 + before_action :get_poll, only:[:create] #获取试卷 + before_action :get_poll_question, except: [:create] #获取试卷的问题及试卷 + before_action :bank_admin #是否为老师 + before_action :validates_params, only: [:create, :update] #传入参数的验证 + + def create + ActiveRecord::Base.transaction do + begin + poll_options = { + :question_title => params[:question_title], + :question_type => params[:question_type], + :is_necessary => params[:is_necessary].to_i, + :question_number => @poll.exercise_bank_questions.count + 1, + :max_choices => params[:max_choices] || nil, + :min_choices => params[:min_choices] || nil + } + @poll_question = @poll.exercise_bank_questions.new(poll_options) + + if params[:insert_id].present? #插入问题时,那么从插入的这个id以后的question_num都将要+1 + insert_poll = @poll.exercise_bank_questions.find_by(id: params[:insert_id]) + if insert_poll.present? #如果该问题存在的话,意思是如果是第一题,那么就不存在插入 + ques_num = insert_poll.question_number.to_i + @poll_question.question_number = ques_num + 1 #更新了问题的位置 + @poll.exercise_bank_questions.insert_question_ex(ques_num).update_all("question_number = question_number + 1") + end + end + if @poll_question.save! + if params[:question_type] != 3 + p_answer = params[:question_answers] + p_other_answer = params[:question_other_answer] + # 新增选择题答案选择的选项 + (1..p_answer.count).each do |i| + answer = p_answer[i-1] # 传入的答案的内容 + question_option = { + :choice_position => i, + :choice_text => answer + } + poll_answers = @poll_question.exercise_bank_choices.new question_option + poll_answers.save + end + # 新增答案的其他选项 + if p_other_answer + question_option = { + :choice_position => p_answer.count + 1, + :choice_text => '' + } + poll_answers = @poll_question.exercise_bank_choices.new question_option + poll_answers.save + end + end + end + normal_status("创建成功") + rescue Exception => e + uid_logger_error(e.message) + tip_exception("问卷的问题创建失败!") + raise ActiveRecord::Rollback + end + end + end + + def update + ActiveRecord::Base.transaction do + begin + if @poll_question.question_type < 3 #当为单选题或多选题时 + p_answer = params[:question_answers] + p_other_answer = params[:question_other_answer] + p_answer_count = p_answer.count + @poll_question.exercise_bank_choices.each do |an| + if (p_answer_count < @poll_current_answers) && (p_answer_count..@poll_current_answers).to_a.include?(an.choice_position) + an.destroy + end + end + (1..p_answer_count).each do |i| + answer = @poll_question.exercise_bank_choices.find_by_custom("choice_position",i).first + if answer # 判断该位置的answer是否存在,存在则更新.不存在则跳到下一步 + answer.choice_text = p_answer[i-1] + answer.choice_position = i + answer.save + else + answer_options = { + :choice_position => i, + :choice_text => p_answer[i-1] + } + @poll_question.exercise_bank_choices.new answer_options + end + end + if p_other_answer #判断答案的其他选项是否存在 + other_answer = @poll_question.exercise_bank_choices.find_by_custom("choice_text","").first + if other_answer.blank? + question_option = { + :choice_position => p_answer_count + 1, + :choice_text => '' + } + @poll_question.exercise_bank_choices.new question_option + else + other_answer.choice_position = p_answer_count + 1 + other_answer.save + end + end + end + @poll_question.update_attributes(poll_questions_params) + normal_status("问卷更新成功") + rescue Exception => e + uid_logger_error(e.message) + tip_exception("更新失败") + raise ActiveRecord::Rollback + end + end + end + + private + + def bank_admin + tip_exception(403, "无权限") unless @bank.user_id == current_user.id || current_user.admin? + end + + def get_poll + @poll = ExerciseBank.find_by!(id: params[:exercise_bank_id]) + end + + def get_poll_question + @poll_question = ExerciseBankQuestion.find_by!(id: params[:id]) + @poll = @poll_question.exercise_bank + end + + def poll_questions_params + params.require(:poll_question).permit(:question_title,:question_type,:is_necessary,:question_number,:max_choices,:min_choices) + end + + def validates_params + normal_status(-1, "问题标题不能为空!") if params[:question_title].blank? + normal_status(-1, "是否要求必答的值不能为空!") if params[:is_necessary].blank? + normal_status(-1, "问题类型不能为空!") if params[:question_type].blank? + if params[:min_choices].present? && params[:max_choices].present? && (params[:min_choices].to_i > params[:max_choices].to_i) + normal_status(-1, "最小可选不能大于最大可选!") + elsif params[:question_answers].present? && (params[:max_choices].to_i > params[:question_answers].count) + normal_status(-1, "选择题的最大可选项不能大于答案数!") + elsif [1,3].include?(params[:question_type]) && (params[:max_choices].to_i > 0 || params[:min_choices].to_i > 0) + normal_status(-1, "单选题或主观题不能有最大或最小选择数!") + elsif params[:question_type] == 3 && (params[:question_answers] || params[:question_other_answer]) + normal_status(-1, "主观问题不需要可选答案!") + elsif params[:question_type] != 3 + if params[:question_answers].present? && params[:question_answers].include?("") + normal_status(-1, "选择题不能有空值!") + elsif params[:question_other_answer].present? && params[:question_other_answer].length > 0 + normal_status(-1, "其他选项不能有值!") + elsif params[:question_type] == 1 && params[:question_answers].count < 2 + normal_status(-1, "单选题选项不能小于2!") + elsif params[:question_type] == 2 && params[:question_answers].count < 3 + normal_status(-1, "多选题选项不能小于3!") + end + end + end + +end diff --git a/app/controllers/task_banks_controller.rb b/app/controllers/task_banks_controller.rb index 9de4f1faf..e2e7f0a1a 100644 --- a/app/controllers/task_banks_controller.rb +++ b/app/controllers/task_banks_controller.rb @@ -25,11 +25,12 @@ class TaskBanksController < ApplicationController def find_bank @bank = GtaskBank.find_by!(id: params[:id]) - tip_exception(403, "无权限") unless (current_user.certification_teacher? && (@bank.is_public || @bank.user_id == current_user.id)) || current_user.admin? + tip_exception(403, "无权限") unless @bank.user_id == current_user.id || current_user.admin? || + (current_user.certification_teacher? && @bank.is_public) end def bank_admin - tip_exception(403, "无权限") unless (current_user.certification_teacher? && @bank.user_id == current_user.id) || current_user.admin? + tip_exception(403, "无权限") unless @bank.user_id == current_user.id || current_user.admin? end def gtask_bank_params diff --git a/app/views/admins/departments/shared/_department_item.html.erb b/app/views/admins/departments/shared/_department_item.html.erb index 2f39d6248..11584909d 100644 --- a/app/views/admins/departments/shared/_department_item.html.erb +++ b/app/views/admins/departments/shared/_department_item.html.erb @@ -14,7 +14,13 @@ <%= render partial: 'admins/departments/shared/member_users', locals: { department: department } %> -<%= link_to department.identifier.to_s, '#', target: '_blank' %> + + <% if department.identifier.present? %> + <%= link_to department.identifier.to_s, statistics_college_path(department.identifier), target: '_blank' %> + <% else %> + -- + <% end %> + <%= department.host_count %> <%= department.created_at&.strftime('%Y-%m-%d %H:%M') %> diff --git a/app/views/colleges/_course_statistics.html.erb b/app/views/colleges/_course_statistics.html.erb index aa3911c02..e10739fb2 100644 --- a/app/views/colleges/_course_statistics.html.erb +++ b/app/views/colleges/_course_statistics.html.erb @@ -17,10 +17,10 @@ <% if @courses.present? %> <% @courses.each do |course| %> - <%= course.name %> + <%= course.name %> <% teacher_names = course.teacher_users.map(&:real_name).join('、') %> - + <%= teacher_names || '--' %> diff --git a/app/views/colleges/statistics.html.erb b/app/views/colleges/statistics.html.erb index 7c0914910..9f2e8ff7b 100644 --- a/app/views/colleges/statistics.html.erb +++ b/app/views/colleges/statistics.html.erb @@ -104,8 +104,8 @@ 排名 姓名 管理课堂 - 已发布实训作业 - 未发布实训作业 + 已发布实训作业 + 未发布实训作业 学生数 完成率 发布实训 diff --git a/config/routes.rb b/config/routes.rb index a8ea3f676..85bc730d9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -663,6 +663,8 @@ Rails.application.routes.draw do end end + resources :poll_bank_questions + resources :attachments resources :schools do diff --git a/public/assets/.sprockets-manifest-1c370772f16743f825981ab0e5c94237.json b/public/assets/.sprockets-manifest-1c370772f16743f825981ab0e5c94237.json index 1dcc2d71d..66d586724 100644 --- a/public/assets/.sprockets-manifest-1c370772f16743f825981ab0e5c94237.json +++ b/public/assets/.sprockets-manifest-1c370772f16743f825981ab0e5c94237.json @@ -1 +1 @@ -{"files":{"admin-9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d.js":{"logical_path":"admin.js","mtime":"2019-08-29T10:56:46+08:00","size":1325003,"digest":"9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d","integrity":"sha256-m8AdkpYRCK2wZzmuQ9UpKMv0HTg78npK4hJa0jLy8W0="},"admin-96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b.css":{"logical_path":"admin.css","mtime":"2019-08-29T10:56:46+08:00","size":640292,"digest":"96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b","integrity":"sha256-lq8GMDfgur8lsVedHJ0eGQGWHRCljvPUH+ueaP7/NIs="},"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot":{"logical_path":"font-awesome/fontawesome-webfont.eot","mtime":"2019-08-14T17:22:43+08:00","size":165742,"digest":"7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979","integrity":"sha256-e/yrbbmdXPvxcFygU23ceFhUMsxfpBu9etDwCQM7KXk="},"font-awesome/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2":{"logical_path":"font-awesome/fontawesome-webfont.woff2","mtime":"2019-08-14T17:22:43+08:00","size":77160,"digest":"2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe","integrity":"sha256-Kt78vAQefRj88tQXh53FoJmXqmTWdbejxLbOM9oT8/4="},"font-awesome/fontawesome-webfont-ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07.woff":{"logical_path":"font-awesome/fontawesome-webfont.woff","mtime":"2019-08-14T17:22:43+08:00","size":98024,"digest":"ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07","integrity":"sha256-ugxZ3rVFD1y0Gz+TYJ7i0NmVQVh33foiPoqKdTNHTwc="},"font-awesome/fontawesome-webfont-aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8.ttf":{"logical_path":"font-awesome/fontawesome-webfont.ttf","mtime":"2019-08-14T17:22:43+08:00","size":165548,"digest":"aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8","integrity":"sha256-qljzPyOaD7AvXHpsRcBD16msmgkzNYBmlOzW1O3A1qg="},"font-awesome/fontawesome-webfont-ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4.svg":{"logical_path":"font-awesome/fontawesome-webfont.svg","mtime":"2019-08-14T17:22:43+08:00","size":444379,"digest":"ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4","integrity":"sha256-rWFXkmwWIrpOHQPUePFUE2hSS/xG9R5C/g2UX37zI+Q="},"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png":{"logical_path":"logo.png","mtime":"2019-08-22T16:56:33+08:00","size":2816,"digest":"7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423","integrity":"sha256-f/ESVocJv5f5iY/ockm3qPIA/x9I1TfYWvhyFfGHBCM="},"application-761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13.js":{"logical_path":"application.js","mtime":"2019-08-29T10:56:46+08:00","size":1459545,"digest":"761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13","integrity":"sha256-dh0Ls1TWAI6FP9C2hmP1MGxQNdzA9QDWhxAlvK7+CxM="},"application-7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe.css":{"logical_path":"application.css","mtime":"2019-08-29T10:56:46+08:00","size":1146039,"digest":"7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe","integrity":"sha256-fkxPXnRqLWpv73Fdb8cQBbPYq4l+e4+3ywZBk1e9YP4="},"admin-692c392528c56090d88fec92e6ff3b6a3442c6a691d9467c3b51e82625417c53.js":{"logical_path":"admin.js","mtime":"2019-08-29T13:45:30+08:00","size":1324968,"digest":"692c392528c56090d88fec92e6ff3b6a3442c6a691d9467c3b51e82625417c53","integrity":"sha256-aSw5JSjFYJDYj+yS5v87ajRCxqaR2UZ8O1HoJiVBfFM="},"admin-94f6ba0b0c1720d61b4dbf60d7c939f8023f170e36099597cc002f546f90a051.css":{"logical_path":"admin.css","mtime":"2019-08-29T13:45:30+08:00","size":640433,"digest":"94f6ba0b0c1720d61b4dbf60d7c939f8023f170e36099597cc002f546f90a051","integrity":"sha256-lPa6CwwXINYbTb9g18k5+AI/Fw42CZWXzAAvVG+QoFE="},"application-8ba6bce5955b760cd5bb9229d2440d3ef53fcbc4b071d9d0e9206176a0337957.js":{"logical_path":"application.js","mtime":"2019-08-29T13:45:30+08:00","size":1459510,"digest":"8ba6bce5955b760cd5bb9229d2440d3ef53fcbc4b071d9d0e9206176a0337957","integrity":"sha256-i6a85ZVbdgzVu5Ip0kQNPvU/y8SwcdnQ6SBhdqAzeVc="},"application-d85c0ab2b3ec2cef4cbc8c4efce6d5bfa77c8568a0cbfd4ac74e0cb206b6f3eb.css":{"logical_path":"application.css","mtime":"2019-08-29T13:45:30+08:00","size":1146321,"digest":"d85c0ab2b3ec2cef4cbc8c4efce6d5bfa77c8568a0cbfd4ac74e0cb206b6f3eb","integrity":"sha256-2FwKsrPsLO9MvIxO/ObVv6d8hWigy/1Kx04Msga28+s="},"admin-8d82c014df138d1f5f4c8d9e1311d45ab7e1f057c1982604abb5c48529896f1c.js":{"logical_path":"admin.js","mtime":"2019-08-29T17:04:11+08:00","size":1325012,"digest":"8d82c014df138d1f5f4c8d9e1311d45ab7e1f057c1982604abb5c48529896f1c","integrity":"sha256-jYLAFN8TjR9fTI2eExHUWrfh8FfBmCYEq7XEhSmJbxw="},"admin-536370ad413cc83f6cc8d12548cdb754dd74450a1469d5b0041bfc2407d5131a.css":{"logical_path":"admin.css","mtime":"2019-08-29T14:46:57+08:00","size":672902,"digest":"536370ad413cc83f6cc8d12548cdb754dd74450a1469d5b0041bfc2407d5131a","integrity":"sha256-U2NwrUE8yD9syNElSM23VN10RQoUadWwBBv8JAfVExo="},"college-d247f01a7114739cdad7cc35b6061894597ca2e3fd9ee4dc2cfa7ca46ba04747.js":{"logical_path":"college.js","mtime":"2019-08-30T10:09:17+08:00","size":3352746,"digest":"d247f01a7114739cdad7cc35b6061894597ca2e3fd9ee4dc2cfa7ca46ba04747","integrity":"sha256-0kfwGnEUc5za18w1tgYYlFl8ouP9nuTcLPp8pGugR0c="},"college-58adc636bb1f4e5c1f312c875bf34402f8e02dbed9c440e0532baeddbd3b4c27.css":{"logical_path":"college.css","mtime":"2019-08-30T10:07:37+08:00","size":577851,"digest":"58adc636bb1f4e5c1f312c875bf34402f8e02dbed9c440e0532baeddbd3b4c27","integrity":"sha256-WK3GNrsfTlwfMSyHW/NEAvjgLb7ZxEDgUyuu3b07TCc="},"application-0e95a6ce509bdf474a0bc91fafac855ec5a33e564d042a1ce0d56ac8e1471507.js":{"logical_path":"application.js","mtime":"2019-08-30T10:09:17+08:00","size":4231481,"digest":"0e95a6ce509bdf474a0bc91fafac855ec5a33e564d042a1ce0d56ac8e1471507","integrity":"sha256-DpWmzlCb30dKC8kfr6yFXsWjPlZNBCoc4NVqyOFHFQc="},"application-472497f1d0379456a4d31b301162d2cb573c222af5435c1a7c3792e60ccf95ce.css":{"logical_path":"application.css","mtime":"2019-08-30T10:09:17+08:00","size":1787162,"digest":"472497f1d0379456a4d31b301162d2cb573c222af5435c1a7c3792e60ccf95ce","integrity":"sha256-RySX8dA3lFak0xswEWLSy1c8Iir1Q1wafDeS5gzPlc4="}},"assets":{"admin.js":"admin-8d82c014df138d1f5f4c8d9e1311d45ab7e1f057c1982604abb5c48529896f1c.js","admin.css":"admin-536370ad413cc83f6cc8d12548cdb754dd74450a1469d5b0041bfc2407d5131a.css","font-awesome/fontawesome-webfont.eot":"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot","font-awesome/fontawesome-webfont.woff2":"font-awesome/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2","font-awesome/fontawesome-webfont.woff":"font-awesome/fontawesome-webfont-ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07.woff","font-awesome/fontawesome-webfont.ttf":"font-awesome/fontawesome-webfont-aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8.ttf","font-awesome/fontawesome-webfont.svg":"font-awesome/fontawesome-webfont-ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4.svg","logo.png":"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png","application.js":"application-0e95a6ce509bdf474a0bc91fafac855ec5a33e564d042a1ce0d56ac8e1471507.js","application.css":"application-472497f1d0379456a4d31b301162d2cb573c222af5435c1a7c3792e60ccf95ce.css","college.js":"college-d247f01a7114739cdad7cc35b6061894597ca2e3fd9ee4dc2cfa7ca46ba04747.js","college.css":"college-58adc636bb1f4e5c1f312c875bf34402f8e02dbed9c440e0532baeddbd3b4c27.css"}} \ No newline at end of file +{"files":{"admin-9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d.js":{"logical_path":"admin.js","mtime":"2019-08-29T10:56:46+08:00","size":1325003,"digest":"9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d","integrity":"sha256-m8AdkpYRCK2wZzmuQ9UpKMv0HTg78npK4hJa0jLy8W0="},"admin-96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b.css":{"logical_path":"admin.css","mtime":"2019-08-29T10:56:46+08:00","size":640292,"digest":"96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b","integrity":"sha256-lq8GMDfgur8lsVedHJ0eGQGWHRCljvPUH+ueaP7/NIs="},"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot":{"logical_path":"font-awesome/fontawesome-webfont.eot","mtime":"2019-08-14T17:22:43+08:00","size":165742,"digest":"7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979","integrity":"sha256-e/yrbbmdXPvxcFygU23ceFhUMsxfpBu9etDwCQM7KXk="},"font-awesome/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2":{"logical_path":"font-awesome/fontawesome-webfont.woff2","mtime":"2019-08-14T17:22:43+08:00","size":77160,"digest":"2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe","integrity":"sha256-Kt78vAQefRj88tQXh53FoJmXqmTWdbejxLbOM9oT8/4="},"font-awesome/fontawesome-webfont-ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07.woff":{"logical_path":"font-awesome/fontawesome-webfont.woff","mtime":"2019-08-14T17:22:43+08:00","size":98024,"digest":"ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07","integrity":"sha256-ugxZ3rVFD1y0Gz+TYJ7i0NmVQVh33foiPoqKdTNHTwc="},"font-awesome/fontawesome-webfont-aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8.ttf":{"logical_path":"font-awesome/fontawesome-webfont.ttf","mtime":"2019-08-14T17:22:43+08:00","size":165548,"digest":"aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8","integrity":"sha256-qljzPyOaD7AvXHpsRcBD16msmgkzNYBmlOzW1O3A1qg="},"font-awesome/fontawesome-webfont-ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4.svg":{"logical_path":"font-awesome/fontawesome-webfont.svg","mtime":"2019-08-14T17:22:43+08:00","size":444379,"digest":"ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4","integrity":"sha256-rWFXkmwWIrpOHQPUePFUE2hSS/xG9R5C/g2UX37zI+Q="},"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png":{"logical_path":"logo.png","mtime":"2019-08-22T16:56:33+08:00","size":2816,"digest":"7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423","integrity":"sha256-f/ESVocJv5f5iY/ockm3qPIA/x9I1TfYWvhyFfGHBCM="},"application-761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13.js":{"logical_path":"application.js","mtime":"2019-08-29T10:56:46+08:00","size":1459545,"digest":"761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13","integrity":"sha256-dh0Ls1TWAI6FP9C2hmP1MGxQNdzA9QDWhxAlvK7+CxM="},"application-7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe.css":{"logical_path":"application.css","mtime":"2019-08-29T10:56:46+08:00","size":1146039,"digest":"7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe","integrity":"sha256-fkxPXnRqLWpv73Fdb8cQBbPYq4l+e4+3ywZBk1e9YP4="},"admin-692c392528c56090d88fec92e6ff3b6a3442c6a691d9467c3b51e82625417c53.js":{"logical_path":"admin.js","mtime":"2019-08-29T13:45:30+08:00","size":1324968,"digest":"692c392528c56090d88fec92e6ff3b6a3442c6a691d9467c3b51e82625417c53","integrity":"sha256-aSw5JSjFYJDYj+yS5v87ajRCxqaR2UZ8O1HoJiVBfFM="},"admin-94f6ba0b0c1720d61b4dbf60d7c939f8023f170e36099597cc002f546f90a051.css":{"logical_path":"admin.css","mtime":"2019-08-29T13:45:30+08:00","size":640433,"digest":"94f6ba0b0c1720d61b4dbf60d7c939f8023f170e36099597cc002f546f90a051","integrity":"sha256-lPa6CwwXINYbTb9g18k5+AI/Fw42CZWXzAAvVG+QoFE="},"application-8ba6bce5955b760cd5bb9229d2440d3ef53fcbc4b071d9d0e9206176a0337957.js":{"logical_path":"application.js","mtime":"2019-08-29T13:45:30+08:00","size":1459510,"digest":"8ba6bce5955b760cd5bb9229d2440d3ef53fcbc4b071d9d0e9206176a0337957","integrity":"sha256-i6a85ZVbdgzVu5Ip0kQNPvU/y8SwcdnQ6SBhdqAzeVc="},"application-d85c0ab2b3ec2cef4cbc8c4efce6d5bfa77c8568a0cbfd4ac74e0cb206b6f3eb.css":{"logical_path":"application.css","mtime":"2019-08-29T13:45:30+08:00","size":1146321,"digest":"d85c0ab2b3ec2cef4cbc8c4efce6d5bfa77c8568a0cbfd4ac74e0cb206b6f3eb","integrity":"sha256-2FwKsrPsLO9MvIxO/ObVv6d8hWigy/1Kx04Msga28+s="},"admin-8d82c014df138d1f5f4c8d9e1311d45ab7e1f057c1982604abb5c48529896f1c.js":{"logical_path":"admin.js","mtime":"2019-08-29T17:04:11+08:00","size":1325012,"digest":"8d82c014df138d1f5f4c8d9e1311d45ab7e1f057c1982604abb5c48529896f1c","integrity":"sha256-jYLAFN8TjR9fTI2eExHUWrfh8FfBmCYEq7XEhSmJbxw="},"admin-536370ad413cc83f6cc8d12548cdb754dd74450a1469d5b0041bfc2407d5131a.css":{"logical_path":"admin.css","mtime":"2019-08-29T14:46:57+08:00","size":672902,"digest":"536370ad413cc83f6cc8d12548cdb754dd74450a1469d5b0041bfc2407d5131a","integrity":"sha256-U2NwrUE8yD9syNElSM23VN10RQoUadWwBBv8JAfVExo="},"college-d247f01a7114739cdad7cc35b6061894597ca2e3fd9ee4dc2cfa7ca46ba04747.js":{"logical_path":"college.js","mtime":"2019-08-30T10:09:17+08:00","size":3352746,"digest":"d247f01a7114739cdad7cc35b6061894597ca2e3fd9ee4dc2cfa7ca46ba04747","integrity":"sha256-0kfwGnEUc5za18w1tgYYlFl8ouP9nuTcLPp8pGugR0c="},"college-58adc636bb1f4e5c1f312c875bf34402f8e02dbed9c440e0532baeddbd3b4c27.css":{"logical_path":"college.css","mtime":"2019-08-30T10:07:37+08:00","size":577851,"digest":"58adc636bb1f4e5c1f312c875bf34402f8e02dbed9c440e0532baeddbd3b4c27","integrity":"sha256-WK3GNrsfTlwfMSyHW/NEAvjgLb7ZxEDgUyuu3b07TCc="},"application-0e95a6ce509bdf474a0bc91fafac855ec5a33e564d042a1ce0d56ac8e1471507.js":{"logical_path":"application.js","mtime":"2019-08-30T10:09:17+08:00","size":4231481,"digest":"0e95a6ce509bdf474a0bc91fafac855ec5a33e564d042a1ce0d56ac8e1471507","integrity":"sha256-DpWmzlCb30dKC8kfr6yFXsWjPlZNBCoc4NVqyOFHFQc="},"application-472497f1d0379456a4d31b301162d2cb573c222af5435c1a7c3792e60ccf95ce.css":{"logical_path":"application.css","mtime":"2019-08-30T10:09:17+08:00","size":1787162,"digest":"472497f1d0379456a4d31b301162d2cb573c222af5435c1a7c3792e60ccf95ce","integrity":"sha256-RySX8dA3lFak0xswEWLSy1c8Iir1Q1wafDeS5gzPlc4="},"college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js":{"logical_path":"college.js","mtime":"2019-08-30T10:27:31+08:00","size":3352744,"digest":"18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287","integrity":"sha256-GPXoQAMxY06JijWswhh4FcCWwl4Kt0q6NBrpFhZs0oc="},"application-555b621615e9dae684fceecd0966645e87b536664cea8c6f7c6031c5c32cd17a.js":{"logical_path":"application.js","mtime":"2019-08-30T10:27:31+08:00","size":4231479,"digest":"555b621615e9dae684fceecd0966645e87b536664cea8c6f7c6031c5c32cd17a","integrity":"sha256-VVtiFhXp2uaE/O7NCWZkXoe1NmZM6oxvfGAxxcMs0Xo="}},"assets":{"admin.js":"admin-8d82c014df138d1f5f4c8d9e1311d45ab7e1f057c1982604abb5c48529896f1c.js","admin.css":"admin-536370ad413cc83f6cc8d12548cdb754dd74450a1469d5b0041bfc2407d5131a.css","font-awesome/fontawesome-webfont.eot":"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot","font-awesome/fontawesome-webfont.woff2":"font-awesome/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2","font-awesome/fontawesome-webfont.woff":"font-awesome/fontawesome-webfont-ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07.woff","font-awesome/fontawesome-webfont.ttf":"font-awesome/fontawesome-webfont-aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8.ttf","font-awesome/fontawesome-webfont.svg":"font-awesome/fontawesome-webfont-ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4.svg","logo.png":"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png","application.js":"application-555b621615e9dae684fceecd0966645e87b536664cea8c6f7c6031c5c32cd17a.js","application.css":"application-472497f1d0379456a4d31b301162d2cb573c222af5435c1a7c3792e60ccf95ce.css","college.js":"college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js","college.css":"college-58adc636bb1f4e5c1f312c875bf34402f8e02dbed9c440e0532baeddbd3b4c27.css"}} \ No newline at end of file diff --git a/public/assets/application-0e95a6ce509bdf474a0bc91fafac855ec5a33e564d042a1ce0d56ac8e1471507.js b/public/assets/application-555b621615e9dae684fceecd0966645e87b536664cea8c6f7c6031c5c32cd17a.js similarity index 99% rename from public/assets/application-0e95a6ce509bdf474a0bc91fafac855ec5a33e564d042a1ce0d56ac8e1471507.js rename to public/assets/application-555b621615e9dae684fceecd0966645e87b536664cea8c6f7c6031c5c32cd17a.js index bb6b14753..78bb4c39d 100644 --- a/public/assets/application-0e95a6ce509bdf474a0bc91fafac855ec5a33e564d042a1ce0d56ac8e1471507.js +++ b/public/assets/application-555b621615e9dae684fceecd0966645e87b536664cea8c6f7c6031c5c32cd17a.js @@ -129134,7 +129134,7 @@ $(document).on('turbolinks:load', function() { $.get('/colleges/' + schoolId + '/shixun_chart_data', function(data){ $statisticBody.find('.shixun-chart-loading').hide(); if (data.data.length > 0) { - $shixunChart.css('height', '400px').css('width', '400px'); + $shixunChart.css('height', '400px').css('width', '100%'); initShixunChart(data.names, data.data); } else { $statisticBody.find('.shixun-chart-empty').show(); @@ -129246,7 +129246,7 @@ $(document).on('turbolinks:load', function() { $.get('/colleges/' + schoolId + '/student_hot_evaluations', function(data){ $statisticBody.find('.hot-chart-loading').hide(); if (data.names.length > 0) { - $statisticBody.find('.hot-chart').css('height', '400px').css('width', '400px'); + $statisticBody.find('.hot-chart').css('height', '400px').css('width', '100%'); initHotEvaluating(data.names.reverse(), data.values.reverse()); } else { $statisticBody.find('.hot-chart-empty').show(); diff --git a/public/assets/application-0e95a6ce509bdf474a0bc91fafac855ec5a33e564d042a1ce0d56ac8e1471507.js.gz b/public/assets/application-555b621615e9dae684fceecd0966645e87b536664cea8c6f7c6031c5c32cd17a.js.gz similarity index 96% rename from public/assets/application-0e95a6ce509bdf474a0bc91fafac855ec5a33e564d042a1ce0d56ac8e1471507.js.gz rename to public/assets/application-555b621615e9dae684fceecd0966645e87b536664cea8c6f7c6031c5c32cd17a.js.gz index 7247d605f..152f898ef 100644 Binary files a/public/assets/application-0e95a6ce509bdf474a0bc91fafac855ec5a33e564d042a1ce0d56ac8e1471507.js.gz and b/public/assets/application-555b621615e9dae684fceecd0966645e87b536664cea8c6f7c6031c5c32cd17a.js.gz differ diff --git a/public/assets/college-d247f01a7114739cdad7cc35b6061894597ca2e3fd9ee4dc2cfa7ca46ba04747.js b/public/assets/college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js similarity index 99% rename from public/assets/college-d247f01a7114739cdad7cc35b6061894597ca2e3fd9ee4dc2cfa7ca46ba04747.js rename to public/assets/college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js index 9bab89a3d..54367a3c2 100644 --- a/public/assets/college-d247f01a7114739cdad7cc35b6061894597ca2e3fd9ee4dc2cfa7ca46ba04747.js +++ b/public/assets/college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js @@ -109199,7 +109199,7 @@ $(document).on('turbolinks:load', function() { $.get('/colleges/' + schoolId + '/shixun_chart_data', function(data){ $statisticBody.find('.shixun-chart-loading').hide(); if (data.data.length > 0) { - $shixunChart.css('height', '400px').css('width', '400px'); + $shixunChart.css('height', '400px').css('width', '100%'); initShixunChart(data.names, data.data); } else { $statisticBody.find('.shixun-chart-empty').show(); @@ -109311,7 +109311,7 @@ $(document).on('turbolinks:load', function() { $.get('/colleges/' + schoolId + '/student_hot_evaluations', function(data){ $statisticBody.find('.hot-chart-loading').hide(); if (data.names.length > 0) { - $statisticBody.find('.hot-chart').css('height', '400px').css('width', '400px'); + $statisticBody.find('.hot-chart').css('height', '400px').css('width', '100%'); initHotEvaluating(data.names.reverse(), data.values.reverse()); } else { $statisticBody.find('.hot-chart-empty').show(); diff --git a/public/assets/college-d247f01a7114739cdad7cc35b6061894597ca2e3fd9ee4dc2cfa7ca46ba04747.js.gz b/public/assets/college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js.gz similarity index 96% rename from public/assets/college-d247f01a7114739cdad7cc35b6061894597ca2e3fd9ee4dc2cfa7ca46ba04747.js.gz rename to public/assets/college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js.gz index 25e268244..226191a4a 100644 Binary files a/public/assets/college-d247f01a7114739cdad7cc35b6061894597ca2e3fd9ee4dc2cfa7ca46ba04747.js.gz and b/public/assets/college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js.gz differ diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index 070d96b84..8071e2680 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -128,7 +128,8 @@ class studentsList extends Component{ } /// 确认是否下载 confirmysl(url){ - axios.get(url).then((response) => { + // this.props.showGlobalLoading('正在生成文件,请稍后...') + axios.get(url + 'export=true').then((response) => { if(response === undefined){ return } diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index f1c9d5253..a0178c895 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -81,7 +81,7 @@ export function TPMIndexHOC(WrappedComponent) { isRender: false, AccountProfiletype: false, - slowDownloading: false + globalLoading: false } } @@ -137,7 +137,7 @@ export function TPMIndexHOC(WrappedComponent) { keyupListener = (e) => { if (e.key === "Escape") { - this.setState({ slowDownloading: false }) + this.setState({ globalLoading: false }) } } componentWillUnmount() { @@ -378,20 +378,27 @@ export function TPMIndexHOC(WrappedComponent) { type===true?window.open(url):window.location.href=url; } slowDownload = (url, tip) => { - this._slowDownloadTip = tip || '正在生成文件,请稍后...'; - this.setState({ slowDownloading: true }) + this._gLoadingTip = tip || '正在生成文件,请稍后...'; + this.setState({ globalLoading: true }) const fileUrl = url; downloadFile({ url: fileUrl, successCallback: (url) => { - this.setState({ slowDownloading: false }) + this.setState({ globalLoading: false }) console.log('successCallback') }, failCallback: (responseHtml, url) => { - this.setState({ slowDownloading: false }) + this.setState({ globalLoading: false }) console.log('failCallback') } }) + } + showGlobalLoading = (tip) => { + this._gLoadingTip = tip || '加载中,请稍后...'; + this.setState({ globalLoading: true }) + } + hideGlobalLoading = () => { + this.setState({ globalLoading: false }) } render() { let{Headertop,Footerdown, isRender, AccountProfiletype}=this.state; @@ -418,7 +425,10 @@ export function TPMIndexHOC(WrappedComponent) { DownloadFileA:(title,url)=>this.DownloadFileA(title,url), DownloadOpenPdf:(type,url)=>this.DownloadOpenPdf(type,url), - slowDownload: this.slowDownload + slowDownload: this.slowDownload, + showGlobalLoading: this.showGlobalLoading, + hideGlobalLoading: this.hideGlobalLoading, + } return (
@@ -456,7 +466,7 @@ export function TPMIndexHOC(WrappedComponent) { } .globalSpin { - + max-height: 700px !important; } .indexHOC > .ant-spin-nested-loading { background: #000; @@ -471,9 +481,9 @@ export function TPMIndexHOC(WrappedComponent) { } ` } -