Merge branch 'dev_aliyun' into dev_ec

dev_ec
hjm 6 years ago
commit da488e7baf

@ -378,7 +378,6 @@ DEPENDENCIES
kaminari (~> 1.1, >= 1.1.1) kaminari (~> 1.1, >= 1.1.1)
listen (>= 3.0.5, < 3.2) listen (>= 3.0.5, < 3.2)
mysql2 (>= 0.4.4, < 0.6.0) mysql2 (>= 0.4.4, < 0.6.0)
newrelic_rpm
oauth2 oauth2
pdfkit pdfkit
puma (~> 3.11) puma (~> 3.11)

@ -13,6 +13,7 @@
//= require bootstrap-datepicker //= require bootstrap-datepicker
//= require bootstrap.viewer //= require bootstrap.viewer
//= require jquery.mloading //= require jquery.mloading
//= require jquery-confirm.min
//= require common //= require common
//= require echarts //= require echarts

@ -0,0 +1,12 @@
$(document).on('turbolinks:load', function(){
$(document).on('click', '.batch-all-check-box', function(){
var $checkAll = $(this);
$('.batch-check-box').prop('checked', $checkAll.is(':checked'));
})
$(document).on('click', '.batch-check-box', function(){
var allChecked = $('.batch-check-box:checked').length === $('.batch-check-box').length
$('.batch-all-check-box').prop('checked', allChecked);
})
});

@ -10,11 +10,41 @@ $(document).on('turbolinks:load', function() {
$searchFrom.find('select[name="status"]').val('processed'); $searchFrom.find('select[name="status"]').val('processed');
if($link.data('value') === 'processed'){ if($link.data('value') === 'processed'){
$('.batch-action-container').hide();
$searchFrom.find('.status-filter').show(); $searchFrom.find('.status-filter').show();
} else { } else {
$('.batch-action-container').show();
$searchFrom.find('.status-filter').hide(); $searchFrom.find('.status-filter').hide();
$searchFrom.find('select[name="status"]').val('pending'); $searchFrom.find('select[name="status"]').val('pending');
} }
}); });
$('.batch-agree-btn').on('click', function(){
if($('.batch-check-box:checked').length === 0){
$.notify({ message: '请先选择数据' }, { type: 'info' });
return;
}
customConfirm({
content: '确认审核通过?',
ok: function(){
var ids = $('.batch-check-box:checked').map(function(_, e){ return $(e).val() }).get();
$.ajax({
url: '/admins/identity_authentications/batch_agree',
method: 'POST',
dataType: 'json',
data: { ids: ids },
success: function(data){
$.notify({ message: '操作成功' });
window.location.reload();
},
error: function(res){
$.notify({ message: res.responseJSON.message }, { type: 'danger' });
}
})
}
})
})
} }
}) })

@ -10,11 +10,41 @@ $(document).on('turbolinks:load', function() {
$searchFrom.find('select[name="status"]').val('processed'); $searchFrom.find('select[name="status"]').val('processed');
if($link.data('value') === 'processed'){ if($link.data('value') === 'processed'){
$('.batch-action-container').hide();
$searchFrom.find('.status-filter').show(); $searchFrom.find('.status-filter').show();
} else { } else {
$('.batch-action-container').show();
$searchFrom.find('.status-filter').hide(); $searchFrom.find('.status-filter').hide();
$searchFrom.find('select[name="status"]').val('pending'); $searchFrom.find('select[name="status"]').val('pending');
} }
}); });
$('.batch-agree-btn').on('click', function(){
if($('.batch-check-box:checked').length === 0){
$.notify({ message: '请先选择数据' }, { type: 'info' });
return;
}
customConfirm({
content: '确认审核通过?',
ok: function(){
var ids = $('.batch-check-box:checked').map(function(_, e){ return $(e).val() }).get();
$.ajax({
url: '/admins/professional_authentications/batch_agree',
method: 'POST',
dataType: 'json',
data: { ids: ids },
success: function(data){
$.notify({ message: '操作成功' });
window.location.reload();
},
error: function(res){
$.notify({ message: res.responseJSON.message }, { type: 'danger' });
}
})
}
})
})
} }
}) })

@ -42,4 +42,26 @@ function ajaxErrorNotifyHandler(res) {
function resetFileInputFunc(file){ function resetFileInputFunc(file){
file.after(file.clone().val("")); file.after(file.clone().val(""));
file.remove(); file.remove();
}
function customConfirm(opts){
var okCallback = opts.ok;
var cancelCallback = opts.cancel;
var defaultOpts = {
title: '提示',
buttons: {
ok: {
text: '确认',
btnClass: 'btn btn-primary',
action: okCallback
},
cancel: {
text: '取消',
btnClass: 'btn btn-secondary',
action: cancelCallback
},
}
}
return $.confirm($.extend({}, defaultOpts, opts))
} }

File diff suppressed because one or more lines are too long

@ -6,6 +6,7 @@
@import "bootstrap-datepicker"; @import "bootstrap-datepicker";
@import "bootstrap-datepicker.standalone"; @import "bootstrap-datepicker.standalone";
@import "jquery.mloading"; @import "jquery.mloading";
@import "jquery-confirm.min";
@import "codemirror/lib/codemirror"; @import "codemirror/lib/codemirror";
@import "editormd/css/editormd.min"; @import "editormd/css/editormd.min";

@ -110,5 +110,11 @@
.CodeMirror { .CodeMirror {
border: 1px solid #ced4da; border: 1px solid #ced4da;
} }
.batch-action-container {
margin-bottom: -15px;
padding: 10px 20px 0;
background: #fff;
}
} }

File diff suppressed because one or more lines are too long

@ -127,21 +127,21 @@ class AccountsController < ApplicationController
# UserDayCertification.create(user_id: user.id, status: 1) # UserDayCertification.create(user_id: user.id, status: 1)
end end
def set_autologin_cookie(user) # def set_autologin_cookie(user)
token = Token.get_or_create_permanent_login_token(user, "autologin") # token = Token.get_or_create_permanent_login_token(user, "autologin")
cookie_options = { # cookie_options = {
:value => token.value, # :value => token.value,
:expires => 1.month.from_now, # :expires => 1.month.from_now,
:path => '/', # :path => '/',
:secure => false, # :secure => false,
:httponly => true # :httponly => true
} # }
if edu_setting('cookie_domain').present? # if edu_setting('cookie_domain').present?
cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain')) # cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain'))
end # end
cookies[autologin_cookie_name] = cookie_options # cookies[autologin_cookie_name] = cookie_options
logger.info("cookies is #{cookies}") # logger.info("cookies is #{cookies}")
end # end
def logout def logout
UserAction.create(action_id: User.current.id, action_type: "Logout", user_id: User.current.id, :ip => request.remote_ip) UserAction.create(action_id: User.current.id, action_type: "Logout", user_id: User.current.id, :ip => request.remote_ip)

@ -1,6 +1,7 @@
class Admins::IdentityAuthenticationsController < Admins::BaseController class Admins::IdentityAuthenticationsController < Admins::BaseController
def index def index
params[:status] ||= 'pending' params[:status] ||= 'pending'
params[:sort_direction] = params[:status] == 'pending' ? 'asc' : 'desc'
applies = Admins::ApplyUserAuthenticationQuery.call(params.merge(type: 1)) applies = Admins::ApplyUserAuthenticationQuery.call(params.merge(type: 1))
@ -18,6 +19,24 @@ class Admins::IdentityAuthenticationsController < Admins::BaseController
render_success_js render_success_js
end end
def batch_agree
ApplyUserAuthentication.real_name_auth.where(id: params[:ids]).each do |apply|
begin
Admins::IdentityAuths::AgreeApplyService.call(apply)
rescue => e
Util.logger_error(e)
end
end
render_ok
end
def revoke
Admins::IdentityAuths::RevokeApplyService.call(current_apply)
render_success_js
end
private private
def current_apply def current_apply

@ -1,6 +1,7 @@
class Admins::ProfessionalAuthenticationsController < Admins::BaseController class Admins::ProfessionalAuthenticationsController < Admins::BaseController
def index def index
params[:status] ||= 'pending' params[:status] ||= 'pending'
params[:sort_direction] = params[:status] == 'pending' ? 'asc' : 'desc'
applies = Admins::ApplyUserAuthenticationQuery.call(params.merge(type: 2)) applies = Admins::ApplyUserAuthenticationQuery.call(params.merge(type: 2))
@ -18,6 +19,23 @@ class Admins::ProfessionalAuthenticationsController < Admins::BaseController
render_success_js render_success_js
end end
def batch_agree
ApplyUserAuthentication.professional_auth.where(id: params[:ids]).each do |apply|
begin
Admins::ProfessionalAuths::AgreeApplyService.call(apply)
rescue => e
Util.logger_error(e)
end
end
render_ok
end
def revoke
Admins::ProfessionalAuths::RevokeApplyService.call(current_apply)
render_success_js
end
private private
def current_apply def current_apply

@ -253,7 +253,10 @@ class ApplicationController < ActionController::Base
if Digest::MD5.hexdigest(content) == params[:chinaoocKey] if Digest::MD5.hexdigest(content) == params[:chinaoocKey]
user = open_class_user user = open_class_user
start_user_session(user) if user if user
start_user_session(user)
set_autologin_cookie(user)
end
User.current = user User.current = user
end end
end end
@ -617,6 +620,22 @@ class ApplicationController < ActionController::Base
cookies[:fileDownload] = true cookies[:fileDownload] = true
end end
def set_autologin_cookie(user)
token = Token.get_or_create_permanent_login_token(user, "autologin")
cookie_options = {
:value => token.value,
:expires => 1.month.from_now,
:path => '/',
:secure => false,
:httponly => true
}
if edu_setting('cookie_domain').present?
cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain'))
end
cookies[autologin_cookie_name] = cookie_options
logger.info("cookies is #{cookies}")
end
# 149课程的评审用户数据创建包含创建课堂学生 # 149课程的评审用户数据创建包含创建课堂学生
def open_class_user def open_class_user
user = User.find_by(login: "OpenClassUser") user = User.find_by(login: "OpenClassUser")

@ -51,7 +51,8 @@ class CommonsController < ApplicationController
200 200
end end
when 'journals_for_message' when 'journals_for_message'
if current_user.course_identity(@object.jour.course) >= Course::STUDENT && @object.user != current_user course = @object&.jour_type.to_s == "StudentWorksScore" ? @object.jour&.student_work&.homework_common&.course : @object.jour&.course
if current_user.course_identity(course) >= Course::STUDENT && @object.user != current_user
403 403
else else
200 200

@ -128,8 +128,8 @@ class CoursesController < ApplicationController
# POST /courses # POST /courses
# POST /courses.json # POST /courses.json
def create def create
ActiveRecord::Base.transaction do begin
begin ActiveRecord::Base.transaction do
@course = Course.new(name: params[:name], class_period: params[:class_period], credit: params[:credit], @course = Course.new(name: params[:name], class_period: params[:class_period], credit: params[:credit],
end_date: params[:end_date], is_public: params[:is_public], school_id: @school.id, end_date: params[:end_date], is_public: params[:is_public], school_id: @school.id,
authentication: params[:authentication], professional_certification: params[:professional_certification]) authentication: params[:authentication], professional_certification: params[:professional_certification])
@ -174,11 +174,12 @@ class CoursesController < ApplicationController
course_module_types = params[:course_module_types] course_module_types = params[:course_module_types]
@course.create_course_modules(course_module_types) @course.create_course_modules(course_module_types)
end end
rescue => e
uid_logger_error(e.message)
tip_exception(e.message)
raise ActiveRecord::Rollback
end end
CreateSubjectCourseStudentJob.perform_later(@course.id) if @course.subject && @course.subject.subject_appointments.count > 0
rescue => e
uid_logger_error(e.message)
tip_exception(e.message)
raise ActiveRecord::Rollback
end end
end end

@ -476,10 +476,13 @@ class GamesController < ApplicationController
if @myshixun.shixun.try(:status) < 2 if @myshixun.shixun.try(:status) < 2
tip_exception("代码获取异常,请检查实训模板的评测设置是否正确") tip_exception("代码获取异常,请检查实训模板的评测设置是否正确")
else else
# 报错继续retry
tip_exception(-3, "#{e.message}") tip_exception(-3, "#{e.message}")
end end
end end
# 如果报错了并且retry 为1的时候则fork一个新的仓库
if params[:retry].to_i == 1
project_fork(@myshixun, @shixun.repo_path, current_user.login)
end
tip_exception(0, e.message) tip_exception(0, e.message)
end end
end end
@ -559,7 +562,7 @@ class GamesController < ApplicationController
secret_rep = @shixun.shixun_secret_repository secret_rep = @shixun.shixun_secret_repository
logger.info("############secret_rep: #{secret_rep}") logger.info("############secret_rep: #{secret_rep}")
if secret_rep&.repo_name if secret_rep&.repo_name
secretGitUrl = repo_url secret_rep.repo_path secretGitUrl = repo_ip_url secret_rep.repo_path
br_params.merge!({secretGitUrl: Base64.urlsafe_encode64(secretGitUrl), secretDir: secret_rep.secret_dir_path}) br_params.merge!({secretGitUrl: Base64.urlsafe_encode64(secretGitUrl), secretDir: secret_rep.secret_dir_path})
logger.info("#######br_params:#{br_params}") logger.info("#######br_params:#{br_params}")
end end

@ -19,43 +19,48 @@ class GitsController < ApplicationController
result = false result = false
if request.env["HTTP_AUTHORIZATION"] && request.env["HTTP_AUTHORIZATION"].split(" ").length == 2 if request.env["HTTP_AUTHORIZATION"] && request.env["HTTP_AUTHORIZATION"].split(" ").length == 2
username_password = Base64.decode64(request.env["HTTP_AUTHORIZATION"].split(" ")[1]) username_password = Base64.decode64(request.env["HTTP_AUTHORIZATION"].split(" ")[1])
input_username = username_password.split(":")[0].strip()
input_password = username_password.split(":")[1].strip()
uid_logger("git start auth: input_username is #{input_username}")
if username_password.split(":")[0].nil? || username_password.split(":")[1].nil?
# Git 超级权限用户 result = false
if input_username.strip == gituser.strip && input_password.strip == gitpassword.strip
result = true
else else
# 用户是否对对象拥有权限 input_username = username_password.split(":")[0].strip()
system_user = User.find_by_login(input_username) || User.find_by_mail(input_username) || User.find_by_phone(input_username) input_password = username_password.split(":")[1].strip()
uid_logger("git start auth: input_username is #{input_username}")
# 如果用户名密码错误 # Git 超级权限用户
if system_user && !system_user.check_password?(input_password) if input_username.strip == gituser.strip && input_password.strip == gitpassword.strip
uid_logger_error("git start: password is wrong") result = true
result = false
else else
git_url = params["url"] # 用户是否对对象拥有权限
username = git_url.split("/")[0] system_user = User.find_by_login(input_username) || User.find_by_mail(input_username) || User.find_by_phone(input_username)
shixunname = git_url.split("/")[1].split(".")[0]
repo_name = username + "/" + shixunname
uid_logger("git start: repo_name is #{repo_name}")
shixun = Shixun.select([:id, :user_id, :repo_name, :identifier]).where(repo_name: repo_name).first
uid_logger("git start auth: shixun identifier is #{shixun.try(:identifier)}")
uid_logger("git start auth: systemuser is #{system_user.try(:login)}")
if shixun.present? # 如果用户名密码错误
if system_user.present? && system_user.manager_of_shixun?(shixun) if system_user && !system_user.check_password?(input_password)
result = true uid_logger_error("git start: password is wrong")
result = false
else
git_url = params["url"]
username = git_url.split("/")[0]
shixunname = git_url.split("/")[1].split(".")[0]
repo_name = username + "/" + shixunname
uid_logger("git start: repo_name is #{repo_name}")
shixun = Shixun.select([:id, :user_id, :repo_name, :identifier]).where(repo_name: repo_name).first
uid_logger("git start auth: shixun identifier is #{shixun.try(:identifier)}")
uid_logger("git start auth: systemuser is #{system_user.try(:login)}")
if shixun.present?
if system_user.present? && system_user.manager_of_shixun?(shixun)
result = true
else
uid_logger_error("gituser is not shixun manager")
result = false
end
else else
uid_logger_error("gituser is not shixun manager") uid_logger_error("shixun is not exist")
result = false # result = false
result = true # 为了测试跳出
end end
else
uid_logger_error("shixun is not exist")
# result = false
result = true # 为了测试跳出
end end
end end
end end

@ -168,7 +168,7 @@ class GraduationTasksController < ApplicationController
end end
end end
else else
@work_list = @work @work_list = !@task.published? ? [] : @work
@view_work = false @view_work = false
@work_count = @work_list.count @work_count = @work_list.count
@all_work_count = @work_list.count @all_work_count = @work_list.count

@ -692,7 +692,7 @@ class PollsController < ApplicationController
else else
unified_setting = @poll.unified_setting unified_setting = @poll.unified_setting
end end
show_result = params[:show_result] ? 1 : 0 show_result = params[:show_result].to_i
un_anonymous = params[:un_anonymous] ? true : false un_anonymous = params[:un_anonymous] ? true : false
# 统一设置或者分班为0则更新问卷并删除问卷分组 # 统一设置或者分班为0则更新问卷并删除问卷分组
if unified_setting || (course_group_ids.size == 0) if unified_setting || (course_group_ids.size == 0)

@ -415,6 +415,20 @@ class SubjectsController < ApplicationController
order by ue_count desc limit 10") order by ue_count desc limit 10")
end end
# 预约报名
def appointment
tip_exception("还存在未结束的课堂") unless @subject.max_course_end_date.nil? || @subject.max_course_end_date < Date.today
tip_exception("无需重复报名") if @subject.subject_appointments.exists?(user_id: current_user.id)
ActiveRecord::Base.transaction do
@subject.subject_appointments << SubjectAppointment.new(user_id: current_user.id)
@subject.increment!(:participant_count)
if @subject.participant_count == @subject.student_count
@subject.start_course_notify
end
normal_status("预约成功")
end
end
private private
def subject_params def subject_params
tip_exception("实训路径名称不能为空") if params[:name].blank? tip_exception("实训路径名称不能为空") if params[:name].blank?

@ -384,4 +384,8 @@ module TidingDecorator
def public_course_start_content def public_course_start_content
I18n.t(locale_format) % [belong_container&.name, belong_container&.start_date&.strftime("%Y-%m-%d")] I18n.t(locale_format) % [belong_container&.name, belong_container&.start_date&.strftime("%Y-%m-%d")]
end end
def subject_start_course_content
I18n.t(locale_format) % belong_container&.name
end
end end

@ -126,10 +126,11 @@ module ApplicationHelper
# 用户图像url如果不存在的话source为匿名用户即默认使用匿名用户图像 # 用户图像url如果不存在的话source为匿名用户即默认使用匿名用户图像
def url_to_avatar(source) def url_to_avatar(source)
if File.exist?(disk_filename(source.class, source.id)) if File.exist?(disk_filename(source.class, source.id))
ctime = File.ctime(disk_filename(source.class, source.id)).to_i
if source.class.to_s == 'User' if source.class.to_s == 'User'
File.join(relative_path, ["#{source.class}", "#{source.id}"]) File.join(relative_path, ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}"
else else
File.join("images/avatars", ["#{source.class}", "#{source.id}"]) File.join("images/avatars", ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}"
end end
elsif source.class.to_s == 'User' elsif source.class.to_s == 'User'
str = source.user_extension.try(:gender).to_i == 0 ? "b" : "g" str = source.user_extension.try(:gender).to_i == 0 ? "b" : "g"

@ -0,0 +1,22 @@
class CreateSubjectCourseStudentJob < ApplicationJob
queue_as :default
def perform(course_id)
course = Course.find_by(id: course_id)
return if course.blank? || course.subject.blank?
attrs = %i[course_id user_id role created_at updated_at]
same_attrs = {course_id: course.id, role: 4}
Rails.logger.info("1:course.students.count:##{course.students.count}")
CourseMember.bulk_insert(*attrs) do |worker|
course.subject.subject_appointments.each do |app|
Rails.logger.info("##{course.students.where(user_id: app.user_id)}")
next if course.students.where(user_id: app.user_id).any?
worker.add same_attrs.merge(user_id: app.user_id)
end
end
Rails.logger.info("2:course.students.count:##{course.students.count}")
course.subject.subject_appointments.destroy_all
end
end

@ -18,6 +18,10 @@ class ApplyUserAuthentication < ApplicationRecord
nil nil
end end
def revoke!
update!(status: 3)
end
private private
def send_tiding def send_tiding

@ -134,6 +134,11 @@ class HomeworkCommon < ApplicationRecord
self.homework_type == 'practice' && self.publish_time.present? && self.publish_time < Time.now && self.homework_group_reviews.count == 0 self.homework_type == 'practice' && self.publish_time.present? && self.publish_time < Time.now && self.homework_group_reviews.count == 0
end end
# 作业查看最新成绩
def update_score identity
identity < Course::NORMAL && publish_time.present? && publish_time < Time.now && !course.is_end
end
# 作业能否立即发布 # 作业能否立即发布
def publish_immediately user def publish_immediately user
homework_detail_manual.try(:comment_status) == 0 || homework_group_settings.where(course_group_id: course.charge_group_ids(user)). homework_detail_manual.try(:comment_status) == 0 || homework_group_settings.where(course_group_id: course.charge_group_ids(user)).

@ -104,7 +104,7 @@ class Poll < ApplicationRecord
status = 4 status = 4
else else
if user.present? && user.student_of_course?(course) if user.present? && user.student_of_course?(course)
ex_time = get_poll_times(user_id,false) ex_time = get_poll_times(user.id,false)
pb_time = ex_time[:publish_time] pb_time = ex_time[:publish_time]
ed_time = ex_time[:end_time] ed_time = ex_time[:end_time]
if pb_time.present? && ed_time.present? && pb_time <= Time.now && ed_time > Time.now if pb_time.present? && ed_time.present? && pb_time <= Time.now && ed_time > Time.now

@ -1,6 +1,6 @@
class StudentWorksScore < ApplicationRecord class StudentWorksScore < ApplicationRecord
#appeal_status: 0正常1申诉中2撤销申诉3申诉成功4申诉被拒绝5申诉失效 #appeal_status: 0正常1申诉中2撤销申诉3申诉成功4申诉被拒绝5申诉失效
belongs_to :student_work belongs_to :student_work
belongs_to :user belongs_to :user
has_many :journals_for_messages, -> { order('created_on desc') }, as: :jour, dependent: :destroy has_many :journals_for_messages, -> { order('created_on desc') }, as: :jour, dependent: :destroy
has_one :student_works_scores_appeal, dependent: :destroy has_one :student_works_scores_appeal, dependent: :destroy

@ -13,6 +13,8 @@ class Subject < ApplicationRecord
has_many :stage_shixuns, dependent: :destroy has_many :stage_shixuns, dependent: :destroy
has_many :shixuns, through: :stage_shixuns has_many :shixuns, through: :stage_shixuns
has_many :subject_appointments, dependent: :destroy
has_many :subject_members, ->{ order("subject_members.position asc")}, dependent: :destroy has_many :subject_members, ->{ order("subject_members.position asc")}, dependent: :destroy
has_many :users, through: :subject_members has_many :users, through: :subject_members
has_many :tidings, as: :container, dependent: :destroy has_many :tidings, as: :container, dependent: :destroy
@ -44,6 +46,10 @@ class Subject < ApplicationRecord
courses.where("start_date <= '#{Date.today}' and end_date >= '#{Date.today}'").count > 0 courses.where("start_date <= '#{Date.today}' and end_date >= '#{Date.today}'").count > 0
end end
def has_participate?
subject_appointments.exists?(user_id: User.current.id)
end
# 挑战过路径的成员数(金课统计去重后的报名人数) # 挑战过路径的成员数(金课统计去重后的报名人数)
def member_count def member_count
excellent ? CourseMember.where(role: 4, course_id: courses.pluck(:id)).pluck(:user_id).length : shixuns.pluck(:myshixuns_count).sum excellent ? CourseMember.where(role: 4, course_id: courses.pluck(:id)).pluck(:user_id).length : shixuns.pluck(:myshixuns_count).sum
@ -109,4 +115,10 @@ class Subject < ApplicationRecord
def learning? user_id def learning? user_id
Myshixun.where(user_id: user_id, shixun_id: shixuns).exists? Myshixun.where(user_id: user_id, shixun_id: shixuns).exists?
end end
def start_course_notify
Tiding.create(user_id: user_id, trigger_user_id: 0, container_id: id,
container_type: 'SubjectStartCourse', belong_container_id: id,
belong_container_type: 'Subject', tiding_type: 'System')
end
end end

@ -0,0 +1,4 @@
class SubjectAppointment < ApplicationRecord
belongs_to :subject
belongs_to :user
end

@ -346,7 +346,7 @@ class User < ApplicationRecord
elsif business? elsif business?
Course::BUSINESS Course::BUSINESS
else else
role = course.course_members.find_by(user_id: id, is_active: 1)&.role role = course&.course_members&.find_by(user_id: id, is_active: 1)&.role
case role case role
when nil then Course::NORMAL when nil then Course::NORMAL
when 'CREATOR' then Course::CREATOR when 'CREATOR' then Course::CREATOR

@ -0,0 +1,26 @@
class Admins::IdentityAuths::RevokeApplyService < ApplicationService
attr_reader :apply, :user
def initialize(apply)
@apply = apply
@user = apply.user
end
def call
ActiveRecord::Base.transaction do
apply.revoke!
user.update!(authentication: false)
deal_tiding!
end
end
private
def deal_tiding!
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
container_id: apply.id, container_type: 'CancelUserAuthentication',
belong_container_id: apply.user_id, belong_container_type: 'User',
status: 1, tiding_type: 'System')
end
end

@ -0,0 +1,26 @@
class Admins::ProfessionalAuths::RevokeApplyService < ApplicationService
attr_reader :apply, :user
def initialize(apply)
@apply = apply
@user = apply.user
end
def call
ActiveRecord::Base.transaction do
apply.revoke!
user.update!(professional_certification: false)
deal_tiding!
end
end
private
def deal_tiding!
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
container_id: apply.id, container_type: 'CancelUserProCertification',
belong_container_id: apply.user_id, belong_container_type: 'User',
status: 1, tiding_type: 'System')
end
end

@ -25,6 +25,10 @@
<% end %> <% end %>
</div> </div>
<div class="batch-action-container">
<%= javascript_void_link '批量同意', class: 'btn btn-outline-primary btn-sm batch-agree-btn' %>
</div>
<div class="box identity-authentication-list-container"> <div class="box identity-authentication-list-container">
<%= render(partial: 'admins/identity_authentications/shared/list', locals: { applies: @applies }) %> <%= render(partial: 'admins/identity_authentications/shared/list', locals: { applies: @applies }) %>
</div> </div>

@ -3,6 +3,12 @@
<table class="table table-hover text-center identity-authentication-list-table"> <table class="table table-hover text-center identity-authentication-list-table">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<% unless is_processed %>
<th width="4%">
<%= check_box_tag('all-check', 1, false, id: nil, class: 'batch-all-check-box',
data: { toggle: 'tooltip', title: '全选' }) %>
</th>
<% end %>
<th width="8%">头像</th> <th width="8%">头像</th>
<th width="10%">姓名</th> <th width="10%">姓名</th>
<th width="14%">身份证号</th> <th width="14%">身份证号</th>
@ -14,12 +20,14 @@
<i class="fa fa-question-circle" data-toggle="tooltip" data-html="true" data-placement="top" title="审核完成后自动删除图片"></i> <i class="fa fa-question-circle" data-toggle="tooltip" data-html="true" data-placement="top" title="审核完成后自动删除图片"></i>
</th> </th>
<% end %> <% end %>
<th width="16%">时间</th>
<% if is_processed %> <% if is_processed %>
<th width="14%">拒绝原因</th> <th width="10%">时间</th>
<th width="12%">拒绝原因</th>
<th width="8%">状态</th> <th width="8%">状态</th>
<th width="8%">操作</th>
<% else %> <% else %>
<th width="20%">操作</th> <th width="16%">时间</th>
<th width="16%">操作</th>
<% end %> <% end %>
</tr> </tr>
</thead> </thead>
@ -28,6 +36,9 @@
<% applies.each do |apply| %> <% applies.each do |apply| %>
<% user = apply.user %> <% user = apply.user %>
<tr class="identity-authentication-item identity-authentication-<%= apply.id %>"> <tr class="identity-authentication-item identity-authentication-<%= apply.id %>">
<% unless is_processed %>
<td><%= check_box_tag('ids[]', apply.id, false, id: nil, class: 'batch-check-box') %></td>
<% end %>
<td> <td>
<%= link_to "/users/#{user.login}", class: 'identity-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> <%= link_to "/users/#{user.login}", class: 'identity-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" /> <img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
@ -53,6 +64,11 @@
<% if is_processed %> <% if is_processed %>
<td class="text-secondary"><%= overflow_hidden_span apply.remarks, width: 140 %></td> <td class="text-secondary"><%= overflow_hidden_span apply.remarks, width: 140 %></td>
<td><span class="apply-status-<%= apply.status %>"><%= apply.status_text %></span></td> <td><span class="apply-status-<%= apply.status %>"><%= apply.status_text %></span></td>
<td>
<% if apply.status == 1 %>
<%= agree_link '撤销', revoke_admins_identity_authentication_path(apply, element: ".identity-authentication-#{apply.id}"), 'data-confirm': '是否确认撤销认证??' %>
<% end %>
</td>
<% else %> <% else %>
<td class="action-container"> <td class="action-container">
<%= agree_link '同意', agree_admins_identity_authentication_path(apply, element: ".identity-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?' %> <%= agree_link '同意', agree_admins_identity_authentication_path(apply, element: ".identity-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?' %>

@ -25,6 +25,10 @@
<% end %> <% end %>
</div> </div>
<div class="batch-action-container">
<%= javascript_void_link '批量同意', class: 'btn btn-outline-primary btn-sm batch-agree-btn' %>
</div>
<div class="box professional-authentication-list-container"> <div class="box professional-authentication-list-container">
<%= render(partial: 'admins/professional_authentications/shared/list', locals: { applies: @applies }) %> <%= render(partial: 'admins/professional_authentications/shared/list', locals: { applies: @applies }) %>
</div> </div>

@ -3,12 +3,18 @@
<table class="table table-hover text-center professional-authentication-list-table"> <table class="table table-hover text-center professional-authentication-list-table">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<% unless is_processed %>
<th width="4%">
<%= check_box_tag('all-check', 1, false, id: nil, class: 'batch-all-check-box',
data: { toggle: 'tooltip', title: '全选' }) %>
</th>
<% end %>
<th width="8%">头像</th> <th width="8%">头像</th>
<th width="14%">姓名</th> <th width="14%">姓名</th>
<th width="28%">学校/单位</th> <th width="20%">学校/单位</th>
<th width="12%">职称</th> <th width="12%">职称</th>
<% unless is_processed %> <% unless is_processed %>
<th width="10%"> <th width="14%">
照片 照片
<i class="fa fa-question-circle" data-toggle="tooltip" data-html="true" data-placement="top" title="审核完成后自动删除图片"></i> <i class="fa fa-question-circle" data-toggle="tooltip" data-html="true" data-placement="top" title="审核完成后自动删除图片"></i>
</th> </th>
@ -17,8 +23,9 @@
<% if is_processed %> <% if is_processed %>
<th width="14%">拒绝原因</th> <th width="14%">拒绝原因</th>
<th width="8%">状态</th> <th width="8%">状态</th>
<th width="8%">操作</th>
<% else %> <% else %>
<th width="18%">操作</th> <th width="22%">操作</th>
<% end %> <% end %>
</tr> </tr>
</thead> </thead>
@ -27,6 +34,9 @@
<% applies.each do |apply| %> <% applies.each do |apply| %>
<% user = apply.user %> <% user = apply.user %>
<tr class="professional-authentication-item professional-authentication-<%= apply.id %>"> <tr class="professional-authentication-item professional-authentication-<%= apply.id %>">
<% unless is_processed %>
<td><%= check_box_tag('ids[]', apply.id, false, id: nil, class: 'batch-check-box') %></td>
<% end %>
<td> <td>
<%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> <%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" /> <img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
@ -51,6 +61,11 @@
<% if is_processed %> <% if is_processed %>
<td class="text-secondary"><%= overflow_hidden_span apply.remarks, width: 140 %></td> <td class="text-secondary"><%= overflow_hidden_span apply.remarks, width: 140 %></td>
<td><span class="apply-status-<%= apply.status %>"><%= apply.status_text %></span></td> <td><span class="apply-status-<%= apply.status %>"><%= apply.status_text %></span></td>
<td>
<% if apply.status == 1 %>
<%= agree_link '撤销', revoke_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}"), 'data-confirm': '是否确认撤销认证??' %>
<% end %>
</td>
<% else %> <% else %>
<td class="action-container"> <td class="action-container">
<%= agree_link '同意', agree_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?', 'data-disable-with': "提交中..." %> <%= agree_link '同意', agree_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?', 'data-disable-with': "提交中..." %>

@ -9,13 +9,13 @@ wb = xlsx_package.workbook
wb.styles do |style| wb.styles do |style|
title_style = style.add_style(sz: 16, height: 20, b: true) title_style = style.add_style(sz: 16, height: 20, b: true)
ec_year_style = style.add_style(sz: 10, height: 14) ec_year_style = style.add_style(sz: 10, height: 14)
label_style = style.add_style(sz: 11, b: true, bg_color: '90EE90', alignment: { horizontal: :center }, border: { style: :thin, color: '000000' }) label_style = style.add_style(sz: 11, b: true, bg_color: '90EE90', alignment: { horizontal: :center, vertical: :center }, border: { style: :thin, color: '000000' })
content_style = style.add_style(sz: 11, height: 16, border: { style: :thin, color: '000000' }) content_style = style.add_style(sz: 11, height: 16, border: { style: :thin, color: '000000' })
tip_style = style.add_style(sz: 11, height: 16, color: 'FFA07A') tip_style = style.add_style(sz: 11, height: 16, color: Axlsx::Color.new(rgb: 'FFFFA07A'))
wb.add_worksheet(:name => '课程体系对毕业要求的支撑') do |sheet| wb.add_worksheet(:name => '课程体系对毕业要求的支撑') do |sheet|
sheet.add_row ['课程体系VS毕业要求'], style: title_style sheet.add_row ['课程体系VS毕业要求'], style: title_style
sheet.merge_cells wb.rows.first.cells[(1..(3 + max_support_length - 1))] sheet.merge_cells sheet.rows.first.cells[(1..(3 + max_support_length - 1))]
sheet.add_row [] sheet.add_row []
@ -25,8 +25,8 @@ wb.styles do |style|
sheet.add_row ['注:有对应关系的课程名称下方为其权重系数,一个指标点的权重系数之和必须等于1'], style: tip_style sheet.add_row ['注:有对应关系的课程名称下方为其权重系数,一个指标点的权重系数之和必须等于1'], style: tip_style
sheet.add_row ['注:“★” 表示关联度高'] sheet.add_row ['注:“★” 表示关联度高']
sheet.merge_cells wb.rows[5].cells[(1..(3 + max_support_length - 1))] sheet.merge_cells sheet.rows[5].cells[(1..(3 + max_support_length - 1))]
sheet.merge_cells wb.rows[6].cells[(1..(3 + max_support_length - 1))] sheet.merge_cells sheet.rows[6].cells[(1..(3 + max_support_length - 1))]
sheet.add_row [] sheet.add_row []
@ -34,9 +34,9 @@ wb.styles do |style|
data[last_column_index] = '课程数量' data[last_column_index] = '课程数量'
sheet.add_row data, style: label_style sheet.add_row data, style: label_style
course_columns = max_support_length.times.map { |i| "课程#{i + 1}" } course_columns = max_support_length.times.map { |i| "课程#{i + 1}" }
sheet.add_row %w('一级 二级') + course_columns + ['∑目标值'], style: label_style sheet.add_row %w(一级 二级) + course_columns + ['∑目标值'], style: label_style
sheet.merge_cells("A9:B9") sheet.merge_cells("A9:B9")
sheet.merge_cells wb.rows[8].cells[(3..(3 + max_support_length - 1))] # sheet.merge_cells sheet.rows[8].cells[(3..(3 + max_support_length - 1))]
current_row = 11 current_row = 11
graduation_subitems.group_by(&:ec_graduation_requirement).each do |requirement, items| graduation_subitems.group_by(&:ec_graduation_requirement).each do |requirement, items|
@ -61,11 +61,11 @@ wb.styles do |style|
sheet.add_row course_data, style: styles sheet.add_row course_data, style: styles
sheet.add_row weight_data, style: styles sheet.add_row weight_data, style: styles
sheet.merge_cells("B#{current_row - 1}:B#{current_row}") sheet.merge_cells("B#{current_row}:B#{current_row + 1}")
current_row += 2 current_row += 2
end end
sheet.merge_cells("A#{start_row - 1}:B#{current_row - 1}") sheet.merge_cells("A#{start_row}:A#{current_row - 1}")
end end
end end
end end

@ -4,6 +4,7 @@ json.partial! "homework_btn_check", locals: {identity: @user_course_identity, ho
json.partial! "student_btn_check", locals: {identity: @user_course_identity, homework: @homework, work: @work} json.partial! "student_btn_check", locals: {identity: @user_course_identity, homework: @homework, work: @work}
json.update_score @homework.update_score(@user_course_identity) if @homework.homework_type == "practice"
json.work_count @work_count json.work_count @work_count
json.all_member_count @all_member_count json.all_member_count @all_member_count
json.course_group_count @course.course_groups_count json.course_group_count @course.course_groups_count

@ -9,8 +9,12 @@ json.results do
# 去除开头标点符号 # 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/ reg = /^[,。?:;‘’!“”—……、]/
# 附件的替换
atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '') highlights[:description]&.first&.sub!(reg, '')
highlights[:description]&.map{|des| des.gsub!(atta_reg, '')}
highlights[:content]&.first&.sub!(reg, '') highlights[:content]&.first&.sub!(reg, '')
highlights[:content]&.map{|des| des.gsub!(atta_reg, '')}
json.content highlights json.content highlights
end end

@ -7,11 +7,16 @@ json.shixun_list do
# 去除开头标点符号 # 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/ reg = /^[,。?:;‘’!“”—……、]/
# 附件的替换
atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '') highlights[:description]&.first&.sub!(reg, '')
highlights[:description]&.map{|des| des.gsub!(atta_reg, '')}
highlights[:content]&.first&.sub!(reg, '') highlights[:content]&.first&.sub!(reg, '')
highlights[:content]&.map{|des| des.gsub!(atta_reg, '')}
json.title highlights.delete(:name)&.join('...') || obj.searchable_title json.title highlights.delete(:name)&.join('...') || obj.searchable_title
json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300] json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.sub!(atta_reg, '')
json.content highlights json.content highlights
json.level level_to_s(obj.trainee) json.level level_to_s(obj.trainee)

@ -24,4 +24,10 @@ if @subject.excellent
json.course_identity @user.course_identity(course) json.course_identity @user.course_identity(course)
json.course_status subject_course_status course json.course_status subject_course_status course
end end
if @subject.max_course_end_date.nil? || @subject.max_course_end_date < Date.today
json.student_count @subject.student_count
json.participant_count @subject.participant_count
json.has_participate @subject.has_participate?
end
end end

@ -5,6 +5,7 @@ json.members_count course.course_members_count
# json.homework_commons_count course.homework_commons_count # json.homework_commons_count course.homework_commons_count
json.homework_commons_count get_tasks_count course json.homework_commons_count get_tasks_count course
json.attachments_count course.attachments.count json.attachments_count course.attachments.count
json.visits course.visits
json.first_category_url module_url(course.course_modules.where(hidden: 0).order(position: :desc).first, course) json.first_category_url module_url(course.course_modules.where(hidden: 0).order(position: :desc).first, course)

@ -10,7 +10,7 @@
"2_1_end": "你提交的职业认证申请,审核已通过" "2_1_end": "你提交的职业认证申请,审核已通过"
"2_2_end": "你提交的职业认证申请,审核未通过<br/><span>原因:%{reason}</span>" "2_2_end": "你提交的职业认证申请,审核未通过<br/><span>原因:%{reason}</span>"
CancelUserAuthentication_end: "取消了你的实名认证:%s %s" CancelUserAuthentication_end: "取消了你的实名认证:%s %s"
CancelUserProCertification_end: "取消了你的实名认证:%s %s" CancelUserProCertification_end: "取消了你的职业认证:%s %s"
JoinCourse: JoinCourse:
"9_end": "申请加入课堂:%s教师" "9_end": "申请加入课堂:%s教师"
"7_end": "申请加入课堂:%s助教" "7_end": "申请加入课堂:%s助教"
@ -227,3 +227,4 @@
1_end: "你提交的发布视频申请:%s审核已通过" 1_end: "你提交的发布视频申请:%s审核已通过"
2_end: "你提交的发布视频申请:%s审核未通过<br/><span>原因:%{reason}</span>" 2_end: "你提交的发布视频申请:%s审核未通过<br/><span>原因:%{reason}</span>"
PublicCourseStart_end: "你报名参与的开放课程:%s将于%s正式开课" PublicCourseStart_end: "你报名参与的开放课程:%s将于%s正式开课"
SubjectStartCourse_end: "您创建的开放课程:%s 已达到开课人数要求。您可以在24小时内自主开设新一期课程。如果超过24小时未开课平台将自动开课并复制您上一期的课程内容。"

@ -284,6 +284,7 @@ Rails.application.routes.draw do
post :up_member_position post :up_member_position
post :down_member_position post :down_member_position
get :right_banner get :right_banner
post :appointment
end end
collection do collection do
@ -879,12 +880,22 @@ Rails.application.routes.draw do
member do member do
post :agree post :agree
post :refuse post :refuse
post :revoke
end
collection do
post :batch_agree
end end
end end
resources :professional_authentications, only: [:index] do resources :professional_authentications, only: [:index] do
member do member do
post :agree post :agree
post :refuse post :refuse
post :revoke
end
collection do
post :batch_agree
end end
end end
resources :shixun_authorizations, only: [:index] do resources :shixun_authorizations, only: [:index] do

@ -0,0 +1,6 @@
class AddCourseMemberToSubjects < ActiveRecord::Migration[5.2]
def change
add_column :subjects, :student_count, :integer, :default => 0
add_column :subjects, :participant_count, :integer, :default => 0
end
end

@ -0,0 +1,10 @@
class CreateSubjectAppointments < ActiveRecord::Migration[5.2]
def change
create_table :subject_appointments do |t|
t.references :subject, index: true
t.references :user, index: true
t.timestamps
end
end
end

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -65,8 +65,8 @@
"<label>" + imageLang.alt + "</label>" + "<label>" + imageLang.alt + "</label>" +
"<input type=\"text\" value=\"" + selection + "\" data-alt />" + "<input type=\"text\" value=\"" + selection + "\" data-alt />" +
"<br/>" + "<br/>" +
"<label>" + imageLang.link + "</label>" + "<label class=\"image-link\">" + imageLang.link + "</label>" +
"<input type=\"text\" value=\"http://\" data-link />" + "<input class=\"image-link\" type=\"text\" value=\"http://\" data-link />" +
"<br/>" + "<br/>" +
( (settings.imageUpload) ? "</form>" : "</div>"); ( (settings.imageUpload) ? "</form>" : "</div>");

@ -1,4 +1,4 @@
document.write("<link href='//at.alicdn.com/t/font_653600_qa9lwwv74z.css' rel='stylesheet' type='text/css'/>"); document.write("<link href='https://at.alicdn.com/t/font_653600_qa9lwwv74z.css' rel='stylesheet' type='text/css'/>");
/*! /*!
* JavaScript Cookie v2.2.0 * JavaScript Cookie v2.2.0

@ -32,7 +32,7 @@ module.exports = {
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map", // devtool: "cheap-module-eval-source-map",
// 开启调试 // 开启调试
// devtool: "eval", // 开启调试 // devtool: "eval-source-map", // 开启调试
// These are the "entry points" to our application. // These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle. // This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS. // The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@icedesign/base": "^0.2.8", "@icedesign/base": "^0.2.5",
"@novnc/novnc": "^1.1.0", "@novnc/novnc": "^1.1.0",
"antd": "^3.23.2", "antd": "^3.23.2",
"array-flatten": "^2.1.2", "array-flatten": "^2.1.2",

@ -3048,7 +3048,7 @@ a.singlepublishtwo{
/*工程认证*/ /*工程认证*/
/*首页*/ /*首页*/
.authMainImg{width: 100%;height: 240px;background:url("/images/educoder/auth/banner1.jpg") no-repeat top center;background-size: 100% 100%;justify-content: center;align-items: center;display: -webkit-flex;} .authMainImg{width: 100%;height: 240px;background:url("/images/educoder/auth/banner1.jpg") no-repeat top center;background-size: 100% 100%;justify-content: center;align-items: center;display: -webkit-flex;}
.ListTableLine>p,.ListTableLine>.ListTableTitle{padding: 0px 30px;background-color: #F5F5F5;line-height: 40px;height: 56px;padding-top: 8px;box-sizing: border-box;} .ListTableLine>p,.ListTableLine>.ListTableTitle{margin-bottom: 0px;padding: 0px 30px;background-color: #F5F5F5;line-height: 40px;height: 56px;padding-top: 8px;box-sizing: border-box;}
.ListTableLine>p span,.ListTableTitle span{float: left;color: #666;box-sizing: border-box} .ListTableLine>p span,.ListTableTitle span{float: left;color: #666;box-sizing: border-box}
.ListTableLine li{min-height: 48px;padding: 10px 0px;box-sizing: border-box;margin:0px 30px;border-bottom: 1px solid #eaeaea;} .ListTableLine li{min-height: 48px;padding: 10px 0px;box-sizing: border-box;margin:0px 30px;border-bottom: 1px solid #eaeaea;}
.ListTableLine li>span{float: left;box-sizing: border-box;} .ListTableLine li>span{float: left;box-sizing: border-box;}

@ -1,8 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- width=device-width, initial-scale=1 , shrink-to-fit=no --> <!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />-->
<!-- width=device-width, initial-scale=1 , shrink-to-fit=no -->
<!-- <meta name="viewport" content=""> --> <!-- <meta name="viewport" content=""> -->
<meta name="theme-color" content="#000000"> <meta name="theme-color" content="#000000">
<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">--> <!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->

File diff suppressed because one or more lines are too long

@ -72,6 +72,13 @@ html, body {
/* 某些情况下被cm盖住了 */ /* 某些情况下被cm盖住了 */
z-index: 99; z-index: 99;
} }
/* 图片点击放大的场景,隐藏图片链接 */
.editormd-image-click-expand .editormd-image-dialog {
height: 234px !important;
}
.editormd-image-click-expand .editormd-image-dialog .image-link {
display: none;
}
/* 解决鼠标框选时,左边第一列没高亮的问题 */ /* 解决鼠标框选时,左边第一列没高亮的问题 */
.CodeMirror .CodeMirror-lines pre.CodeMirror-line, .CodeMirror .CodeMirror-lines pre.CodeMirror-line-like { .CodeMirror .CodeMirror-lines pre.CodeMirror-line, .CodeMirror .CodeMirror-lines pre.CodeMirror-line-like {
padding: 0 12px ; padding: 0 12px ;

@ -315,9 +315,33 @@ class CoursesIndex extends Component{
if(isNaN(id)){ if(isNaN(id)){
return return
} }
const querys = this.props.location.search;
var dataqueryss={}
try {
var foqus=this.foo(querys);
if(JSON.stringify(foqus) ==="{}"){
this.setState({
dataquerys:{},
});
}else{
this.setState({
dataquerys:foqus,
});
dataqueryss=foqus;
}
}catch (e) {
this.setState({
dataquerys:{},
})
}
// let id=this.props.match.params.coursesId; // let id=this.props.match.params.coursesId;
let url ="/courses/"+id+"/left_banner.json" let url ="/courses/"+id+"/left_banner.json"
axios.get(url).then((response) => { axios.get(url,
{params:
dataqueryss
}
).then((response) => {
if(response!=undefined){ if(response!=undefined){
if(response.data&&response.data){ if(response.data&&response.data){
this.setState({ this.setState({
@ -330,7 +354,28 @@ class CoursesIndex extends Component{
} }
} }
}) })
} };
foo=(url)=> {
var json = {};
var regExp = /[\?\&](\w+)(=?)(\w*)/g;
var arr;
do {
arr = regExp.exec(url);
// console.log(arr); // arr = [完整的字符串, key, 等号或'', value或'']
if (arr) {
var key = arr[1];
var value = arr[3];
// arr[2] === ''时, value = undefined
if (!arr[2])
value = undefined;
json[key] = value;
}
} while (arr);
return json;
};
locationNav=(list)=>{ locationNav=(list)=>{
if(list){ if(list){

@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip,Spin, Pagination} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip,Spin, Pagination} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import locale from 'antd/lib/date-picker/locale/zh_CN'; import locale from 'antd/lib/date-picker/locale/zh_CN';
import { WordsBtn, ConditionToolTip, queryString,getImageUrl, on, off} from 'educoder'; import { WordsBtn, ConditionToolTip, queryString,getImageUrl, on, off, NoneData} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
@ -817,10 +817,8 @@ class CommonWorkList extends Component{
<Spin size="large" spinning={this.state.isSpin}> <Spin size="large" spinning={this.state.isSpin}>
<div id="forum_list" className="forum_table"> <div id="forum_list" className="forum_table">
<div className="mh650 edu-back-white"> <div className="mh650 edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/> <NoneData></NoneData>
<p className="edu-nodata-p mb30">暂时还没有相关数据哦</p>
</div>
</div> </div>
</div> </div>
</Spin> </Spin>

@ -70,10 +70,23 @@ class NewWorkForm extends Component{
contentFileList, contentFileList,
answerFileList, answerFileList,
}, () => { }, () => {
setTimeout(() => { // setTimeout(() => {
this.contentMdRef.current.setValue(data.description || '') // this._scrollToTop()
this.answerMdRef.current.setValue(data.reference_answer || '') // 阻止setValue的滚动
}, 2000) // $(window).scroll( function() {
// $("html").scrollTop(0)
// $(window).unbind("scroll");
// });
/**
setValue会调用到 codemirror的 o.scrollIntoView(i), 会导致滚动条跳动
*/
// $('.editormd').parent().css('position', 'fixed').css('left', '-1000px')
// this.contentMdRef.current.setValue(data.description || '')
// this.answerMdRef.current.setValue(data.reference_answer || '')
// setTimeout(() => {
// $('.editormd').parent().css('position', '').css('left', 'auto')
// }, 100);
// }, 500)
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
title: data.name, title: data.name,
@ -85,12 +98,13 @@ class NewWorkForm extends Component{
} else { // new } else { // new
} }
this._scrollToTop() // this._scrollToTop()
} }
_scrollToTop = () => { _scrollToTop = () => {
setTimeout(() => { // setTimeout(() => {
$("html").animate({ scrollTop: 0 }) $("html").scrollTop(0)
}, 1500) // $("html").animate({ scrollTop: 0 })
// }, 1000)
} }
// 输入title // 输入title
@ -303,15 +317,13 @@ class NewWorkForm extends Component{
let{ let{
title_value, contentFileList, answerFileList, max_num, min_num, base_on_project, title_value, contentFileList, answerFileList, max_num, min_num, base_on_project,
init_max_num, init_min_num, init_max_num, init_min_num,
title_num, course_name, category, has_commit, has_project, title_num, course_name, category, has_commit, has_project
isEdit
}=this.state }=this.state
const { current_user } = this.props const { current_user } = this.props
const courseId = this.state.course_id || this.props.match.params.coursesId ; const courseId = this.state.course_id || this.props.match.params.coursesId ;
this.isEdit = this.isEdit || this.props.match.url.indexOf('/edit') != -1
if ((isEdit) && !this.state.workLoaded) { if ((this.isEdit) && !this.state.description) {
return '' return ''
} }
const uploadProps = { const uploadProps = {
@ -439,7 +451,8 @@ class NewWorkForm extends Component{
}], }],
})( })(
<TPMMDEditor ref={this.contentMdRef} placeholder="请在此输入作业内容和要求,最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500} <TPMMDEditor ref={this.contentMdRef} placeholder="请在此输入作业内容和要求,最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500}
className="courseMessageMD" initValue={this.state.description}></TPMMDEditor> initValue={this.state.description} noSetValueOnInit={!!this.isEdit}
className="courseMessageMD" ></TPMMDEditor>
)} )}
</Form.Item> } </Form.Item> }
<Upload {...uploadProps} className="upload_1 newWorkUpload"> <Upload {...uploadProps} className="upload_1 newWorkUpload">
@ -479,7 +492,7 @@ class NewWorkForm extends Component{
<InputNumber className="winput-240-40" placeholder="请填写每组最大人数" value={max_num} max={10} <InputNumber className="winput-240-40" placeholder="请填写每组最大人数" value={max_num} max={10}
onChange={this.max_num_change} style={{width:'180px'}} /> onChange={this.max_num_change} style={{width:'180px'}} />
</ConditionToolTip> </ConditionToolTip>
<label className="color-grey-9 ml20 font-14">项目管理员角色的成员都可以提交作品提交作品时需要关联同组成员组内成员作品共享</label> <label className="color-grey-9 ml20 font-14">学生提交作品时需要关联同组成员组内成员作品共享</label>
</p> </p>
<p className="mt20"> <p className="mt20">
<ConditionToolTip condition={has_commit || has_project} title={'已有关联项目或作品,不能修改'}> <ConditionToolTip condition={has_commit || has_project} title={'已有关联项目或作品,不能修改'}>
@ -488,7 +501,7 @@ class NewWorkForm extends Component{
>基于项目实施</Checkbox> >基于项目实施</Checkbox>
</ConditionToolTip> </ConditionToolTip>
<label className="color-grey-9 ml12 font-14">勾选后各小组必须在educoder平台创建项目教师可随时观察平台对各小组最新进展的实时统计</label> <label className="color-grey-9 ml12 font-14">选中则必须在本平台创建项目项目管理员可以提交作品不选中无需在平台创建项目任意小组成员均可以提交作品</label>
</p> </p>
</div> </div>
)} )}
@ -507,7 +520,8 @@ class NewWorkForm extends Component{
}], }],
})( })(
<TPMMDEditor ref={this.answerMdRef} placeholder="请在此输入作业的参考答案,最大限制5000个字符" mdID={'workAnswerMD'} <TPMMDEditor ref={this.answerMdRef} placeholder="请在此输入作业的参考答案,最大限制5000个字符" mdID={'workAnswerMD'}
className="courseMessageMD" refreshTimeout={1500} initValue={this.state.reference_answer || ''}></TPMMDEditor> initValue={this.state.reference_answer || ''} noSetValueOnInit={!!this.isEdit}
className="courseMessageMD" refreshTimeout={1500} ></TPMMDEditor>
)} )}
</Form.Item> </Form.Item>
<Upload {...answerUploadProps} className="upload_1 newWorkUpload resetNewWorkUpload"> <Upload {...answerUploadProps} className="upload_1 newWorkUpload resetNewWorkUpload">

@ -86,7 +86,7 @@ class WorkDetailPageHeader extends Component{
background: #fff; background: #fff;
} }
.workDetailPageHeader .summaryname { .workDetailPageHeader .summaryname {
line-height:30px line-height:28px
} }
`}</style> `}</style>
<CBreadcrumb items={[ <CBreadcrumb items={[

@ -16,7 +16,7 @@ class CBreadcrumb extends Component{
return '' return ''
} }
if (item.to) { if (item.to) {
return <React.Fragment> return <React.Fragment key={index}>
<WordsBtn style="grey" className="fl hovercolorblue" to={item.to}>{item.name}</WordsBtn> <WordsBtn style="grey" className="fl hovercolorblue" to={item.to}>{item.name}</WordsBtn>
{separator ? {separator ?
<span className="color-grey-9 fl ml3 mr3">{separator}</span> : <span className="color-grey-9 fl ml3 mr3">{separator}</span> :
@ -24,7 +24,7 @@ class CBreadcrumb extends Component{
} }
</React.Fragment> </React.Fragment>
} else { } else {
return <span>{item.name}</span> return <span key={index}>{item.name}</span>
} }
})} })}
</p> </p>

@ -250,7 +250,7 @@ class CommonReply extends Component{
} }
`}</style> `}</style>
<MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么" <MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
height={160} showError={true} height={160} showError={true} imageExpand={true}
replyComment={this.replyComment} replyComment={this.replyComment}
commentsLength={comments ? comments.length : 0} commentsLength={comments ? comments.length : 0}
></MemoDetailMDEditor> ></MemoDetailMDEditor>

@ -94,9 +94,30 @@ class CoursesBanner extends Component {
this.updatabanner() this.updatabanner()
} }
updatabanner=()=>{ updatabanner=()=>{
const query = this.props.location.search;
var dataqueryss={}
try {
var foqus=this.foo(query);
if(JSON.stringify(foqus) ==="{}"){
this.setState({
dataquerys:{},
});
}else{
this.setState({
dataquerys:foqus,
});
dataqueryss=foqus;
}
}catch (e) {
this.setState({
dataquerys:{},
})
}
let courseId = this.props.match.params.coursesId; let courseId = this.props.match.params.coursesId;
let url = "/courses/" + courseId + "/top_banner.json" let url = "/courses/" + courseId + "/top_banner.json"
axios.get(url).then((result) => { axios.get(url,{params:
dataqueryss
}).then((result) => {
if( result!=undefined){ if( result!=undefined){
let data = result.data; let data = result.data;
this.setState({ this.setState({
@ -107,7 +128,28 @@ class CoursesBanner extends Component {
this.onloadupdatabanner() this.onloadupdatabanner()
} }
}) })
} };
foo=(url)=> {
var json = {};
var regExp = /[\?\&](\w+)(=?)(\w*)/g;
var arr;
do {
arr = regExp.exec(url);
// console.log(arr); // arr = [完整的字符串, key, 等号或'', value或'']
if (arr) {
var key = arr[1];
var value = arr[3];
// arr[2] === ''时, value = undefined
if (!arr[2])
value = undefined;
json[key] = value;
}
} while (arr);
return json;
};
showeditmenu = () => { showeditmenu = () => {
this.setState({ this.setState({
show: true, show: true,

@ -30,7 +30,7 @@ class CoursesListType extends Component {
return( return(
<span style={{display:'inline-block'}}> <span style={{display:'inline-block'}}>
{ {
typelist===undefined?"":typelist.map((item,key)=>{ typelist===undefined || typelist=== 403 || typelist === 401 || typelist=== 407 || typelist=== 408|| typelist=== 409 || typelist === 500?"":typelist.map((item,key)=>{
return( return(
<Tooltip placement="bottom" title={tipval} getPopupContainer={()=>document.querySelector('.TabsWarp')} key={key}> <Tooltip placement="bottom" title={tipval} getPopupContainer={()=>document.querySelector('.TabsWarp')} key={key}>
<span key={key}> <span key={key}>

@ -233,7 +233,7 @@ class Bullsubdirectory extends Component{
{ {
whethertoeditysl === false? whethertoeditysl === false?
<div> <div>
<div> <div className="fudonyingxiangysls">
<div className="fudonyingxiangysl"> <div className="fudonyingxiangysl">
<div style={{marginRight:"60px"}}> <div style={{marginRight:"60px"}}>
<span className="ysltitbt">{myname}</span> <span className="ysltitbt">{myname}</span>

@ -70,6 +70,10 @@
.fudonyingxiangysl{ .fudonyingxiangysl{
width: 100%; width: 100%;
} }
.fudonyingxiangysls{
display: flex;
flex-direction:column;
}
.yslbianji{ .yslbianji{
padding-top: 31px; padding-top: 31px;

@ -249,7 +249,7 @@ class GraduateTaskItem extends Component{
</h6> </h6>
<div className="cl"></div> <div className="cl"></div>
<p className="color-grey panel-lightgrey mt16 fl"> <p className="color-grey mt16 fl">
<span className="mr50"> <span className="mr50">
{/* <a href="/users/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> */} {/* <a href="/users/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> */}

@ -285,7 +285,7 @@ class GraduationTasksSubmitedit extends Component{
let{ search,page,limit,workslist}=this.state; let{ search,page,limit,workslist}=this.state;
let newpage=page+2 let newpage=page+1
this.searchList(search,newpage,limit,workslist.task_id,1) this.searchList(search,newpage,limit,workslist.task_id,1)

@ -271,20 +271,27 @@ class GraduationTasksSubmitnew extends Component{
contentViewScroll=(e)=>{ contentViewScroll=(e)=>{
//滑动到底判断
//滑动到底判断
const {memberslist} = this.state;
let newscrollTop=parseInt(e.currentTarget.scrollTop); let newscrollTop=parseInt(e.currentTarget.scrollTop);
let allclientHeight=e.currentTarget.clientHeight+newscrollTop; let allclientHeight=e.currentTarget.clientHeight+newscrollTop;
if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){ if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){
// console.log("到达底部");
let{ search,page,limit }=this.state; if(memberslist.length===0){
return;
}else{
let{ search,page,limit }=this.state;
let newpage=page+2 let newpage=page+1
this.searchList(search,newpage,limit,1)
}
}
this.searchList(search,newpage,limit,1)
}
} }

@ -32,8 +32,10 @@ class GraduationTasksappraise extends Component{
axios.get(zrl).then((result)=>{ axios.get(zrl).then((result)=>{
if(result.status===200){ if(result.status===200){
let status=result.data.status;
if(status===undefined || status=== 403 || status === 401 || status=== 407 || status=== 408|| status=== 409 || status === 500||status===-1){
if(result.data.status!=-1){ }else{
this.setState({ this.setState({
firelistdata:result.data, firelistdata:result.data,
}) })

@ -80,6 +80,8 @@ class GraduationTaskssettingapp extends Component{
starttime:undefined, starttime:undefined,
DownloadType:false, DownloadType:false,
DownloadMessageval:undefined, DownloadMessageval:undefined,
commentstatustype:undefined,
commenttimeone:undefined
} }
} }
@ -102,10 +104,10 @@ class GraduationTaskssettingapp extends Component{
} }
let starttype=false; let starttype=false;
let endtype=false; let endtype=false;
if(moment(result.data.publish_time)<moment()){ if(moment(result.data.publish_time)<=moment()){
starttype=true starttype=true
} }
if(moment(result.data.end_time)<moment()){ if(moment(result.data.end_time)<=moment()){
endtype=true endtype=true
} }
@ -130,6 +132,7 @@ class GraduationTaskssettingapp extends Component{
taskname: result.data.task_name, taskname: result.data.task_name,
coursename: result.data.course_name, coursename: result.data.course_name,
commentstatus: result.data.comment_status, commentstatus: result.data.comment_status,
commentstatustype:result.data.status,
commentnum: result.data.comment_num, commentnum: result.data.comment_num,
operworks: result.data.open_work, operworks: result.data.open_work,
opergrade: result.data.open_score, opergrade: result.data.open_score,
@ -343,28 +346,33 @@ class GraduationTaskssettingapp extends Component{
let {endtimetype}=this.state; let {endtimetype}=this.state;
if(types===1){ if(types===1){
this.setState({ this.setState({
latetime:newlatetime, // latetime:newlatetime,
crosscomment:true, crosscomment:true,
commenttime:newcommenttime commenttime:newlatetime,
commenttimeone:newlatetime,
}) })
}else{ }else{
if(endtimetype===true){ if(endtimetype===true){
this.setState({ this.setState({
crosscomment:true, crosscomment:true,
commenttime:newcommenttime commenttime:newlatetime,
commenttimeone:newlatetime,
}) })
}else{ }else{
this.setState({ this.setState({
end_time:newlatetime, // end_time:newlatetime,
crosscomment:true, crosscomment:true,
commenttime:newcommenttime commenttime:newlatetime,
commenttimeone:newlatetime,
}) })
} }
} }
} }
funcrosscomment=(e)=>{ funcrosscomment=(e)=>{
let {latetime,end_time,allowlate}=this.state; let {latetime,end_time,allowlate,commenttime,commenttimeone}=this.state;
let commenttimetype=commenttime===null||commenttime==="";
let newlatetimea=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm"); let newlatetimea=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimea=moment(new Date()).format("YYYY-MM-DD HH:mm"); let newcommenttimea=moment(new Date()).format("YYYY-MM-DD HH:mm");
@ -377,26 +385,33 @@ class GraduationTaskssettingapp extends Component{
let newend_timed=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm"); let newend_timed=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm"); let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm");
let newtime;
if(e.target.checked===true){ if(e.target.checked===true){
if(commenttimetype===true){
if(allowlate===1||allowlate===true){
if(latetime===null||latetime===""){ if(allowlate===1||allowlate===true){
this.updatesfuncrosscomment(1,newlatetimea,newcommenttimea) if(latetime===null||latetime===""){
}else{ this.updatesfuncrosscomment(1,newlatetimea,newcommenttimea)
this.updatesfuncrosscomment(1,newlatetimes,newcommenttimes) }else{
} this.updatesfuncrosscomment(1,newlatetimes,newcommenttimes)
}else{ }
if(end_time===null||end_time===""){ }else{
this.updatesfuncrosscomment(2,newend_timeb,newcommenttimeb) if(end_time===null||end_time===""){
this.updatesfuncrosscomment(2,newend_timeb,newcommenttimeb)
}else{
this.updatesfuncrosscomment(2,newend_timed,newcommenttimed)
}
}
}else{ }else{
this.updatesfuncrosscomment(2,newend_timed,newcommenttimed) this.setState({
} crosscomment:e.target.checked,
} commenttime:commenttimeone,
})
}
}else{ }else{
this.setState({ this.setState({
crosscomment:e.target.checked, crosscomment:e.target.checked,
commenttime:undefined commenttime:undefined
}) })
} }
} }
@ -519,10 +534,10 @@ class GraduationTaskssettingapp extends Component{
} }
if(moment(end_time)<moment(publish_time)){ if(moment(end_time)<=moment(publish_time)){
this.setState({ this.setState({
endTimetypes:true, endTimetypes:true,
endTimetypesval:"截止时间不能早于发布时间" endTimetypesval:"截止时间必须晚于发布时间"
}) })
return return
}else{ }else{
@ -531,16 +546,16 @@ class GraduationTaskssettingapp extends Component{
}) })
} }
if(moment(latetime)<moment(publish_time)){ if(moment(latetime)<=moment(publish_time)){
this.setState({ this.setState({
latetimetype:true, latetimetype:true,
latetimetypeval:"结束时间不能早于发布时间" latetimetypeval:"结束时间必须晚于发布时间"
}) })
return return
}else if(moment(latetime)<moment(end_time)){ }else if(moment(latetime)<=moment(end_time)){
this.setState({ this.setState({
latetimetype:true, latetimetype:true,
latetimetypeval:"结束时间不能早于截止时间" latetimetypeval:"结束时间必须晚于截止时间"
}) })
return return
}else{ }else{
@ -562,7 +577,7 @@ class GraduationTaskssettingapp extends Component{
commenttimetype:false commenttimetype:false
}) })
} }
if(moment(this.state.commenttime)<moment(publish_time)){ if(moment(this.state.commenttime)<=moment(publish_time)){
this.setState({ this.setState({
commenttimetype:true, commenttimetype:true,
commenttimevalue:"开始时间不能小于发布时间", commenttimevalue:"开始时间不能小于发布时间",
@ -574,7 +589,7 @@ class GraduationTaskssettingapp extends Component{
}) })
} }
if(moment(this.state.commenttime)<moment(end_time)){ if(moment(this.state.commenttime)<=moment(end_time)){
this.setState({ this.setState({
commenttimetype:true, commenttimetype:true,
commenttimevalue:"开始时间不能小于截止时间", commenttimevalue:"开始时间不能小于截止时间",
@ -918,7 +933,8 @@ class GraduationTaskssettingapp extends Component{
endtimetype, endtimetype,
commenttimetype, commenttimetype,
commenttimevalue, commenttimevalue,
flagPageEdit flagPageEdit,
commentstatustype
} =this.state; } =this.state;
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
@ -992,7 +1008,7 @@ class GraduationTaskssettingapp extends Component{
} }
{/*内容*/} {/*内容*/}
{task_type===2?<div className="stud-class-set bor-bottom-greyE pd20 edu-back-white pl30" > {task_type===2?<div className="stud-class-set bor-bottom-greyE pd20 edu-back-white pl30" >
<div className={"xingrequired font-16 color-dark h20 mb20"}>分组设置 <span className={"font-14 color-grey-c"}>提交作品时需要关联同组成员组内成员作品共享</span></div> <div className={"xingrequired font-16 color-dark h20 mb20"}>分组设置 <span className={"font-14 color-grey-c"}></span></div>
<div className={"mb30 h20 ml40"}> <div className={"mb30 h20 ml40"}>
<Input className={numtype===true?"noticeTip mr20":"mr20"} style={{ width:"100px" }} value={minnum} onInput={this.setminnum} disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true}/> <Input className={numtype===true?"noticeTip mr20":"mr20"} style={{ width:"100px" }} value={minnum} onInput={this.setminnum} disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true}/>
<span className="mr20">~</span> <span className="mr20">~</span>
@ -1154,7 +1170,7 @@ class GraduationTaskssettingapp extends Component{
<div className={" font-16 color-dark h20 mb20"}>评分设置 </div> <div className={" font-16 color-dark h20 mb20"}>评分设置 </div>
<div className={"font-16 h20 mb20"}>最终成绩组成 <span className={"font-14 color-grey-c"}>取各教师最终评分的平均分</span></div> <div className={"font-16 h20 mb20"}>最终成绩组成 <span className={"font-14 color-grey-c"}>取各教师最终评分的平均分</span></div>
<Checkbox className="ml40 font-16" checked={crosscomment} onChange={this.funcrosscomment} <Checkbox className="ml40 font-16" checked={crosscomment} onChange={this.funcrosscomment}
disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true} >启用交叉评阅 <span className={"font-14 color-grey-c"}>给老师分配其他指导老师的学生作品</span> disabled={this.props.isAdmin()===true?flagPageEdit===true?commentstatustype===3?true:false:true:true} >启用交叉评阅 <span className={"font-14 color-grey-c"}>给老师分配其他指导老师的学生作品</span>
</Checkbox> </Checkbox>
{crosscomment===true?<div> {crosscomment===true?<div>
<div className={"h20 mb30 ml30 mt20 ml87"}> <div className={"h20 mb30 ml30 mt20 ml87"}>

@ -850,47 +850,47 @@ class GraduationTaskssettinglist extends Component{
</span> </span>
), ),
}, { }, {
title: '操作', title: '操作',
key: 'operation', key: 'operation',
width:'100px', width:'100px',
dataIndex: 'operation', dataIndex: 'operation',
className:'edu-txt-center', className:'edu-txt-center',
render: operation => ( render: operation => (
<div> <div>
{this.props.isAdmin()?operation.map((tag,key) => { {this.props.isAdmin()?operation.map((tag,key) => {
return( return(
<React.Fragment> <React.Fragment>
{ {
tag.name && tag.name &&
<Tooltip key={key} placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>其它历史评分将全部失效</pre>:""}> <Tooltip key={key} placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?<a style={{color:'#4CACFF',padding:"0px 5px"}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} > {tag.name==="评阅"?<a style={{color:'#4CACFF',padding:"0px 5px"}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
{tag.name} {tag.name}
</a> </a>
: :
<a style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}} <a style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}> onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}>
{tag.name} {tag.name}
</a> </a>
} }
</Tooltip> </Tooltip>
} }
</React.Fragment> </React.Fragment>
) )
}):""} }):""}
{ {
this.props.isStudent()? this.props.isStudent()?
operation.map((tag,key) => { operation.map((tag,key) => {
return( return(
<div key={key}> <div key={key}>
{tag.view_work===false?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a>} {tag.view_work===false?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a>}
</div> </div>
)} )}
):"" ):""
} }
</div> </div>
), ),
}]; }];
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
let position=this.props.match.params.position; let position=this.props.match.params.position;
@ -972,7 +972,7 @@ class GraduationTaskssettinglist extends Component{
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.ant-table-tbody>tr>td, .ant-table-thead>tr>th{ .ant-table-tbody>tr>td, .ant-table-thead>tr>th{
padding: 16px 10px padding: 16px 10px
} }

@ -88,7 +88,7 @@ class GraduationTasks extends Component{
savedelete=()=>{ savedelete=()=>{
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
}) })
let {checkAllValue,checkBoxValues,search,page,order} = this.state; let {checkAllValue,checkBoxValues,search,page,order} = this.state;
// let all_check; // let all_check;
@ -107,9 +107,10 @@ class GraduationTasks extends Component{
if (response.data.status == 0) { if (response.data.status == 0) {
// {"status":1,"message":"删除成功"} // {"status":1,"message":"删除成功"}
this.fetchAll(search,page,order) this.fetchAll(search,page,order)
this.props.showNotification(response.data.message);
this.setState({ this.setState({
Modalstype:true, // Modalstype:true,
Modalstopval:response.data.message, // Modalstopval:response.data.message,
ModalsBottomval:"", ModalsBottomval:"",
ModalSave:this.cancelmodel, ModalSave:this.cancelmodel,
Loadtype:true, Loadtype:true,

@ -382,7 +382,7 @@ class GraduateTopicPostWorksNew extends Component{
)} )}
</Form.Item> </Form.Item>
<span className="tag color-grey9 ">(项目管理员角色的成员都可以提交作品提交作品时需要关联同组成员组内成员作品共享)</span> <span className="tag color-grey9 ">(学生提交作品时需要关联同组成员组内成员作品共享)</span>
<Form.Item <Form.Item
label="" label=""
className=" " className=" "
@ -394,7 +394,7 @@ class GraduateTopicPostWorksNew extends Component{
<Checkbox >基于项目实施</Checkbox> <Checkbox >基于项目实施</Checkbox>
)} )}
</Form.Item> </Form.Item>
<span className="tag color-grey9 ">(勾选后各小组必须在educoder平台创建项目教师可随时观察平台对各小组最小进展的实时统计)</span> <span className="tag color-grey9 ">(选中则必须在本平台创建项目项目管理员可以提交作品不选中无需在平台创建项目任意小组成员均可以提交作品)</span>
</div> </div>
<div className="formBlock"> <div className="formBlock">

@ -80,7 +80,10 @@ class AddStudentModal extends Component{
} }
setVisible = (visible) => { setVisible = (visible) => {
if (visible) { if (visible) {
this.setState({school_name: this.props.user.user_school},()=>{ this.setState({
school_name: this.props.user.user_school,
name: undefined
},()=>{
this.fetchMemberList(); this.fetchMemberList();
}) })
this.fetchOptions() this.fetchOptions()
@ -88,7 +91,7 @@ class AddStudentModal extends Component{
this.refs.modalWrapper.setVisible(visible) this.refs.modalWrapper.setVisible(visible)
if (visible == false) { if (visible == false) {
this.setState({ this.setState({
checkBoxValues: [] checkBoxValues: [],
}) })
} }
} }

@ -2863,7 +2863,7 @@ class PollNew extends Component {
} }
</style> </style>
<Input placeholder="请输入问卷标题最大限制60个字符" maxLength="60" <Input placeholder="请输入问卷标题最大限制60个字符" maxLength="60"
style={{"margin-top": "15px", "text-align": "left"}} style={{"margin-top": "15px", textAlign: "left"}}
onInput={this.changeTopicName} onInput={this.changeTopicName}
readOnly={readOnlys} readOnly={readOnlys}
autoComplete="off" autoComplete="off"
@ -2887,7 +2887,7 @@ class PollNew extends Component {
<div style={{"color": "#212121", "font-size": "16px"}}>问卷须知</div> <div style={{"color": "#212121", "font-size": "16px"}}>问卷须知</div>
<TextArea placeholder="请输入本次问卷答题的相关说明最大限制100个字符" <TextArea placeholder="请输入本次问卷答题的相关说明最大限制100个字符"
style={{"height": "120px", "margin-top": "15px", "text-align": "left"}} style={{"height": "120px", "margin-top": "15px", textAlign: "left"}}
maxLength="100" maxLength="100"
readOnly={readOnlys} readOnly={readOnlys}
onInput={this.changeTopicNametwo} onInput={this.changeTopicNametwo}
@ -3012,8 +3012,8 @@ class PollNew extends Component {
{item.question.answers === undefined ? "" : item.question.answers.map((items, i) => { {item.question.answers === undefined ? "" : item.question.answers.map((items, i) => {
return ( return (
<div className="h20 pt20" style={{"clear": "both"}}> <div className="h20 pt20" style={{"clear": "both"}}>
<Radio value={i} className={"fl"} style={{"text-align": "left",marginTop:"3px"}}></Radio> <Radio value={i} className={"fl"} style={{textAlign: "left",marginTop:"3px"}}></Radio>
<span className={" flex1 "} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}} >{items.answer_text}</span> <span className={" flex1 "} style={{textAlign: "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}} >{items.answer_text}</span>
</div> </div>
) )
@ -3029,8 +3029,8 @@ class PollNew extends Component {
{item.question.answers === undefined ? "" : item.question.answers.map((items, i) => { {item.question.answers === undefined ? "" : item.question.answers.map((items, i) => {
return ( return (
<div className="mt10 pt20 " style={{"clear": "both"}}> <div className="mt10 pt20 " style={{"clear": "both"}}>
<Checkbox value={i} key={i} className={"fl"} style={{"text-align": "left"}}></Checkbox> <Checkbox value={i} key={i} className={"fl"} style={{textAlign: "left",marginRight:"8px"}}></Checkbox>
<span className={" flex1"} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1120px"}}>{items.answer_text}</span> <span className={" flex1"} style={{textAlign: "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}}>{items.answer_text}</span>
</div> </div>
) )
})} })}
@ -3086,7 +3086,7 @@ class PollNew extends Component {
<p className="df mb20"> <p className="df mb20">
<span <span
className="color-grey-6 mr3 w60 font-16 lineh-40" className="color-grey-6 mr3 w60 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span> style={{textAlign: "center"}}>其它</span>
<input <input
className="mr20 input-flex-40 TextAreainput" disabled className="mr20 input-flex-40 TextAreainput" disabled
@ -3100,7 +3100,7 @@ class PollNew extends Component {
: ""} : ""}
</p>) : (<p className="df mb20"> </p>) : (<p className="df mb20">
<span className="color-grey-6 mr10 w60 font-16 lineh-40" <span className="color-grey-6 mr10 w60 font-16 lineh-40"
style={{"text-align": "center"}}>选项</span> style={{textAlign: "center"}}>选项</span>
<TextArea <TextArea
autosize={{minRows: 1, maxRows: 5}} autosize={{minRows: 1, maxRows: 5}}
@ -3172,7 +3172,7 @@ class PollNew extends Component {
"height": "80%"; "height": "80%";
"margin-top": "5px"; "margin-top": "5px";
"margin-left": "5px"; "margin-left": "5px";
"text-align": "center"; textAlign: "center";
"display": "block"; "display": "block";
"opacity": "1"; "opacity": "1";
} }
@ -3328,7 +3328,7 @@ class PollNew extends Component {
<p className="df mb20"> <p className="df mb20">
<span <span
className="color-grey-6 mr3 w60 font-16 lineh-40" className="color-grey-6 mr3 w60 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span> style={{textAlign: "center"}}>其它</span>
<input <input
className="mr20 input-flex-40 TextAreainput" disabled className="mr20 input-flex-40 TextAreainput" disabled
@ -3342,7 +3342,7 @@ class PollNew extends Component {
: ""} : ""}
</p>) : (<p className="df mb20"> </p>) : (<p className="df mb20">
<span className="color-grey-6 mr10 w60 font-16 lineh-40" <span className="color-grey-6 mr10 w60 font-16 lineh-40"
style={{"text-align": "center"}}>选项</span> style={{textAlign: "center"}}>选项</span>
<TextArea <TextArea
autosize={{minRows: 1, maxRows: 5}} autosize={{minRows: 1, maxRows: 5}}
@ -3414,7 +3414,7 @@ class PollNew extends Component {
"height": "80%"; "height": "80%";
"margin-top": "5px"; "margin-top": "5px";
"margin-left": "5px"; "margin-left": "5px";
"text-align": "center"; textAlign: "center";
"display": "block"; "display": "block";
"opacity": "1"; "opacity": "1";
} }
@ -3579,7 +3579,7 @@ class PollNew extends Component {
<p className="df mb20"> <p className="df mb20">
<span <span
className="color-grey-6 mr3 w60 font-16 lineh-40" className="color-grey-6 mr3 w60 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span> style={{textAlign: "center"}}>其它</span>
<input <input
className="mr20 input-flex-40 TextAreainput" disabled className="mr20 input-flex-40 TextAreainput" disabled
@ -3593,7 +3593,7 @@ class PollNew extends Component {
: ""} : ""}
</p>) : (<p className="df mb20"> </p>) : (<p className="df mb20">
<span className="color-grey-6 mr10 w60 font-16 lineh-40" <span className="color-grey-6 mr10 w60 font-16 lineh-40"
style={{"text-align": "center"}}>选项</span> style={{textAlign: "center"}}>选项</span>
<TextArea <TextArea
autosize={{minRows: 1, maxRows: 5}} autosize={{minRows: 1, maxRows: 5}}
@ -3665,7 +3665,7 @@ class PollNew extends Component {
"height": "80%"; "height": "80%";
"margin-top": "5px"; "margin-top": "5px";
"margin-left": "5px"; "margin-left": "5px";
"text-align": "center"; textAlign: "center";
"display": "block"; "display": "block";
"opacity": "1"; "opacity": "1";
} }

@ -3059,20 +3059,20 @@ class Listofworksstudentone extends Component {
// console.log(this.props.isAdmin()); // console.log(this.props.isAdmin());
let course_is_end = this.props.current_user&&this.props.current_user.course_is_end; let course_is_end = this.props.current_user&&this.props.current_user.course_is_end;
try { // try {
if(this.props.isAdmin() === false){ // if(this.props.isAdmin() === false){
if(teacherdata&&teacherdata.student_works){ // if(teacherdata&&teacherdata.student_works){
if(teacherdata&&teacherdata.student_works.length>0){ // if(teacherdata&&teacherdata.student_works.length>0){
console.log("这是双层页面。。。。"); // console.log("这是双层页面。。。。");
//
} // }
} // }
//
} // }
}catch (e) { // }catch (e) {
console.log("Listofworksstudentone123"); // console.log("Listofworksstudentone123");
console.log(e); // console.log(e);
} // }
return ( return (
@ -3151,12 +3151,12 @@ class Listofworksstudentone extends Component {
typs={this.state.typs} typs={this.state.typs}
/> />
{ {
homework_status.length===0? homework_status&&homework_status.length===0?
<div className="edu-back-white"> <div className="edu-back-white">
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
: :
homework_status.length>0 && homework_status[0]==="未发布"? homework_status&&homework_status.length>0 && homework_status[0]==="未发布"?
<div className="edu-back-white"> <div className="edu-back-white">
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
@ -3231,7 +3231,7 @@ class Listofworksstudentone extends Component {
<div className="fr mr5 search-newysl" style={{marginBottom: '1px'}}> <div className="fr mr5 search-newysl" style={{marginBottom: '1px'}}>
{course_is_end===true?"":<span> {course_is_end===true?"":<span>
{teacherdata&&teacherdata.publish_immediately===false&&computeTimetype===true? {teacherdata&&teacherdata.update_score===true&&computeTimetype===true?
(this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTimet}> (this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTimet}>
查看最新成绩 查看最新成绩
</div>:""): </div>:""):
@ -3491,12 +3491,12 @@ class Listofworksstudentone extends Component {
} }
{ {
homework_status.length===0? homework_status&&homework_status.length&&homework_status.length===0?
<div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}> <div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
: :
homework_status.length>0 && homework_status[0]==="未发布"? homework_status&&homework_status.length>0 && homework_status&&homework_status[0]==="未发布"?
<div className=" clearfix edu-back-white " style={{margin: "auto" , minWidth:"1200px"}}> <div className=" clearfix edu-back-white " style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
@ -3555,9 +3555,13 @@ class Listofworksstudentone extends Component {
{ course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":<span> { course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true? {computeTimetype===true?
(this.props.isNotMember()===false? (this.props.isNotMember()===false?
<div className={"computeTime font-16"} onClick={this.setComputeTime}> (
查看最新成绩 teacherdata&&teacherdata.update_score===true?
</div> <div className={"computeTime font-16"} onClick={this.setComputeTime}>
查看最新成绩
</div>
:""
)
:"") :"")
: :
(teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "": (teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
@ -3651,12 +3655,12 @@ class Listofworksstudentone extends Component {
} }
{ {
homework_status.length===0? homework_status&&homework_status.length===0?
<div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}> <div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
: :
homework_status.length>0 && homework_status[0]==="未发布"? homework_status&&homework_status.length>0 && homework_status&&homework_status[0]==="未发布"?
<div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}> <div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
@ -3783,9 +3787,15 @@ class Listofworksstudentone extends Component {
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span> <span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
{ course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span> { course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true? {computeTimetype===true?
(this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTime}>
查看最新成绩 (this.props.isNotMember()===false?
</div>:""): (
teacherdata&&teacherdata.update_score===true?
<div className={"computeTime font-16"} onClick={this.setComputeTime}>
查看最新成绩
</div>:""
)
:""):
teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "": teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
(this.props.isNotMember()===false?<div className={"computeTimes font-16"}> (this.props.isNotMember()===false?<div className={"computeTimes font-16"}>
查看最新成绩 查看最新成绩

@ -349,7 +349,7 @@ class ShixunWorkReport extends Component {
<span className={"color-grey-9"}> {data&&data.course_name}</span> <span className={"color-grey-9"}> {data&&data.course_name}</span>
</a> </a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a className="btn colorgrey fl hovercolorblue " to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+category_id}> <a className="btn colorgrey fl hovercolorblue " href={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+category_id}>
<span className={"color-grey-9"}>{data===undefined?"":data.category===null?"":data.category.category_name}</span> <span className={"color-grey-9"}>{data===undefined?"":data.category===null?"":data.category.category_name}</span>
</a> </a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>

@ -329,7 +329,7 @@ class ShixunhomeWorkItem extends Component{
</h6> </h6>
<div className="cl"></div> <div className="cl"></div>
<p className="color-grey panel-lightgrey mt16 fl"> <p className="color-grey mt16 fl">
<span className="mr50 df"> <span className="mr50 df">
{/* <a href="/users/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> */} {/* <a href="/users/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> */}
{ discussMessage.author && <span className="mr15 color-grey-3">{discussMessage.author}</span> } { discussMessage.author && <span className="mr15 color-grey-3">{discussMessage.author}</span> }

@ -86,13 +86,13 @@ class Trainingjobsetting extends Component {
latepenaltytype: false, latepenaltytype: false,
unifiedsetting: true, unifiedsetting: true,
allowreplenishment: undefined, allowreplenishment: undefined,
completionefficiencyscore: true, completionefficiencyscore: false,
whethertopay: false, whethertopay: false,
proportion: undefined, proportion: undefined,
level: undefined, level: undefined,
ealuation: false, ealuation: false,
latededuction: undefined, latededuction: undefined,
latedeductiontwo: "20", latedeductiontwo: "0",
database: false, database: false,
datasheet: false, datasheet: false,
databasetwo: undefined, databasetwo: undefined,
@ -120,8 +120,10 @@ class Trainingjobsetting extends Component {
showmodel:false, showmodel:false,
code_review:false, code_review:false,
testscripttiptype:false, testscripttiptype:false,
end_timebool:false, end_timebool:false,
late_timesbool:false, late_timesbool:false,
work_efficiencys:false,
} }
// console.log("获取到的值") // console.log("获取到的值")
// console.log("Trainingjobsetting") // console.log("Trainingjobsetting")
@ -283,7 +285,7 @@ class Trainingjobsetting extends Component {
allowreplenishment: result.data.allow_late, allowreplenishment: result.data.allow_late,
latededuction: result.data.late_penalty, latededuction: result.data.late_penalty,
level: result.data.answer_open_evaluation === true ? "满分" : "扣分", level: result.data.answer_open_evaluation === true ? "满分" : "扣分",
completionefficiencyscore: result.data.work_efficiency, work_efficiencys: result.data.work_efficiency,
latedeductiontwo: result.data.eff_score, latedeductiontwo: result.data.eff_score,
proportion: result.data.shixun_evaluation === 0 ? "均分比例" : result.data.shixun_evaluation === 1 ? "经验值比例" : result.data.shixun_evaluation === 2 ? "自定义分值" : "", proportion: result.data.shixun_evaluation === 0 ? "均分比例" : result.data.shixun_evaluation === 1 ? "经验值比例" : result.data.shixun_evaluation === 2 ? "自定义分值" : "",
publicwork: result.data.work_public, publicwork: result.data.work_public,
@ -634,7 +636,7 @@ class Trainingjobsetting extends Component {
late_penalty: parseInt(this.state.latededuction), //迟交扣分 late_penalty: parseInt(this.state.latededuction), //迟交扣分
late_time: moment(this.state.late_time).format('YYYY-MM-DD HH:mm'), //结束时间 late_time: moment(this.state.late_time).format('YYYY-MM-DD HH:mm'), //结束时间
answer_open_evaluation: this.state.level === "满分" ? true : false, //扣分项 answer_open_evaluation: this.state.level === "满分" ? true : false, //扣分项
work_efficiency: this.state.completionefficiencyscore, //完成效率评分占比 work_efficiency: this.state.work_efficiencys, //完成效率评分占比
eff_score: this.state.completionefficiencyscore === true ? this.state.latedeductiontwo : undefined,//占比分 eff_score: this.state.completionefficiencyscore === true ? this.state.latedeductiontwo : undefined,//占比分
shixun_evaluation: this.state.proportion === "均分比例" ? 0 : this.state.proportion === "经验值比例" ? 1 : this.state.proportion === "自定义分值" ? 2 : 0, shixun_evaluation: this.state.proportion === "均分比例" ? 0 : this.state.proportion === "经验值比例" ? 1 : this.state.proportion === "自定义分值" ? 2 : 0,
challenge_settings: array, challenge_settings: array,
@ -659,6 +661,7 @@ class Trainingjobsetting extends Component {
flagPageEditsthrees:false, flagPageEditsthrees:false,
flagPageEditsfor:false, flagPageEditsfor:false,
whethertopay:false, whethertopay:false,
completionefficiencyscore:false,
}) })
this.refs.targetElementTrainingjobsetting.scrollIntoView() this.refs.targetElementTrainingjobsetting.scrollIntoView()
@ -1003,6 +1006,7 @@ class Trainingjobsetting extends Component {
this.state.latedeductiontwo=20; this.state.latedeductiontwo=20;
this.setState({ this.setState({
completionefficiencyscore: e.target.checked, completionefficiencyscore: e.target.checked,
work_efficiencys:e.target.checked,
latedeductiontwo: 20, latedeductiontwo: 20,
}) })
//均分比例 //均分比例
@ -1019,6 +1023,7 @@ class Trainingjobsetting extends Component {
this.state.latedeductiontwo=0; this.state.latedeductiontwo=0;
this.setState({ this.setState({
completionefficiencyscore: e.target.checked, completionefficiencyscore: e.target.checked,
work_efficiencys:e.target.checked,
latedeductiontwo: 0, latedeductiontwo: 0,
}) })
//均分比例 //均分比例
@ -1067,7 +1072,7 @@ class Trainingjobsetting extends Component {
// //占比分 // //占比分
changeTopicNametwo = (value) => { changeTopicNametwo = (value) => {
// console.log("2e.target.value", value) // console.log("TrainingjobsettingTrainingjobsetting", value)
if (value === "" || value === undefined) { if (value === "" || value === undefined) {
return return
} }
@ -1694,15 +1699,78 @@ class Trainingjobsetting extends Component {
if(this.state.allowreplenishment === false){ if(this.state.allowreplenishment === false){
whethertopays=false; whethertopays=false;
} }
this.setState({ if(this.state.jobsettingsdata!==undefined){
flagPageEditsbox:true,
flagPageEdit: true, }
whethertopay:whethertopays,
flagPageEditstwo:releasetime, try {
flagPageEditsthrees:deadline, if(this.state.jobsettingsdata&& this.state.jobsettingsdata.data.homework_status[0]==="未发布"){
flagPageEditsfor:endtime, this.setState({
unifiedsetting:this.state.unifiedsetting, flagPageEditsbox:true,
}) flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
completionefficiencyscore:true,
work_efficiencys:true,
unifiedsetting:this.state.unifiedsetting,
latedeductiontwo:20,
});
//均分比例
try {
if(this.state.proportion==="均分比例"){
this.Equalproportion(20);
}else if(this.state.proportion==="经验值比例"){
this.Empiricalvalueratio(20);
}
}catch (e) {
}
}else {
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:this.state.unifiedsetting,
});
if(this.state.work_efficiencys===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
}catch (e) {
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:this.state.unifiedsetting,
});
if(this.state.work_efficiencys===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
if(this.state.proportion === "自定义分值"){ if(this.state.proportion === "自定义分值"){
this.setState({ this.setState({
boolUnitetwoname:"自定义分值", boolUnitetwoname:"自定义分值",
@ -1715,7 +1783,121 @@ class Trainingjobsetting extends Component {
} catch (e) { } catch (e) {
} }
};
//一进来就是老师要用的编辑页面
editSettings=(datas)=>{
console.log("编辑页面");
console.log(datas);
try {
if (datas.data.is_end === true) {
this.setState({
modalsType: true,
modalsTopval: "课堂已结束不能再修改!",
loadtype: true,
modalSave: this.cancelBox
})
} else {
var releasetime =true;
var deadline = true;
var endtime =true;
var whethertopays =true;
//发布时间
if(moment(datas.data.publish_time,"YYYY-MM-DD HH:mm")<=moment()){
releasetime=false;
}
//截止时间
if(moment(datas.data.end_time,"YYYY-MM-DD HH:mm")<=moment()){
deadline=false;
}
//结束时间
if(moment(datas.data.late_time,"YYYY-MM-DD HH:mm")<=moment()){
endtime=false;
}
if(datas.data.allowreplenishment === false){
whethertopays=false;
}
try {
if(datas.data&& datas.data.homework_status[0]==="未发布"){
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
completionefficiencyscore:true,
work_efficiencys:true,
unifiedsetting:datas.data.unifiedsetting,
latedeductiontwo:20,
});
//均分比例
try {
if(datas.data.proportion==="均分比例"){
this.Equalproportion(20);
}else if(datas.data.proportion==="经验值比例"){
this.Empiricalvalueratio(20);
}
}catch (e) {
}
}else {
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:datas.data.unifiedsetting,
});
if(datas.data.work_efficiencys===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
}catch (e) {
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:datas.data.unifiedsetting,
});
if(datas.data.work_efficiencys===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
if(datas.data.proportion === "自定义分值"){
this.setState({
boolUnitetwoname:"自定义分值",
boolUnitetwo: false,
flagPageEdits:true,
})
}
}
} catch (e) {
}
} }
//取消编辑 //取消编辑
cancelEdit = () => { cancelEdit = () => {
@ -1733,6 +1915,8 @@ class Trainingjobsetting extends Component {
hand__e_tip: "", hand__e_tip: "",
hand_flags: false, hand_flags: false,
handclass: undefined, handclass: undefined,
completionefficiencyscore:false,
latedeductiontwo:0,
unit_e_tip: "", unit_e_tip: "",
}) })
this.refs.targetElementTrainingjobsetting.scrollIntoView(); this.refs.targetElementTrainingjobsetting.scrollIntoView();
@ -1847,9 +2031,9 @@ class Trainingjobsetting extends Component {
const dataformat = 'YYYY-MM-DD HH:mm'; const dataformat = 'YYYY-MM-DD HH:mm';
let {flagPageEdit,testscripttiptype,publish_timebool,end_timebool,late_timesbool,flagPageEdits,flagPageEditstwo,flagPageEditsbox,whethertopay,handclass,flagPageEditsthrees, flagPageEditsfor,rules,rulest,unifiedsetting,group_settings, course_group,unit_e_tip, borreds,borredss,unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles} = this.state; let {flagPageEdit,testscripttiptype,publish_timebool,end_timebool,late_timesbool,work_efficiencys,flagPageEdits,flagPageEditstwo,flagPageEditsbox,whethertopay,handclass,flagPageEditsthrees, flagPageEditsfor,rules,rulest,unifiedsetting,group_settings, course_group,unit_e_tip, borreds,borredss,unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles} = this.state;
console.log(publish_timebool); // console.log(publish_timebool);
console.log(!flagPageEditstwo); // console.log(!flagPageEditstwo);
const radioStyle = { const radioStyle = {
display: 'block', display: 'block',
height: '30px', height: '30px',
@ -1875,6 +2059,8 @@ class Trainingjobsetting extends Component {
// } // }
// console.log(this.props.isAdmin()) // console.log(this.props.isAdmin())
// console.log(this.state.code_review===false) // console.log(this.state.code_review===false)
// console.log("引入的分值");
// console.log(this.state.work_efficiencys);
return ( return (
<div className=" clearfix " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}> <div className=" clearfix " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
{this.state.showmodel===true?<ShixunWorkModal {this.state.showmodel===true?<ShixunWorkModal
@ -2129,7 +2315,7 @@ class Trainingjobsetting extends Component {
<div className=" clearfix edu-back-white poll_list mt10" style={{marginLeft:" 40px"}}> <div className=" clearfix edu-back-white poll_list mt10" style={{marginLeft:" 40px"}}>
<Checkbox disabled={!flagPageEdit} className=" font-13 mt10" <Checkbox disabled={!flagPageEdit} className=" font-13 mt10"
onChange={this.onChangeeffectiveness} onChange={this.onChangeeffectiveness}
checked={this.state.completionefficiencyscore} style={{"color":"#666666"}}>效率分<span checked={this.state.work_efficiencys} style={{"color":"#666666"}}>效率分<span
className={"font-14 color-grey-c font-14 ml15"} style={{"text-align":"left"}}>(选中则学生最终成绩包含效率分)</span> className={"font-14 color-grey-c font-14 ml15"} style={{"text-align":"left"}}>(选中则学生最终成绩包含效率分)</span>
</Checkbox> </Checkbox>
<div> <div>
@ -2139,7 +2325,7 @@ class Trainingjobsetting extends Component {
</div> </div>
<div className=" mt20" style={{marginLeft:"75px"}}> <div className=" mt20" style={{marginLeft:"75px"}}>
<span className="c_grey mr10" style={{"color":"#999999"}}>分值</span> <span className="c_grey mr10" style={{"color":"#999999"}}>分值</span>
<InputNumber min={0} disabled={!flagPageEdit} max={100} className="ml10 h40 mr10 color-grey-9" <InputNumber min={0} disabled={!this.state.completionefficiencyscore} max={100} className="ml10 h40 mr10 color-grey-9"
style={{width: "100px","color":"#999999"}} style={{width: "100px","color":"#999999"}}
onChange={this.changeTopicNametwo} onChange={this.changeTopicNametwo}
value={this.state.latedeductiontwo}/> value={this.state.latedeductiontwo}/>

@ -1064,8 +1064,7 @@ class ShixunHomework extends Component{
<div className="edu-back-white"> <div className="edu-back-white">
<p className="clearfix padding30 bor-bottom-greyE"> <p className="clearfix padding30 bor-bottom-greyE">
<p style={{height: '20px'}}> <p style={{height: '20px'}}>
{/*<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>*/} <span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>
<span className="font-18 fl color-dark-21">实训作业</span>
<li className="fr"> <li className="fr">
{datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isAdminOrCreator()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null? {datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isAdminOrCreator()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span> <span>

@ -355,4 +355,10 @@ input{
.editlybuttonbox{ .editlybuttonbox{
margin-bottom: 30px; margin-bottom: 30px;
margin-right: 3%; margin-right: 3%;
}
.Importclassroomdata{
top: 30px;
position: absolute;
right: 0px;
} }

@ -34,7 +34,13 @@ class CourseSupports extends Component {
Supportslist:'', Supportslist:'',
Supportssum:false, Supportssum:false,
Supportsclass:false, Supportsclass:false,
Supportsclasskey:undefined Supportsclasskey:undefined,
neweditcourse:[{"weights": 0,
"ec_course_name":'',
"top_relation": false,
"ec_course_id":''
}],
max_support_count:0
} }
} }
@ -58,15 +64,25 @@ class CourseSupports extends Component {
axios.get(url) axios.get(url)
.then((response) => { .then((response) => {
if(response.status===200){ if(response.status===200){
this.setState({
data:response.data
})
console.log(response.data.graduation_subitems.length)
if(response.data.graduation_subitems.length===0){ if(response.data.graduation_subitems.length===0){
this.setState({ this.setState({
Supportstype:true, Supportstype:true,
data:response.data,
Supportslist:'数据为空,请去毕业要求——>毕业要求指标点分解列表配置数据' Supportslist:'数据为空,请去毕业要求——>毕业要求指标点分解列表配置数据'
}) })
}else{
let datas=response.data.graduation_subitems;
let listlength=[]
datas.map((item,key)=>{
listlength.push(item.course_supports.length)
})
let max_support_count=Math.max(...listlength);
this.setState({
max_support_count:max_support_count,
data:response.data
})
} }
} }
@ -108,7 +124,7 @@ class CourseSupports extends Component {
id=parseInt(id); id=parseInt(id);
let subindex =e.target.getAttribute("subindex"); let subindex =e.target.getAttribute("subindex");
debugger
// const url = `/ec_course_supports/edit_require_vs_course?subitem_id=`+id // const url = `/ec_course_supports/edit_require_vs_course?subitem_id=`+id
// axios.get(url) // axios.get(url)
// .then((response) => { // .then((response) => {
@ -155,14 +171,18 @@ class CourseSupports extends Component {
if(item.course_supports.length>0){ if(item.course_supports.length>0){
this.setState({ this.setState({
editcourse:item.course_supports, editcourse:item.course_supports,
neweditcourse:item.course_supports,
Editkey:key, Editkey:key,
index:subindex, index:subindex,
ec_graduation_subitem_id:id,
}) })
}else if(item.course_supports.length===0){ }else if(item.course_supports.length===0){
this.setState({ this.setState({
editcourse:[{weights: 0,top_relation: false,ec_course_name:'',ec_course_id:''}], editcourse:[{weights: 0,top_relation: false,ec_course_name:'',ec_course_id:''}],
neweditcourse:[{weights: 0,top_relation: false,ec_course_name:'',ec_course_id:''}],
Editkey:key, Editkey:key,
index:subindex, index:subindex,
ec_graduation_subitem_id:id,
}) })
} }
@ -197,7 +217,12 @@ class CourseSupports extends Component {
Addcourse=(e)=>{ Addcourse=(e)=>{
let {editcourse} =this.state; let {editcourse} =this.state;
let neweditcourse=editcourse; let arr=new Array();
editcourse.map((item,key)=>{
arr.push(item)
})
let neweditcourse=arr;
let newadd = {weights: 0,top_relation: false,ec_course_name:'',ec_course_id:''}; let newadd = {weights: 0,top_relation: false,ec_course_name:'',ec_course_id:''};
neweditcourse.push(newadd); neweditcourse.push(newadd);
this.setState({ this.setState({
@ -215,29 +240,49 @@ class CourseSupports extends Component {
// 删除 // 删除
// let id =e.target.getAttribute("index"); // let id =e.target.getAttribute("index");
let {editcourse} = this.state; let {editcourse} = this.state;
let neweditcourse=editcourse; let arr=new Array();
neweditcourse.splice(e,1); editcourse.map((item,key)=>{
let newnum=0; arr.push(item)
for(var j=0;j<neweditcourse.length;j++){ })
if(neweditcourse[j].weights===undefined){
newnum=0 let neweditcourse=arr;
}else{ if(neweditcourse.length>1){
newnum=newnum+neweditcourse[j].weights; neweditcourse.splice(e,1);
} let newnum=0;
} for(var j=0;j<neweditcourse.length;j++){
newnum= Math.round(newnum*100)/100; if(neweditcourse[j].weights===undefined){
this.setState({ newnum=0
Supportstype:false, }else{
supportid:null, newnum=newnum+neweditcourse[j].weights;
Supportslist:"", }
editcourse:neweditcourse, }
editnum:newnum newnum= Math.round(newnum*100)/100;
})
this.setState({
Supportstype:false,
supportid:null,
Supportslist:"",
editcourse:neweditcourse,
editnum:newnum
})
}else{
this.setState({
// Supportstype:true,
Supportslist:'删除失败,至少保留一个课程',
})
}
} }
enterweight=(e)=>{ enterweight=(e)=>{
let {editcourse} = this.state; let {editcourse} = this.state;
let neweditcourse=editcourse; let arr=new Array();
editcourse.map((item,key)=>{
arr.push(item)
})
let neweditcourse=arr;
var id=e.target.id; var id=e.target.id;
var value=parseFloat(e.target.value); var value=parseFloat(e.target.value);
if(isNaN(value)){ if(isNaN(value)){
@ -301,9 +346,15 @@ class CourseSupports extends Component {
handleChange=(e)=> { handleChange=(e)=> {
let {editcourse} = this.state; let {editcourse} = this.state;
let value=`${e[0]}`;
value=parseInt(value) let arr=new Array();
let neweditcourse=editcourse; editcourse.map((item,key)=>{
arr.push(item)
})
let neweditcourse=arr;
let value=`${e[0]}`;
value=parseInt(value)
let num=`${e[1]}`; let num=`${e[1]}`;
num=parseInt(num) num=parseInt(num)
@ -327,7 +378,13 @@ class CourseSupports extends Component {
relevancetop=(e)=>{ relevancetop=(e)=>{
let {editcourse} = this.state; let {editcourse} = this.state;
let neweditcourse=editcourse;
let arr=new Array();
editcourse.map((item,key)=>{
arr.push(item)
})
let neweditcourse=arr;
let id =e.target.getAttribute("itindex"); let id =e.target.getAttribute("itindex");
for(var i=0;i<1;i++){ for(var i=0;i<1;i++){
neweditcourse[id].top_relation=false; neweditcourse[id].top_relation=false;
@ -339,7 +396,11 @@ class CourseSupports extends Component {
relevancebottom=(e)=>{ relevancebottom=(e)=>{
let {editcourse} = this.state; let {editcourse} = this.state;
let neweditcourse=editcourse; let arr=new Array();
editcourse.map((item,key)=>{
arr.push(item)
})
let neweditcourse=arr;
let id =e.target.getAttribute("itindex"); let id =e.target.getAttribute("itindex");
for(var i=0;i<1;i++){ for(var i=0;i<1;i++){
neweditcourse[id].top_relation=true; neweditcourse[id].top_relation=true;
@ -355,14 +416,20 @@ class CourseSupports extends Component {
this.inputNumberRef.blur(); this.inputNumberRef.blur();
} }
CancelSupports=()=>{ CancelSupports=()=>{
let{editcourse,neweditcourse}=this.state;
//
// console.log(editcourse)
// console.log(neweditcourse)
this.setState({ this.setState({
Editkey:null, Editkey:null,
Supportssum:false, Supportssum:false,
Supportsclass:false, Supportsclass:false,
editcourse:neweditcourse
}) })
} }
SubmitClassData=()=>{ SubmitClassData=()=>{
let {editcourse,editnum,ec_graduation_subitem_id,ec_year_id} = this.state; let {editcourse,editnum,ec_graduation_subitem_id} = this.state;
if(editcourse.length===0){ if(editcourse.length===0){
this.setState({ this.setState({
// Supportstype:true, // Supportstype:true,
@ -409,35 +476,39 @@ class CourseSupports extends Component {
} }
}) })
var Url = '/ec_course_supports';
var Url = `/ec_years/${this.props.match.params.ec_year_id}/graduation_course_supports.json`;
axios.post(Url, { axios.post(Url, {
ec_year_id: ec_year_id, graduation_subitem_id :ec_graduation_subitem_id,
ec_graduation_subitem_id:ec_graduation_subitem_id, course_supports: editcourse
course: editcourse
},
{
withCredentials: true
} }
).then((response) => { ).then((response) => {
if(response.data.id===ec_graduation_subitem_id){
if(response.data.status===0){
this.setState({ // this.setState({
Editkey:null, // Editkey:null,
Supportslist:response.data.messsage, // Supportslist:"保存成功",
Supportstype:true, // Supportstype:true,
Supportssum:false, // Supportssum:false,
Supportsclass:false, // Supportsclass:false,
Supportsclasskey:undefined, // Supportsclasskey:undefined,
}) // })
this.UpdateClassData(); this.UpdateClassData();
this.setState({
Editkey:null,
Supportssum:false,
Supportsclass:false,
})
}else if(response.data.status===-1){ }else if(response.data.status===-1){
this.setState({ // this.setState({
Supportslist:"参数错误", // Supportslist:"参数错误",
Supportstype:true, // Supportstype:true,
Supportssum:false, // Supportssum:false,
Supportsclass:false, // Supportsclass:false,
Supportsclasskey:undefined, // Supportsclasskey:undefined,
}) // })
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -457,9 +528,41 @@ class CourseSupports extends Component {
Supportslist:"", Supportslist:"",
}) })
} }
confirmysl(url){
axios.get(url + '?export=true').then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.message === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
}
toforums=(url)=>{
window.open( url, '_blank');
}
render() { render() {
const Option = Select.Option; const Option = Select.Option;
let {data,ec_courses_list,editcourse,editnum,index,ec_year_id,Supportsclasskey,ecComponentState,hidesupport,supportid,Editkey,titlemessage,Supportstype,Supportslist,Supportssum,Supportsclass,major_school_id} = this.state; let {max_support_count,data,ec_courses_list,editcourse,editnum,index,ec_year_id,Supportsclasskey,ecComponentState,hidesupport,supportid,Editkey,titlemessage,Supportstype,Supportslist,Supportssum,Supportsclass,major_school_id} = this.state;
var list = (length) => { var list = (length) => {
var res = []; var res = [];
for(var i = 0; i < length; i++) { for(var i = 0; i < length; i++) {
@ -472,6 +575,11 @@ class CourseSupports extends Component {
return res return res
} }
let toptiebox={width: 126.6*max_support_count+"px"};
let ismidbox={width:123.82*max_support_count+"px",margin:'0px 0px'};
// console.log(this.props.year&&this.props.year.can_manager)
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
<Modal <Modal
@ -497,7 +605,7 @@ class CourseSupports extends Component {
</Modal> </Modal>
<div className="educontent mb290"> <div className="educontent mb20">
@ -506,24 +614,26 @@ class CourseSupports extends Component {
<div className="clearfix padding20-30 bor-bottom-greyE" style={{position:'relative'}}> <div className="clearfix padding20-30 bor-bottom-greyE" style={{position:'relative'}}>
<span className="font-18 courseSystem">课程体系对毕业要求的支撑</span> <span className="font-18 courseSystem">课程体系对毕业要求的支撑</span>
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */} {/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<span className={data.is_manager===false?"none":"Importclassroomdata"} style={{top: '29px'}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={'/ec_major_schools/'+major_school_id+'/academic_years/'+ec_year_id+'/export_course_requirements?format=xls'}>导出课程体系支撑矩阵</a>
<span className={this.props.year&&this.props.year.can_manager===false?"none":"Importclassroomdata"} style={{top: '29px'}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10" onClick={()=>this.confirmysl(`/ec_years/${this.props.match.params.ec_year_id}/graduation_course_supports.xlsx`)}>导出课程体系支撑矩阵</a>
</span> </span>
<div className="color-grey-9 mr10">用矩阵图的形式说明本专业课程体系对毕业要求的支撑关系 <a className={"color-blue"} onClick={() => window.elasticLayer(3534)} >查看详情</a></div> <div className="color-grey-9 mr10">用矩阵图的形式说明本专业课程体系对毕业要求的支撑关系 <a className={"color-blue"} onClick={() => this.toforums(`/forums/${3534}`)} >查看详情</a></div>
</div> </div>
<div className="padding20-30" id="training_objective_contents"> <div className="padding20-30" id="training_objective_contents">
<span className="fl SystemParameters" >毕业要求指标点<a href={data.subitems_url}><span className="Systemnum">{data.count}</span></a></span> <span className="fl SystemParameters" >毕业要求指标点<Link to={`/ecs/major_schools/${this.props.match.params.major_school_id}/years/${this.props.match.params.ec_year_id}/graduation_requirement`}><span className="Systemnum">{data.count}</span></Link></span>
<span className="fl ml20 SystemParameters">课程体系<a href={data.course_url}><span className="Systemnum">{data.course_count}</span></a></span> <span className="fl ml20 SystemParameters">课程体系<Link to={`/ecs/major_schools/${this.props.match.params.major_school_id}/years/${this.props.match.params.ec_year_id}/courses/ec_course_support_setting/1`}><span className="Systemnum">{data.course_count}</span></Link></span>
</div> </div>
</div> </div>
<div className="ListTableLine" id="school_major_list" style={{overflow:'auto'}}> <div className="ListTableLine" id="school_major_list" style={{overflow:'auto'}}>
<p className="clearfix" style={{width: 120*data.max_support_count>1200? 140*data.max_support_count : 1200+"px"}}> <p className="clearfix" style={toptiebox}>
<span className="color-666 finishtarget">毕业要求指标点</span> <span className="color-666 finishtarget">毕业要求指标点</span>
{list(data.max_support_count<5||data.max_support_count===undefined?5:data.max_support_count)} {data.graduation_subitems===undefined?"":list(max_support_count<5||max_support_count===undefined?5:max_support_count)}
<span className="column-1 operationright color-666" <span className="column-1 operationright color-666"
style={{ style={{
paddingLeft: '28px' paddingLeft: '28px'
@ -535,7 +645,7 @@ class CourseSupports extends Component {
data.graduation_subitems===undefined? <Spin delay={500} className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:data.graduation_subitems.map((item,key)=>{ data.graduation_subitems===undefined? <Spin delay={500} className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:data.graduation_subitems.map((item,key)=>{
return ( return (
<li className={data.graduation_subitems.length===key+1?"clearfix mb10":"clearfix"} key={key} style={{width: 120*data.max_support_count > 1134 ? 136*data.max_support_count : 1134+"px",margin: '0px 0px'}}> <li className={data.graduation_subitems.length===key+1?"clearfix mb10":"clearfix"} key={key} style={ismidbox}>
<Tooltip placement="bottom" title={item.sequence_title}> <Tooltip placement="bottom" title={item.sequence_title}>
<span className="column-1 columnlocation" style={{display:Editkey!=key?"block":'none',width: '95px', paddingLeft: '23px'}}>{item.graduation_requirement_position+"-"+item.position}</span> <span className="column-1 columnlocation" style={{display:Editkey!=key?"block":'none',width: '95px', paddingLeft: '23px'}}>{item.graduation_requirement_position+"-"+item.position}</span>
</Tooltip> </Tooltip>
@ -550,7 +660,7 @@ class CourseSupports extends Component {
display:Editkey!=key?"block":'none', display:Editkey!=key?"block":'none',
marginRight: '-1px' marginRight: '-1px'
}}> }}>
<div data-tip-down={t.ec_course_name} className={t.top_relation===true?"DDred columnbox":"columnbox"} <div title={t.ec_course_name} className={t.top_relation===true?"DDred columnbox":"columnbox"}
style={{textAlign: 'center'}} style={{textAlign: 'center'}}
>{t.ec_course_name.length>12?t.ec_course_name.substring(0, 10)+"...":t.ec_course_name}</div> >{t.ec_course_name.length>12?t.ec_course_name.substring(0, 10)+"...":t.ec_course_name}</div>
<div className={t.top_relation===true?"DDred":""} <div className={t.top_relation===true?"DDred":""}
@ -569,27 +679,34 @@ class CourseSupports extends Component {
<div className="width20">{Math.round(item.weights_total*100)/100===0?0:(Math.round(item.weights_total*100)/100)}</div> <div className="width20">{Math.round(item.weights_total*100)/100===0?0:(Math.round(item.weights_total*100)/100)}</div>
</div> </div>
<div className="left operationalter"> <div className="left operationalter">
{data.is_manager===false?"":<a className="editSubentry" data-tip-down="编辑"> {this.props.year&&this.props.year.can_manager===false?"":<a className="editSubentry" title="编辑">
<i className="iconfont icon-bianjidaibeijing color-green" id={item.ec_graduation_subitem_id} subindex={item.graduation_requirement_position+"-"+item.position} onClick={this.EditSupportCourse.bind(this,key)}></i> <i className="iconfont icon-bianjidaibeijing color-green" id={item.id} subindex={item.graduation_requirement_position+"-"+item.position} onClick={this.EditSupportCourse.bind(this,key)}></i>
</a>} </a>}
</div> </div>
</div> </div>
</span> </span>
<style>
<p className="ListTableLine" id="school_ListTableLine" style={{width: '1134px',display:Editkey===key?"block":'none'}} > {
`
<p className="clearfix SystemModifythelist"> .ListTableLine li{ background: rgb(255, 255, 255);}
<span className="ml6" style={{width:'77px'}}>指标点 {index}</span> `
<span className="column-4">支撑课程</span> }
<span className="column-2 ml93"> </style>
{Editkey===key?
<p className="ListTableLine" id="school_ListTableLine" style={ismidbox} >
<div style={{width: '1134px'}}>
<p className="clearfix SystemModifythelist">
<span className="ml6" style={{width:'77px'}}>指标点 {index}</span>
<span className="column-4">支撑课程</span>
<span className="column-2 ml93">
<span> 权重(=1)</span> <span> 权重(=1)</span>
<span className="Systempoint">精确到两位小数</span> <span className="Systempoint">精确到两位小数</span>
</span> </span>
<span className="column-1 ml50">关联度最高</span> <span className="column-1 ml50">关联度最高</span>
</p> </p>
<div className="clearfix editorModify"> <div className="clearfix editorModify">
{Supportsclass===true?<style> {Supportsclass===true?<style>
{ {
` `
@ -599,77 +716,75 @@ class CourseSupports extends Component {
` `
} }
</style>:""} </style>:""}
{ {
editcourse.map((it,key)=>{ editcourse.map((it,key)=>{
return( return(
<div className="mb15" key={key}> <div className="mb15" key={key}>
<Select className={Supportsclasskey===key?"showredfont heightimportant":"heightimportant"} showSearch value={it.ec_course_name} onChange={this.handleChange}> <Select className={Supportsclasskey===key?"showredfont heightimportant":"heightimportant"} showSearch value={it.ec_course_name} onChange={this.handleChange}>
{ {
ec_courses_list.map((qva,qk)=>{ ec_courses_list.map((qva,qk)=>{
return( return(
<Option value={[qva.id,key,qva.name]} key={[qva.id,key,qva.name]}>{qva.name}</Option> <Option value={[qva.id,key,qva.name]} key={[qva.id,key,qva.name]}>{qva.name}</Option>
) )
}) })
} }
</Select> </Select>
<Input <Input
type="number" type="number"
size="large" size="large"
className={Supportssum===true?"inputWeight bor-red":"inputWeight"} className={Supportssum===true?"inputWeight bor-red":"inputWeight"}
id={key} id={key}
value={it.weights} value={it.weights}
onInput={this.enterweight.bind(this)} onInput={this.enterweight.bind(this)}
/> />
<div className="SetTheAssociated"> <div className="SetTheAssociated">
<div className="SetTheAssociatedchild"> <div className="SetTheAssociatedchild">
<i className="iconfont icon-gouxuan gouxuanbule" style={{display:it.top_relation===false?'none':'block'}} itindex={key} onClick={this.relevancetop.bind(this)}></i> <i className="iconfont icon-gouxuan gouxuanbule" style={{display:it.top_relation===false?'none':'block'}} itindex={key} onClick={this.relevancetop.bind(this)}></i>
<i className="iconfont icon-gouxuan gouxuanwhite" style={{display:it.top_relation===false?'block':'none'}} itindex={key} onClick={this.relevancebottom.bind(this)}></i> <i className="iconfont icon-gouxuan gouxuanwhite" style={{display:it.top_relation===false?'block':'none'}} itindex={key} onClick={this.relevancebottom.bind(this)}></i>
</div> </div>
<div className="left operatebutton"> <div className="left operatebutton">
<a className="mr15 delSubentry" data-tip-down="删除"> {editcourse.length===1?"":<a className="mr15 delSubentry" title="删除">
<i className="iconfont icon-shanchu color-grey-c font-15" onClick={()=>this.Deletcourses(key)}></i> <i className="iconfont icon-shanchu color-grey-c font-15" onClick={()=>this.Deletcourses(key)}></i>
</a> </a>}
<a className="newAddSubentry" data-tip-down="添加" <a className="newAddSubentry" title="添加"
style={{display:key===editcourse.length-1?"inline-block":'none'}} style={{display:key===editcourse.length-1?"inline-block":'none'}}
><i className="iconfont icon-tianjiafangda color-green" onClick={this.Addcourse}></i></a> ><i className="iconfont icon-tianjiafangda color-green" onClick={this.Addcourse}></i></a>
</div> </div>
</div> </div>
</div> </div>
) )
}) })
} }
</div> </div>
<span className="c_red none ml35 color-red" id="error_tip" style={{display:Supportssum===true||Supportsclass===true?'inline':'none'}}>{Supportslist}</span> <span className="c_red none ml35 color-red" id="error_tip" style={{display:Supportssum===true||Supportsclass===true?'inline':'none'}}>{Supportslist}</span>
<div className="clearfix editorModify"> <div className="clearfix editorModify">
<span className="column-1" <span className="column-1"
style={{ style={{
width: '580px', width: '580px',
paddingLeft: '37px', paddingLeft: '37px',
display: 'inline-block' display: 'inline-block'
}} }}
>合计: <span>{editcourse.length}</span></span> >合计: <span>{editcourse.length}</span></span>
<span className="ml30">合计: <span>{editnum}</span></span> <span className="ml30">合计: <span>{editnum}</span></span>
</div> </div>
<div className="right editlybuttonbox"> <div className="right editlybuttonbox">
<div className="defalutSubmitbtn fr" onClick={this.SubmitClassData}>保存</div> <div className="defalutSubmitbtn fr" onClick={this.SubmitClassData}>保存</div>
<div className="defalutCancelbtn fr mr20" onClick={this.CancelSupports}>取消</div> <div className="defalutCancelbtn fr mr20" onClick={this.CancelSupports}>取消</div>
</div> </div>
</div>
</p> </p>:""}
</li> </li>
) )
}) })

@ -130,7 +130,7 @@ class MemoDetailMDEditor extends Component {
} }
} }
render() { render() {
const { match, history, memo, placeholder, className } = this.props const { match, history, memo, placeholder, className, imageExpand } = this.props
const { isInited, errorMsg } = this.state const { isInited, errorMsg } = this.state
if (!memo) { if (!memo) {
return <div></div> return <div></div>
@ -185,7 +185,8 @@ class MemoDetailMDEditor extends Component {
` `
} */} } */}
</style> </style>
<div nhname={`new_message_${memo.id}`} className={`commentInput commentInputs ${className}`} <div nhname={`new_message_${memo.id}`}
className={`commentInput commentInputs ${className} ${imageExpand && 'editormd-image-click-expand' }`}
style={{ padding: '30px',boxSizing:"border-box", display: isInited ? '' : 'none', paddingBottom: '40px' }} > style={{ padding: '30px',boxSizing:"border-box", display: isInited ? '' : 'none', paddingBottom: '40px' }} >
<div id="memo_comment_editorMd" className="editorMD" style={{ marginBottom: '0px' <div id="memo_comment_editorMd" className="editorMD" style={{ marginBottom: '0px'
, border: errorMsg ? '1px solid red' : '1px solid #ddd'}}> , border: errorMsg ? '1px solid red' : '1px solid #ddd'}}>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save