Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

issues25489
杨树明 5 years ago
commit 6633e47e86

@ -0,0 +1,119 @@
$(document).on('turbolinks:load', function() {
if ($('body.admins-laboratory-shixuns-index-page').length > 0) {
var $searchForm = $('.laboratory-shixun-list-form .search-form');
var laboratoryId = $('.laboratory-shixun-list-container').data('id');
$searchForm.find('select#tag_id').select2({
placeholder: "请选择",
allowClear: true
});
// 定义状态切换监听事件
var defineStatusChangeFunc = function (doElement, undoElement, url, callback) {
$('.laboratory-shixun-list-container').on('click', doElement, function () {
var $doAction = $(this);
var $undoAction = $doAction.siblings(undoElement);
var laboratoryShixunId = $doAction.data('id');
customConfirm({
content: '确认进行该操作吗?',
ok: function () {
$.ajax({
url: '/admins/laboratories/' + laboratoryId + '/laboratory_shixuns/' + laboratoryShixunId + url,
method: 'POST',
dataType: 'json',
success: function () {
show_success_flash();
$doAction.hide();
$undoAction.show();
if (callback && typeof callback === "function") {
callback(laboratoryShixunId, url);
}
}
});
}
});
});
}
// 首页展示与取消首页展示
var homepageShowCallback = function (laboratoryShixunId, url) {
var $laboratoryShixunItem = $('.laboratory-shixun-list-container').find('.laboratory-shixun-item-' + laboratoryShixunId);
if (url === '/homepage') {
$laboratoryShixunItem.find('.homepage-badge').show();
} else {
$laboratoryShixunItem.find('.homepage-badge').hide();
}
}
defineStatusChangeFunc('.homepage-show-action', '.homepage-hide-action', '/homepage', homepageShowCallback);
defineStatusChangeFunc('.homepage-hide-action', '.homepage-show-action', '/cancel_homepage', homepageShowCallback);
// 添加实训功能
var $addModal = $('.modal.admin-add-laboratory-shixun-modal');
var $addForm = $addModal.find('form.admin-add-laboratory-user-form');
var $shixunSelect = $addForm.find('select.shixun-select');
$addModal.on('show.bs.modal', function(){
$addModal.find('.error').html('');
$shixunSelect.select2('val', ' ');
});
$shixunSelect.select2({
theme: 'bootstrap4',
placeholder: '请输入实训名称/创建者检索',
multiple: true,
minimumInputLength: 1,
ajax: {
delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/shixuns_for_select',
dataType: 'json',
data: function(params){
return { keyword: params.term };
},
processResults: function(data){
return { results: data.shixuns }
}
},
templateResult: function (item) {
if(!item.id || item.id === '') return item.text;
var ele = '<span>'
ele += '<span>' + item.name + '</span>';
ele += '<span class="font-12"> -- ' + item.creator_name + '</span>';
ele += '<span class="font-12"> -- ' + item.status_text+ '</span>';
ele += '</span>';
return $(ele);
},
templateSelection: function(item){
if (item.id) {
}
var ele = '<span>' + (item.name || item.text) + '<span class="font-12"> -- ' + item.creator_name + '</span></span>'
return $(ele);
}
});
$addModal.on('click', '.submit-btn', function(){
$addModal.find('.error').html('');
var shixunIds = $shixunSelect.val();
if (shixunIds && shixunIds.length > 0) {
$.ajax({
method: 'POST',
dataType: 'json',
url: '/admins/laboratories/' + laboratoryId + '/laboratory_shixuns',
data: { shixun_ids: shixunIds },
success: function(){
show_success_flash();
window.location.reload();
},
error: function(res){
$addModal.find('.error').html(res.responseJSON.message);
}
});
} else {
$addModal.find('.error').html('请选择实训');
}
});
}
})

@ -0,0 +1,141 @@
$(document).on('turbolinks:load', function() {
if ($('body.admins-laboratory-subjects-index-page').length > 0) {
var $searchForm = $('.laboratory-subject-list-form .search-form');
var laboratoryId = $('.laboratory-subject-list-container').data('id');
// ************** 学校选择 *************
$searchForm.find('.school-select').select2({
theme: 'bootstrap4',
placeholder: '请选择创建者单位',
minimumInputLength: 1,
ajax: {
delay: 500,
url: '/api/schools/search.json',
dataType: 'json',
data: function (params) {
return {keyword: params.term};
},
processResults: function (data) {
return {results: data.schools}
}
},
templateResult: function (item) {
if (!item.id || item.id === '') return item.text;
return item.name;
},
templateSelection: function (item) {
if (item.id) {
}
return item.name || item.text;
}
});
// 定义状态切换监听事件
var defineStatusChangeFunc = function (doElement, undoElement, url, callback) {
$('.laboratory-subject-list-container').on('click', doElement, function () {
var $doAction = $(this);
var $undoAction = $doAction.siblings(undoElement);
var laboratorySubjectId = $doAction.data('id');
customConfirm({
content: '确认进行该操作吗?',
ok: function () {
$.ajax({
url: '/admins/laboratories/' + laboratoryId + '/laboratory_subjects/' + laboratorySubjectId + url,
method: 'POST',
dataType: 'json',
success: function () {
show_success_flash();
$doAction.hide();
$undoAction.show();
if (callback && typeof callback === "function") {
callback(laboratorySubjectId, url);
}
}
});
}
});
});
}
// 首页展示与取消首页展示
var homepageShowCallback = function (laboratoryShixunId, url) {
var $laboratoryShixunItem = $('.laboratory-subject-list-container').find('.laboratory-subject-item-' + laboratoryShixunId);
if (url === '/homepage') {
$laboratoryShixunItem.find('.homepage-badge').show();
} else {
$laboratoryShixunItem.find('.homepage-badge').hide();
}
}
defineStatusChangeFunc('.homepage-show-action', '.homepage-hide-action', '/homepage', homepageShowCallback);
defineStatusChangeFunc('.homepage-hide-action', '.homepage-show-action', '/cancel_homepage', homepageShowCallback);
// 添加实践课程功能
var $addModal = $('.modal.admin-add-laboratory-subject-modal');
var $addForm = $addModal.find('form.admin-add-laboratory-user-form');
var $subjectSelect = $addForm.find('select.subject-select');
$addModal.on('show.bs.modal', function(){
$addModal.find('.error').html('');
$subjectSelect.select2('val', ' ');
});
$subjectSelect.select2({
theme: 'bootstrap4',
placeholder: '请输入课程名称/创建者检索',
multiple: true,
minimumInputLength: 1,
ajax: {
delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/subjects_for_select',
dataType: 'json',
data: function(params){
return { keyword: params.term };
},
processResults: function(data){
return { results: data.subjects }
}
},
templateResult: function (item) {
if(!item.id || item.id === '') return item.text;
var ele = '<span>'
ele += '<span>' + item.name + '</span>';
ele += '<span class="font-12"> -- ' + item.creator_name + '</span>';
ele += '<span class="font-12"> -- ' + item.status_text+ '</span>';
ele += '</span>';
return $(ele);
},
templateSelection: function(item){
if (item.id) {
}
var ele = '<span>' + (item.name || item.text) + '<span class="font-12"> -- ' + item.creator_name + '</span></span>'
return $(ele);
}
});
$addModal.on('click', '.submit-btn', function(){
$addModal.find('.error').html('');
var subjectIds = $subjectSelect.val();
if (subjectIds && subjectIds.length > 0) {
$.ajax({
method: 'POST',
dataType: 'json',
url: '/admins/laboratories/' + laboratoryId + '/laboratory_subjects',
data: { subject_ids: subjectIds },
success: function(){
show_success_flash();
window.location.reload();
},
error: function(res){
$addModal.find('.error').html(res.responseJSON.message);
}
});
} else {
$addModal.find('.error').html('请选择课程');
}
});
}
})

@ -6,6 +6,7 @@ class Admins::BaseController < ApplicationController
layout 'admin'
skip_before_action :verify_authenticity_token
skip_before_action :setup_laboratory
before_action :require_login, :require_admin!

@ -6,6 +6,16 @@ class Admins::CompetitionPrizeUsersController < Admins::BaseController
include_class = [:competition_team, :competition_prize, :approver,
user: [:process_real_name_apply, :process_professional_apply, user_extension: :school]]
@prize_users = paginate(prize_users.preload(include_class))
respond_to do |format|
format.js
format.html
format.xlsx do
@all_prize_users = prize_users
filename = "#{@competition.name}竞赛获奖人信息列表_#{Time.current.strftime('%Y%m%d%H%M%S')}.xlsx"
render xlsx: 'index', filename: filename
end
end
end
def create

@ -12,10 +12,6 @@ class Admins::EnrollListsController < Admins::BaseController
respond_to do |format|
format.js
format.html
format.xls{
filename = "#{@competition.name}竞赛报名列表_#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}.xls"
send_data(shixun_list_xls(shixuns), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
end
end

@ -1,7 +1,6 @@
class Admins::LaboratoriesController < Admins::BaseController
def index
params[:sort_by] = params[:sort_by].presence || 'id'
params[:sort_direction] = params[:sort_direction].presence || 'desc'
default_sort('id', 'desc')
laboratories = Admins::LaboratoryQuery.call(params)
@laboratories = paginate laboratories.preload(:school, :laboratory_users)
@ -20,6 +19,34 @@ class Admins::LaboratoriesController < Admins::BaseController
render_delete_success
end
def shixuns_for_select
except_shixun_ids = current_laboratory.laboratory_shixuns.pluck(:shixun_id)
shixuns = Shixun.where.not(id: except_shixun_ids)
keyword = params[:keyword].to_s.strip
if keyword.present?
like_sql = 'shixuns.name LIKE :keyword OR CONCAT(users.lastname, users.firstname) LIKE :keyword'
shixuns = shixuns.joins(:user).where(like_sql, keyword: "%#{keyword}%")
end
@shixuns = paginate(shixuns.includes(:user))
end
def subjects_for_select
except_subject_ids = current_laboratory.laboratory_subjects.pluck(:subject_id)
subjects = Subject.where.not(id: except_subject_ids)
keyword = params[:keyword].to_s.strip
if keyword.present?
like_sql = 'subjects.name LIKE :keyword OR CONCAT(users.lastname, users.firstname) LIKE :keyword'
subjects = subjects.joins(:user).where(like_sql, keyword: "%#{keyword}%")
end
@subjects = paginate(subjects.includes(:user))
end
private
def current_laboratory

@ -0,0 +1,41 @@
class Admins::LaboratoryShixunsController < Admins::BaseController
helper_method :current_laboratory, :current_laboratory_shixun
def index
laboratory_shixuns = Admins::LaboratoryShixunQuery.call(current_laboratory, params)
@laboratory_shixuns = paginate laboratory_shixuns.includes(shixun: %i[tag_repertoires user])
end
def create
shixun_ids = Array.wrap(params[:shixun_ids])
shixun_ids = Shixun.where(id: shixun_ids).pluck(:id)
exist_shixun_id = current_laboratory.laboratory_shixuns.where(shixun_id: shixun_ids).pluck(:shixun_id)
LaboratoryShixun.bulk_insert(*%i[shixun_id laboratory_id created_at updated_at]) do |worker|
(shixun_ids - exist_shixun_id).each do |shixun_id|
worker.add(shixun_id: shixun_id, laboratory_id: current_laboratory.id)
end
end
render_ok
end
def homepage
current_laboratory_shixun.update!(homepage: true)
render_ok
end
def cancel_homepage
current_laboratory_shixun.update!(homepage: false)
render_ok
end
private
def current_laboratory
@_current_laboratory ||= Laboratory.find(params[:laboratory_id])
end
def current_laboratory_shixun
@_current_laboratory_shixun ||= current_laboratory.laboratory_shixuns.find(params[:id])
end
end

@ -0,0 +1,43 @@
class Admins::LaboratorySubjectsController < Admins::BaseController
helper_method :current_laboratory, :current_laboratory_subject
def index
laboratory_subjects = Admins::LaboratorySubjectQuery.call(current_laboratory, params)
includes_tables = { subject: [:repertoire, :subject_level_system, user: {user_extension: :school}] }
@laboratory_subjects = paginate(laboratory_subjects.includes(includes_tables))
end
def create
subject_ids = Array.wrap(params[:subject_ids])
subject_ids = Subject.where(id: subject_ids).pluck(:id)
exist_subject_id = current_laboratory.laboratory_subjects.where(subject_id: subject_ids).pluck(:subject_id)
LaboratorySubject.bulk_insert(*%i[subject_id laboratory_id created_at updated_at]) do |worker|
(subject_ids - exist_subject_id).each do |subject_id|
worker.add(subject_id: subject_id, laboratory_id: current_laboratory.id)
end
end
render_ok
end
def homepage
current_laboratory_subject.update!(homepage: true)
render_ok
end
def cancel_homepage
current_laboratory_subject.update!(homepage: false)
render_ok
end
private
def current_laboratory
@_current_laboratory ||= Laboratory.find(params[:laboratory_id])
end
def current_laboratory_subject
@_current_laboratory_subject ||= current_laboratory.laboratory_subjects.find(params[:id])
end
end

@ -2,6 +2,8 @@ module LaboratoryHelper
extend ActiveSupport::Concern
included do
before_action :setup_laboratory
helper_method :current_laboratory
helper_method :default_setting
end
@ -17,4 +19,8 @@ module LaboratoryHelper
def default_setting
@_default_setting ||= LaboratorySetting.find_by(laboratory_id: 1)
end
def setup_laboratory
Laboratory.current = current_laboratory
end
end

@ -18,7 +18,7 @@ class CoursesController < ApplicationController
:left_banner, :top_banner, :apply_to_join_course, :exit_course, :course_groups]
before_action :set_course, only: [:show, :update, :destroy, :settings, :set_invite_code_halt,
:set_public_or_private, :search_teacher_candidate, :teachers, :apply_teachers,
:top_banner, :left_banner, :add_teacher_popup, :add_teacher,
:top_banner, :left_banner, :add_teacher_popup, :add_teacher, :inform_up, :inform_down,
:graduation_group_list, :create_graduation_group, :join_graduation_group,
:course_group_list, :set_course_group, :change_course_admin, :change_course_teacher,
:delete_course_teacher, :teacher_application_review, :students, :all_course_groups,
@ -41,7 +41,7 @@ class CoursesController < ApplicationController
:set_course_group, :create_group_by_importing_file,
:update_task_position, :tasks_list]
before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group,
:change_course_teacher, :course_group_list, :change_member_role,
:change_course_teacher, :course_group_list, :change_member_role,:inform_up, :inform_down,
:teacher_application_review, :apply_teachers, :delete_course_teacher]
before_action :validate_course_name, only: [:create, :update]
before_action :find_board, only: :board_list
@ -281,13 +281,43 @@ class CoursesController < ApplicationController
end
def informs
@informs = @course.informs
@informs = @course.informs.order("position desc")
end
def inform_up
inform = @course.informs.find_by(id: params[:inform_id])
next_inform = inform.next_inform
ActiveRecord::Base.transaction do
if next_inform.blank?
render_error('已经到达最顶部')
else
inform.update_attribute(:position, (inform.position + 1))
next_inform.update_attribute(:position, inform.position - 1)
render_ok
end
end
end
def inform_down
inform = @course.informs.find_by(id: params[:inform_id])
last_inform = inform.last_inform
ActiveRecord::Base.transaction do
if last_inform.blank?
render_error('已经到达最底部')
else
inform.update_attribute(:position, (inform.position - 1))
last_inform.update_attribute(:position, inform.position + 1)
render_ok
end
end
end
def new_informs
inform = Inform.new(container: @course)
inform.name = params[:name]
inform.description = params[:description]
inform.position = @course.informs.maximum(:position).to_i + 1
inform.save!
normal_status("创建成功")
end
@ -300,6 +330,7 @@ class CoursesController < ApplicationController
def delete_informs
inform = @course.informs.find_by(id: params[:inform_id])
@course.informs.where("position > ?", inform.position).update_all("position = position - 1")
inform.destroy!
normal_status("删除成功")
end

@ -26,12 +26,27 @@ class HomeController < ApplicationController
@rep_list << {rep_id: rep.id, rep_name: rep.name, sub_rep_list: sub_rep_list}
end
@shixuns = Shixun.where(homepage_show: 1).includes(:tag_repertoires, :challenges).limit(8)
shixuns = current_laboratory.shixuns
subjects = current_laboratory.subjects
if current_laboratory.main_site?
shixuns = shixuns.where(homepage_show: true)
subjects = subjects.where(homepage_show: true)
else
shixuns = shixuns.where(laboratory_shixuns: { homepage: true })
subjects = subjects.where(laboratory_subjects: { homepage: true })
end
@shixuns = shixuns.includes(:tag_repertoires, :challenges).limit(8)
@subjects = subjects.includes(:repertoire, :shixuns).limit(8)
@subjects = Subject.where(homepage_show: 1).includes(:shixuns, :repertoire).limit(8)
@main_shixuns = Shixun.where(homepage_show: true).includes(:tag_repertoires, :challenges).limit(8)
@main_subjects = Subject.where(homepage_show: true).includes(:shixuns, :repertoire).limit(8)
@tea_users = User.where(homepage_teacher: 1).includes(:user_extension).limit(10).order("experience desc")
@stu_users = User.where(is_test: 0).includes(:user_extension).where(user_extensions: {identity: 1}).limit(10).order("experience desc")
if current_laboratory.main_site?
@tea_users = User.where(homepage_teacher: 1).includes(:user_extension).limit(10).order("experience desc")
@stu_users = User.where(is_test: 0).includes(:user_extension).where(user_extensions: {identity: 1}).limit(10).order("experience desc")
end
end
def search

@ -103,11 +103,14 @@ class MessagesController < ApplicationController
return normal_status(403, "您没有权限进行该操作") if current_user != @message.author && !current_user.teacher_of_course?(@message.board.course)
begin
h = {is_md: true}
email_notify = @message.email_notify ? 1 : @board.course.email_notify && params[:email_notify]
send_email = !@message.email_notify && email_notify
h = {is_md: true, email_notify: email_notify}
m_params = message_params.merge(h)
@message.update_attributes(m_params)
Attachment.associate_container(params[:attachment_ids], @message.id, @message.class.name)
@message.update_content(params[:content])
notify_course_students(@message, @board.course) if send_email
rescue Exception => e
uid_logger_error(e.message)
tip_exception("修改失败")
@ -123,6 +126,7 @@ class MessagesController < ApplicationController
@message.author = current_user
@message.board_id = params[:select_board_id]
@message.message_detail_attributes = {content: params[:content]}
@message.email_notify = @board.course.email_notify && params[:email_notify] ? 1 : 0
@message.save!
Attachment.associate_container(params[:attachment_ids], @message.id, @message.class.name)
if @board.course.email_notify && params[:email_notify]
@ -189,7 +193,7 @@ class MessagesController < ApplicationController
private
def validate_sort_type
normal_status(2, "参数sort_tyope暂时只支持 'time', 'hot'两种") if params.has_key?(:sort_type) && !SORT_TYPE.include?(params[:sort_type].strip)
normal_status(2, "参数sort_type暂时只支持 'time', 'hot'两种") if params.has_key?(:sort_type) && !SORT_TYPE.include?(params[:sort_type].strip)
end
def find_message
@ -207,7 +211,7 @@ class MessagesController < ApplicationController
def notify_course_students message, course
course.students.includes(:user).each do |student|
UserMailer.course_message_email(student&.user&.mail, message.id).deliver_now if student&.user&.mail
UserMailer.course_message_email(student&.user&.mail, message.id).deliver_later if student&.user&.mail
end
end
end

@ -33,7 +33,12 @@ class ShixunsController < ApplicationController
current_user.my_shixuns
else
Shixun.unhidden
end
end
## 云上实验室过滤
unless current_laboratory.main_site?
@shixuns = @shixuns.joins(:laboratory_shixuns).where(laboratory_shixuns: { laboratory_id: current_laboratory.id })
end
## 方向
if params[:tag_level].present? && params[:tag_id].present?
@ -335,6 +340,9 @@ class ShixunsController < ApplicationController
end
end
end
# 将实训标志为该云上实验室建立
Laboratory.current.laboratory_shixuns.create!(shixun: @shixun, ownership: true)
rescue Exception => e
uid_logger_error("copy shixun failed ##{e.message}")
# 删除版本库
@ -430,6 +438,9 @@ class ShixunsController < ApplicationController
GitService.add_repository(repo_path: repo_path)
# todo: 为什么保存的时候要去除后面的.git呢??
@shixun.update_column(:repo_name, repo_path.split(".")[0])
# 将实训标志为该云上实验室建立
Laboratory.current.laboratory_shixuns.create!(shixun: @shixun, ownership: true)
rescue Exception => e
uid_logger_error(e.message)
tip_exception("实训创建失败")

@ -23,16 +23,17 @@ class SubjectsController < ApplicationController
# 最热排序
if reorder == "myshixun_count"
laboratory_join = current_laboratory.main_site? ? '' : " JOIN laboratory_subjects ls ON ls.subject_id = subjects.id AND ls.laboratory_id = #{current_laboratory.id} "
if select
@subjects = Subject.find_by_sql("SELECT subjects.id, subjects.user_id, subjects.name, subjects.stages_count, subjects.repertoire_id, subjects.status,
subjects.shixuns_count, subjects.excellent, sum(shixuns.myshixuns_count) AS myshixun_member_count FROM subjects join stage_shixuns
on stage_shixuns.subject_id = subjects.id join shixuns on shixuns.id = stage_shixuns.shixun_id where
on stage_shixuns.subject_id = subjects.id join shixuns on shixuns.id = stage_shixuns.shixun_id #{laboratory_join} where
subjects.hidden = 0 AND subjects.status = 2 AND subjects.name like '%#{search}%'
AND subjects.repertoire_id = #{select} GROUP BY subjects.id ORDER BY myshixun_member_count DESC")
else
@subjects = Subject.find_by_sql("SELECT subjects.id, subjects.user_id, subjects.name, subjects.stages_count, subjects.repertoire_id, subjects.status,
subjects.shixuns_count, subjects.excellent, sum(shixuns.myshixuns_count) AS myshixun_member_count FROM subjects join stage_shixuns
on stage_shixuns.subject_id = subjects.id join shixuns on shixuns.id = stage_shixuns.shixun_id where
on stage_shixuns.subject_id = subjects.id join shixuns on shixuns.id = stage_shixuns.shixun_id #{laboratory_join} where
subjects.hidden = 0 AND subjects.status = 2 AND subjects.name like '%#{search}%'
GROUP BY subjects.id ORDER BY myshixun_member_count DESC")
end
@ -52,6 +53,11 @@ class SubjectsController < ApplicationController
@subjects = Subject.visible.unhidden
end
# 云上实验室过滤
unless current_laboratory.main_site?
@subjects = @subjects.joins(:laboratory_subjects).where(laboratory_subjects: { laboratory_id: current_laboratory.id })
end
# 类型
if select
@subjects = @subjects.where(repertoire_id: select)
@ -117,6 +123,9 @@ class SubjectsController < ApplicationController
@subject.user_id = current_user.id
@subject.save!
@subject.subject_members.create!(role: 1, user_id: current_user.id)
# 将实践课程标记为该云上实验室建立
Laboratory.current.laboratory_subjects.create!(subject: @subject, ownership: true)
rescue Exception => e
uid_logger_error(e.message)
tip_exception("实训路径创建失败")

@ -414,6 +414,14 @@ module ApplicationHelper
m_t&.include?("src=\"") ? m_t&.gsub("src=\"","src=\"#{origin_url}") : m_t
end
def shixun_status_class(shixun)
case shixun.status
when 0 then 'text-info'
when 1 then 'text-warning'
when 2 then 'text-success'
when 3 then 'text-secondary'
end
end
end

@ -12,6 +12,6 @@ class UserMailer < ApplicationMailer
def course_message_email(mail, message_id)
@message = Message.find_by(id: message_id)
@course = @message&.board&.course
mail(to: mail, subject: '课堂通知') if @message.present? && @course.present?
mail(to: mail, subject: '课堂发布了新的帖子') if @message.present? && @course.present?
end
end

@ -5,4 +5,13 @@ class Inform < ApplicationRecord
validates :description, length: { maximum: 5000 }
has_many :attachments, as: :container, dependent: :destroy
def next_inform
Inform.find_by(position: self.position+1, container_id: self.container_id, container_type: self.container_type)
end
def last_inform
Inform.find_by(position: self.position-1, container_id: self.container_id, container_type: self.container_type)
end
end

@ -8,6 +8,9 @@ class Laboratory < ApplicationRecord
has_many :portal_images, dependent: :destroy
has_many :laboratory_shixuns, dependent: :destroy
has_many :laboratory_subjects, dependent: :destroy
validates :identifier, uniqueness: { case_sensitive: false }, allow_nil: true
delegate :name, :navbar, :footer, :login_logo_url, :nav_logo_url, :tab_logo_url, :default_navbar, to: :laboratory_setting
@ -27,4 +30,25 @@ class Laboratory < ApplicationRecord
find_by_identifier(subdomain)
end
def self.current=(laboratory)
Thread.current[:current_laboratory] = laboratory
end
def self.current
Thread.current[:current_laboratory] ||= Laboratory.find(1)
end
def shixuns
main_site? ? Shixun.all : Shixun.joins(:laboratory_shixuns).where(laboratory_shixuns: { laboratory_id: id })
end
def subjects
main_site? ? Subject.all : Subject.joins(:laboratory_subjects).where(laboratory_subjects: { laboratory_id: id })
end
# 是否为主站
def main_site?
id == 1
end
end

@ -0,0 +1,4 @@
class LaboratoryShixun < ApplicationRecord
belongs_to :laboratory
belongs_to :shixun
end

@ -0,0 +1,4 @@
class LaboratorySubject < ApplicationRecord
belongs_to :laboratory
belongs_to :subject
end

@ -51,6 +51,8 @@ class Shixun < ApplicationRecord
# 实训审核记录
has_many :shixun_reviews, -> {order("shixun_reviews.created_at desc")}, :dependent => :destroy
has_many :laboratory_shixuns, dependent: :destroy
scope :search_by_name, ->(keyword) { where("name like ? or description like ? ",
"%#{keyword}%", "%#{keyword}%") }

@ -24,6 +24,8 @@ class Subject < ApplicationRecord
# 开放课堂
has_many :courses, -> { where("is_delete = 0").order("courses.created_at ASC") }
has_many :laboratory_subjects, dependent: :destroy
validates :name, length: { maximum: 60 }
validates :description, length: { maximum: 8000 }
validates :learning_notes, length: { maximum: 2000 }

@ -235,6 +235,28 @@ class User < ApplicationRecord
end
end
# 实名认证状态
def auth_status
status = if authentication
"已认证"
elsif process_real_name_apply.present?
"待审核"
else
"未认证"
end
end
# 职业认证状态
def pro_status
status = if professional_certification
"已认证"
elsif process_professional_apply.present?
"待审核"
else
"未认证"
end
end
# 判断当前用户是否通过职业认证
def pro_certification?
professional_certification

@ -0,0 +1,36 @@
class Admins::LaboratoryShixunQuery < ApplicationQuery
attr_reader :laboratory, :params
def initialize(laboratory, params)
@laboratory = laboratory
@params = params
end
def call
laboratory_shixuns = laboratory.laboratory_shixuns.joins(:shixun)
keyword = params[:keyword].to_s.strip
if keyword.present?
like_sql = 'shixuns.name LIKE :keyword OR CONCAT(users.lastname, users.firstname) LIKE :keyword'
laboratory_shixuns = laboratory_shixuns.joins(shixun: :user).where(like_sql, keyword: "%#{keyword}%")
end
# 实训状态
laboratory_shixuns = laboratory_shixuns.where(shixuns: { status: params[:status] }) if params[:status].present?
# 技术平台
if params[:tag_id].present?
laboratory_shixuns = laboratory_shixuns.joins(shixun: :shixun_mirror_repositories)
.where(shixun_mirror_repositories: { mirror_repository_id: params[:tag_id] })
end
# 首页展示、单位自建
%i[homepage ownership].each do |column|
if params[column].present? && params[column].to_s == 'true'
laboratory_shixuns = laboratory_shixuns.where(column => true)
end
end
laboratory_shixuns
end
end

@ -0,0 +1,36 @@
class Admins::LaboratorySubjectQuery < ApplicationQuery
attr_reader :laboratory, :params
def initialize(laboratory, params)
@laboratory = laboratory
@params = params
end
def call
laboratory_subjects = laboratory.laboratory_subjects.joins(:subject)
keyword = params[:keyword].to_s.strip
if keyword.present?
like_sql = 'subjects.name LIKE :keyword OR CONCAT(users.lastname, users.firstname) LIKE :keyword'
laboratory_subjects = laboratory_subjects.joins(subject: :user).where(like_sql, keyword: "%#{keyword}%")
end
# 状态
laboratory_subjects = laboratory_subjects.where(subjects: { status: params[:status] }) if params[:status].present?
# 创建者单位
if params[:school_id].present?
laboratory_subjects = laboratory_subjects.joins(subjects: { user: :user_extension })
.where(user_extensions: { school_id: params[:school_id] })
end
# 首页展示、单位自建
%i[homepage ownership].each do |column|
if params[column].present? && params[column].to_s == 'true'
laboratory_subjects = laboratory_subjects.where(column => true)
end
end
laboratory_subjects
end
end

@ -11,6 +11,9 @@ class Admins::ShixunSettingsQuery < ApplicationQuery
def call
all_shixuns = Shixun.all
all_shixuns = all_shixuns.where(id: params[:id]) if params[:id].present?
status =
case params[:status]
when "editing" then [0]

@ -12,6 +12,8 @@ class Admins::SubjectQuery < ApplicationQuery
def call
subjects = Subject.all
subjects = subjects.where(id: params[:id]) if params[:id].present?
# 状态过滤
status =
case params[:status].to_s.strip

@ -94,8 +94,8 @@ class DuplicateCourseService < ApplicationService
exercise = course.exercises.create!(attrs.merge(user_id: user.id))
origin_exercise.exercise_questions.find_each do |origin_question|
question_attrs = origin_question.as_json(only: %i[question_title question_type question_number question_score])
question_attrs[:question_type] ||= 1
question_attrs = origin_question.as_json(only: %i[question_title question_type question_number question_score shixun_name shixun_id is_ordered level])
# question_attrs[:question_type] ||= 1
question = exercise.exercise_questions.create!(question_attrs)
exercise_choice_map = {}
@ -103,15 +103,20 @@ class DuplicateCourseService < ApplicationService
choice_attrs = { choice_position: index + 1, choice_text: origin_choice.choice_text }
choice = question.exercise_choices.create!(choice_attrs)
exercise_choice_map[origin_choice.id] = choice.id
# exercise_choice_map[origin_choice.id] = choice.id 标准答案中存的是choice_position, 直接取原题的exercise_choice_id就行
end
origin_question.exercise_standard_answers.find_each do |origin_answer|
question.exercise_standard_answers.create!(
exercise_choice_id: exercise_choice_map[origin_answer.exercise_choice_id],
exercise_choice_id: origin_answer.exercise_choice_id,
answer_text: origin_answer.answer_text
)
end
origin_question.exercise_shixun_challenges.each_with_index do |sc, index|
question.exercise_shixun_challenges.create!({position: index+1, challenge_id: sc.challenge_id,
shixun_id: sc.shixun_id, question_score: sc.question_score})
end
end
origin_exercise.exercise_bank.increment!(:quotes) if exercise.exercise_bank

@ -50,6 +50,12 @@
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
<%= link_to '清除', admins_competition_competition_prize_users_path(@competition), class: "btn btn-default",'data-disable-with': '清除中...' %>
<% end %>
<div class="mt-3 d-flex align-items-end">
<%= link_to '导出', admins_competition_competition_prize_users_path(competition_id: @competition.id, format: :xlsx), class: 'btn btn-primary' %>
<%#= javascript_void_link '导出', class: 'btn btn-primary', 'data-url': admins_competition_competition_prize_users_path(competition_id: @competition.id, format: :xlsx) %>
</div>
</div>
</div>

@ -0,0 +1,33 @@
wb = xlsx_package.workbook
wb.styles do |s|
blue_cell = s.add_style :bg_color => "FAEBDC", :sz => 10,:height => 25,:b => true, :border => { :style => :thin, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center}
wb.add_worksheet(name: "#{@competition.name}证书审批列表") do |sheet|
sheet.add_row %w(序号 排名 奖项 战队ID 战队名称 姓名 职业 学号 学校名称 学院名称 地区 实名认证 职业认证 手机号码 队长 签领/开户行及银行卡号 审批时间 审批人), :height => 25,:style => blue_cell
@all_prize_users.each_with_index do |prize_user, index|
user = prize_user.user
data = [
index + 1,
prize_user.rank,
prize_user.competition_prize.name,
prize_user.competition_team_id,
prize_user.competition_team.name,
user.real_name,
user.identity,
user.student_id,
user.school_name,
user.department_name,
user.location,
user.auth_status,
user.pro_status,
user.phone,
prize_user.leader? ? "是" : "-",
[prize_user.extra&.[]('bank'), prize_user.extra&.[]('second_bank'), prize_user.extra&.[]('card_no')].compact.join('/'),
prize_user.approved_at&.strftime('%Y-%m-%d %H:%M'),
prize_user.approver&.real_name
]
sheet.add_row(data)
end
end
end

@ -41,6 +41,9 @@
<div class="dropdown-menu more-action-dropdown">
<%= link_to '轮播图', admins_laboratory_carousels_path(laboratory), class: 'dropdown-item' %>
<%= link_to '查看实训项目', admins_laboratory_laboratory_shixuns_path(laboratory), class: 'dropdown-item' %>
<%= link_to '查看实践课程', admins_laboratory_laboratory_subjects_path(laboratory), class: 'dropdown-item' %>
<% if school.present? && laboratory.id != 1 %>
<%= delete_link '删除', admins_laboratory_path(laboratory, element: ".laboratory-item-#{laboratory.id}"), class: 'dropdown-item delete-laboratory-action' %>
<% end %>

@ -0,0 +1,7 @@
json.shixuns do
json.array! @shixuns do |shixun|
json.extract! shixun, :id, :name, :status
json.status_text I18n.t("shixun.status.#{shixun.status}")
json.creator_name shixun.user.real_name
end
end

@ -0,0 +1,7 @@
json.subjects do
json.array! @subjects do |subject|
json.extract! subject, :id, :name, :status
json.status_text I18n.t("subject.status.#{subject.status}")
json.creator_name subject.user.real_name
end
end

@ -0,0 +1,45 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('云上实验室', admins_laboratories_path) %>
<% add_admin_breadcrumb("#{current_laboratory.name} - 实训项目") %>
<% end %>
<div class="box search-form-container laboratory-shixun-list-form">
<%= form_tag(admins_laboratory_laboratory_shixuns_path(current_laboratory), method: :get, class: 'form-inline search-form', remote: true) do %>
<div class="form-group mr-1">
<label for="status">状态:</label>
<% status_options = [['全部', ''], ['编辑中', 0], ['审核中', 1], ['已发布', 2], ['已关闭', 3]] %>
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
</div>
<div class="form-group mr-4">
<label for="status">技术平台:</label>
<%= select_tag(:tag_id, options_for_select(MirrorRepository.pluck(:type_name,:id).unshift(['']), params[:tag_id]), class: 'form-control') %>
</div>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-12 col-md-2 mr-3', placeholder: '创建者/实训名称检索') %>
<div class="form-check mr-2">
<%= hidden_field_tag(:homepage, false, id:'') %>
<%= check_box_tag(:homepage, true, params[:homepage].to_s == 'true', class: 'form-check-input') %>
<label class="form-check-label" for="homepage">只看首页展示</label>
</div>
<div class="form-check mr-2">
<%= hidden_field_tag(:ownership, false, id:'') %>
<%= check_box_tag(:ownership, true, params[:ownership].to_s == 'true', class: 'form-check-input') %>
<label class="form-check-label" for="ownership">只看自建</label>
</div>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
<%= link_to '清空', admins_laboratory_laboratory_shixuns_path(current_laboratory), class: 'btn btn-default','data-disable-with': '清空中...' %>
<% end %>
<%= javascript_void_link('添加实训', class: 'btn btn-primary', data: { toggle: 'modal', target: '.admin-add-laboratory-shixun-modal' }) %>
</div>
<div class="box laboratory-shixun-list-container" data-id="<%= current_laboratory.id %>">
<%= render partial: 'admins/laboratory_shixuns/shared/list', locals: { laboratory_shixuns: @laboratory_shixuns } %>
</div>
<%= render partial: 'admins/laboratory_shixuns/shared/add_laboratory_shixun_modal' %>

@ -0,0 +1 @@
$('.laboratory-shixun-list-container').html("<%= j(render partial: 'admins/laboratory_shixuns/shared/list', locals: { laboratory_shixuns: @laboratory_shixuns }) %>");

@ -0,0 +1,28 @@
<div class="modal fade admin-add-laboratory-shixun-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">添加实训</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="admin-add-laboratory-user-form">
<div class="form-group d-flex">
<label class="col-form-label">选择实训:</label>
<div class="d-flex flex-column-reverse w-75">
<select id="shixun_ids" name="shixun_ids" class="form-control shixun-select" multiple></select>
</div>
</div>
<div class="error text-danger"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

@ -0,0 +1,27 @@
<table class="table text-center laboratory-shixun-list-table">
<thead class="thead-light">
<tr>
<th width="28%" class="text-left">实训名称</th>
<th width="12%">技术平台</th>
<th width="14%" class="text-left">技术体系</th>
<th width="10%">封面</th>
<th width="8%">创建者</th>
<th width="8%">状态</th>
<th width="10%">执行时间</th>
<th width="14%">操作</th>
</tr>
</thead>
<tbody>
<% if laboratory_shixuns.present? %>
<% laboratory_shixuns.each do |laboratory_shixun| %>
<tr class="laboratory-shixun-item-<%= laboratory_shixun.id %>">
<%= render partial: 'admins/laboratory_shixuns/shared/td', locals: { laboratory_shixun: laboratory_shixun } %>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: laboratory_shixuns } %>

@ -0,0 +1,28 @@
<%- shixun = laboratory_shixun.shixun -%>
<td class="text-left">
<%= link_to "/shixuns/#{shixun.identifier}", target: '_blank' do %>
<%= shixun.name %>
<span class="badge badge-pill badge-success homepage-badge" style="<%= laboratory_shixun.homepage? ? '' : 'display:none' %>">首页</span>
<span class="badge badge-pill badge-info ownership-badge" style="<%= laboratory_shixun.ownership ? '' : 'display:none' %>">自建</span>
<% end %>
</td>
<td><%= shixun.shixun_main_name %></td>
<td class="text-left">
<% shixun.tag_repertoires.each do |tag| %>
<span class="badge badge-secondary"><%= tag.name %></span>
<% end %>
</td>
<td>
<% imageExists = Util::FileManage.exists?(shixun) %>
<% imageUrl = imageExists ? '/' + url_to_avatar(shixun) : '' %>
<%= image_tag(imageUrl, width: 60, height: 40, class: "preview-image shixun-image-#{shixun.id}", data: { toggle: 'tooltip', title: '点击预览' }, style: imageExists ? '' : 'display:none') %>
</td>
<td><%= link_to shixun.user&.real_name, "/users/#{shixun.user&.login}", target:'_blank' %></td>
<td><span class="<%= shixun_status_class(shixun) %>"><%= t("shixun.status.#{shixun.status}") %></span></td>
<td><%= shixun.excute_time %></td>
<td class="action-container">
<%= link_to('去修改', admins_shixun_settings_path(id: laboratory_shixun.shixun_id)) %>
<%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? 'display:none' : '') %>
<%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? '' : 'display:none') %>
</td>

@ -0,0 +1,45 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('云上实验室', admins_laboratories_path) %>
<% add_admin_breadcrumb("#{current_laboratory.name} - 实践课程") %>
<% end %>
<div class="box search-form-container laboratory-subject-list-form">
<%= form_tag(admins_laboratory_laboratory_subjects_path(current_laboratory), method: :get, class: 'form-inline search-form', remote: true) do %>
<div class="form-group mr-1">
<label for="status">状态:</label>
<% status_options = [['全部', ''], ['编辑中', 0], ['审核中', 1], ['已发布', 2]] %>
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
</div>
<div class="form-group col-12 col-md-3">
<label for="school_name">单位:</label>
<%= select_tag :school_id, options_for_select([''], params[:school_id]), class: 'form-control school-select flex-1' %>
</div>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-12 col-md-2 mr-3', placeholder: '创建者/课程名称检索') %>
<div class="form-check mr-2">
<%= hidden_field_tag(:homepage, false, id:'') %>
<%= check_box_tag(:homepage, true, params[:homepage].to_s == 'true', class: 'form-check-input') %>
<label class="form-check-label" for="homepage">只看首页展示</label>
</div>
<div class="form-check mr-2">
<%= hidden_field_tag(:ownership, false, id:'') %>
<%= check_box_tag(:ownership, true, params[:ownership].to_s == 'true', class: 'form-check-input') %>
<label class="form-check-label" for="ownership">只看自建</label>
</div>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
<%= link_to '清空', admins_laboratory_laboratory_subjects_path(current_laboratory), class: 'btn btn-default','data-disable-with': '清空中...' %>
<% end %>
<%= javascript_void_link('添加课程', class: 'btn btn-primary', data: { toggle: 'modal', target: '.admin-add-laboratory-subject-modal' }) %>
</div>
<div class="box laboratory-subject-list-container" data-id="<%= current_laboratory.id %>">
<%= render partial: 'admins/laboratory_subjects/shared/list', locals: { laboratory_subjects: @laboratory_subjects } %>
</div>
<%= render partial: 'admins/laboratory_subjects/shared/add_laboratory_subject_modal' %>

@ -0,0 +1 @@
$('.laboratory-subject-list-container').html("<%= j(render partial: 'admins/laboratory_subjects/shared/list', locals: { laboratory_subjects: @laboratory_subjects }) %>");

@ -0,0 +1,28 @@
<div class="modal fade admin-add-laboratory-subject-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">添加实践课程</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="admin-add-laboratory-user-form">
<div class="form-group d-flex">
<label class="col-form-label">选择实践课程:</label>
<div class="d-flex flex-column-reverse w-75">
<select id="subject_ids" name="subject_ids" class="form-control subject-select" multiple></select>
</div>
</div>
<div class="error text-danger"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

@ -0,0 +1,48 @@
<table class="table text-center laboratory-subject-list-table">
<thead class="thead-light">
<tr>
<th width="28%" class="text-left">课程名称</th>
<th width="12%">技术体系</th>
<th width="10%">等级体系</th>
<th width="10%">封面</th>
<th width="8%">创建者</th>
<th width="10%">单位</th>
<th width="8%">状态</th>
<th width="14%">操作</th>
</tr>
</thead>
<tbody>
<% if laboratory_subjects.present? %>
<% laboratory_subjects.each do |laboratory_subject| %>
<tr class="laboratory-subject-item-<%= laboratory_subject.id %>">
<%- subject = laboratory_subject.subject -%>
<td class="text-left">
<%= link_to(subject.name, "/paths/#{subject.id}", target: '_blank') %>
<span class="badge badge-pill badge-success homepage-badge" style="<%= laboratory_subject.homepage? ? '' : 'display:none' %>">首页</span>
<span class="badge badge-pill badge-success ownership-badge" style="<%= laboratory_subject.ownership? ? '' : 'display:none' %>">自建</span>
</td>
<td><%= display_text subject.repertoire&.name %></td>
<td><%= display_text subject.subject_level_system&.name %></td>
<td>
<% image_exists = Util::FileManage.exists?(subject) %>
<%= image_tag(image_exists ? Util::FileManage.source_disk_file_url(subject) : '', height: 40, class: "w-100 preview-image subject-image-#{subject.id}", style: image_exists ? '' : 'display:none') %>
</td>
<td><%= subject.user.real_name %></td>
<td><%= subject.user.school_name %></td>
<td><%= display_subject_status(subject) %></td>
<td class="action-container">
<%= link_to('去修改', admins_subjects_path(id: laboratory_subject.subject_id)) %>
<%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? 'display:none' : '') %>
<%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? '' : 'display:none') %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: laboratory_subjects } %>

@ -3,7 +3,8 @@ json.author do
end
json.id message.id
json.content content_safe(message.contents_show(identity))
# json.content content_safe(message.contents_show(identity))
json.content message.contents_show(identity)
json.time time_from_now(message.created_at)
json.hidden message.hidden
# 主贴与子贴不一致

@ -3,17 +3,19 @@ json.images_url @images_url
json.reps @rep_list
json.shixuns do
json.partial! 'shixuns/shixun', locals: {shixuns: @shixuns}
json.partial! 'shixuns/shixun', locals: {shixuns: @shixuns.present? ? @shixuns : @main_shixuns}
end
json.subjects do
json.partial! 'subjects/subject', locals: {subjects: @subjects}
json.partial! 'subjects/subject', locals: {subjects: @subjects.present? ? @subjects : @main_subjects}
end
json.teachers do
json.partial! 'users/user_small', users: @tea_users
end
if current_laboratory.main_site?
json.teachers do
json.partial! 'users/user_small', users: @tea_users
end
json.students do
json.partial! 'users/user_small', users: @stu_users
json.students do
json.partial! 'users/user_small', users: @stu_users
end
end

@ -1,2 +1,2 @@
json.extract! message, :id, :parent_id, :subject, :created_on, :total_replies_count, :total_praises_count,
:is_md, :praises_count, :visits, :sticky, :is_hidden, :is_public
:is_md, :praises_count, :visits, :sticky, :is_hidden, :is_public, :email_notify

@ -1,7 +1,7 @@
<html>
<head>
<meta charset="utf-8">
<title><%= @course.name %>通知</title>
<title><%= @course.name %> 发布了新的帖子</title>
<style type="text/css">
/* 验证链接页面 */
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
@ -36,22 +36,16 @@
<p style="color:#333; font-size:16px; margin-bottom:15px;font-weight: bold">
您好!
</p>
<p style="color:#333;">
正在注册Educoder请在10分钟内在注册页输入此验证码并进行下一步操作。
如非你本人操作,请忽略此邮件。
<p style="color:#333; ">
参与的课堂:<%= @course.name %>,有新的帖子发布了:
<a href="https://www.educoder.net/courses/<%= @course.id %>/boards/<%= @message.board_id %>/messages/<%= @message.id %>" style="font-weight: normal; color:#ff7500;"><%= @message.subject %></a>
</p>
<div style="text-align: center;">
<div style="display:block; height: 45px; line-height:45px;padding:0 30px; width:100px; font-size: 20px; font-weight: bold; background:#ffd9d9; color:#e72c37; margin:30px auto;">
<p><%= @code %></p>
</div>
<div style="text-align: center; margin-top:40px;">
<span style="font-weight: normal;color:#666;">
此邮件为系统所发,请勿直接回复。<br/>
要解决问题或了解您的帐户详情,您可以访问 <a href="https://www.educoder.net/help?index=5" style="font-weight: normal; color:#ff7500;">帮助中心</a>。
</span>
</div>
<p style="color:#666; margin-top:30px;">
如果您并未发过此请求,则可能是因为其他用户在注册时误输了您的邮件地址,而使您收到了这封邮件,那么您可以放心的忽略此邮件,无需进一步采取任何操作。
</p>
</div>
<div style="padding:20px; color:#333; line-height: 1.9;background:#46484c;border:1px solid #ddd; border-top:none; width: 558px;">
<a href="https:///www.educoder.net/" style="font-weight: normal; color:#fff;">www.educoder.net</a>

@ -1,6 +1,7 @@
admins-mirror_scripts: 'admins-mirror_repositories'
admins-laboratory_settings: 'admins-laboratories'
admins-carousels: 'admins-laboratories'
admins-laboratory_shixuns: 'admins-laboratories'
admins-competition_settings: 'admins-competitions'
admins-enroll_lists: 'admins-competitions'
admins-competition_prize_users: 'admins-competitions'

@ -381,6 +381,8 @@ Rails.application.routes.draw do
get 'work_score'
get 'act_score'
get 'statistics'
post :inform_up
post :inform_down
end
collection do
@ -1032,12 +1034,30 @@ Rails.application.routes.draw do
post :replace_image_url, on: :member
end
resources :laboratories, only: [:index, :create, :destroy] do
member do
get :shixuns_for_select
get :subjects_for_select
end
resource :laboratory_setting, only: [:show, :update]
resource :laboratory_user, only: [:create, :destroy]
resources :carousels, only: [:index, :create, :update, :destroy] do
post :drag, on: :collection
end
resources :laboratory_shixuns, only: [:index, :create] do
member do
post :homepage
post :cancel_homepage
end
end
resources :laboratory_subjects, only: [:index, :create] do
member do
post :homepage
post :cancel_homepage
end
end
end
resources :competitions, only: [:index, :destroy, :create] do

@ -0,0 +1,13 @@
class CreateLaboratoryShixuns < ActiveRecord::Migration[5.2]
def change
create_table :laboratory_shixuns do |t|
t.references :laboratory
t.references :shixun
t.boolean :ownership, default: false
t.boolean :homepage, default: false
t.timestamps
end
end
end

@ -0,0 +1,17 @@
class AddPositionForInforms < ActiveRecord::Migration[5.2]
def change
add_column :informs, :position, :integer, :default => 1
course_ids = Inform.where(container_type: 'Course').pluck(:container_id).uniq
courses = Course.where(id: course_ids)
courses.find_each do |course|
next if course.informs.count == 1
informs = course.informs.order("created_at asc")
informs.each_with_index do |inform, index|
inform.update_attribute(:position, index+1)
end
end
end
end

@ -0,0 +1,13 @@
class CreateLaboratorySubjects < ActiveRecord::Migration[5.2]
def change
create_table :laboratory_subjects do |t|
t.references :laboratory
t.references :subject
t.boolean :ownership, default: false
t.boolean :homepage, default: false
t.timestamps
end
end
end

@ -0,0 +1,5 @@
class AddEmailNotifyToMessages < ActiveRecord::Migration[5.2]
def change
add_column :messages, :email_notify, :boolean, default: 0
end
end

File diff suppressed because one or more lines are too long

@ -137693,6 +137693,268 @@ $(document).on('turbolinks:load', function() {
});
}
});
$(document).on('turbolinks:load', function() {
if ($('body.admins-laboratory-shixuns-index-page').length > 0) {
var $searchForm = $('.laboratory-shixun-list-form .search-form');
var laboratoryId = $('.laboratory-shixun-list-container').data('id');
$searchForm.find('select#tag_id').select2({
placeholder: "请选择",
allowClear: true
});
// 定义状态切换监听事件
var defineStatusChangeFunc = function (doElement, undoElement, url, callback) {
$('.laboratory-shixun-list-container').on('click', doElement, function () {
var $doAction = $(this);
var $undoAction = $doAction.siblings(undoElement);
var laboratoryShixunId = $doAction.data('id');
customConfirm({
content: '确认进行该操作吗?',
ok: function () {
$.ajax({
url: '/admins/laboratories/' + laboratoryId + '/laboratory_shixuns/' + laboratoryShixunId + url,
method: 'POST',
dataType: 'json',
success: function () {
show_success_flash();
$doAction.hide();
$undoAction.show();
if (callback && typeof callback === "function") {
callback(laboratoryShixunId, url);
}
}
});
}
});
});
}
// 首页展示与取消首页展示
var homepageShowCallback = function (laboratoryShixunId, url) {
var $laboratoryShixunItem = $('.laboratory-shixun-list-container').find('.laboratory-shixun-item-' + laboratoryShixunId);
if (url === '/homepage') {
$laboratoryShixunItem.find('.homepage-badge').show();
} else {
$laboratoryShixunItem.find('.homepage-badge').hide();
}
}
defineStatusChangeFunc('.homepage-show-action', '.homepage-hide-action', '/homepage', homepageShowCallback);
defineStatusChangeFunc('.homepage-hide-action', '.homepage-show-action', '/cancel_homepage', homepageShowCallback);
// 添加实训功能
var $addModal = $('.modal.admin-add-laboratory-shixun-modal');
var $addForm = $addModal.find('form.admin-add-laboratory-user-form');
var $shixunSelect = $addForm.find('select.shixun-select');
$addModal.on('show.bs.modal', function(){
$addModal.find('.error').html('');
$shixunSelect.select2('val', ' ');
});
$shixunSelect.select2({
theme: 'bootstrap4',
placeholder: '请输入实训名称/创建者检索',
multiple: true,
minimumInputLength: 1,
ajax: {
delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/shixuns_for_select',
dataType: 'json',
data: function(params){
return { keyword: params.term };
},
processResults: function(data){
return { results: data.shixuns }
}
},
templateResult: function (item) {
if(!item.id || item.id === '') return item.text;
var ele = '<span>'
ele += '<span>' + item.name + '</span>';
ele += '<span class="font-12"> -- ' + item.creator_name + '</span>';
ele += '<span class="font-12"> -- ' + item.status_text+ '</span>';
ele += '</span>';
return $(ele);
},
templateSelection: function(item){
if (item.id) {
}
var ele = '<span>' + (item.name || item.text) + '<span class="font-12"> -- ' + item.creator_name + '</span></span>'
return $(ele);
}
});
$addModal.on('click', '.submit-btn', function(){
$addModal.find('.error').html('');
var shixunIds = $shixunSelect.val();
if (shixunIds && shixunIds.length > 0) {
$.ajax({
method: 'POST',
dataType: 'json',
url: '/admins/laboratories/' + laboratoryId + '/laboratory_shixuns',
data: { shixun_ids: shixunIds },
success: function(){
show_success_flash();
window.location.reload();
},
error: function(res){
$addModal.find('.error').html(res.responseJSON.message);
}
});
} else {
$addModal.find('.error').html('请选择实训');
}
});
}
})
;
$(document).on('turbolinks:load', function() {
if ($('body.admins-laboratory-subjects-index-page').length > 0) {
var $searchForm = $('.laboratory-subject-list-form .search-form');
var laboratoryId = $('.laboratory-subject-list-container').data('id');
// ************** 学校选择 *************
$searchForm.find('.school-select').select2({
theme: 'bootstrap4',
placeholder: '请选择创建者单位',
minimumInputLength: 1,
ajax: {
delay: 500,
url: '/api/schools/search.json',
dataType: 'json',
data: function (params) {
return {keyword: params.term};
},
processResults: function (data) {
return {results: data.schools}
}
},
templateResult: function (item) {
if (!item.id || item.id === '') return item.text;
return item.name;
},
templateSelection: function (item) {
if (item.id) {
}
return item.name || item.text;
}
});
// 定义状态切换监听事件
var defineStatusChangeFunc = function (doElement, undoElement, url, callback) {
$('.laboratory-subject-list-container').on('click', doElement, function () {
var $doAction = $(this);
var $undoAction = $doAction.siblings(undoElement);
var laboratorySubjectId = $doAction.data('id');
customConfirm({
content: '确认进行该操作吗?',
ok: function () {
$.ajax({
url: '/admins/laboratories/' + laboratoryId + '/laboratory_subjects/' + laboratorySubjectId + url,
method: 'POST',
dataType: 'json',
success: function () {
show_success_flash();
$doAction.hide();
$undoAction.show();
if (callback && typeof callback === "function") {
callback(laboratorySubjectId, url);
}
}
});
}
});
});
}
// 首页展示与取消首页展示
var homepageShowCallback = function (laboratoryShixunId, url) {
var $laboratoryShixunItem = $('.laboratory-subject-list-container').find('.laboratory-subject-item-' + laboratoryShixunId);
if (url === '/homepage') {
$laboratoryShixunItem.find('.homepage-badge').show();
} else {
$laboratoryShixunItem.find('.homepage-badge').hide();
}
}
defineStatusChangeFunc('.homepage-show-action', '.homepage-hide-action', '/homepage', homepageShowCallback);
defineStatusChangeFunc('.homepage-hide-action', '.homepage-show-action', '/cancel_homepage', homepageShowCallback);
// 添加实践课程功能
var $addModal = $('.modal.admin-add-laboratory-subject-modal');
var $addForm = $addModal.find('form.admin-add-laboratory-user-form');
var $subjectSelect = $addForm.find('select.subject-select');
$addModal.on('show.bs.modal', function(){
$addModal.find('.error').html('');
$subjectSelect.select2('val', ' ');
});
$subjectSelect.select2({
theme: 'bootstrap4',
placeholder: '请输入课程名称/创建者检索',
multiple: true,
minimumInputLength: 1,
ajax: {
delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/subjects_for_select',
dataType: 'json',
data: function(params){
return { keyword: params.term };
},
processResults: function(data){
return { results: data.subjects }
}
},
templateResult: function (item) {
if(!item.id || item.id === '') return item.text;
var ele = '<span>'
ele += '<span>' + item.name + '</span>';
ele += '<span class="font-12"> -- ' + item.creator_name + '</span>';
ele += '<span class="font-12"> -- ' + item.status_text+ '</span>';
ele += '</span>';
return $(ele);
},
templateSelection: function(item){
if (item.id) {
}
var ele = '<span>' + (item.name || item.text) + '<span class="font-12"> -- ' + item.creator_name + '</span></span>'
return $(ele);
}
});
$addModal.on('click', '.submit-btn', function(){
$addModal.find('.error').html('');
var subjectIds = $subjectSelect.val();
if (subjectIds && subjectIds.length > 0) {
$.ajax({
method: 'POST',
dataType: 'json',
url: '/admins/laboratories/' + laboratoryId + '/laboratory_subjects',
data: { subject_ids: subjectIds },
success: function(){
show_success_flash();
window.location.reload();
},
error: function(res){
$addModal.find('.error').html(res.responseJSON.message);
}
});
} else {
$addModal.find('.error').html('请选择课程');
}
});
}
})
;
$(document).on('turbolinks:load', function() {
if ($('body.admins-library-applies-index-page').length > 0) {
var $searchFrom = $('.library-applies-list-form');

@ -0,0 +1,36 @@
项目里有许多其他地方也有marked.js除了js_min_all.js里的其他地方的marked.js都没被使用到。
// 说明:左边 --> 右边 左边被替换成了右边的内容
// 这里的替换是直接在marked.min.js中完成的。
1、 // b(i[1].replace(/^ *| *\| *$/g,"")) --> i[1].replace(/^ *| *\| *$/g, "").split(/ *\| */) table没识别的问题
2、 // header.length===a.align.length --> header.length table没识别的问题
3、 // 2个table b(a.cells[p],a.header.length) --> a.cells[p].replace(/^ *\| *| *\| *$/g, "").split(/ *\| */)
4、 // .replace(/(?: *\| *)?\n$/,"") --> .replace(/\n$/, "")
5、 // /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/ --> /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/
如果要继续升级marked.min.js还是要注意上面所列的问题
issue列表中搜索md可以查看到部分的相关问题下面列举若干关键问题
table相关 1、2、3、4、5
https://www.trustie.net/issues/24398
https://www.trustie.net/issues/24448
https://www.trustie.net/issues/24336
/educoder/public/react/public/js/editormd/editormd.min.js
md编辑器公式相关修改修改上述文件并压缩然后替换到js_min_all.js的这个位置的
/*
* Editor.md
*
* @file editormd.js
* @version v1.5.0
* @description Open source online markdown editor.
* @license MIT License
* @author Pandao
* {@link https://github.com/pandao/editor.md}
* @updateTime 2015-06-09
*/
公式相关 修改在 /public/js/editormd/editormd.min.js
https://www.trustie.net/issues/23895
https://www.trustie.net/issues/23695

@ -2,6 +2,7 @@
/educoder/public/react/public/js/readme.txt 关于js_min_all
/educoder/educoder/public/react/scripts/readme-cdn.txt 关于CDN
/educoder/public/react/src/modules/page/readme.txt 关于TPI
/educoder/public/editormd/lib/readme-marked.txt 关于md编辑器 marked.js
1、 安装node v6.9.x此安装包含了node和npm。

@ -243,4 +243,4 @@ function initOnlineOfflineListener() {
'网络异常,请检测网络后重试。',
})
});
}
}

@ -4,7 +4,13 @@ const queryString = {
for (let key in params) {
// https://stackoverflow.com/questions/6566456/how-to-serialize-an-object-into-a-list-of-url-query-parameters
if (params[key] != undefined) {
paramsUrl += `${key}=${encodeURIComponent(params[key])}&`
if (params[key].constructor === Array) {
for (let singleArrIndex of params[key]) {
paramsUrl = paramsUrl + key + '[]=' + singleArrIndex + '&'
}
} else {
paramsUrl += `${key}=${encodeURIComponent(params[key])}&`
}
}
}
if (paramsUrl == '') {

@ -363,8 +363,8 @@ function buildColumns(that, student_works, studentData) {
{/*<React.Fragment>*/}
{/*</React.Fragment>*/}
{ isAdmin && <Tooltip placement="bottom" title={<pre>调整学生最终成绩<br/>其它历史评分将全部失效</pre>}>
<a style={{color:"#000"}}
onClick={() => that.showModulationModal(record)}
<a style={{color: "#4CACFF"}}
onClick={() => that.showModulationModal(record)}
>调分</a>
</Tooltip> }
{/* toWorkDetailPage */}
@ -748,11 +748,17 @@ class CommonWorkList extends Component{
isPublish={true} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
<PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
<ModulationModal
visible={modulationModalVisible}
Cancel={this.cancelModulationModel}
Saves={(value,num)=>this.saveModulationModal(value,num)}
/>
{
modulationModalVisible === true ?
<ModulationModal
visible={modulationModalVisible}
Cancel={this.cancelModulationModel}
Saves={(value, num) => this.saveModulationModal(value, num)}
/>
: ""
}
{/* 内容区 */}

@ -728,18 +728,18 @@ class CommonWorkSetting extends Component{
course_id ,
unified_setting: unified_setting, // 统一设置
group_settings: group_settings_param,
publish_time: temp_end_time ? new Date(temp_publish_time) : temp_end_time, // 发布
end_time: temp_end_time ? new Date(temp_end_time) : temp_end_time, // 截止
publish_time: temp_end_time ? new Date(temp_publish_time.replace(/-/g, '/')) : temp_end_time, // 发布
end_time: temp_end_time ? new Date(temp_end_time.replace(/-/g, '/')) : temp_end_time, // 截止
late_penalty: late_penalty, // 迟交扣分
allow_late: allow_late, // 是否允许补交
late_time: late_time ? new Date(late_time) : late_time, // 补交截止时间
late_time: late_time ? new Date(late_time.replace(/-/g, '/')) : late_time, // 补交截止时间
anonymous_comment: anonymous_comment, // true: 启用匿评 false:未启用匿评
evaluation_start: evaluation_start ? new Date(evaluation_start) : evaluation_start, //匿评开始时间
evaluation_end: evaluation_end ? new Date(evaluation_end) : evaluation_end,
evaluation_start: evaluation_start ? new Date(evaluation_start.replace(/-/g, '/')) : evaluation_start, //匿评开始时间
evaluation_end: evaluation_end ? new Date(evaluation_end.replace(/-/g, '/')) : evaluation_end,
evaluation_num: evaluation_num, // 匿评数
absence_penalty: absence_penalty, // 匿评扣分
anonymous_appeal: anonymous_appeal, // true: 启用匿评申诉, false:未启用
appeal_time: appeal_time ? new Date(appeal_time) : appeal_time, // 申诉结束时间
appeal_time: appeal_time ? new Date(appeal_time.replace(/-/g, '/')) : appeal_time, // 申诉结束时间
appeal_penalty: appeal_penalty, // 违规匿评扣分
ta_mode: ta_mode, // 1:普通模式 0:复审模式
final_mode: final_mode, // true: 单项评分优先, false: 多项评分配比

@ -1,7 +1,9 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,Input} from "antd";
import {Modal, Checkbox, Upload, Button, Icon, message, Input, Form} from "antd";
import { WordNumberTextarea } from 'educoder';
import './Newshixunmodel.css'
//调分
class ModulationModal extends Component{
constructor(props){
super(props);
@ -16,22 +18,32 @@ class ModulationModal extends Component{
Saves=()=>{
let {textareaval,Inputsval}=this.state;
if(textareaval===""||textareaval===undefined){
this.setState({
textareavaltype:true
})
return
}
// if(textareaval===""||textareaval===undefined){
// this.setState({
// textareavaltype:true
// })
// return
// }
this.setState({
textareavaltype: false
})
if(Inputsval===undefined||Inputsval===""){
this.setState({
Inputsvaltype:true
})
this.setState({
Inputsval: "",
Inputsvaltype: true,
Inputsvaltest: "请输入分数",
})
return
}
if (this.state.Inputsvaltype === true) {
return;
}
this.setState({
Inputsvaltype: false,
Inputsvaltest: "",
})
this.props.Saves(textareaval,Inputsval)
}
@ -43,21 +55,34 @@ class ModulationModal extends Component{
}
setInputs=(e)=>{
debugger
var value=parseInt(e.target.value)
if(isNaN(value)){
value=0
value = 0;
this.setState({
Inputsval: value,
Inputsvaltype: true,
Inputsvaltest: "请输入分数",
})
}else{
if(value<0||value>100){
value=0
value = 0;
this.setState({
Inputsval: value,
Inputsvaltype: true,
Inputsvaltest: "请输入0-100的分数",
})
}
}
this.setState({
Inputsval:value
Inputsval: value,
Inputsvaltype: false,
})
}
render(){
let {textareaval,Inputsval,textareavaltype,Inputsvaltype}=this.state;
let {textareaval, Inputsval, textareavaltype, Inputsvaltype, Inputsvaltest} = this.state;
return(
<div>
<Modal
@ -69,60 +94,144 @@ class ModulationModal extends Component{
footer={null}
destroyOnClose={true}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 mb20">
<span className={"color-dark-21"}>该学生的最终成绩将不会按照评分规则进行计算</span>
</p>
<div className="clearfix">
{/*<textarea*/}
{/*className="winput-100-150"*/}
{/*placeholder="请填写您对作品调分的原因"*/}
{/*value={textareaval}*/}
{/*onInput={this.settextarea}*/}
{/*></textarea>*/}
<div className="clearfix" style={{
display: "-webkit-flex",
flexDirection: "column",
alignItems: "center",
}}>
<div style={{
marginTop: " 27px",
display: "flex",
flexDirection: "initial",
}}>
<span style={{
width: "70px",
textAlign: "center",
lineHeight: " 40px",
}}><span style={{
textAlign: "center",
lineHeight: " 40px",
color: " #f5222d",
}}>*</span></span>
<Input
className={Inputsvaltype === true ? "borerinput" : ""}
style={{
width: "335px",
height: "40px",
}}
placeholder="请填写分数"
value={Inputsval}
onInput={this.setInputs}
suffix={
<span
style={{
textAlign: "center",
lineHeight: " 40px",
}}
></span>
}
/>
</div>
{
Inputsvaltype === true ?
<p style={{color: "#DD1717", width: "268px"}}>{Inputsvaltest}</p>
: ""
}
<div style={{
display: "flex",
flexDirection: "initial",
}}>
<span style={{width: "70px"}}></span>
<p className=" mt3 font-14 " style={{color: "#666666"}}>调分后该学生的最终成绩将不会按照评分规则进行计算</p>
</div>
<div style={{
display: "flex",
flexDirection: "initial",
marginTop: "10px;",
}}>
<span style={{width: "70px", marginTop: "24px"}}>调分原因</span>
<WordNumberTextarea
placeholder={"请填写您对作品调分的原因"}
onInput={(e)=>this.settextarea(e)}
style={{width: "335px"}}
placeholder={"请输入调分原因(选填)"}
onInput={(e) => this.settextarea(e)}
value={textareaval}
maxlength={100}
/>
<li style={{height:"20px",lineHeight:"20px"}}><span className={textareavaltype===true?"color-red":"none"}>原因不能为空</span></li>
</div>
<div style={{
marginTop: "27px",
width: " 336px",
marginLeft: "70px",
marginBottom: "29px",
}}>
<a className="task-btn color-white mr30" style={{width: "72px",}}
onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" style={{width: "72px",}}
onClick={this.Saves}>{this.props.Savesname || '保存'}</a>
</div>
<style>
{
`
.pdl10{
padding-left:10px;
}
`
}
</style>
<li className={"pdl10"}>
<Input style={{
width: '20%',
}}
placeholder="请填写分数"
value={Inputsval}
onInput={this.setInputs}/> <span className="ml10"></span>
</li>
<li style={{height:"20px",lineHeight:"20px"}}><span className={Inputsvaltype===true?"color-red":"none"}>分数不能为空</span></li>
<div className="clearfix edu-txt-center">
<a className="task-btn color-white mr30" onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" onClick={this.Saves}>{this.props.Savesname || '保存'}</a>
</div>
</div>
</Modal>
</Modal>
</div>
)
}
}
export default ModulationModal;
export default ModulationModal;
// <div className="task-popup-content">
// <p className="task-popup-text-center font-16 mb20">
//
// <span className={"color-dark-21"}>该学生的最终成绩将不会按照评分规则进行计算</span>
//
// </p>
//
//
// <div className="clearfix">
// {/*<textarea*/}
// {/*className="winput-100-150"*/}
// {/*placeholder="请填写您对作品调分的原因"*/}
// {/*value={textareaval}*/}
// {/*onInput={this.settextarea}*/}
// {/*></textarea>*/}
//
// <WordNumberTextarea
// placeholder={"请填写您对作品调分的原因"}
// onInput={(e)=>this.settextarea(e)}
// value={textareaval}
// maxlength={100}
// />
//
// {/*<li style={{height:"20px",lineHeight:"20px"}}><span className={textareavaltype===true?"color-red":"none"}>原因不能为空</span></li>*/}
// <div style={{height:"20px",lineHeight:"20px"}}></div>
// </div>
//
// <style>
// {
//
// `
// .pdl10{
// padding-left:10px;
// }
// `
// }
// </style>
//
// <li className={"pdl10"}>
//
// </li>
// <li style={{height:"20px",lineHeight:"20px"}}><span className={Inputsvaltype===true?"color-red":"none"}>分数不能为空</span></li>
// <div className="clearfix edu-txt-center">
// <a className="task-btn color-white mr30" onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
// <a className="task-btn task-btn-orange" onClick={this.Saves}>{this.props.Savesname || '保存'}</a>
{/* </div>*/
}
{/*</div>*/
}

@ -266,4 +266,62 @@
.padding13-30 {
padding: 13px 30px;
box-sizing: border-box;
}
}
.displaymodulat {
display: flex;
display: -webkit-flex;
flex-direction: column;
align-items: center;
}
.WordNumberTextarea {
outline: none; /* 去掉输入字符时的默认样式 */
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
background-color: white;
text-shadow: none;
-webkit-writing-mode: horizontal-tb !important;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
resize: none; /*禁止拉伸*/
border: none; /*去掉默认边框*/
width: 100%;
height: 130px;
border: none;
display: block;
}
.WordNumbernote {
padding: 0;
margin: 0;
list-style: none;
text-decoration: none;
box-sizing: border-box;
overflow: hidden;
height: auto;
border: 1px solid rgba(234, 234, 234, 1);
border-radius: 0.125rem;
margin: 10px 10px 0px 10px;
padding: 10px 10px 5px 10px;
backgroud: rgba(234, 234, 234, 1);
width: 335px;
}
.WordNumberTextarea-count {
display: inline-block;
float: right;
font-size: 16px;
color: #adadad;
padding-right: 0.25rem;
}
.borerinput {
border: 1px solid #DD1717 !important;
}
.borerinputs {
border: 1px solid #eee !important;
}

@ -23,6 +23,7 @@ import './yslexercisetable.css';
import {getImageUrl, toPath, sortDirections} from 'educoder';
import CheckBoxGroup from "../../page/component/CheckBoxGroup";
import NoneData from '../../../modules/courses/coursesPublic/NoneData'
import ModulationModal from "../coursesPublic/ModulationModal";
const Search = Input.Search;
const RadioGroup = Radio.Group;
const CheckboxGroup = Checkbox.Group;
@ -38,6 +39,7 @@ class Studentshavecompletedthelist extends Component {
datas: [],
page: 1,
limit: 20,
testpapergradingboll: false,
styletable: {
"display": "block"
},
@ -1028,11 +1030,9 @@ class Studentshavecompletedthelist extends Component {
render: (text, record) => (
<span>
{record.finalscore==="--"?
<span style={{textAlign: "center",color: '#999999'}}
>--</span>
:record.submitstate === "未提交"?
<span style={{textAlign: "center",color: '#999999'}}
>--</span>
<span className="color-blue" style={{textAlign: "center", cursor: "pointer"}}
onClick={() => this.Adjustment(record)}
>调分</span>
:
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"
@ -1227,11 +1227,9 @@ class Studentshavecompletedthelist extends Component {
render: (text, record) => (
<span>
{record.finalscore==="--"?
<span style={{textAlign: "center",color: '#999999'}}
>--</span>
:record.submitstate === "未提交"?
<span style={{textAlign: "center",color: '#999999'}}
>--</span>
<span className="color-blue" style={{textAlign: "center", cursor: "pointer"}}
onClick={() => this.Adjustment(record)}
>调分</span>
:
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"
@ -1244,9 +1242,10 @@ class Studentshavecompletedthelist extends Component {
],//columnsystwo 也会被columnsys当作参数接收
exercise_status:0,
order_type: "desc",
exeuserid: 0,
}
// console.log("Studentshavecompletedthelist");
// console.log(props.current_status);
// //console.log("Studentshavecompletedthelist");
// //console.log(props.current_status);
// columnsys 老师列表
// columnss 学生只能看自己的 未截止页面
// columnstwo 截止显示自己的
@ -1254,7 +1253,7 @@ class Studentshavecompletedthelist extends Component {
}
paginationonChange = (pageNumber) => {
// console.log('Page: ');
// //console.log('Page: ');
if (this.state.loadingstate === false) {
this.setState({
page: pageNumber,
@ -1271,7 +1270,7 @@ class Studentshavecompletedthelist extends Component {
}
paginationonChanges = (pageNumber) => {
// console.log('Page: ');
// //console.log('Page: ');
if (this.state.loadingstate === false) {
this.setState({
page: pageNumber,
@ -1292,12 +1291,12 @@ class Studentshavecompletedthelist extends Component {
componentDidMount() {
// if(this.props.isAdmin() === true){
// this.Teacherliststudentlistsy();
// console.log("1111111111111111");
// console.log(this.props.isAdmin());
// //console.log("1111111111111111");
// //console.log(this.props.isAdmin());
// }else {
this.Teacherliststudentlist();
// console.log("2222222222222");
// console.log(this.props.isAdmin());
// //console.log("2222222222222");
// //console.log(this.props.isAdmin());
// }
try {
this.props.triggerRef(this);
@ -1313,10 +1312,10 @@ class Studentshavecompletedthelist extends Component {
//试卷列表
Teacherliststudentlist = () => {
// console.log("Teacherliststudentlist"); // 764
// //console.log("Teacherliststudentlist"); // 764
var thiss = this;
var exercise_id = this.props.match.params.Id;
// console.log(731); // 764 935
// //console.log(731); // 764 935
var url = `/exercises/${exercise_id}/exercise_lists.json`;
axios.get((url), {
params: {
@ -1342,7 +1341,7 @@ class Studentshavecompletedthelist extends Component {
})
if (response.data.current_answer_user === undefined || response.data.current_answer_user === null) {
// 学生未截止
// console.log("试卷学生未截止");
// //console.log("试卷学生未截止");
this.Generatenewdatas(response.data.exercise_users);
if (response.data.exercise_types.subjective === 0) {
if (this.state.noclassroom === undefined || this.state.noclassroom === "" || this.state.noclassroom === null) {
@ -1389,7 +1388,7 @@ class Studentshavecompletedthelist extends Component {
}
} else {
//学生已截止
// console.log("试卷学生已截止");
// //console.log("试卷学生已截止");
if (response.data.exercise_types.subjective === 0) {
if (this.state.loadingstate === false) {
var arr =[];
@ -1469,22 +1468,22 @@ class Studentshavecompletedthelist extends Component {
}
//老师
else if (response.data.exercise_types.user_permission === 0) {
// console.log(response.data.exercise_users)
// console.log(response)
// console.log("试卷老师加载中");
// //console.log(response.data.exercise_users)
// //console.log(response)
// //console.log("试卷老师加载中");
if (thiss.state.loadingstate === false) {
thiss.setState({
loadingstate: true,
})
}
console.log(response);
console.log(1393);
//console.log(response);
//console.log(1393);
thiss.Generatenewdatasy(response.data.exercise_users, response);
}
}).catch((error) => {
// console.log(error);
// console.log("其实数据加载失败了");
// console.log("1111");
// //console.log(error);
// //console.log("其实数据加载失败了");
// //console.log("1111");
});
@ -1495,9 +1494,9 @@ class Studentshavecompletedthelist extends Component {
let datalist = [];
let datalisttwo = [];
var teacherlist = undefined;
// console.log("开始数据了");
// //console.log("开始数据了");
if (exercise_users !== undefined) {
// console.log("开始打印数据了");
// //console.log("开始打印数据了");
for (var i = 0; i < exercise_users.length; i++) {
if (exercise_users[i].commit_status === 1) {
datalist.push({
@ -1574,9 +1573,9 @@ class Studentshavecompletedthelist extends Component {
let datalist = [];
var teacherlist = undefined;
var noclassroom = undefined;
// console.log("开始数据了");
// //console.log("开始数据了");
if (exercise_users !== undefined) {
// console.log("开始打印数据了");
// //console.log("开始打印数据了");
for (var i = 0; i < exercise_users.length; i++) {
datalist.push({
myid: exercise_users[i].login,
@ -1610,7 +1609,7 @@ class Studentshavecompletedthelist extends Component {
}
TablePagination = (e) => {
// console.log(e.current);
// //console.log(e.current);
var teacherlist = { //分页
total: this.state.exercise_users.length, //数据总数量
pageSize: 20, //一页显示几条
@ -1623,7 +1622,7 @@ class Studentshavecompletedthelist extends Component {
}
TablePaginations = (e) => {
// console.log(e.current);
// //console.log(e.current);
var teacherlists = { //分页
total: this.state.exercise_users, //数据总数量
pageSize: 10, //一页显示几条
@ -1639,7 +1638,7 @@ class Studentshavecompletedthelist extends Component {
Searchdata = (order, commit_status, review, exercise_group_id, search, page, limit, order_type) => {
var exercise_id = this.props.match.params.Id;
// console.log(731); // 764 935
// //console.log(731); // 764 935
var url = `/exercises/${exercise_id}/exercise_lists.json`;
var params = {
order: order,
@ -1654,7 +1653,7 @@ class Studentshavecompletedthelist extends Component {
axios.get(url, {
params: params
}).then((response) => {
// console.log(JSON.stringify(response));
// //console.log(JSON.stringify(response));
this.setState({
Teacherliststudentlist: response.data,
review: response.data.review,
@ -1702,7 +1701,7 @@ class Studentshavecompletedthelist extends Component {
}
this.Generatenewdata(response.data.exercise_users, response.data.current_answer_user);
}).catch((error) => {
console.log(error)
//console.log(error)
this.setState({
loadingstate: false,
})
@ -1717,9 +1716,9 @@ class Studentshavecompletedthelist extends Component {
let datalist = [];
var indexi = 0;
var teacherlist = undefined;
// console.log("开始数据了");
// //console.log("开始数据了");
if (exercise_users !== undefined) {
// console.log("开始打印数据了");
// //console.log("开始打印数据了");
for (var i = 0; i < exercise_users.length; i++) {
if (exercise_users[i].commit_status === 1) {
datalist.push({
@ -1734,7 +1733,8 @@ class Studentshavecompletedthelist extends Component {
completion: exercise_users[i].objective_score === undefined ? "--" : exercise_users[i].objective_score === null ? "--" : exercise_users[i].objective_score === "" ? "--" : exercise_users[i].objective_score,
levelscore: exercise_users[i].subjective_score === undefined ? "--" : exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score,
efficiencyscore: exercise_users[i].score === undefined ? "--" : exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score,
finalscore: "评阅"
finalscore: "评阅",
user_id: exercise_users[i].user_id
})
} else {
datalist.push({
@ -1749,7 +1749,8 @@ class Studentshavecompletedthelist extends Component {
completion: exercise_users[i].objective_score === undefined ? "--" : exercise_users[i].objective_score === null ? "--" : exercise_users[i].objective_score === "" ? "--" : exercise_users[i].objective_score,
levelscore: exercise_users[i].subjective_score === undefined ? "--" : exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score,
efficiencyscore: exercise_users[i].score === undefined ? "--" : exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score,
finalscore: "--"
finalscore: "--",
user_id: exercise_users[i].user_id
})
indexi++;
}
@ -1767,7 +1768,7 @@ class Studentshavecompletedthelist extends Component {
if (indexi === exercise_users.length) {
//都没评论 不显示评论
if (response.data.exercise_types.groups_count > 0) {
// console.log("77771111111");
// //console.log("77771111111");
//分班大于0显示分班
//7ge
// this.state.columnsys.map((item,key)=>{
@ -1854,8 +1855,8 @@ class Studentshavecompletedthelist extends Component {
arr.push(item);
}
}
// console.log(thiss.state.columnsys);
// console.log(arr);
// //console.log(thiss.state.columnsys);
// //console.log(arr);
this.setState({
data: datalist,
@ -1908,7 +1909,7 @@ class Studentshavecompletedthelist extends Component {
} else {
//包括主观题
if (indexi === exercise_users.length) {
console.log("2548包含主观题不包含分班");
//console.log("2548包含主观题不包含分班");
if (response.data.exercise_types.groups_count > 0) {
var arr =[];
@ -1959,7 +1960,7 @@ class Studentshavecompletedthelist extends Component {
})
}
} else {
// console.log("2699包含主观题包含分班");
// //console.log("2699包含主观题包含分班");
if (response.data.exercise_types.groups_count > 0) {
this.setState({
data: datalist,
@ -2010,7 +2011,7 @@ class Studentshavecompletedthelist extends Component {
TablePaginationsy = (e) => {
// console.log(e.current);
// //console.log(e.current);
var teacherlist = { //分页
total: this.state.exercise_users.length, //数据总数量
pageSize: 20, //一页显示几条
@ -2037,19 +2038,19 @@ class Studentshavecompletedthelist extends Component {
order_type: order_type
}
}).then((response) => {
// console.log("528");
// console.log(JSON.stringify(response));
// //console.log("528");
// //console.log(JSON.stringify(response));
if(response===undefined){
return
}
this.setState({
loadingstate: false,
})
// console.log(response);
// console.log(1997);
// //console.log(response);
// //console.log(1997);
this.Generatenewdatasy(response.data.exercise_users, response);
}).catch((error) => {
// console.log(error)
// //console.log(error)
this.setState({
loadingstate: false,
})
@ -2101,9 +2102,9 @@ class Studentshavecompletedthelist extends Component {
this.Searchdatasys(this.state.order, undefined, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
}
checkeboxstwo = (checkedValues, data) => {
// console.log(checkedValues)
// //console.log(checkedValues)
if (JSON.stringify(checkedValues) === "[]") {
// console.log(checkedValues);
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
loadingstate: true,
@ -2138,7 +2139,7 @@ class Studentshavecompletedthelist extends Component {
this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else {
// console.log(checkedValues);
// //console.log(checkedValues);
this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
if (this.state.loadingstate === false) {
this.setState({
@ -2160,7 +2161,7 @@ class Studentshavecompletedthelist extends Component {
}
notlimitedst = () => {
// console.log();
// //console.log();
// var datas=this.state.course_groups;
// for(var ik=0;ik<datas.length;ik++){
// datas[ik].exercise_group_id=undefined;
@ -2182,7 +2183,7 @@ class Studentshavecompletedthelist extends Component {
if (JSON.stringify(checkedValues) === "[]") {
// console.log(checkedValues);
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
unlimited: 0,
@ -2217,7 +2218,7 @@ class Studentshavecompletedthelist extends Component {
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else {
// console.log(checkedValues);
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
unlimited: 1,
@ -2260,9 +2261,9 @@ class Studentshavecompletedthelist extends Component {
}
funtaskstatustwo = (checkedValues, data) => {
// console.log(checkedValues);
// //console.log(checkedValues);
if (JSON.stringify(checkedValues) === "[]") {
// console.log(checkedValues);
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
course_groupysls: undefined,
@ -2297,7 +2298,7 @@ class Studentshavecompletedthelist extends Component {
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.order_type)
} else {
// console.log(checkedValues);
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
checkedValuesineinfo: checkedValues,
@ -2325,7 +2326,7 @@ class Studentshavecompletedthelist extends Component {
onSearchKeywordKeyUp = (e) => {
if (e.keyCode === 13) {
// this.onSearch();
// console.log("使用了回车键");
// //console.log("使用了回车键");
// if(this.state.searchtext === ""){
// message.error("请输入姓名或学号搜索");
// return
@ -2356,7 +2357,7 @@ class Studentshavecompletedthelist extends Component {
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, value, 1, this.state.limit, this.state.order_type);
// this.Startsorting(this.state.order,this.state.checkedValuesine,this.state.checkedValuesineinfo,value);
// console.log(value)
// //console.log(value)
};
@ -2375,7 +2376,7 @@ class Studentshavecompletedthelist extends Component {
//搜索学生 文字输入
inputSearchValues = (e) => {
// console.log(e.target.value)
// //console.log(e.target.value)
if (e.target.value === "") {
this.setState({
searchtext: undefined,
@ -2563,19 +2564,61 @@ class Studentshavecompletedthelist extends Component {
setExerciseReviewAndAnswer = () => {
}
// 调分
Adjustment = (e) => {
this.setState({
testpapergradingboll: true,
exeuserid: e.user_id,
})
}
//调分窗
Adjustments = () => {
//弹出弹框
this.setState({
testpapergradingboll: false
})
}
//试卷调分
Testpapergrading = (v, n) => {
var exercise_id = this.props.match.params.Id;
let url = `/exercises/${exercise_id}/adjust_score.json`;
axios.post(url, {
score: n,
user_id: this.state.exeuserid,
comment: v,
})
.then((response) => {
if (response.data.status == '0') {
this.setState({testpapergradingboll: false});
this.props.showNotification('调分成功');
this.Teacherliststudentlist();
}
})
.catch(function (error) {
console.log(error);
this.setState({testpapergradingboll: false})
});
}
render() {
const isAdmin = this.props.isAdmin();
let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable,exercise_status, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users,mylistansum} = this.state;
// console.log("Studentshavecompletedthelist");
// console.log(this.props.current_status);
// console.log("获取到的数据");
// console.log(datas);
// console.log(data);
// console.log("this.props.Commonheadofthetestpaper.exercise_status");
// console.log(this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status);
// console.log(exercise_status);
let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable, exercise_status, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users, mylistansum, testpapergradingboll} = this.state;
// //console.log("Studentshavecompletedthelist");
// //console.log(this.props.current_status);
// //console.log("获取到的数据");
// //console.log(datas);
// //console.log(data);
// //console.log("this.props.Commonheadofthetestpaper.exercise_status");
// //console.log(this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status);
// //console.log(exercise_status);
return (
isAdmin === true ?
(
@ -2591,6 +2634,11 @@ class Studentshavecompletedthelist extends Component {
</div>
:
<div>
{testpapergradingboll === true ? <ModulationModal
visible={testpapergradingboll}
Cancel={() => this.Adjustments()}
Saves={(value, num) => this.Testpapergrading(value, num)}
/> : ""}
<div className="edu-back-white" >
<ul className="clearfix" style={{padding: '10px 30px 10px 30px'}}>

@ -895,8 +895,10 @@ debugger
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
this.props.slowDownload(url)
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)

@ -718,8 +718,10 @@ class GraduationTaskssettinglist extends Component{
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
this.props.slowDownload(url)
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
@ -900,8 +902,8 @@ class GraduationTaskssettinglist extends Component{
{tag.name}
</a>
:
<span style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":"":""}>
<span style={{color: tag.name === "调分" ? "#4CACFF" : '#4CACFF', padding: "0px 5px"}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":"":""}>
{tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":"":tag.name}
</span>
}

@ -239,8 +239,10 @@ class GraduationTasksquestions extends Component{
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
this.props.slowDownload(url)
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)

@ -114,8 +114,10 @@ class PollDetailIndex extends Component{
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
this.props.slowDownload(url)
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)

@ -1174,7 +1174,10 @@ class Listofworksstudentone extends Component {
align: 'center',
className: 'font-14',
render: (text, record) => (
record.submitstate === "未提交" ? <span style={{color: '#9A9A9A'}}>--</span> :
record.submitstate === "未提交" ?
<a style={{textAlign: "center"}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
onClick={() => this.Viewstudenttraininginformationt(record)}>查看</a> :
<span>
<a style={{textAlign: "center"}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
@ -1505,7 +1508,10 @@ class Listofworksstudentone extends Component {
align: 'center',
className: 'font-14',
render: (text, record) => (
record.submitstate === "未提交" ? <span style={{color: '#9A9A9A'}}>--</span> :
record.submitstate === "未提交" ?
<a style={{textAlign: "center"}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
onClick={() => this.Viewstudenttraininginformationt(record)}>{record.operating}</a> :
<span>
<a style={{textAlign: "center"}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
@ -2812,14 +2818,14 @@ class Listofworksstudentone extends Component {
this.setState({visible: false})
}
// 调分
Viewstudenttraininginformations = (e) => {
// console.log("Viewstudenttraininginformations2");
Adjustment = (e) => {
// console.log("Adjustment");
// console.log(e.myid);
this.setState({
visible: true,
userid: e.myid,
// Tune
})
}
//确定
saveModulationModal = (value, num) => {
@ -3243,7 +3249,7 @@ class Listofworksstudentone extends Component {
<div className=" clearfix " style={{margin: "auto", minWidth: "1200px"}}>
{visible === true ? <ModulationModal
visible={visible}
Cancel={this.cancelModulationModel}
Cancel={() => this.cancelModulationModel()}
Saves={(value, num) => this.saveModulationModal(value, num)}
/> : ""}

@ -72,8 +72,10 @@ class ShixunWorkReport extends Component {
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url+'?export=true', '_blank');
this.props.slowDownload(url)
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url+'?export=true', '_blank');
this.setState({ isspinning: false })
}
}).catch((error) => {

@ -394,6 +394,7 @@ class ShixunsHome extends Component {
{/*导师排行榜*/}
{ homedatalist !== undefined && homedatalist.teachers !== undefined && (
<div className="pt60 pb60 mb30 mentor-ranking">
<div className="educontent">
<div className="edu-txt-center">
@ -470,8 +471,10 @@ class ShixunsHome extends Component {
</div>
</div>
)}
{/*程序员排行榜*/}
{ homedatalist !== undefined && homedatalist.students !== undefined && (
<div className="pt60 pb60 mb30 pro-ranking">
<div className="educontent">
<div className="edu-txt-center">
@ -544,6 +547,7 @@ class ShixunsHome extends Component {
</div>
</div>
</div>
)}
</div>
</Spin>
</div>

@ -159,9 +159,10 @@ class Modifytext extends Component {
marginTop: "24px",
}}>
<Button style={{
background: "#CDCDCD !important",
border: "0.5px solid #CDCDCD"
}} type="primary grayBtn " onClick={() => this.hideUpdating()}>取消</Button>
border: "0.5px solid #C9C9C9",
background: "#C9C9C9",
color: "#fff",
}} type="primary " onClick={() => this.hideUpdating()}>取消</Button>
<Button style={{
marginLeft: "10px",
}} type="primary" onClick={() => this.Modifytext()}>确定</Button>

@ -685,7 +685,7 @@ class PathDetailIndex extends Component{
<i className={"iconfont icon-sandian fr color999"} style={{
width: "30px",
height: "30px",
textAlign: "center",
textAlign: "right",
}}></i>
</Popover>
</div>

Loading…
Cancel
Save