diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index c26151a87..99a02106c 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -541,7 +541,7 @@ class StudentWorksController < ApplicationController def destroy_score score = @work.student_works_scores.find_by(id: params[:score_id]) tip_exception("该评阅记录不存在") unless score.present? - tip_exception("该评阅记录不能删除") unless score.allow_delete(current_user, @user_course_identity) + tip_exception("该评阅记录不能删除") unless score.allow_delete(current_user) begin score.destroy normal_status(0,"删除成功") diff --git a/app/models/student_works_score.rb b/app/models/student_works_score.rb index f6c7b3e33..19043f7f8 100644 --- a/app/models/student_works_score.rb +++ b/app/models/student_works_score.rb @@ -13,9 +13,8 @@ belongs_to :student_work identity < Course::STUDENT || self.user == user || self.reviewer_role != 3 end - def allow_delete current_user, identity - self.is_invalid && (current_user == self.user || identity < Course::STUDENT) || - (self.score.nil? && current_user == self.user) + def allow_delete current_user + (self.is_invalid || self.score.nil?) && (current_user == self.user || current_user.admin?) end # 匿评分 diff --git a/app/views/graduation_works/comment_list.json.jbuilder b/app/views/graduation_works/comment_list.json.jbuilder index 51595c55b..77898c91d 100644 --- a/app/views/graduation_works/comment_list.json.jbuilder +++ b/app/views/graduation_works/comment_list.json.jbuilder @@ -15,7 +15,7 @@ json.comment_scores @comment_scores do |score| json.score score.score json.content score.comment json.is_invalid score.is_invalid - json.delete @current_user == score.user && (score.is_invalid || score.score.nil?) + json.delete (@current_user == score.user || @current_user.admin?) && (score.is_invalid || score.score.nil?) json.attachments score.attachments do |atta| json.partial! "attachments/attachment_simple", locals: {attachment: atta, delete: false} end diff --git a/app/views/student_works/comment_list.json.jbuilder b/app/views/student_works/comment_list.json.jbuilder index b14de2f31..1a089587b 100644 --- a/app/views/student_works/comment_list.json.jbuilder +++ b/app/views/student_works/comment_list.json.jbuilder @@ -23,7 +23,7 @@ json.comment_scores @comment_scores do |score| json.content score.comment json.appeal_status score.appeal_status json.is_invalid score.is_invalid - json.delete score.allow_delete(@current_user, @user_course_identity) + json.delete score.allow_delete(@current_user) json.attachments score.attachments do |atta| json.partial! "attachments/attachment_simple", locals: {attachment: atta, delete: false} end diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index a81a273bb..52eda5901 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -471,6 +471,9 @@ export function TPMIndexHOC(WrappedComponent) { .indexHOC > .ant-spin-nested-loading { background: #000; } + .indexHOC > .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot { + top: 50% !important; + } .globalSpin .ant-spin-text { text-shadow: none !important;