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

# Conflicts:
#	public/react/src/AppConfig.js
dev_cs
杨树明 6 years ago
commit 4b760f5512

@ -23,7 +23,7 @@ module GitHelper
Rails.logger.info "encoding: #{cd['encoding']} confidence: #{cd['confidence']}"
# 字符编码问题GB18030编码识别率不行
decode_content =
if cd["encoding"] == 'GB18030' && cd['confidence'] == 1.0
if cd["encoding"] == 'GB18030' && cd['confidence'] > 0.8
content.encode('UTF-8', 'GBK', {:invalid => :replace, :undef => :replace, :replace => ' '})
else
content.force_encoding('UTF-8')

@ -494,20 +494,88 @@ class ExerciseQuestionsController < ApplicationController
def adjust_score
ActiveRecord::Base.transaction do
begin
ex_all_scores = @exercise.exercise_questions.pluck(:question_score).sum
ex_obj_score = @exercise_current_user.objective_score #全部客观题得分
ex_subj_score = @exercise_current_user.subjective_score < 0.0 ? 0.0 : @exercise_current_user.subjective_score #全部主观题得分
ex_answers = @exercise_question.exercise_answers.search_answer_users("user_id",@user_id) #当前用户答案的得分
if @exercise_question.question_type == Exercise::COMPLETION #当为填空题,更新问题的总分,
ex_answer_old = ex_answers.score_reviewed.pluck(:score).sum #每一关的得分总和
each_right_score = (@c_score / ex_answers.count.to_f) #调分后,平均每关的分数
new_obj_score = ex_obj_score - ex_answer_old + @c_score
if @exercise_question.question_type == Exercise::MULTIPLE
if ex_answers.present? #学生有回答时 取学生的答题得分否则0分
answer_choice_array = []
ex_answers.each do |a|
if a.try(:exercise_choice).try(:choice_position).present?
answer_choice_array.push(a&.exercise_choice&.choice_position) #学生答案的位置
end
end
user_answer_content = answer_choice_array.reject(&:blank?).sort
standard_answer = @exercise_question.exercise_standard_answers.pluck(:exercise_choice_id).sort
if standard_answer.size == 1 # 老数据需要判断学生答题是否正确, 正确取原题得分否则是0分
standard_answer = standard_answer.first.to_s.split("").map(&:to_i).sort
if user_answer_content == standard_answer
ex_answer_old = @exercise_question.question_score
else
ex_answer_old = 0
end
else # 新多选题只需取第一条答题记录的得分
ex_answer_old = ex_answers.first.score > 0 ? ex_answers.first.score : 0
end
ex_answers.update_all(:score => @c_score) #所有的正确选项需重新更新
else
answer_option = {
:user_id => @user_id,
:exercise_question_id => @exercise_question.id,
:score => @c_score,
:answer_text => ""
}
ExerciseAnswer.create(answer_option)
ex_answer_old = 0
end
if ex_obj_score <= 0.0
new_obj_score = @c_score
else
new_obj_score = ex_obj_score - ex_answer_old + @c_score
end
total_scores = new_obj_score + ex_subj_score
if total_scores < 0.0
total_scores = 0.0
elsif total_scores > ex_all_scores
total_scores = ex_all_scores
end
ex_scores = {
:objective_score => new_obj_score,
:score => total_scores
}
@exercise_current_user.update_attributes(ex_scores)
elsif @exercise_question.question_type == Exercise::COMPLETION #当为填空题,更新问题的总分,
if ex_answers.exists?
ex_answer_old = ex_answers.score_reviewed.pluck(:score).sum #每一关的得分总和
each_right_score = (@c_score / ex_answers.count.to_f) #调分后,平均每关的分数
new_obj_score = ex_obj_score - ex_answer_old + @c_score
ex_answers.update_all(:score => each_right_score) #所有的正确选项需重新更新
else #如果学生未答,则创建新的答题记录
answer_option = {
:user_id => @user_id,
:exercise_question_id => @exercise_question.id,
:score => @c_score,
:answer_text => ""
}
ExerciseAnswer.create(answer_option)
new_obj_score = ex_obj_score + @c_score
end
total_scores = new_obj_score + ex_subj_score
if total_scores < 0.0
total_scores = 0.0
elsif total_scores > ex_all_scores
total_scores = ex_all_scores
end
ex_scores = {
:objective_score => new_obj_score,
:score => total_scores
}
@exercise_current_user.update_attributes(ex_scores)
ex_answers.update_all(:score => each_right_score) #所有的正确选项需重新更新
elsif @exercise_question.question_type == Exercise::SUBJECTIVE #当为主观题时
if ex_answers.exists?
ex_answers_old_score = ex_answers.first.score > 0.0 ? ex_answers.first.score : 0.0 #原分数小于0取0
@ -524,6 +592,11 @@ class ExerciseQuestionsController < ApplicationController
new_sub_score = ex_subj_score + @c_score
end
total_scores = ex_obj_score + new_sub_score
if total_scores < 0.0
total_scores = 0.0
elsif total_scores > ex_all_scores
total_scores = ex_all_scores
end
ex_scores = {
:subjective_score => new_sub_score,
:score => total_scores
@ -549,6 +622,11 @@ class ExerciseQuestionsController < ApplicationController
new_obj_score = @c_score
end
total_scores = new_obj_score + ex_subj_score
if total_scores < 0.0
total_scores = 0.0
elsif total_scores > ex_all_scores
total_scores = ex_all_scores
end
ex_scores = {
:objective_score => new_obj_score,
:score => total_scores
@ -556,30 +634,33 @@ class ExerciseQuestionsController < ApplicationController
@exercise_current_user.update_attributes(ex_scores)
end
comments = params[:comment]
question_comment = @exercise_question.exercise_answer_comments.first
question_comment = @exercise_question.exercise_answer_comments&.first
if question_comment.present?
comment_option = {
:comment => comments.present? ? comments : question_comment.comment,
:comment => comments,
:score => @c_score,
:exercise_answer_id => ex_answers.present? ? ex_answers.first.id : nil
:exercise_answer_id => ex_answers.present? ? ex_answers.first.id : nil,
:user_id => current_user.id
}
question_comment.update_attributes(comment_option)
@exercise_comments = question_comment
else
ex_answer_comment_id = @exercise_question.exercise_answers.find_by(user_id: @user_id).try(:id)
comment_option = {
:user_id => current_user.id,
:comment => comments,
:score => @c_score,
:exercise_question_id => @exercise_question.id,
:exercise_shixun_answer_id => @shixun_a_id.present? ? @shixun_a_id : nil,
:exercise_answer_id => ex_answers.present? ? ex_answers.first.id : nil
:exercise_answer_id => ex_answer_comment_id
}
@exercise_comments = ExerciseAnswerComment.new(comment_option)
@exercise_comments.save
end
rescue Exception => e
uid_logger_error(e.message)
tip_exception("没有权限")
tip_exception(e.message)
raise ActiveRecord::Rollback
end
end
@ -703,8 +784,8 @@ class ExerciseQuestionsController < ApplicationController
normal_status(-1,"用户不存在!")
elsif @c_score.blank?
normal_status(-1,"分数不能为空!")
elsif @exercise_question.question_type <= Exercise::JUDGMENT
normal_status(-1,"题/判断题不能调分!")
elsif @exercise_question.question_type == Exercise::SINGLE || @exercise_question.question_type == Exercise::JUDGMENT
normal_status(-1,"选题/判断题不能调分!")
elsif params[:comment].present? && params[:comment].length > 100
normal_status(-1,"评语不能超过100个字符!")
else

@ -324,7 +324,7 @@ class GraduationTasksController < ApplicationController
tip_exception("缺少截止时间参数") if params[:end_time].blank?
tip_exception("截止时间必须晚于当前时间") if params[:end_time] <= strf_time(Time.now)
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > @course.end_date.end_of_day
@course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
# ActiveRecord::Base.transaction do
begin
@ -401,7 +401,7 @@ class GraduationTasksController < ApplicationController
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S")
tip_exception("截止时间不能早于发布时间") if params[:publish_time] > params[:end_time]
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > @course.end_date.end_of_day
@course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
@task.publish_time = params[:publish_time]
@task.end_time = params[:end_time]
@ -414,7 +414,7 @@ class GraduationTasksController < ApplicationController
tip_exception("截止时间不能为空") if params[:end_time].blank?
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S")
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > @course.end_date.end_of_day
@course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
@task.end_time = params[:end_time]
end
@ -426,7 +426,7 @@ class GraduationTasksController < ApplicationController
tip_exception("补交结束时间不能为空") if params[:late_time].blank?
tip_exception("补交结束时间不能早于截止时间") if params[:late_time] <= @task.end_time
tip_exception("补交结束时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:late_time] > @course.end_date.end_of_day
@course.end_date.present? && params[:late_time] > strf_time(@course.end_date.end_of_day)
tip_exception("迟交扣分应为正整数") if params[:late_penalty] && params[:late_penalty].to_i < 0
@task.allow_late = true

@ -271,7 +271,11 @@ class MyshixunsController < ApplicationController
unless @hide_code || @myshixun.shixun&.vnc_evaluate
# 远程版本库文件内容
last_content = GitService.file_content(repo_path: @repo_path, path: path)["content"]
content = params[:content]
content = if @myshixun.mirror_name.select {|a| a.include?("MachineLearning") || a.include?("Python")}.present? && params[:content].present?
params[:content].gsub(/\t/, ' ').gsub(/ /, ' ') # 这个不是空格在windows机器上带来的问题
else
params[:content]
end
Rails.logger.info("###11222333####{content}")
Rails.logger.info("###222333####{last_content}")

@ -264,8 +264,9 @@ class QuestionBanksController < ApplicationController
# new_exercise.create_exercise_list
# exercise.update_column(:quotes, exercise.quotes+1)
# end
new_exercise if new_exercise.save!
new_exercise.save!
exercise.update_column(:quotes, exercise.quotes+1)
new_exercise
end
end
@ -292,8 +293,9 @@ class QuestionBanksController < ApplicationController
# new_poll.create_polls_list
# poll.update_column(:quotes, poll.quotes+1)
# end
new_poll if new_poll.save!
new_poll.save!
poll.update_column(:quotes, poll.quotes+1)
new_poll
end
end

@ -0,0 +1,10 @@
class ShixunListsController < ApplicationController
def index
@results = ShixunSearchService.call(search_params)
end
private
def search_params
params.permit(:keyword, :type, :page, :limit, :order, :type, :status, :diff)
end
end

@ -1,6 +1,7 @@
class ShixunsController < ApplicationController
include ShixunsHelper
include ApplicationHelper
include ElasticsearchAble
before_action :require_login, :check_auth, except: [:download_file, :index, :menus, :show, :show_right, :ranking_list,
:discusses, :collaborators, :fork_list, :propaedeutics]
@ -131,8 +132,16 @@ class ShixunsController < ApplicationController
offset = (page.to_i - 1) * (limit.to_i)
order = params[:order] || "desc"
## 搜索关键字创建者、实训名称、院校名称
keyword = params[:search].blank? ? "*" : params[:search]
@shixuns = Shixun.search keyword, where: {id: @shixuns.pluck(:id)}, order: {"myshixuns_count" => order}, limit: limit, offset: offset
keyword = params[:keyword].to_s.strip.presence || '*'
model_options = {
index_name: [Shixun],
model_includes: Shixun.searchable_includes
}
model_options.merge(where: { id: @shixuns.pluck(:id) }).merge(order: {"myshixuns_count" => order}).merge(limit: limit, offset: offset)
model_options.merge(default_options)
@shixuns = Searchkick.search(keyword, model_options)
# @shixuns = Shixun.search keyword, where: {id: @shixuns.pluck(:id)}, order: {"myshixuns_count" => order}, limit: limit, offset: offset
@total_count = @shixuns.total_count
end

@ -16,18 +16,26 @@ module ExercisesHelper
end
if q_type <= Exercise::JUDGMENT
if answers_content.present? #学生有回答时
answer_choice_array = []
answers_content.each do |a|
answer_choice_array.push(a.exercise_choice.choice_position) #学生答案的位置
end
user_answer_content = answer_choice_array.sort
standard_answer = q.exercise_standard_answers.pluck(:exercise_choice_id).sort #该问题的标准答案,可能有多个
if user_answer_content == standard_answer #答案一致,多选或单选才给分,答案不对不给分
ques_score = q.question_score
else
ques_score = 0.0
end
if answers_content.present? #学生有回答时,分数已经全部存到exercise_answer 表,所以可以直接取第一个值
ques_score = answers_content.first.score
ques_score = ques_score < 0 ? 0.0 : ques_score
# answer_choice_array = []
# answers_content.each do |a|
# answer_choice_array.push(a.exercise_choice.choice_position) #学生答案的位置
# end
# user_answer_content = answer_choice_array.sort
# standard_answer = q.exercise_standard_answers.pluck(:exercise_choice_id).sort #该问题的标准答案,可能有多个
# if q_type == Exercise::MULTIPLE && standard_answer.size == 1 # 老数据的问题
# ques_score = answers_content.first.score
# else
#
# end
# if user_answer_content == standard_answer #答案一致,多选或单选才给分,答案不对不给分
# ques_score = q.question_score
# else
# ques_score = 0.0
# end
else
ques_score = 0.0
end
@ -58,7 +66,6 @@ module ExercisesHelper
exercise_sub_status.each do |s|
sub_answer = s.exercise_answers.search_answer_users("user_id",user_id) #主观题只有一个回答
if sub_answer.present? && sub_answer.first.score >= 0.0
if s.question_score <= sub_answer.first.score
stand_status = 1
else
@ -775,22 +782,24 @@ module ExercisesHelper
user_score = user_score_pre.present? ? user_score_pre.pluck(:score).sum : nil
elsif ques_type == 5 || ques_type == 3
user_score = user_score_pre.present? ? user_score_pre.pluck(:score).sum : 0.0
else
if exercise_answers.present? #判断题和选择题时,
answer_choice_array = []
exercise_answers.each do |a|
answer_choice_array.push(a.exercise_choice.choice_position) #学生答案的位置
end
user_answer_content = answer_choice_array.sort
standard_answer = q.exercise_standard_answers.pluck(:exercise_choice_id).sort #该问题的标准答案,可能有多个
if user_answer_content == standard_answer #答案一致,多选或单选才给分,答案不对不给分
user_score = q.question_score
else
user_score = 0.0
end
else
user_score = 0.0
end
else #选择题,判断题根据第一个记录查分
user_score = user_score_pre.present? ? user_score_pre.first.score : 0.0
# if exercise_answers.present? #判断题和选择题时,
# answer_choice_array = []
# exercise_answers.each do |a|
# answer_choice_array.push(a.exercise_choice.choice_position) #学生答案的位置
# end
# user_answer_content = answer_choice_array.sort
# standard_answer = q.exercise_standard_answers.pluck(:exercise_choice_id).sort #该问题的标准答案,可能有多个
# if user_answer_content == standard_answer #答案一致,多选或单选才给分,答案不对不给分
# user_score = q.question_score
# else
# user_score = 0.0
# end
# else
# user_score = 0.0
# end
end
end

@ -3,7 +3,7 @@ class ExerciseAnswerComment < ApplicationRecord
belongs_to :user
belongs_to :exercise_question
belongs_to :exercise_shixun_answer, optional: true
belongs_to :exercise_answer,optional: true
belongs_to :exercise_answer, optional: true
scope :search_answer_comments, lambda {|name,ids| where("#{name}":ids)}
end

@ -51,13 +51,12 @@ module Searchable::Shixun
visits_count: visits,
challenges_count: challenges_count,
study_count: myshixuns_count,
description: description
}
end
module ClassMethods
def searchable_includes
{ user: { user_extension: :school } }
[ :shixun_info, user: { user_extension: :school } ]
end
end
end

@ -46,8 +46,7 @@ class Subject < ApplicationRecord
# 挑战过路径的成员数(金课统计去重后的报名人数)
def member_count
excellent && CourseMember.where(role: 4, course_id: courses.pluck(:id)).pluck(:user_id).length > shixuns.pluck(:myshixuns_count).sum ?
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
end
def all_score

@ -22,4 +22,9 @@ class Tiding < ApplicationRecord
value
end
def anonymous?
(container_type == 'StudentWorksScore' && extra.to_i == 3) ||
(container_type == 'StudentWorksScoresAppeal' && parent_container_type == 'StudentWork' && tiding_type == 'System')
end
end

@ -28,9 +28,11 @@ module ElasticsearchAble
end
def body_options
{
min_score: EduSetting.get('es_min_score') || 10
}
hash = {}
hash[:min_score] = (EduSetting.get('es_min_score') || 10) if keyword != '*'
hash
end
def per_page

@ -0,0 +1,56 @@
class ShixunSearchService < ApplicationService
include ElasticsearchAble
attr_reader :params
def initialize(params)
@params = params
end
def call
# 全部实训/我的实训
type = params[:type] || "all"
# 状态:已发布/未发布
status = params[:status] || "all"
# 超级管理员用户显示所有未隐藏的实训、非管理员显示所有已发布的实训(对本单位公开且未隐藏未关闭)
if type == "mine"
@shixuns = User.current.shixuns.none_closed
else
if User.current.admin? || User.current.business?
@shixuns = Shixun.none_closed.where(hidden: 0)
else
none_shixun_ids = ShixunSchool.where("school_id != #{User.current.school_id}").pluck(:shixun_id)
@shixuns = Shixun.where.not(id: none_shixun_ids).none_closed.where(hidden: 0)
end
end
unless status == "all"
@shixuns = status == "published" ? @shixuns.where(status: 2) : @shixuns.where(status: [0, 1])
end
## 筛选 难度
if params[:diff].present? && params[:diff].to_i != 0
@shixuns = @shixuns.where(trainee: params[:diff])
end
Shixun.search(keyword, search_options)
end
private
def search_options
model_options = {
includes: [ :shixun_info, :challenges, :subjects, user: { user_extension: :school } ]
}
model_options.merge!(where: { id: @shixuns.pluck(:id) })
model_options.merge!(order: {"myshixuns_count" => sort_str})
model_options.merge!(default_options)
model_options
end
def sort_str
params[:order] || "desc"
end
end

@ -13,7 +13,7 @@ wb.styles do |style|
name = course_evaluation.name
items_size = course_evaluation.ec_course_evaluation_subitems.count
sheet.add_row name, style: bg_style
sheet.add_row [name], style: bg_style
sheet.merge_cells wb.rows.first.cells[(1..(items_size * course_evaluation.evaluation_count))]
data = []

@ -1 +1 @@
json.course_evaluations @course_evaluations, partial: 'shared/ec_course_evaluation', as: :ec_course_evaluation
json.course_evaluations @course_evaluations, partial: 'ecs/course_evaluations/shared/ec_course_evaluation', as: :ec_course_evaluation

@ -1 +1 @@
json.partial! 'shared/ec_course_evaluation', ec_course_evaluation: @course_evaluation
json.partial! 'ecs/course_evaluations/shared/ec_course_evaluation', ec_course_evaluation: @course_evaluation

@ -1 +1 @@
json.course_evaluations @course_evaluations, partial: 'shared/ec_course_evaluation_slim', as: :ec_course_evaluation
json.course_evaluations @course_evaluations, partial: 'ecs/course_evaluations/shared/ec_course_evaluation_slim', as: :ec_course_evaluation

@ -1,2 +1,2 @@
json.course_targets @course_targets, partial: 'shared/course_target', as: :ec_course_target
json.course_targets @course_targets, partial: 'ecs/course_targets/shared/course_target', as: :ec_course_target

@ -15,7 +15,7 @@ wb.styles do |style|
name = "#{@_current_course.name}课程目标"
wb.add_worksheet(name: name) do |sheet|
sheet.add_row name, style: title_style
sheet.add_row [name], style: title_style
sheet.add_row []
sheet.add_row []

@ -1,2 +1,2 @@
json.count @count
json.ec_courses @ec_courses, partial: 'shared/ec_course_slim', as: :ec_course
json.ec_courses @ec_courses, partial: 'ecs/ec_courses/shared/ec_course_slim', as: :ec_course

@ -6,15 +6,15 @@ wb = xlsx_package.workbook
wb.styles do |style|
title_style = style.add_style(sz: 16, height: 20, b: true)
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 })
label_style = style.add_style(sz: 11, b: true, bg_color: '90EE90', alignment: { horizontal: :center, vertical: :center })
content_style = style.add_style(sz: 11, height: 16, border: { style: :thin, color: '000000' })
wb.add_worksheet(:name => '毕业要求及指标点') do |sheet|
sheet.add_row '毕业要求及指标点', style: title_style
sheet.add_row ['毕业要求及指标点'], style: title_style
sheet.add_row []
sheet.add_row ['专业代码', major.code], style: ec_year_style
sheet.add_row ['专业代码', major.code.to_s + ' '], style: ec_year_style
sheet.add_row ['专业名称', major.name], style: ec_year_style
sheet.add_row ['学年', "#{ec_year.year}学年"], style: ec_year_style
@ -32,12 +32,15 @@ wb.styles do |style|
end
items_size = requirement.ec_graduation_subitems.size
sheet.merge_cells("A#{index}:A#{index + items_size}")
sheet.merge_cells("B#{index}:B#{index + items_size}")
if items_size.zero?
sheet.add_row [requirement_content, ''], style: content_style
else
sheet.merge_cells("A#{index + 1}:A#{index + items_size}")
end
index += items_size
end
sheet.column_widths [400, 400]
sheet.column_widths 100, 100
end
end

@ -1 +1 @@
json.partial! 'shared/ec_graduation_subitem', ec_graduation_subitem: @graduation_subitem
json.partial! 'ecs/graduation_course_supports/shared/ec_graduation_subitem', ec_graduation_subitem: @graduation_subitem

@ -1,3 +1,3 @@
json.course_count @course_count
json.graduation_subitems @graduation_subitems, partial: 'shared/ec_graduation_subitem', as: :ec_graduation_subitem
json.graduation_subitems @graduation_subitems, partial: 'ecs/graduation_course_supports/shared/ec_graduation_subitem', as: :ec_graduation_subitem
json.count @graduation_subitems.size

@ -14,7 +14,7 @@ wb.styles do |style|
tip_style = style.add_style(sz: 11, height: 16, color: 'FFA07A')
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.add_row []

@ -10,7 +10,7 @@ wb.styles do |style|
content_style = style.add_style(sz: 11, height: 16, border: { style: :thin, color: '000000' })
wb.add_worksheet(name: '达成度-毕业要求综合评价报表') do |sheet|
sheet.add_row '培养目标及目标分解', style: title_style
sheet.add_row ['达成度-毕业要求综合评价报表'], style: title_style
sheet.merge_cells("A1:D1")
sheet.add_row []

@ -1,4 +1,4 @@
json.graduation_requirements @graduation_requirements, partial: 'ecs/ec_graduation_requirements/shared/ec_graduation_requirement', as: :ec_graduation_requirement
json.training_subitems @training_subitems, partial: 'ecs/ec_training_subitems/shared/ec_training_subitem', as: :ec_training_subitem
json.requirement_support_objectives @requirement_support_objectives, partial: 'shared/requirement_support_objective', as: :requirement_support_objective
json.requirement_support_objectives @requirement_support_objectives, partial: 'ecs/requirement_support_objectives/shared/requirement_support_objective', as: :requirement_support_objective

@ -16,7 +16,7 @@ wb.styles do |style|
content_style = style.add_style(sz: 11, height: 16, border: { style: :thin, color: '000000' })
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..subitem_size)]

@ -1 +1 @@
json.score_levels @score_levels, partial: 'shared/ec_score_level', as: :ec_score_level
json.score_levels @score_levels, partial: 'ecs/score_levels/shared/ec_score_level', as: :ec_score_level

@ -1,2 +1,2 @@
json.count @count
json.students @students, partial: 'shared/ec_year_student', as: :ec_year_student
json.students @students, partial: 'ecs/students/shared/ec_year_student', as: :ec_year_student

@ -1,4 +1,4 @@
json.graduation_standards @graduation_standards, partial: 'ecs/shared/ec_graduation_standard', as: :ec_graduation_standard
json.graduation_subitems @graduation_subitems, partial: 'ecs/shared/ec_graduation_subitem', as: :ec_graduation_subitem
json.subitem_support_standards @subitem_support_standards, partial: 'shared/subitem_support_standard', as: :subitem_support_standard
json.subitem_support_standards @subitem_support_standards, partial: 'ecs/subitem_support_standards/shared/subitem_support_standard', as: :subitem_support_standard

@ -17,7 +17,7 @@ wb.styles do |style|
content_style = style.add_style(sz: 11, height: 16, border: { style: :thin, color: '000000' })
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..standards_size)]

@ -1,4 +1,4 @@
# json.shixun_list @shixuns do |shixun|
# json.shixun_lists @shixuns do |shixun|
# json.shixun_identifier shixun.identifier
# json.name shixun.name
# json.creator shixun.user&.full_name

@ -0,0 +1,22 @@
json.shixuns_count @results.total_count
json.shixun_list do
json.array! @results.with_highlights(multiple: true) do |obj, highlights|
json.merge! obj.to_searchable_json
json.challenge_names obj.challenges.pluck(:subject)
# 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/
highlights[:description]&.first&.sub!(reg, '')
highlights[:content]&.first&.sub!(reg, '')
json.title highlights.delete(:name)&.join('...') || obj.searchable_title
json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]
json.content highlights
json.level level_to_s(obj.trainee)
json.subjects obj.subjects.uniq do |subject|
json.(subject, :id, :name)
end
end
end

@ -10,7 +10,7 @@ json.shixun_list do
# json.description highlights.values[0,5].each { |arr| arr.is_a?(Array) ? arr.join('...') : arr }.join('<br/>')
json.content highlights
json.level level_to_s(obj.trainee)
json.subjects obj.subjects do |subject|
json.subjects obj.subjects.uniq do |subject|
json.(subject, :id, :name)
end
end

@ -17,8 +17,13 @@ json.homework_type homework_type
json.time tiding.how_long_time
json.new_tiding tiding.unread?(@onclick_time)
# 需要系统头像
show_system_user = tiding.trigger_user_id.zero? ||
(tiding.trigger_user_id == 1 && tiding.tiding_type == 'System') ||
tiding.anonymous?
json.trigger_user do
if tiding.trigger_user_id.zero? || (tiding.trigger_user_id == 1 && tiding.tiding_type == 'System')
if show_system_user
json.id 0
json.name "系统"
json.login ""

@ -202,6 +202,7 @@
2_end: "别人对你的匿评发起的申诉申请:%s审核未通过"
StudentWork:
Apply_end: "发起了匿评申诉申请:%s"
HomeworkCommon_end: "发起了匿评申诉申请:%s"
System_end: "有人对你的匿评发起了申诉:%s"
Department_end: "你选填的二级单位:%s%s因不符合规范,已被系统删除.请重新选择"
Library:

@ -174,7 +174,10 @@ Rails.application.routes.draw do
end
end
resources :shixun_lists
resources :shixuns, param: :identifier do
collection do
get :menus
get :get_recommend_shixuns
@ -182,7 +185,7 @@ Rails.application.routes.draw do
get :get_mirror_script
post :apply_shixun_mirror
get :download_file
get :shixun_list
get :shixun_lists
end
member do

Binary file not shown.

@ -81,8 +81,10 @@ namespace :public_classes do
homework.update_columns(publish_time: publish_time, end_time: end_time, created_at: created_at, updated_at: updated_at)
homework.homework_detail_manual.update_columns(comment_status: 6, created_at: created_at, updated_at: updated_at)
homework.update_homework_work_score
homework.update_attribute('calculation_time', end_time)
homework.student_works.where("work_status !=0 and update_time > '#{end_time}'").update_all(update_time: end_time)
# homework.student_works.where("work_status !=0 and update_time > '#{end_time}'").update_all(update_time: end_time)
end
when 3
# 试卷

File diff suppressed because one or more lines are too long

@ -32,7 +32,7 @@ module.exports = {
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map",
// 开启调试
devtool: "eval", // 开启调试
// devtool: "eval", // 开启调试
// These are the "entry points" to our application.
// 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.

@ -34,8 +34,9 @@
// location.href = './compatibility'
location.href = '/compatibility.html'
}
const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
if (isMobile) {
// const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
const isWeiXin = (/MicroMessenger/i.test(navigator.userAgent.toLowerCase()));
if (isWeiXin) {
document.write('<script type="text/javascript" src="/javascripts/wx/jweixin-1.3.0.js"><\/script>');
}
</script>

@ -9,7 +9,7 @@ import {
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import '@icedesign/base/dist/ICEDesignBase.css';
import '@icedesign/base/index.scss';
@ -37,7 +37,7 @@ import {MuiThemeProvider, createMuiTheme} from 'material-ui/styles';
import history from './history';
import {SnackbarHOC, configShareForIndex} from 'educoder'
import {SnackbarHOC} from 'educoder'
import {initAxiosInterceptors} from './AppConfig'
@ -303,47 +303,7 @@ class App extends Component {
mydisplay:true,
})
};
initWXShare = () => {
if (window.wx) {
const wx = window.wx
const url = '/wechats/js_sdk_signature.json'
const currentUrl = window.location.href.split('#')[0]
// window.encodeURIComponent()
axios.post(url, {
url: window.__testUrl || currentUrl,
}).then((response) => {
console.log('got res')
const data = response.data;
wx.config({
debug: false,
appId: data.appid,
timestamp: data.timestamp,
nonceStr: data.noncestr,
signature: data.signature,
jsApiList: [
'onMenuShareTimeline',//
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo',
'onMenuShareQZone'
]
});
wx.ready(function () {
console.log('wx is ready')
configShareForIndex('/')
});
wx.error(function (res) {
console.log('wx is error')
console.log(res)
//alert(res.errMsg);//错误提示
});
}).catch((error) => {
console.log(error)
})
}
}
disableVideoContextMenu = () => {
window.$( "body" ).on( "mousedown", "video", function(event) {
if(event.which === 3) {
@ -365,7 +325,6 @@ class App extends Component {
});
initAxiosInterceptors(this.props)
this.initWXShare()
//
// axios.interceptors.response.use((response) => {
// // console.log("response"+response);

@ -3,4 +3,6 @@ export function isDev() {
}
// const isMobile
export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
// const isWeiXin = (/MicroMessenger/i.test(navigator.userAgent.toLowerCase()));

@ -1,4 +1,5 @@
const host = window.location.host
import axios from 'axios'
const host = window.location.protocol + '//' + window.location.host
const wx = window.wx
function share(shareData) {
try {
@ -11,7 +12,47 @@ function share(shareData) {
console.log(e)
}
}
const urlDoneMap = {}
function requestForSignatrue (callback) {
const currentUrl = window.location.href.split('#')[0]
if (window.wx && !urlDoneMap[currentUrl]) {
const wx = window.wx
const url = '/wechats/js_sdk_signature.json'
urlDoneMap[currentUrl] = true
// window.encodeURIComponent()
axios.post(url, {
url: window.__testUrl || currentUrl,
}).then((response) => {
console.log('got res')
const data = response.data;
wx.config({
debug: false,
appId: data.appid,
timestamp: data.timestamp,
nonceStr: data.noncestr,
signature: data.signature,
jsApiList: [
'onMenuShareTimeline',//
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo',
'onMenuShareQZone'
]
});
wx.ready(function () {
callback && callback()
});
wx.error(function (res) {
console.log('wx is error')
console.log(res)
//alert(res.errMsg);//错误提示
});
}).catch((error) => {
console.log(error)
})
}
}
/**
实践课程 平台提供涵盖基础入门案例实践和创新应用的完整实训项目体系通过由浅入深的实训路径帮助学生快速提升实战能力
实训项目 覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训
@ -19,60 +60,72 @@ function share(shareData) {
单个课程和实训 获取课程/实训的简介 该课程或者实训展示的缩略图
*/
export function configShareForIndex (path) {
if (!wx) return;
var shareData = {
title: 'EduCoder - 首页',
desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台提供企业级工程实训以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动将传统的知识传授和时兴的工程实战一体化。',
link: host + (path || ''),
imgUrl: window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
};
share(shareData)
export function configShareForIndex (path) {
requestForSignatrue(() => {
var shareData = {
title: 'EduCoder - 首页',
desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台提供企业级工程实训以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动将传统的知识传授和时兴的工程实战一体化。',
link: host + (path || ''),
imgUrl: window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
};
share(shareData)
})
}
export function configShareForPaths () {
if (!wx) return;
var shareData = {
title: 'EduCoder - 实践课程',
desc: '平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。',
link: `${host}/paths`,
imgUrl: window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
};
share(shareData)
requestForSignatrue(() => {
console.log('configShareForPaths', host)
var shareData = {
title: 'EduCoder - 实践课程',
desc: '平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。',
link: `${host}/paths`,
imgUrl: window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
};
share(shareData)
})
}
export function configShareForShixuns () {
if (!wx) return;
var shareData = {
title: 'EduCoder - 实训项目',
desc: '覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训。',
link: `${host}/shixuns`,
imgUrl: window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
};
share(shareData)
requestForSignatrue(() => {
console.log('configShareForShixuns', host)
var shareData = {
title: 'EduCoder - 实训项目',
desc: '覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训。',
link: `${host}/shixuns`,
imgUrl: window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
};
share(shareData)
})
}
export function configShareForCourses () {
if (!wx) return;
var shareData = {
title: 'EduCoder - 翻转课堂',
desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。',
link: `${host}/courses`,
imgUrl: window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
};
share(shareData)
requestForSignatrue(() => {
console.log('configShareForCourses', host)
var shareData = {
title: 'EduCoder - 翻转课堂',
desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。',
link: `${host}/courses`,
imgUrl: window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
};
share(shareData)
})
}
// detail
export function configShareForCustom (title, desc, path, imgUrl) {
if (!wx) return;
var shareData = {
title: title,
desc: desc,
link: `${host}/${path}`,
imgUrl: imgUrl || window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
};
share(shareData)
requestForSignatrue(() => {
console.log('configShareForCustom', host)
var shareData = {
title: title,
desc: desc,
link: `${host}/${path}`,
imgUrl: imgUrl || window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
};
share(shareData)
})
}

@ -174,7 +174,7 @@ class TPIContextProvider extends Component {
}
let testPath = ''
if (window.location.port == 3007) {
testPath = 'http://pre-newweb.educoder.net'
testPath = 'http://test-newweb.educoder.net'
}
// var url = `${testPath}/api/v1/games/${ game.identifier }/cost_time`
var url = `${testPath}/api/tasks/${ game.identifier }/cost_time`

@ -93,13 +93,13 @@ class ListPageIndex extends Component{
}
componentDidMount(){
console.log("77");
// console.log("77");
var yslGuideone = window.localStorage.getItem('yslGuideone');
console.log("78");
console.log(yslGuideone);
// console.log("78");
// console.log(yslGuideone);
try {
if (yslGuideone === "true") {
console.log("true 字符串");
// console.log("true 字符串");
this.setState({
yslGuideone:true,
})
@ -107,7 +107,7 @@ class ListPageIndex extends Component{
this.setState({
yslGuideone:false,
});
console.log("false 字符串");
// console.log("false 字符串");
}
}catch (e) {
console.log(e);
@ -133,8 +133,7 @@ class ListPageIndex extends Component{
window.localStorage.setItem('yslGuideone', bool);
try {
if (bool === "true") {
console.log("115");
console.log("true 字符串");
this.setState({
yslGuideone:true,
})
@ -142,11 +141,10 @@ class ListPageIndex extends Component{
this.setState({
yslGuideone:false,
});
console.log("124");
console.log("false 字符串");
}
}catch (e) {
console.log(e);
// console.log(e);
this.setState({
yslGuideone:false,
});

@ -0,0 +1,555 @@
import React,{Component} from 'react';
import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon,Drawer,Dropdown,Menu,Breadcrumb,Pagination,Button,notification} from "antd";
import axios from'axios';
import NoneData from "../coursesPublic/NoneData";
import './Newshixunmodel.css';
const Search = Input.Search;
class NewShixunModel extends Component{
constructor(props){
super(props)
this.state={
shixun_list:undefined,
shixuns_count:undefined,
Grouplist:[],
allGrouplist:[{page:1,list:[]}],
page:1,
type:'all',
status:'all',
keyword:undefined,
order:'desc',
diff:0,
limit:15,
}
}
componentDidMount() {
let{page,type,keyword,order,diff,limit,status}=this.state;
this.getdatalist(page,type,status,keyword,order,diff,limit)
}
getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype)=>{
this.setState({
isspinning:true
})
let status=this.props.statustype===undefined?newstatus:'published';
let url="/shixun_lists.json"
axios.get(url,{params:{
page,
type,
status,
keyword,
order,
diff,
limit
}}).then((response) => {
if(response.data){
if(pagetype===undefined){
this.setState({
shixun_list:response.data.shixun_list,
shixuns_count:response.data.shixuns_count,
Grouplist:[],
isspinning:false
})
}else if(pagetype==="pagetype"){
this.setState({
shixun_list:response.data.shixun_list,
shixuns_count:response.data.shixuns_count,
isspinning:false
})
}
}
}).catch((error) => {
this.setState({
isspinning:false
})
})
}
DropdownClick=(diff)=>{
this.setState({
diff:diff
})
let{page,type,status,keyword,order,limit}=this.state;
this.getdatalist(page,type,status,keyword,order,diff,limit)
}
ItsCourse=(item)=>{
return <Menu>
{item.map((list,key)=>{
return(
<Menu.Item key={key} id={list.id}>
<a target="_blank" href={`/paths/${list.id}`} className={"newshixun500"} title={list.name}>{list.name}</a>
</Menu.Item>
)
})}
</Menu>
}
getGrouplist=(Grouplist)=>{
let {page,allGrouplist}=this.state;
let newallGrouplist=allGrouplist;
var a=newallGrouplist.find((value,index,arr)=>{
return value.page==page
});
if(a!=undefined){
newallGrouplist.map((item,key)=>{
if(item.page===page){
item.list=Grouplist
}
})
}
let newGrouplist=[];
newallGrouplist.map((item,key)=>{
item.list.map((items,ke)=>{
newGrouplist.push(items)
})
})
this.setState({
Grouplist: newGrouplist,
allGrouplist:newallGrouplist
})
}
PaginationCourse=(pageNumber)=>{
let {allGrouplist}=this.state;
let newallGrouplist=allGrouplist;
var v=newallGrouplist.find((value,index,arr)=>{
return value.page==pageNumber
});
if(v===undefined){
newallGrouplist.push({page:pageNumber,list:[]})
}
let{type,status,keyword,order,diff,limit}=this.state;
this.getdatalist(pageNumber,type,status,keyword,order,diff,limit,"pagetype")
this.setState({
page:pageNumber,
allGrouplist:newallGrouplist
})
}
belongto=(value)=>{
this.setState({
type:value,
keyword:undefined,
page:1
})
let{status,order,diff,limit}=this.state;
this.getdatalist(1,value,status,undefined,order,diff,limit)
}
updatedlist=(order)=>{
if(order==="desc"){
this.setState({
order:"asc"
})
let{type,page,status,keyword,diff,limit}=this.state;
this.getdatalist(page,type,status,keyword,"asc",diff,limit)
}else{
this.setState({
order:"desc"
})
let{type,page,status,keyword,diff,limit}=this.state;
this.getdatalist(page,type,status,keyword,"desc",diff,limit)
}
}
setdatafunsval=(e)=>{
this.setState({
keyword:e.target.value
})
}
setdatafuns=(value)=>{
this.setState({
keyword:value,
type:undefined,
page:1,
status:'all',
order:'desc',
diff:0,
limit:15,
})
this.getdatalist(1,undefined,'all',value,'desc',0,15)
}
showNotification = (description, message = "提示", icon) => {
const data = {
message,
description
}
if (icon) {
data.icon = icon;
}
notification.open(data);
}
savecouseShixunModal=()=>{
this.setState({
hometypepvisible:true
})
let {coursesId}=this.props;
let{Grouplist}=this.state;
if(Grouplist.length===0){
this.setState({
hometypepvisible:false
})
this.showNotification("请先选择实训")
return
}
if (this.props.chooseShixun) {
if(Grouplist.length>1){
this.setState({
hometypepvisible:false
})
this.showNotification("试卷选择的实训数不能大于1")
return
}
this.props.chooseShixun(Grouplist)
this.setState({
hometypepvisible:false
})
return;
}
if (this.props.pathShixun) {
this.setState({
hometypepvisible:false
})
this.props.pathShixun(Grouplist)
return;
}
let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json";
axios.post(url, {
category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id),
shixun_ids:Grouplist,
}
).then((response) => {
if(response.data.status===-1){
// this.props.showNotification(response.data.message)
}else{
// this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids)
this.showNotification("操作成功")
this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order);
this.props.hideNewShixunModelType()
}
this.setState({
hometypepvisible:false
})
// category_id: 3
// homework_ids: (5) [9171, 9172, 9173, 9174, 9175]
}).catch((error) => {
console.log(error)
this.setState({
hometypepvisible:false
})
})
}
poststatus=(status)=>{
this.setState({
status:status
})
let{page,type,keyword,order,diff,limit}=this.state;
this.getdatalist(page,type,status,keyword,order,diff,limit)
}
render() {
let {diff,Grouplist,status,shixun_list,shixuns_count,page,type,order}=this.state;
// let {visible,patheditarry}=this.props;
// console.log(Grouplist)
// console.log(allGrouplist)
const statusmenus=(
<Menu className="menus">
<Menu.Item>
<a className={status==="all"?"color-blue":""} onClick={()=>this.poststatus("all")}>
所有
</a>
</Menu.Item>
<Menu.Item >
<a className={status==="published"?"color-blue":""} onClick={()=>this.poststatus("published")} >
已发布
</a>
</Menu.Item>
<Menu.Item>
<a className={status==="unpublished"?"color-blue":""} onClick={()=>this.poststatus("unpublished")}>
未发布
</a>
</Menu.Item>
</Menu>
);
const menus = (
<Menu className="menus">
<Menu.Item>
<a className={diff===0?"color-blue":""} onClick={()=>this.DropdownClick(0)}>
所有
</a>
</Menu.Item>
<Menu.Item >
<a className={diff===1?"color-blue":""} onClick={()=>this.DropdownClick(1)} >
初级
</a>
</Menu.Item>
<Menu.Item>
<a className={diff===2?"color-blue":""} onClick={()=>this.DropdownClick(2)}>
中级
</a>
</Menu.Item>
<Menu.Item>
<a className={diff===3?"color-blue":""} onClick={()=>this.DropdownClick(3)}>
高级
</a>
</Menu.Item>
<Menu.Item>
<a className={diff===4?"color-blue":""} onClick={()=>this.DropdownClick(4)}>
顶级
</a>
</Menu.Item>
</Menu>
);
return(
<div>
<style>
{
`body{ overflow: hidden !important; }
.ant-drawer-content{ overflow:auto !important; background: #f5f5f5; }
.yslbottomsj{position: absolute;bottom: -8px;}
`
}
</style>
<Drawer
placement="bottom"
closable={false}
destroyOnClose={true}
visible={this.props.NewShixunModelType}
height={'100%'}
>
<Spin spinning={this.state.isspinning}>
<div className={"clearfix educontent pr"}>
<div className={"square-list clearfix"}>
<div className="newshixunheadersear">
<div style={{height:"53px"}}></div>
<Search
style={{ width: "800px"}}
className="packinput"
placeholder="实训信息 / 院校名称 / 创建者"
value={this.state.keyword}
enterButton={<span>搜索</span>}
onInput={(e)=>this.setdatafunsval(e)}
onSearch={ (value)=>this.setdatafuns(value)} />
</div>
<div className="clearfix font-12 mt30">
<div className="font-12 ml5 fl">
<span className="fl color-grey-9 mr20">已选 <span className={"color-blue"}>{Grouplist.length}</span> </span>
<span className="fl color-grey-9 mr20"> <span className={"color-blue"}>{shixuns_count===undefined?"":shixuns_count}</span> </span>
<span className="fl color-grey-9 pointer mr30">
<a className={" color-grey-6"} onClick={()=>this.updatedlist(order)}>学习人数</a>
<sapn className="relativef ml5 " >
<i className={order==="desc"?"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9"}></i>
<i className={order==="asc"?"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9"}></i>
</sapn>
</span>
{this.props.statustype===undefined?<Dropdown overlay={statusmenus}>
<a className="ant-dropdown-link color-grey-6 mr20">
{status==='all'?"发布状态":status==='published'?"已发布":status==="unpublished"?"未发布":""}<Icon type="down" className={"color-grey-6"}/>
</a>
</Dropdown>:""}
<Dropdown overlay={menus}>
<a className="ant-dropdown-link color-grey-6">
{diff===0?"难度":diff===1?"初级":diff===2?"中级":diff===3?"高级":diff===4?"顶级":""}<Icon type="down" className={"color-grey-6"}/>
</a>
</Dropdown>
</div>
<div className="font-12 alltopiscright ml25 fr">
<span className={"fr pointer color-grey-3"} onClick={()=>this.props.hideNewShixunModelType()}>返回</span>
<span className={type==="mine"?"fr mr30 topcsactive pointer color-grey-3 color-blue":"fr mr30 pointer color-grey-3"} onClick={()=>this.belongto("mine")}>我的实训</span>
<span className={type==="all"?"fr mr30 topcsactive pointer color-grey-3 color-blue":"fr mr30 pointer color-grey-3"} onClick={()=>this.belongto("all")}>全部实训</span>
</div>
</div>
<Checkbox.Group onChange={this.getGrouplist} value={Grouplist} >
{shixun_list===undefined?"":shixun_list.length===0?"":shixun_list.map((item,key)=>{
return(
<div className="mt20 edu-back-white pd20 relativef newshixunlist" key={key}>
<div className="clearfix">
<div className="item-body">
<div className="clearfix ds pr contentSection">
<Checkbox
value={item.id}
key={item.id}
className="fl task-hide edu-txt-left mt3"
name="shixun_homework[]"
></Checkbox>
<a target="_blank" href={`/shixuns/${item.identifier}/challenges`} title={item.title} className="ml15 fl font-16 color-dark maxwidth1100"
dangerouslySetInnerHTML={{__html: item.title}}
>
</a>
<div className="cl"></div>
<style>
{
`
.newradioStyles{
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
max-height: 42px;
}
`
}
</style>
{JSON.stringify(item.description) == "{}"?"":<div className="newshixunmodelmidfont newradioStyles" title={item.description} dangerouslySetInnerHTML={{__html: item.description}}>
</div>}
{item.challenge_names.length===0?"":<div className="newshixunmodelbotfont">
{item.challenge_names.map((item,key)=>{
return(
<span>{key+1}{item}</span>
)
})}
</div>}
<div className={"newshixunpd030"}>
<div className="xuxianpro"></div>
</div>
<div className="color-grey panel-lightgrey fl ml30">
<style>
{`
.ant-breadcrumb-separator{
color: #D7D7D7 !important;
}
.panel-lightgrey, .panel-lightgrey span{
color: #999 !important;
}
.ant-breadcrumb-link{
margin-right:10px !important;
}
.ant-breadcrumb-separator{
margin-right:20px !important;
}
`}
</style>
<Breadcrumb separator="|">
<Breadcrumb.Item>{item.author_name}</Breadcrumb.Item>
<Breadcrumb.Item>{item.author_school_name}</Breadcrumb.Item>
<Breadcrumb.Item>难度系数{item.level}</Breadcrumb.Item>
<Breadcrumb.Item>学习人数{item.study_count}</Breadcrumb.Item>
</Breadcrumb>
</div>
{item.subjects.length===0?"":<Dropdown overlay={()=>this.ItsCourse(item.subjects)}>
<a className="ant-dropdown-link fl ml30 newshixunfont12 color-blue" >
所属课程<Icon className={"color-blue"} type="down" />
</a>
</Dropdown>}
</div>
</div>
</div>
</div>
)})
}
</Checkbox.Group>
{shixun_list===undefined||shixuns_count===undefined?"":shixun_list.length===0||shixuns_count===0?"":shixuns_count>15?<div className={" edu-txt-center pd303010"}>
<Pagination
showQuickJumper
defaultCurrent={1}
pageSize={15}
total={shixuns_count===undefined?"":shixuns_count}
current={page}
onChange={this.PaginationCourse}
/>
</div>:""}
{
shixun_list===undefined?
<div className={"minhegiht300"}>
</div>
:shixun_list.length===0? <NoneData></NoneData>:""
}
{
shixun_list===undefined?"":shixun_list.length===0?"":<div className={" edu-txt-center padding20-30"}>
<Button className={"mr20 newshixunmode"} onClick={()=>this.props.hideNewShixunModelType()}>取消</Button>
<Button className={"newshixunmode"} type="primary" onClick={()=>this.savecouseShixunModal()} loading={this.state.hometypepvisible}>确定</Button>
</div>}
</div>
</div>
</Spin>
</Drawer>
</div>
)
}
}
export default NewShixunModel;
// {JSON.stringify(item.content) == "{}"?<div className="newshixunmodelmidfont newradioStyles" title={item.description} dangerouslySetInnerHTML={{__html: item.description}}>
// </div>:<div className="newshixunmodelbotfont">
// {item.content.description === undefined || item.content.description===0?"":item.content.description.map((item,key)=>{
// return(
// <span dangerouslySetInnerHTML={{__html: item}}>{}</span>
// )
// })}
// </div>}
//
// {JSON.stringify(item.content) == "{}"?item.challenge_names.length===0?"":<div className="newshixunmodelbotfont">
// {item.challenge_names.map((item,key)=>{
// return(
// <span>第{key+1}关:{item}</span>
// )
// })}
// </div>:<div className="newshixunmodelbotfont">
// {item.content.challenge_names === undefined || item.content.challenge_names===0?"":item.content.challenge_names.map((item,key)=>{
// return(
// <span dangerouslySetInnerHTML={{__html: item}}>{}</span>
// )
// })}
// </div>}

@ -0,0 +1,250 @@
.searchinput{
width: 800px;
margin-top: 53px;
}
.newshixunheadersear{
display: flex;
justify-content: center;
}
.packinput .ant-input{
height: 55px;
width:663px !important;
font-size: 14px;
/*color: #681616 !important;*/
border-color: #E1EDF8 !important;
padding-left: 20px;
}
.packinput .ant-input-group-addon .ant-btn{
width:137px !important;
font-size: 18px;
height: 53px;
background:rgba(76,172,255,1);
}
.tabtitle{
height: 62px !important;
box-shadow: 3px 10px 21px 0px rgba(76, 76, 76, 0.15);
border-radius: 6px;
background: #fff;
display: flex;
justify-content: center;
}
.tabtitles2{
background: #fff;
height: 62px !important;
width: 1200px;
}
.tabtitless{
height: 62px !important;
line-height: 62px !important;
}
.tabtitle1{
}
.tabtitle2{
margin-left: 30px !important;
}
.counttit{
display: flex;
justify-content: center;
}
.counttittext{
text-align: left;
width: 1200px;
height: 18px;
color: #888888;
font-size: 13px;
margin-top: 24px;
}
.counttittexts{
color: #4CACFF !important;
font-size: 13px;
}
.mainx{
display: flex;
justify-content: center;
margin-top: 17px;
}
.project-packages-list{
}
.project-package-item{
display: -webkit-flex;
display: flex;
flex-direction:column;
margin-bottom: 20px;
padding: 20px;
background: white;
/* box-shadow: 1px 3px 3px 1px rgba(156,156,156,0.16); */
}
.xuxianpro{
height: 20px;
border-bottom: 1px dashed;
border-color: #EAEAEA;
margin-bottom: 18px;
}
.magr11{
margin-top: 11px;
}
.highlight{
color: #4CACFF;
}
.fonttext{
font-size: 20px;
font-weight:bold;
}
.fontextcolor{
color: #777777;
}
.tzbq{
margin-left: 68px;
}
.tzbqx{
/* margin-left: 24px; */
}
.bjyss{
background: #F8F8F8;
}
.zj{
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
}
.ziticor{
color: #777777;
font-size: 13px;
}
.foohter{
margin-top: 20px;
display: flex;
flex-direction:row;
}
.maxwidth1100{
max-width: 1100px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
font-size: 18px !important;
font-weight: 500;
color: rgba(51,51,51,1) !important;
}
.newshixunmodelmidfont{
font-size: 14px;
font-weight: 400;
color: #999999;
margin-top: 15px;
margin-left: 30px;
max-width: 1100px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.newshixunmodelbotfont{
font-size:12px;
font-weight:400;
color:rgba(102,102,102,1);
margin-top: 15px;
margin-left: 30px;
}
.newshixunlist{
max-height:227px;
width: 1200px;
}
.xuxianpro {
height: 20px;
border-bottom: 1px dashed;
border-color: #eaeaea;
margin-bottom: 18px;
}
.newshixunpd030{
padding: 0px 30px;
}
.pd303010{
padding: 30px 30px 10px;
}
.newshixunfont12{
font-size: 12px;
color: rgba(76,172,255,1);
line-height: 21px;
}
.newshixunmode{
width: 100px;
height: 38px;
border-radius: 3px;
border: 1px solid rgba(191,191,191,1);
}
.ntopsj {
position: absolute;
top: -4px;
}
.nyslbottomsj {
position: absolute;
bottom: -6px;
}
.inherits .ant-dropdown-menu-item{
cursor: inherit !important;
}
.menus{
width: 91px;
text-align: center;
}
.newshixunmodelbotfont span{
display: inline-block;
margin-right: 34px;
}
.minhegiht300{
min-height: 300px;
}
.newshixunlist:hover{
box-shadow: 1px 6px 16px rgba(156,156,156,0.16);
opacity: 1;
border-radius: 2px;
}
.newshixun500{
max-width: 500px;
overflow: hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
}
.mt3 {
margin-top: 3px !important;
}
.highlight{
color: #4CACFF;
}

@ -1,120 +1,122 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input,Tooltip} from "antd";
import axios from'axios';
import ShixunModal from './ShixunModal'
const Option = Select.Option;
const Search = Input.Search;
class ShixunChooseModal extends Component{
constructor(props){
super(props);
this.state={
shixunmodal: false,
hometypepvisible: false,
}
}
setVisible = (visible) => {
if (visible) {
this.createCommonWork()
} else {
this.setState({ shixunmodal: visible })
}
}
hidecouseShixunModal = () => {
this.setVisible(false)
}
componentDidMount() {
}
funshixunmodallist=(search,type,loading,page)=>{
let{newshixunmodallist}=this.state;
let newshixunmodallists=[]
if(page>1){
newshixunmodallists=newshixunmodallist;
}
this.setState({
hometypepvisible:loading
})
let coursesId=this.props.match.params.coursesId;
let url = this.props.shixunsUrl || "/courses/"+coursesId+"/homework_commons/shixuns.json";
axios.get(url, {
params: {
search: search,
type:type,
page:page
}
}).then((result)=>{
if(result.status===200){
let shixun_list=result.data.shixun_list;
for(var i=0; i<shixun_list.length;i++){
newshixunmodallists.push(shixun_list[i])
}
this.setState({
shixunmodal:true,
shixunmodallist:result.data,
newshixunmodallist:newshixunmodallists,
hometypepvisible:false
})
}
}).catch((error)=>{
console.log(error);
})
}
funpatheditarry=(list)=>{
this.setState({
patheditarry:list
})
}
createCommonWork=()=>{
this.setState({
hometypepvisible:true,
patheditarry:[]
})
let coursesId=this.props.match.params.coursesId;
let url = this.props.shixunsUrl || "/courses/"+coursesId+"/homework_commons/shixuns.json";
axios.get(url).then((result)=>{
if(result.status===200){
this.setState({
shixunmodal:true,
shixunmodallist:result.data,
hometypepvisible:false,
newshixunmodallist:result.data.shixun_list,
})
}
}).catch((error)=>{
console.log(error);
})
}
render(){
let {Searchvalue,type,category_id, datas, shixunmodal, shixunmodallist
, hometypepvisible, newshixunmodallist, patheditarry }=this.state;
let {visible}=this.props;
// console.log(patheditarry)
return(
<ShixunModal
datas={datas}
category_id={this.props.match.params.category_id}
visible={shixunmodal}
shixunmodallist={shixunmodallist}
funshixunmodallist={(search,type,loading,page)=>this.funshixunmodallist(search,type,loading,page)}
hometypepvisible={hometypepvisible}
hidecouseShixunModal={this.hidecouseShixunModal}
newshixunmodallist={newshixunmodallist}
coursesId={this.props.match.params.coursesId}
courseshomeworkstart={(category_id,homework_ids)=> this.props.newhomeworkstart
&& this.props.newhomeworkstart(category_id,homework_ids)}
funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)}
patheditarry={patheditarry}
{...this.props}
></ShixunModal>
)
}
}
import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input,Tooltip} from "antd";
import axios from'axios';
import NewShixunModel from '../coursesPublic/NewShixunModel';
const Option = Select.Option;
const Search = Input.Search;
class ShixunChooseModal extends Component{
constructor(props){
super(props);
this.state={
shixunmodal: false,
hometypepvisible: false,
}
}
setVisible = (visible) => {
// if (visible) {
// this.createCommonWork()
// } else {
//
// }
this.setState({ shixunmodal: visible })
}
hidecouseShixunModal = () => {
this.setVisible(false)
}
componentDidMount() {
}
funshixunmodallist=(search,type,loading,page)=>{
let{newshixunmodallist}=this.state;
let newshixunmodallists=[]
if(page>1){
newshixunmodallists=newshixunmodallist;
}
this.setState({
hometypepvisible:loading
})
let coursesId=this.props.match.params.coursesId;
let url = this.props.shixunsUrl || "/courses/"+coursesId+"/homework_commons/shixuns.json";
axios.get(url, {
params: {
search: search,
type:type,
page:page
}
}).then((result)=>{
if(result.status===200){
let shixun_list=result.data.shixun_list;
for(var i=0; i<shixun_list.length;i++){
newshixunmodallists.push(shixun_list[i])
}
this.setState({
shixunmodal:true,
shixunmodallist:result.data,
newshixunmodallist:newshixunmodallists,
hometypepvisible:false
})
}
}).catch((error)=>{
console.log(error);
})
}
funpatheditarry=(list)=>{
this.setState({
patheditarry:list
})
}
createCommonWork=()=>{
this.setState({
hometypepvisible:true,
patheditarry:[]
})
let coursesId=this.props.match.params.coursesId;
let url = this.props.shixunsUrl || "/courses/"+coursesId+"/homework_commons/shixuns.json";
axios.get(url).then((result)=>{
if(result.status===200){
this.setState({
shixunmodal:true,
shixunmodallist:result.data,
hometypepvisible:false,
newshixunmodallist:result.data.shixun_list,
})
}
}).catch((error)=>{
console.log(error);
})
}
render(){
let {Searchvalue,type,category_id, datas, shixunmodal, shixunmodallist
, hometypepvisible, newshixunmodallist, patheditarry }=this.state;
let {visible}=this.props;
// console.log(patheditarry)
return(
shixunmodal===true?<NewShixunModel
statustype={'published'}
datas={datas}
category_id={this.props.match.params.category_id}
NewShixunModelType={shixunmodal}
shixunmodallist={shixunmodallist}
funshixunmodallist={(search,type,loading,page)=>this.funshixunmodallist(search,type,loading,page)}
hometypepvisible={hometypepvisible}
hideNewShixunModelType={this.hidecouseShixunModal}
newshixunmodallist={newshixunmodallist}
coursesId={this.props.match.params.coursesId}
courseshomeworkstart={(category_id,homework_ids)=> this.props.newhomeworkstart
&& this.props.newhomeworkstart(category_id,homework_ids)}
funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)}
patheditarry={patheditarry}
{...this.props}
></NewShixunModel>:""
)
}
}
export default ShixunChooseModal;

@ -77,7 +77,9 @@ class ExerciseReviewAndAnswer extends Component{
exerciseTotalScore:undefined,
// 加载效果
isSpin:false
isSpin:false,
// 调分数组
ajustSore:undefined
}
}
componentDidUpdate (prevProps) {
@ -190,7 +192,23 @@ class ExerciseReviewAndAnswer extends Component{
user_exercise_status:1,
Id:result.data.exercise_answer_user.user_id,
exerciseTotalScore:result.data.exercise_answer_user.score,
isSpin:false
isSpin:false,
})
// 先将未批的简答题放入到调分数组中
let ajustSore = [];
result.data && result.data.exercise_questions.length>0 && result.data.exercise_questions.map((item,key)=>{
if( item.question_type == 4 && item.answer_status == 0 ){
ajustSore.push({
inputSore:0,
desc:undefined,
id:item.question_id,
position:item.q_position,
setTip:""
})
}
})
this.setState({
ajustSore
})
}
}).catch((error)=>{
@ -227,7 +245,7 @@ class ExerciseReviewAndAnswer extends Component{
}
scrollToAnchor=(index)=>{
let name="Anchor_"+index;
console.log($("#Anchor_"+index).scrollTop());
// console.log($("#Anchor_"+index).scrollTop());
if (index) {
// let anchorElement = document.getElementById(name);
// if(anchorElement) { anchorElement.scrollIntoView(); }
@ -244,62 +262,115 @@ class ExerciseReviewAndAnswer extends Component{
)
}
// 调分
showSetScore=(key,flag,setId)=>{
showSetScore=(key,flag,position,type,id)=>{
this.setState(
(prevState) => ({
exercise_questions : update(prevState.exercise_questions, {[key]: { setScore: {$set: flag == undefined || flag==false ? true : false}}})
}),()=>{
if (setId && (flag == undefined || flag==false)) {
$("html").animate({ scrollTop: $("#Anchor_"+setId).offset().top - 150 })
if (position && type && (flag == undefined || flag==false)) {
$("#input_"+position+"_"+type).focus();
$("html").animate({ scrollTop: $("#Anchor_"+position+"_"+type).offset().top - 150 });
if(id){
let { ajustSore } = this.state;
let obj = ajustSore.filter(obj => obj.id === id).length > 0;
if(!obj){
ajustSore.push({
id,
inputSore:0,
desc:undefined,
position:position,
setTip:""
})
}
}
}
}
)
this.setState({
score:undefined
})
// this.setState({
// score:undefined
// })
}
inputScore=(value)=>{
inputScore=(value,id)=>{
let { ajustSore } = this.state;
var index = ajustSore.map(function (item) { return item.id; }).indexOf(id);
let reg = /^[0-9]+.?[0-9]*$/;
if(reg.test(value)==false){
this.setState({
setTip:"请输入数字"
})
// this.setState({
// setTip:"请输入数字"
// })
this.setState(
(prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入数字"}}})
})
)
return;
}else{
this.setState({
setTip:"",
score:value
})
// this.setState({
// setTip:"",
// score:value
// })
this.setState(
(prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { inputSore: {$set: value},setTip:{$set: ""}}})
})
)
}
}
changeScoreReasons=(e)=>{
console.log(e.target.value);
this.setState({
setScoreReason:e.target.value
})
changeScoreReasons=(e,id)=>{
// console.log(e.target.value);
// this.setState({
// setScoreReason:e.target.value
// })
let value = e.target.value;
let { ajustSore } = this.state;
var index = ajustSore.map(function (item) { return item.id; }).indexOf(id);
this.setState(
(prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: value}}})
})
)
}
//确认调分
setAction=(key,q_id,maxScore)=>{
let{ score,setScoreReason ,setTip }=this.state;
setAction=(key,q_id,maxScore,oldScore)=>{
let {ajustSore}=this.state;
let list = ajustSore.filter(obj => obj.id == q_id);
let index = ajustSore.map(function (item) { return item.id; }).indexOf(q_id);
let score = list[0].inputSore;
let setScoreReason = list[0].desc;
let{ setTip }=this.state;
if(!score && score != 0){
this.setState({
setTip:"请输入分数"
})
// this.setState({
// setTip:"请输入分数"
// })
this.setState(
(prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入分数"}}})
})
)
return;
}
if(score < 0){
this.setState({
setTip:"分数必须大于或者等于0"
})
// this.setState({
// setTip:"分数必须大于或者等于0"
// })
this.setState(
(prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数必须大于或者等于0"}}})
})
)
return;
}
if(score > maxScore){
this.setState({
setTip:"分数不能大于当前题目的分数"
})
// this.setState({
// setTip:"分数不能大于当前题目的分数"
// })
this.setState(
(prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数不能大于当前题目的分数"}}})
})
)
return;
}
if(setTip==""){
@ -311,21 +382,26 @@ class ExerciseReviewAndAnswer extends Component{
}).then((result)=>{
if(result.status==200){
this.props.showNotification('调分成功');
console.log(this.state.exercise_questions);
let statusScore = score==0 ? 0 : score > 0 && score < maxScore ? 2 : 1;
console.log(statusScore);
this.setState(
(prevState) => ({
exercise_questions : update(prevState.exercise_questions, {[key]: { user_score: {$set: score},answer_status : {$set: statusScore},question_comments:{$set:result.data.question_comments} }}),
})
)
console.log(this.state.exercise_questions);
this.setState({
score:undefined,
setTip:"",
setScoreReason:undefined
})
this.showSetScore(key,true);
this.getInfo();
// let statusScore = score==0 ? 0 : score > 0 && score < maxScore ? 2 : 1;
// this.setState(
// (prevState) => ({
// exercise_questions : update(prevState.exercise_questions, {[key]: { user_score: {$set: parseFloat(score).toFixed(1)},answer_status : {$set: statusScore},question_comments:{$set:result.data.question_comments} }}),
// })
// )
// this.setState(
// (prevState) => ({
// ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: undefined},inputSore:{ $set:undefined }}})
// })
// )
// let {exerciseTotalScore} = this.state;
// let newScore = parseFloat(parseFloat(exerciseTotalScore)+parseFloat(score)-parseFloat(oldScore)).toFixed(1);
// this.setState({
// exerciseTotalScore:newScore
// })
// this.showSetScore(key,true);
}
}).catch((error)=>{
console.log(error);
@ -518,12 +594,13 @@ class ExerciseReviewAndAnswer extends Component{
ModalSave,
Loadtype,
exerciseTotalScore,
isSpin
isSpin,
ajustSore
}=this.state
let isAdmin = this.props.isAdmin();
let isStudent =this.props.isStudent();
const { current_user } = this.props
console.log(data&&data.exercise.user_name)
// console.log(data&&data.exercise.user_name)
return(
<div className="newMain" style={{paddingTop:"0px"}}>
<Spin size="large" spinning={isSpin}>
@ -709,6 +786,7 @@ class ExerciseReviewAndAnswer extends Component{
<div>
{
exercise_questions && exercise_questions.map((item,key)=>{
let list = ajustSore && ajustSore.filter(obj => obj.id === item.question_id);
return(
<div className="bor-top-greyE pt30 pb30" id={"Anchor_"+parseInt(key+1)}>
<p className="clearfix font-16 pl30 pr30">
@ -716,32 +794,32 @@ class ExerciseReviewAndAnswer extends Component{
<span className="fr">
{
// 填空(一直都有调分),和简答题调分:老师身份 已经评分的才能出现调分按钮
isAdmin && ((parseInt(item.answer_status) != 0 && item.question_type == 4) || item.question_type == 3) ?
<WordsBtn style="blue" className="mr20 font-16 fl" onClick={()=>this.showSetScore(key,item.setScore,item.q_position+"_"+item.question_type)}>调分</WordsBtn>:""
isAdmin && ((parseInt(item.answer_status) != 0 && item.question_type == 4) || item.question_type == 3 || item.question_type == 1) ?
<WordsBtn style="blue" className="ml20 font-16 fl" onClick={()=>this.showSetScore(key,item.setScore,item.q_position,item.question_type,item.question_id)}>调分</WordsBtn>:""
}
{
// 简答题,未评分的显示未批
isAdmin && parseInt(item.answer_status) == 0 && item.question_type == 4 ?
<span className="color-red fl mr20">未批</span>:""
<span className="color-red fl ml20">未批</span>:""
}
{
// 客观题:老师||学生(试卷已截止且答案公开)显示正确答案
item.question_type < 3 && item.standard_answer_show ?
<span className="font-16 ml20">
<span className="font-16 fl ml20">
正确答案{ item.standard_answer_show }
</span>:""
}
{
//(老师身份且除实训题外) || (学生身份且试卷已经截止)就显示用户当前题目所得分数
( isAdmin || (isStudent && exercise.exercise_status == 3)) && item.question_type != 5 && item.user_score ?
<span className="font-16 ml20">
<span className="font-16 ml20 fl">
<span><span className={parseInt(item.answer_status) == 0 ?"color-red":parseInt(item.answer_status) == 1 ?"color-green":"color-orange-tip"}>{item.user_score}</span> </span>
</span> : ""
}
{
//实训题 ,答题
item.question_type == 5 &&
<a href={"/shixuns/"+item.shixun_identifier+"/challenges"} target="_blank" class="font-16 color-blue" target={"_blank"}>实训详情</a>
<a href={"/shixuns/"+item.shixun_identifier+"/challenges"} target="_blank" class="font-16 color-blue fl" target={"_blank"}>实训详情</a>
}
</span>
</p>
@ -825,7 +903,7 @@ class ExerciseReviewAndAnswer extends Component{
{
//调分理由部分
item.question_comments && item.question_comments.comment && (item.question_type == 3 || item.question_type == 4) &&
item.question_comments && item.question_comments.comment && (item.question_type == 3 || item.question_type == 4 || item.question_type == 1) &&
<div className="ml30 mr30 bor-top-greyE pt30 mt20 clearfix df">
<img src={getImageUrl(`images/${item.question_comments.user_picture}`)} width="48" height="48" className="radius mr10"/>
<div className="flex1">
@ -839,7 +917,7 @@ class ExerciseReviewAndAnswer extends Component{
}
{
// 调分输入部分
isAdmin && ((item.setScore && item.question_type == 3) || ((item.setScore || parseInt(item.answer_status) == 0) && item.question_type == 4))?
isAdmin && ((item.setScore && item.question_type == 3) || (item.setScore && item.question_type == 1) || ((item.setScore || parseInt(item.answer_status) == 0) && item.question_type == 4))?
<div className="ml30 mr30 bor-top-greyE pt20 mt20" id={`${"Anchor_"+item.q_position+"_"+item.question_type}`}>
<div className="edu-txt-right">
<span><span className="color-red">*</span></span>
@ -848,25 +926,26 @@ class ExerciseReviewAndAnswer extends Component{
<InputNumber
placeholder="请填写分数"
min={0}
max={item.question_score}
value={score}
// max={item.question_score}
value={list && list.length>0 && list[0].inputSore}
step={0.1}
precision={1}
className={ setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"}
onChange={this.inputScore}
className={ list && list.length>0 && list[0].setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"}
onChange={(value)=>this.inputScore(value,item.question_id)}
id={`${"input_"+item.q_position+"_"+item.question_type}`}
></InputNumber>
<span className="ml5"></span>
{
parseInt(item.answer_status) == 0 && item.question_type == 4 ? <span className="color-red ml10 font-16">未评分</span> : ''
}
<ActionBtn style="blue" className="middle ml20" onClick={()=>this.setAction(key,item.question_id,item.question_score)}>确认</ActionBtn>
<ActionBtn style="blue" className="middle ml20" onClick={()=>this.setAction(key,item.question_id,item.question_score,item.user_score)}>确认</ActionBtn>
</p>
{
setTip !="" ? <p className="color-red edu-txt-left">{setTip}</p> :""
list && list.length > 0 && list[0].setTip !="" ? <p className="color-red edu-txt-left">{ list[0].setTip }</p> :""
}
</li>
</div>
<Textarea className="winput-100-150 mt20" value={setScoreReason} style={{height:"180px"}} maxLength="100" onChange={this.changeScoreReasons} placeholder="请您输入评语最大限制100个字符"></Textarea>
<Textarea className="winput-100-150 mt20" value={list && list.length>0 && list[0].desc} style={{height:"180px"}} maxLength="100" onChange={(e)=>this.changeScoreReasons(e,item.question_id)} placeholder="请您输入评语最大限制100个字符"></Textarea>
</div>:""
}
</div>

@ -35,10 +35,15 @@ class ShixunWorkDetails extends Component {
}
}).then((result) => {
if (result.status === 200) {
this.setState({
data:result.data,
spinning:false
})
if (result.data.status === 403 || result.data.status === 401 || result.data.status === 407 || result.data.status === 408|| result.data.status === 409 || result.data.status === 500) {
}else{
this.setState({
data:result.data,
spinning:false
})
}
}
}).catch((error) => {
console.log(error)
@ -50,7 +55,33 @@ class ShixunWorkDetails extends Component {
shixuntypes:type[3]
})
}
updatas=()=>{
this.setState({
spinning:true
})
let homeworkid=this.props.match.params.homeworkid;
let userid=this.props.match.params.userid;
let url = "/homework_commons/"+homeworkid+"/code_review_detail.json";
axios.get(url,{
params: {
user_id:userid,
}
}).then((result) => {
if (result.status === 200) {
if (result.data.status === 403 || result.data.status === 401 || result.data.status === 407 || result.data.status === 408|| result.data.status === 409 || result.data.status === 500) {
}else{
this.setState({
data:result.data,
spinning:false
})
}
}
}).catch((error) => {
console.log(error)
})
}
goback=(sum)=>{
// let{data}=this.state
// if(sum===1){
@ -102,14 +133,18 @@ class ShixunWorkDetails extends Component {
<span className="fl color-orange font-14">非编程类型任务不参与查重</span>
<span className="fr mt4">
<span className={"color656565"}>被查作品</span>
<span className={"mr20"}>{data&&data.username}</span>
<span className={"color-orange"}>{data&&data.final_score}</span>
<span className={"mr50"}><span className={"color-orange"}>{data&&data.username}</span></span>
{data&&data.eff_score===null||data&&data.eff_score===undefined||data&&data.eff_score_full===null||data&&data.eff_score_full===undefined?"":<span className={"mr50"}>效率分<span className={"color-orange"}>{data&&data.eff_score}</span>/{data&&data.eff_score_full}</span>}
<span className={""}>最终成绩<span className={"color-orange"}>{data&&data.final_score}</span></span>
</span>
</div>
<div className="stud-class-set bor-bottom-greyE">
<div className="clearfix edu-back-white poll_list">
<ShixunCustomsPass
{...this.props}
{...this.state}
updatas={()=>this.updatas()}
data={data}
/>
</div>

@ -1,10 +1,10 @@
import React, {Component} from "react";
import {WordsBtn} from 'educoder';
import {Table} from "antd";
import {Table,InputNumber} from "antd";
import {Link,Switch,Route,Redirect} from 'react-router-dom';
import moment from 'moment';
import { MonacoDiffEditor } from 'react-monaco-editor';
import axios from 'axios';
class ShixunCustomsPass extends Component {
constructor(props) {
@ -18,10 +18,51 @@ class ShixunCustomsPass extends Component {
componentDidMount() {
}
editgame_scores=(e,id,maxsum,code_rate,copy_user_id)=>{
let{datas}=this.state;
let newdatas=datas;
let score=e.target.value;
if(score!=null&&score!=undefined&&score!=""){
if(score<0){
this.props.showNotification("不能小于0");
this.setState({
customsids:id
})
}else if(score>maxsum){
this.props.showNotification(`不能大于关卡分值${maxsum}`);
this.setState({
customsids:id
})
}else{
let work_id=this.props.data.work_id;
let url=`/student_works/${work_id}/adjust_review_score.json`
axios.post(url,{
type:"review",
score:score,
challenge_id:id,
code_rate:code_rate,
copy_user_id:copy_user_id
}).then((result)=>{
if(result.data.status===0){
this.props.updatas();
this.props.showNotification(result.data.message);
}else{
this.props.showNotification(result.data.message);
}
}).catch((error)=>{
})
}
}else{
this.props.showNotification("调分为空将不会修改之前的分数");
}
}
render() {
let {data}=this.props;
console.log(data)
let {customsids}=this.state;
// console.log(data)
let datas=[];
data&&data.challenge_list.forEach((item,key)=>{
@ -33,6 +74,8 @@ class ShixunCustomsPass extends Component {
finishtime:item.copy_username,
elapsedtime:item.copy_end_time===null?"无":item.copy_end_time===undefined?"无":item.copy_end_time===""?"无":moment(item.copy_end_time).format('YYYY-MM-DD HH:mm:ss'),
empvalue:item.code_rate,
challenge_id:{id:item.id},
copy_user_id:item.copy_user_id
// adjustmentminute:asdasd
})
})
@ -112,6 +155,22 @@ class ShixunCustomsPass extends Component {
render: (text, record) => (
<span className={"color-grey-9"}>
{record.elapsedtime}
</span>
),
},{
title: '调分',
key: 'adjustmentminute',
dataIndex: 'adjustmentminute',
render: (text, record) => (
<span>
<a>
{record.copy_user_id===null?"":<InputNumber size="small" className={customsids===record.challenge_id.id?"bor-red":""} defaultValue={record.evaluating.final_score}
onBlur={(e) => this.editgame_scores(e,record.challenge_id.id,record.evaluating.all_score,record.empvalue,record.copy_user_id)}
// min={0} max={record.game_scores.game_score_full}
/>}
</a>
{/*<a style={{textAlign: "center"}} className="color-blue font-14 mr20">查看</a>*/}
</span>
),
}, {
@ -138,7 +197,15 @@ class ShixunCustomsPass extends Component {
// },
if(this.props.isAdmin()===false){
columns.some((item,key)=> {
if (item.title === "调分") {
columns.splice(key, 1)
return true
}
}
)
}
return (
<div>
@ -177,6 +244,9 @@ class ShixunCustomsPass extends Component {
.customsPass{
text-align: left !important;
}
.ant-table-thead > tr > th, .ant-table-tbody > tr > td {
padding: 16px 12px;
}
`}
</style>
{datas===undefined?"":<Table

@ -6,6 +6,7 @@ import axios from'axios';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import ShixunModal from "../coursesPublic/ShixunModal";
import PathModal from "../coursesPublic/PathModal";
import NewShixunModel from '../coursesPublic/NewShixunModel';
import AddcoursesNav from "../coursesPublic/AddcoursesNav";
import Modals from '../../modals/Modals';
import moment from 'moment';
@ -445,18 +446,18 @@ class ShixunHomework extends Component{
}
// 选用实训
createCommonWork=()=>{
this.setState({
hometypepvisible:true,
shixunmodal:true,
patheditarry:[],
checkBoxValues:[]
})
}
// // 选用实训
// createCommonWork=()=>{
//
// this.setState({
// hometypepvisible:true,
// shixunmodal:true,
// patheditarry:[],
// checkBoxValues:[]
// })
//
//
// }
// 选用实训路径
createCommonpath=()=>{
@ -502,9 +503,9 @@ class ShixunHomework extends Component{
// }).then((result)=>{
// if(result.status===200){
//
// let shixun_list=result.data.shixun_list;
// for(var i=0; i<shixun_list.length;i++){
// newshixunmodallists.push(shixun_list[i])
// let shixun_lists=result.data.shixun_lists;
// for(var i=0; i<shixun_lists.length;i++){
// newshixunmodallists.push(shixun_lists[i])
// }
// this.setState({
// shixunmodal:true,
@ -540,9 +541,9 @@ class ShixunHomework extends Component{
// }).then((result)=>{
// if(result.status===200){
//
// let shixun_list=result.data.subject_list;
// for(var i=0; i<shixun_list.length;i++){
// newshixunmodallists.push(shixun_list[i])
// let shixun_lists=result.data.subject_list;
// for(var i=0; i<shixun_lists.length;i++){
// newshixunmodallists.push(shixun_lists[i])
// }
// this.setState({
// shixunpath:true,
@ -896,6 +897,18 @@ class ShixunHomework extends Component{
this.props.history.push(this.props.current_user.first_category_url);
}
}
showNewShixunModelType=()=>{
this.setState({
NewShixunModelType:true,
patheditarry:[],
checkBoxValues:[]
})
}
hideNewShixunModelType=()=>{
this.setState({
NewShixunModelType:false
})
}
render(){
let {
modalname,
@ -931,7 +944,7 @@ class ShixunHomework extends Component{
course_modules,
shixunpath,
order,
antIcon,
NewShixunModelType,
}=this.state;
let main_id=this.props.match.params.main_id;
@ -940,6 +953,23 @@ class ShixunHomework extends Component{
return(
<React.Fragment >
<div>
{/*新版实训model*/}
{NewShixunModelType===true?<NewShixunModel
{...this.props}
{...this.state}
category_id={this.props.match.params.category_id}
type={'shixuns'}
hideNewShixunModelType={()=>this.hideNewShixunModelType()}
coursesId={this.props.match.params.coursesId}
homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)}
Coursename={Coursename}
page={page}
order={order}
statustype={'published'}
/>:""}
{/*提示*/}
{Modalstype&&Modalstype===true?<Modals
modalsType={this.state.Modalstype}
@ -973,23 +1003,23 @@ class ShixunHomework extends Component{
getcourse_groupslist={(id)=>this.getcourse_groupslist(id)}
/>:""}
{/*选择实训*/}
{shixunmodal===true?<ShixunModal
{...this.props}
{...this.state}
datas={datas}
category_id={this.props.match.params.category_id}
visible={shixunmodal}
shixunmodallist={shixunmodallist}
homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)}
hometypepvisible={hometypepvisible}
hidecouseShixunModal={this.hidecouseShixunModal}
newshixunmodallist={newshixunmodallist}
coursesId={this.props.match.params.coursesId}
courseshomeworkstart={(category_id,homework_ids)=>this.newhomeworkstart(category_id,homework_ids)}
funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)}
patheditarry={patheditarry}
/>:""}
{/*/!*选择实训*!/*/}
{/*{shixunmodal===true?<ShixunModal*/}
{/*{...this.props}*/}
{/*{...this.state}*/}
{/*datas={datas}*/}
{/*category_id={this.props.match.params.category_id}*/}
{/*visible={shixunmodal}*/}
{/*shixunmodallist={shixunmodallist}*/}
{/*homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)}*/}
{/*hometypepvisible={hometypepvisible}*/}
{/*hidecouseShixunModal={this.hidecouseShixunModal}*/}
{/*newshixunmodallist={newshixunmodallist}*/}
{/*coursesId={this.props.match.params.coursesId}*/}
{/*courseshomeworkstart={(category_id,homework_ids)=>this.newhomeworkstart(category_id,homework_ids)}*/}
{/*funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)}*/}
{/*patheditarry={patheditarry}*/}
{/*/>:""}*/}
{shixunmodal===true||shixunpath===true?<style>
{
@ -1051,7 +1081,7 @@ class ShixunHomework extends Component{
</span>:
<WordsBtn style="blue" onClick={()=>this.editDir(datas&&datas.category_name)} className={"mr30 font-16"}>目录重命名</WordsBtn>:""}
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?<WordsBtn style="blue" className="mr30 font-16" onClick={this.createCommonpath}>选用实践课程</WordsBtn>:"":""}
{this.props.isAdmin()===true?<a className={"btn colorblue font-16"} onClick={()=>this.createCommonWork()}>选用实训</a>:""}
{this.props.isAdmin()===true?<a className={"btn colorblue font-16"} onClick={()=>this.showNewShixunModelType()}>选用实训</a>:""}
</li>
</p>

@ -6,7 +6,7 @@ import axios from 'axios';
import './index.scss';
import CustomLoadable from "../../../CustomLoadable";
import Curriculum from "../../../modules/ecs/curriculum/Curriculum"
const { Step } = Steps;
const TrainingObjective = CustomLoadable(() => import('./TrainingObjective/index'))
@ -101,6 +101,12 @@ class EcSetting extends React.Component {
<Switch>
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/training_objectives'
render={ (props) => (<TrainingObjective {...this.props} {...props} {...this.state} />) }></Route>
{/*课程体系*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses'
render={ (props) => (<Curriculum {...this.props} {...props} {...this.state} />) }></Route>
{/*课程体系VS毕业要求*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/requirement_vs_courses'
render={ (props) => (<TrainingObjective {...this.props} {...props} {...this.state} />) }></Route>
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/graduation_requirement'
render={ (props) => (<GraduationRequirement {...this.props} {...props} {...this.state} />) }></Route>

@ -0,0 +1,27 @@
.newedu-class-container{
width:1240px;
height:84px;
}
.ecnewbutton{
width:68px;
height:30px;
background:rgba(76,172,255,1);
border-radius:2px;
float:right;
}
.newedu-title-bottom{
width:1240px;
height:65px;
}
.edu-con-bottom {
padding: 10px 0;
background: #fff;
font-size: 16px;
}
.TabledataSource .ant-table-wrapper{
width: 1240px;
}
.ant-table-thead{
background:rgba(245,245,245,1);
}

@ -0,0 +1,576 @@
.TrainingLecturer{
font-size:18px;
font-family:MicrosoftYaHei;
font-weight:400;
color:#656565;
}
.TrainingTheory{
font-size:18px;
font-family:MicrosoftYaHei;
font-weight:400;
color:#05101A !important;
}
#SystemParameters{
height: 81px;
line-height: 40px;
}
#SystemParameters .SystemParameters:nth-child(1){
font-size:14px;
font-family:MicrosoftYaHei;
font-weight:400;
/* color:#989898 !important; */
}
#SystemParameters .SystemParameters:nth-child(2){
font-size:14px;
font-family:MicrosoftYaHei;
font-weight:400;
color:#989898 !important;
}
.operationright{
float:right !important;
}
.ml75{
margin-left:75px;
}
.mlim30{
margin-left:30px !important;
}
.RadioGroupbox{
display: inline-block;
width: 100px;
height: 25px;
position: relative;
}
.RadioGroupboxab{
position: absolute;
top: -5px;
left: 30px;
}
.buttoninline{
display: inline-block;
margin-left: 29px;
position: relative;
/* width: 100px; */
margin-top: 0px;
height: 25px;
}
.placeholder::-moz-placeholder{font-size:12px;}
.placeholder::-webkit-input-placeholder{font-size:12px;}
.placeholder:-ms-input-placeholder{font-size:12px;}
.mr16{
margin-right:16px;
}
.defalutSubmitbtn{
cursor: pointer;
}
.defalutCancelbtn{
cursor: pointer;
}
.newSystem{
background: #fff;
}
/* #EvaluationsList{
padding:20px 0px;
} */
.mt55{
margin-top:55px !important;
}
.mb100{
margin-bottom:100px !important;
}
.mt26{
margin-top:26px !important;
}
.mb80{
margin-bottom:80px !important;
}
.color99{
color:#999999;
}
.ant-select-selection__placeholder{
width: 100%;
font-size:14px;
height:58px;
}
.mt70{
margin-top:70px;
}
.mb50{
margin-bottom:50px;
}
/* 谷歌 */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
appearance: none;
margin: 0;
font-size:14px;
}
/* 火狐 */
input{
-moz-appearance:textfield;
font-size:14px;
}
.ColorF68{
color:#FF6800;
}
.eaSystemp a{
color:#05101a;
}
.eaSystemp span{
color: #05101a !important;
}
.editorModify div .ant-input-lg{
font-size: 14px;
}
#Coursemultiple div div ul .ant-select-selection__choice{
margin-left: 0px;
height: 20px !important;
min-height: 29px;
font-size: 14px;
line-height: 27px;
margin-top: 4px;
margin-bottom: 3px;
}
#Coursemultiple .ant-select-selection--multiple{
min-height: 40px !important;
line-height: 38px !important;
}
#Coursemultiple div div ul .ant-select-search.ant-select-search--inline{
margin-left: 0px;
height: 20px !important;
min-height: 29px;
font-size: 14px;
line-height: 27px;
margin-top: 4px;
margin-bottom: 3px;
}
.neweditSubentry{
position: relative;
top: -4px;
left: 7px;
}
.nulleditSubentry{
position: relative;
top: -4px;
left: 3px;
}
.percentage{
margin-left: 8px;
padding-left: 25px !important;
}
.Coursetitle{
margin-bottom:0px !important;
}
.textaligncenter{
padding-left: 30px !important;
width: 70px !important;
}
.ml72{
margin-left:72px;
}
.bordereaeaea{
border-bottom: 1px solid transparent !important;
}
.ecnowrap{
max-width: 170px;
display: inline-block;
overflow: hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
color: #40a9ff !important;
margin-right: 108px;
}
.ecblock{
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.Spinlarge{
text-align: center;
width: 100%;
margin-top: 25px;
margin-bottom: 25px;
}
/* .ant-select-search{
display:none;
}
.ant-select-search--inline{
display:none;
} */
.boxinline-block{
display: inline-block;
}
.boxinline{
margin-right: 20px;
}
.evaluationdataClass{
margin-left: 217px !important;
width: 589px !important;
display: inline-block;
}
.absolute{
position:absolute;
}
.ml115{
margin-left: 115px;
}
.ml100{
margin-left: 100px;
}
.Importclassroomdata{
position: absolute;
right: 18px;
top: 26px;
}
.Importclassroomdatas{
position: absolute;
right: 375px!important;
top: 122px !important;
}
.Importclassroomdatass {
position: absolute;
right: 375px !important;
top: 248px !important;
}
#SystemParameters{
position: relative;
}
.newSystem .newtarget_scoreclass{
padding: 10px 0px !important;
margin: 0px 20px !important;
}
.newSystem .newtarget_target{
padding: 10px 0px !important;
margin: 0px 30px !important;
border-bottom:1px solid transparent !important;
}
.nowrap329{
max-width: 329px !important;
text-align: left;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
color:transparent !important;
min-width: 329px !important;
}
.ListTableLine li>.column-500{
max-width: 360px !important;
text-align: left;
min-width: 360px !important;
}
.color-666{
color:#666666 !important;
}
.color-05101A{
color:#05101A !important;
}
#SystemParametersP{
position:relative;
margin-bottom:0px !important;
}
.major_name{
cursor:inherit;
}
.padding1030{
padding: 10px 30px;
height: 60px !important;
}
.color-red{
color:#DD1717;
}
.color-redFF{
color:#FF6666;
}
.margin-left63{
margin-left: 63px !important;
}
.colorTransparent{
color:transparent !important;
}
.color999{
color: #999999 !important;
}
.operationrightbotton{
margin-top: 2px!important;
margin-right: -25px;
}
.mr2{
margin-right:2px;
}
.colorFF6800{
color: #FF6800 !important;
}
.lineheight60{
line-height: 52px !important;
}
.mr13{
margin-right: 13px;
}
.mr14{
margin-right: 14px;
}
.ecmorelist{
margin: 0 auto;
width: 100px;
/* height: 100px; */
display: block;
}
.padding10im{
padding: 10px 0px !important;
}
.lipadding10im{
margin: 0 0px!important;
}
.lipadding20im{
padding: 10px 20px!important;
}
.marlr19{
margin: 0 19px!important;
}
.mrj15{
margin-right: -15px;
}
.margin64px{
margin: 0 64px!important;
}
.marginright84{
margin-right: 84px!important;
}
.marginright162{
margin-right: 162px;
}
.width86{
width: 86px!important;
}
.ant-modal-mask {
background-color: rgba(5,16,26,0.4);
}
.ecmodeldelet{
/* 考虑有各种尺寸的屏幕,用比例 */
top:36%;
}
.ecmodeldelet .ant-modal-header{
padding: 0px 24px;
}
.ecmodeldelet .ant-modal-title{
padding: 0px 15px;
text-align: center;
box-sizing: border-box;
line-height: 70px;
height: 70px;
border-radius: 10px 10px 0px 0px;
font-size: 16px;
font-weight: bold;
}
a.TrainingLecturer:hover{
color:#4CACFF !important;
}
.newSystem .lipadding10im{
margin: 0 0px!important;
}
.operationleft{
float:left !important;
}
.color4D4D4D{
color:#4D4D4D !important;
}
/* #SystemParameters .SystemParameters:nth-child(1){
color:#4D4D4D !important;
} */
.color4CACFF{
color:#4CACFF !important;
}
.SystemParameters4CACFF{
font-size:14px;
font-family:MicrosoftYaHei;
font-weight:400;
line-height: 45px;
}
.detaillist{
text-align: center !important;
width: 133px !important;
height: 24px ;
}
.associatedclass{
margin-right: 128px !important;
}
.associatedclasslist{
width: 234px;
height: 20px;
font-size: 14px;
font-family: MicrosoftYaHei;
font-weight: 400;
color: rgba(101,101,101,1);
line-height: 22px;
margin: 6px auto;
}
.associatedclasslists{
width: 323px;
height: 35px;
font-size: 14px;
font-family: MicrosoftYaHei;
font-weight: 400;
color: rgba(101,101,101,1);
line-height: 22px;
margin: 6px auto;
margin-bottom: 15px;
}
.newecmodeldelet{
width:600px !important;
top:100px;
}
.assclasslistsearch{
width:454px;
height:36px;
background:rgba(244,244,244,1);
border:1px solid rgba(234,234,234,1);
border-radius:4px;
position: relative;
}
.assclassposition{
position: absolute;
top: 3px;
left: 9px;
}
.assclasslistsearchbtn{
width: 64px;
height: 35px !important;
font-weight: 300 !important;
line-height: 35px !important;
}
.btnweight{
font-weight: 300 !important;
color: #fff !important;
}
.CBCBCB{
background:#CBCBCB!important;
}
.clear{
clear: both;
}
.ml120{
margin-left: 120px;
}
.ml88{
margin-left: 88px;
}
.assclasslistmid{
width: 540px;
height: 282px;
background: rgba(244,250,255,1);
border-radius: 4px;
margin-left: 10px;
overflow: auto;
padding-top: 10px;
}
.assclasslistsubmit{
margin-top: 26px !important;
margin-bottom: 8px !important;
}
.ant-modal-header{
border-top-left-radius:10px;
border-top-right-radius:10px;
}
.ant-modal-content{
border-radius: 10px;
}
.assclasslistmidname{
width: 160px;
overflow: hidden;
/* height: 24px; */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.bordereaeaeas{
border-bottom: 1px solid #eaeaea !important;
}
.isreloadsbtn{
width: 80px !important;
font-weight: 400 !important;
padding: 0px !important;
padding-left: 10px !important;
}
.f5f5f5{
color:rgb(245, 245, 245) !important;
}
.ant-select-selection{
border-radius: 0px !important;
background-color: #F5F5F5;
}
.ant-select-selection:focus{
border-radius: 0px !important;
background-color: #fff;
border-color: #d9d9d9 !important;
}
.listchildbox{
overflow: hidden;
}
.listchildboxs{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ant-input:focus, .ant-input:hover{
border-color: transparent;
}
.inputWeight{
background-color: #F5F5F5;
}
.inputWeight:focus {
background-color: #fff;
}
.ant-input:focus {
outline: 0;
-webkit-box-shadow: 0 0 0 2px transparent !important;
box-shadow: 0 0 0 2px transparent !important;
}
.ant-input{
border-color: #d9d9d9 !important;
}
.mt60{
margin-top:60px;
}
.SystemParameters{
height:auto;
}

@ -0,0 +1,368 @@
.eaSystemp a{
color:#05101a;
}
.eaSystemp span{
color: #05101a !important;
}
.eacourse p{
height:84px;
margin-bottom:0px !important;
}
.eacourse #training_objective_contents{
height:81px;
}
.courseSystem{
font-size:18px;
font-family:MicrosoftYaHei;
font-weight:400;
line-height:45px;
color:rgba(5,16,26,1);
}
.SystemParameters{
font-size:14px;
font-family:MicrosoftYaHei;
font-weight:400;
line-height:45px;
color:rgba(50,50,50,1);
}
.SystemParametersysls{
font-size:14px;
font-family:MicrosoftYaHei;
font-weight:400;
color:rgba(50,50,50,1);
}
.Systemnum{
font-size:14px;
font-family:MicrosoftYaHei;
font-weight:400;
color:#FF6800;
}
.newSystem{
width:1200px;
overflow:auto;
background: #FFF;
}
.newSystem .clearfix .column-1{
width: 113px !important;
text-align: center;
}
.operationColumn{
margin: 0px 10%;
width:100%;
height:100%;
}
.operationalter{
margin: 20px 16px;
}
.SystemModifythelist .column-1{
width: 120px !important;
text-align: center;
}
.SystemModifythelist .column-3{
padding-left: 96px;
margin-right: 23px;
}
.operationright{
float:right !important;
}
.newSystem p{
/*padding: 10px 33px !important;*/
margin-bottom: 0em;
}
.newSystem li{
margin:0 !important;
}
.SystemModifythelist{
background:#FFF !important;
}
.SystemModifythelist .column-1:nth-child(1){
margin-left: 7px;
}
.Systempoint{
font-size:12px;
font-family:MicrosoftYaHei;
font-weight:400;
color:rgba(152,152,152,1);
}
.editorModify{
background:#FFF !important;
}
.newSystem .editorModify .column-1{
width: 194px !important;
text-align: left;
margin-left: 30px;
}
.newSystem .editorModify .column-1:nth-child(1){
margin-right: 510px;
}
.editorModify .ant-select{
width: 556px !important;
margin-left: 36px;
}
.editorModify .ant-select .ant-select-selection{
height: 30px !important;
}
.editorModify .ant-select .ant-select-selection .ant-select-selection__rendered{
height: 30px !important;
}
.editorModify .ant-select .ant-select-selection .ant-select-selection__rendered .ant-select-selection-selected-value{
line-height: 30px !important;
}
.inputWeight{
width: 20%;
font-size:14px;
height:30px;
margin-left: 20px;
background-color: #F5F5F5;
}
.SetTheAssociated{
width: 314px;
height: 30px;
float: right;
margin-right: -3.5%;
}
.SetTheAssociatedchild{
width: 120px;
height: 30px;
background: rgba(255,255,255,1);
border: 1px solid rgba(234,234,234,1);
border-radius: 4px;
float: left;
margin-right: 10px;
text-align: center;
line-height: 30px;
/*margin-left: 34px;*/
}
.operatebutton{
margin-left: 20px;
/* margin-top: 16px; */
}
.editbulebutton{
width:120px;
height:30px;
background:rgba(76,172,255,1);
border-radius:2px;
color:#FFF;
text-align: center;
line-height: 30px;
}
.editglybutton{
width:120px;
height:30px;
border:1px solid rgba(205,205,205,1);
border-radius:2px;
color:#999;
text-align: center;
line-height: 30px;
}
.editglybuttonbox{
width: 275px;
margin-bottom: 30px;
margin-right: 20px;
margin-right:7%;
}
.editglybuttonboxs{
width: 275px;
margin-bottom: 30px;
margin-right: 20px;
margin-right:3%;
}
.defalutCancelbtn:hover {
border: 1px solid #B2B2B2;
color: #B2B2B2!important;
}
.gouxuanbule{
color:#4CACFF;
}
.gouxuanwhite{
color:#FFF;
}
.icon-gouxuan{
cursor: pointer;
}
/* 谷歌 */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
appearance: none;
margin: 0;
}
/* 火狐 */
input{
-moz-appearance:textfield;
}
.inputWeight{
text-indent:0.625rem;
}
.columnlocation{
height: 40px;
line-height: 40px;
}
.paddingLF{
padding:0 33px;
}
.width20{
width: 20px;
height: 20px;
text-align: center;
}
.defalutSubmitbtn,.defalutCancelbtn{
cursor: pointer;
}
.mb290{
margin-bottom:290px;
}
.Spinlarge{
text-align: center;
width: 100%;
margin-top: 25px;
margin-bottom: 25px;
}
.DDred{
color:#DD1717;
}
.color-666{
color:#666666 !important;
}
.color-05101A{
color:#05101A !important;
}
.ec_graduation_name{
margin-right:20px !important;
}
.column-width575{
color: transparent !important;
}
.column-width130{
width: 130px !important;
height: 40px;
}
.ListTableLine li>span {
max-width: 550px !important;
}
.graduateRequirement .clearfix .column-1 {
width: 76px!important;
}
.newrightcalculatebutton{
width: 50px;
height: 25px;
border: 1px solid rgba(76,172,255,1);
border-radius: 1px;
line-height: 25px;
text-align: center;
margin-top: 7px;
cursor: pointer;
color: rgba(76,172,255,1);
}
.newrightcalculatebuttons{
width: 50px;
height: 25px;
border: 1px solid rgba(76,172,255,1);
border-radius: 1px;
line-height: 25px;
text-align: center;
margin-top:9px;
cursor: pointer;
color: rgba(76,172,255,1);
}
.columnbox{
height: 53px;
overflow: hidden;
}
.ant-modal-mask {
background-color: rgba(5,16,26,0.4);
}
.ecmodeldelet{
top:300px;
}
.ecmodeldelet .ant-modal-header{
padding: 0px 24px;
}
.ecmodeldelet .ant-modal-title{
padding: 0px 15px;
text-align: center;
box-sizing: border-box;
line-height: 70px;
height: 70px;
border-radius: 10px 10px 0px 0px;
font-size: 16px;
font-weight: bold;
}
.bor-red {
border: 1px solid #db0505 !important;
}
.ml93{
margin-left:93px;
}
.ml26{
margin-left: 26px;
}
.finishtarget{
width: 69px;
/* height: 48px; */
line-height: 20px;
text-align: center;
margin-right: 48px;
}
.bordereaeaea{
border-bottom: 1px solid transparent !important;
}
.heightimportant{
height: 30px !important;
background-color: #F5F5F5;
}
.heightimportant:focus {
background-color: #fff;
}
.inputWeight:focus {
background-color: #fff;
}
.heightlineimportant{
line-height: 30px !important;
}
.ant-select-selection:hover{
border-color: #d9d9d9 !important;
}
.ant-input:focus {
outline: 0;
-webkit-box-shadow: 0 0 0 2px transparent !important;
box-shadow: 0 0 0 2px transparent !important;
}
.ant-input{
border-color: #d9d9d9 !important;
}
.ant-select-selection:focus{
-webkit-box-shadow: 0 0 0 2px transparent !important;
box-shadow: 0 0 0 2px transparent !important;
}
.ant-select-selection:active{
-webkit-box-shadow: 0 0 0 2px transparent !important;
box-shadow: 0 0 0 2px transparent !important;
}
.ant-select-selection:focus{
border-color: #d9d9d9 !important;
}
.ant-select-selection{
-webkit-box-shadow: 0 0 0 2px transparent !important;
box-shadow: 0 0 0 2px transparent !important;
}
.mt60{
margin-top:60px;
}

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#333333" d="M463.9 804.4c-194.7 0-353.1-158.4-353.1-353.1S269.2 98.2 463.9 98.2 817 256.6 817 451.3 658.6 804.4 463.9 804.4z m0-651.9c-164.8 0-298.8 134-298.8 298.8s134 298.8 298.8 298.8 298.8-134 298.8-298.8-134-298.8-298.8-298.8zM884.9 926.6c-7.2 0-14.4-2.9-19.8-8.6l-198-210.6c-10.3-10.9-9.7-28.1 1.2-38.4 10.9-10.3 28.1-9.8 38.4 1.2l198 210.6c10.3 10.9 9.7 28.1-1.2 38.4-5.2 5-11.9 7.4-18.6 7.4z" /></svg>

After

Width:  |  Height:  |  Size: 674 B

@ -0,0 +1,245 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import axios from 'axios';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder'
import { message,Modal,Spin,Icon} from 'antd';
import 'antd/dist/antd.css';
import EcTitleCourseEvaluations from '../ecTitle/ecTitle'
import '../css/ecCourseSupports.css';
import '../css/ecCourseEvaluations.css';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from "../../../Loading";
const Curriculumtwo = Loadable({
loader: () => import('./Curriculumtwo'),
loading: Loading,
})
const $ = window.$;
class Curriculum extends Component {
//课程体系
constructor(props) {
super(props)
this.state= {
classcalue:5,
newec_course_idbottom:"",
course_name:undefined,
course_url:"a",
ecmanager:true,
titine:1,
}
}
componentWillMount(){
// window.document.title = '课程达成评价结果';
}
componentDidMount(){
console.log(this.props);
}
sync_course_data=()=>{
// this.setState({listSpin:true})
// let ec_course_id=this.props.match.params.ec_course_id;
// let Url ='/ec_course_achievement_methods/sync_course_data';
// axios.post(Url, {
// ec_course_id:ec_course_id
// },
// {
// withCredentials: true
// }
// ).then((response) => {
// if(response.data.status===0){
// this.setState({
// // titlemessage: response.data.message+"(支撑关系变更)",
// Modallist: response.data.message,
// Modallisttype:true,
// listSpin:false
// })
// this.UpdateEvaluations();
// }else if(response.data.status===-1){
// this.setState({
// // titlemessage: response.data.message+"(支撑关系变更)",
// Modallist: response.data.message,
// Modallisttype:true,
// listSpin:false
// })
//
// }
// }).catch((error) => {
// console.log(error)
// })
}
onAclick=(i)=>{
console.log("onAclick");
console.log(i);
if(i===1){
this.props.history.push(this.props.match.url+"/ec_course_support_setting/1");
}else if(i===2){
this.props.history.push(this.props.match.url+"/ec_course_reach_setting/2");
}else if(i===3){
this.props.history.push(this.props.match.url+"/score_level/3");
}else if(i===4){
this.props.history.push(this.props.match.url+"/evaluation_methods/4");
}else{
this.props.history.push(this.props.match.url+"/competition_calculation_info/5");
}
this.setState({
titine:i,
})
};
Ontitine=(s)=>{
if(s==="ec_course_support_setting"){
this.setState({
titine:1,
})
}else if(s==="ec_course_reach_setting"){
this.setState({
titine:2,
})
}else if(s==="score_level"){
this.setState({
titine:3,
})
}else if(s==="evaluation_methods"){
this.setState({
titine:4,
})
}else if(s==="competition_calculation_info"){
this.setState({
titine:5,
})
}
};
associatedclass=()=>{
};
deleteassociatedclass=()=>{
}
render() {
let {newec_course_idbottom,titine,classcalue,course_name,course_url,ecmanager,Spintype,calculatesetype,ec_course_id,course_total_scoreaverage,ec_course_targets_count,schooldata,ecComponentState,course_total_score,total_rate_data,ec_course_targets,graduation_list,target_list,target_score,evaluate_result,morelisttype,titlemessage,completiontype,completionlist,ismanager} = this.state;
// console.log("Curriculum");
// console.log(this.props);
// console.log(titine);
return (
<div className="educontent">
<div className="newMain clearfix">
<div className="edu-back-white eacourse">
<div className="clearfix padding20-30 bor-bottom-greyE">
<a href={schooldata&&schooldata.course_setting_url} className="color-grey-9 TrainingLecturer">课程体系</a> >
<a className="TrainingTheory major_name"> {schooldata&&schooldata.ec_course_name} 达成评价详情</a>
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<div className="color-grey-9 mr10">系统根据课程目标课程考核方式与课程目标评价方法一键计算评价课程目标的达成情况 <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
{
titine === 4 ?
<span className="Importclassroomdatas" style={{top: '22px'}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10 mt7" target="_blank"
href={'/ec_courses/' + newec_course_idbottom + '/export_ec_course_targets?format=xls'}>导出评价方法</a>
</span>
:titine === 1 ?
<span className="Importclassroomdatas" style={{top: '22px'}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10 mt7"
href={`/ec_courses/${this.props.match.params.ec_course_id}/export_ec_course_targets?format=xls`}
>导出课程目标</a>
</span>
:titine===2?
<div className={"Importclassroomdatas"}>
<span className="" >
<a className="white-btn edu-blueback-btn fr mr10 mt7" style={{top: '22px',display:ecmanager===false?"none":"block"}} target="_blank" href={'/ec_courses/'+ec_course_id+'/export_ec_course_targets?format=xls'}>导出考核方法</a>
</span>
<a className="white-btn edu-blueline-btn fr mr10 mt7 mr20"
onClick={this.associatedclass}
style={{display: course_url === "" && ecmanager === true ? "block" : "none"}}
>关联课堂</a>
<a className="white-btn edu-blueline-btn fr mr10 mt7 mr20"
onClick={this.deleteassociatedclass}
style={{display:course_url!=""&&ecmanager===true?"block":"none"}}
>取消关联</a>
</div>
:""
}
</div>
<div className="padding20-30"style={titine===2||titine===3?{height:"100px"}:{height:"80px"}}
>
<a className="fl SystemParameters" style={titine===1?{display:schooldata&&schooldata.ec_course_support_setting_url===null?"none":"block",color:'#4CACFF'}:{display:schooldata&&schooldata.ec_course_support_setting_url===null?"none":"block",color:'#4D4D4D'}}
onClick={()=>this.onAclick(1)}>1.课程目标</a>
<a className="fl SystemParameters ml40"
style={titine===2?{display:schooldata&&schooldata.ec_course_reach_setting_url===null?"none":"block",color:'#4CACFF'}:{display:schooldata&&schooldata.ec_course_reach_setting_url===null?"none":"block",color:'#4D4D4D'}}
onClick={()=>this.onAclick(2)}>2.课程考核方式与数据来源</a>
<a className="fl SystemParameters4CACFF ml40 "
style={titine===3?{color:'#4CACFF'}:{display:"block",color:'#4D4D4D'}}
onClick={()=>this.onAclick(3)}>3.成绩等级设置</a>
<a className="fl SystemParameters ml40"
style={titine===4?{display:schooldata&&schooldata.evaluation_methods_url===null?"none":"block",color:'#4CACFF'}:{display:schooldata&&schooldata.evaluation_methods_url===null?"none":"block",color:'#4D4D4D'}}
onClick={()=>this.onAclick(4)}
>4.课程目标评价方法</a>
<a className="fl SystemParameters ml40 "
style={titine===5?{display:schooldata&&schooldata.competition_calculation_info_url===null?"none":"block",color:'#4CACFF'}:{display:schooldata&&schooldata.competition_calculation_info_url===null?"none":"block",color:'#4D4D4D'}}
onClick={()=>this.onAclick(5)}
>5.课程达成评价结果</a>
{
titine===5?
<span>
<span className={ismanager===false?"none":""} style={{top: "26px"}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10 mt9" target="_blank" href={"/ec_courses/"+ec_course_id+"/export_evaluation_result.xls"}>导出评价详情</a>
</span>
<span className={ismanager===false?"none":"right newrightcalculatebuttons fr mb10 mr20 "}
onClick={this.newrightcalculatebutton}>计算</span>
</span>
:titine===4?
<span className="fr ml20 SystemParameters" style={{color: '#989898'}}>各环节平均得分*占比之和/各环节总分*占比之和</span>
:titine===3?
<span className="fl SystemParametersysls" style={{display:course_name===null||course_name===undefined?"block":"none",
padding: '0px 0px 0px 0px',textAlign: 'left',width: '100%',color:'#989898'}}>将学生的成绩转换成对应的等级</span>
:titine===2?
<span>
<span className="fl" style={{display:course_name===null||course_name===undefined?"block":"none",padding: '0px 0px 0px 0px',textAlign: 'left',width: '100%',color: '#989898'}}>请在完成配置后使用各项成绩导入模板将本学年所有参与的学生成绩数据导入系统</span>
<span className="Importclassroomdatass" style={{display:course_url===""||ecmanager===false?"none":"block",}}><a onClick={this.sync_course_data} className="white-btn edu-orangeback-btn fr mt2 mr10" style={{width:'112px'}}>导入课堂数据</a></span>
</span>
:""
}
</div>
</div>
<Switch>
{/*Curriculumtwo 测试用*/}
{/*课程目标*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/:type/1'
render={ (props) => (<Curriculumtwo {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)} />) }></Route>
{/*课程考核方式与数据来源*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/:type/2'
render={ (props) => (<Curriculumtwo {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route>
{/*成绩等级设置*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/:type/3'
render={ (props) => (<Curriculumtwo {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route>
{/*课程目标评价方法*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/:type/4'
render={ (props) => (<Curriculumtwo {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route>
{/*课程达成评价结果*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/:type/5'
render={ (props) => (<Curriculumtwo {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route>
</Switch>
</div>
</div>
)
}
}
export default Curriculum;

@ -0,0 +1,32 @@
import React, { Component } from 'react';
class Curriculumtwo extends Component {
//测试用
constructor(props) {
super(props)
// console.log(props);
}
componentWillMount(){
}
componentDidMount(){
// console.log(this.props);
console.log("Curriculumtwo");
console.log(this.props.match.params.type);
this.props.Ontitine(this.props.match.params.type);
}
render() {
// console.log("Curriculumtwo");
// console.log(this.props);
return (
<div className="educontent fl">
<span>测试</span>
</div>
)
}
}
export default Curriculumtwo;

@ -0,0 +1,104 @@
#traningNav {
display: flex
}
#traningNav>li {
float: none !important;
}
/* 最后一个item 占满剩余空间 */
#traningNav>li:last-child{
flex: 1;
}
#traningNav>li>.ecTitle {
width: 24px;
height: 24px;
border: 1px solid rgba(65, 140, 205, 1);
border-radius: 50%;
text-align: center;
line-height: 22px;
display: inline-block;
color: rgba(65, 140, 205, 1) !important;
margin-right: 10px;
}
#traningNav>li>.ecTitles {
line-height: 16px !important;
height: 18px!important;
width: 18px!important;
}
#traningNav>li>.ecTitlefont:hover{
color: rgba(65, 140, 205, 1) !important;
}
.ecimgs3{
background: url("./img/3.png");
background-repeat: no-repeat;
background-size: 100% 100%;
-moz-background-size: 100% 100%;
height: 90px;
line-height: 90px;
width: 235px;
}
.ecimgs2{
background: url("./img/4.png");
background-repeat: no-repeat;
background-size: 100% 100%;
-moz-background-size: 100% 100%;
height: 90px;
line-height: 90px;
width: 190px;
}
.ecimgs11{
background: url("./img/3.png");
background-repeat: no-repeat;
background-size: 100% 100%;
-moz-background-size: 100% 100%;
height: 90px;
line-height: 90px;
width: 146px;
}
.ml18{
margin-left: 18px;
}
.ecimgs{
height: 90px;
line-height: 90px;
}
.ecmarginleft{
margin-left: 23px;
}
#traningNav>li>.ecTitlefontFFF{
color:#fff !important;
}
#traningNav>li>.ecTitleFFF {
width: 24px;
height: 24px;
border: 1px solid #fff;
border-radius: 50%;
text-align: center;
line-height: 22px;
display: inline-block;
color: #fff !important;
margin-right: 10px;
}
.traningNavs{
padding: 0px 0px 0px 0px !important;
}
.traningNavs>li{
padding: 0px 10px 30px 10px !important;
}
.mb0{
margin-bottom: 0px !important;
}
.info2{
width:232px;
text-align: center;
}
.info1{
width: 206px;
text-align: center;
}

@ -0,0 +1,100 @@
import React, { Component } from 'react';
import './ecTitle.css';
class EcTitleCourseEvaluations extends Component {
constructor(props) {
super(props)
this.state = {
schooldata:{},
ecComponentState:"",
ecpaths:""
}
}
componentWillReceiveProps(nextProps){
const {schooldata,ecComponentState,ecpath}=nextProps;
this.setState({
schooldata:schooldata,
ecComponentState:ecComponentState,
ecpaths:ecpath
})
}
render() {
let{schooldata,ecComponentState,ecpaths}=this.state;
return (
<div>
<div className="mb10 mt10 eaSystemp">
<a href={schooldata.user_url}>{schooldata.user_name===undefined?"":schooldata.user_name+" > "}</a>
<a href={schooldata.school_url}>{schooldata.school_name===undefined?"":schooldata.school_name+"认证"}</a>
<a href={schooldata.major_url}>{schooldata.school_name===undefined?"":" > "+schooldata.major_name+" > "}</a>
<span> {schooldata.school_name===undefined?"":schooldata.year+"届"}</span>
</div>
<ul className="clearfix mb0 traningNavs " id="traningNav" style={{display:ecpaths==='none'?"none":"flex"}}>
<li className={"ecimgs"}>
<a className={"ecTitle ecTitles"} >1</a>
<a className={"ecTitlefont"} href={schooldata.major_training}>培养目标</a>
</li>
<li className={"ecimgs"}>
<a className={"ecTitle ecTitles"} >2</a>
<a className={"ecTitlefont"} href={schooldata.graduation_requirement_url} >毕业要求</a>
</li>
<li className={"ecimgs"}>
<a className={"ecTitle ecTitles"} >3</a>
<a className={"ecTitlefont"} href={schooldata.requirement_vs_objective_url}>毕业要求 vs 培养目标</a>
</li>
<li className={"ecimgs"}>
<a className={"ecTitle ecTitles"} >4</a>
<a className={"ecTitlefont"} href={schooldata.requirement_vs_standard}>毕业要求 vs 通用标准</a>
</li>
<li className={ecpaths==="ecStudentList"?"ecimgs11":"ecimgs"} style={{width: ecpaths==="ecStudentList"?'126px':'83px'}}>
<a className={ ecpaths==="ecStudentList"?"ml18 ecTitleFFF ecTitles":"ecTitle"} >5</a>
<a className={ ecpaths==="ecStudentList"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.students_url}>学生</a>
</li>
<li className={ecpaths==="ec_course_support_setting"||ecpaths==="show"?"ecimgs11":"ecimgs"}>
<a className={ ecpaths==="ec_course_support_setting"||ecpaths==="show"?"ml18 ecTitleFFF ecTitles":"ecTitle ecTitles"} >6</a>
<a className={ ecpaths==="ec_course_support_setting"||ecpaths==="show"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.course_setting_url}>课程体系</a>
</li>
<li className={ecpaths==="requirement_vs_courses"?"ecimgs3":"ecimgs"}>
<a className={ ecpaths==="requirement_vs_courses"?"ecmarginleft ecTitleFFF ecTitles":"ecTitle ecTitles"} >7</a>
<a className={ ecpaths==="requirement_vs_courses"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.requirement_vs_courses}>课程体系 vs 毕业要求</a>
</li>
<li className={ecpaths==="reach_calculation_info"?"ecimgs2 info2":"ecimgs"}>
<a className={ ecpaths==="reach_calculation_info"?"ecTitleFFF ml18 ecTitles":"ecTitle ecTitles"} >8</a>
<a className={ ecpaths==="reach_calculation_info"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.reach_calculation_info_url}>达成度评价结果</a>
</li>
{/*<li className={ecComponentState==="ecCourseSupports"?"active edu-menu-panel":"edu-menu-panel"}>*/}
{/*<a>毕业要求</a>*/}
{/*<i className="iconfont icon-xiajiantou font-14 ml5" style={{display:ecComponentState==="ecCourseSupports"?"inline-block":"none"}}></i>*/}
{/*<ul className="edu-menu-list" style={{width:'200px',right:'unset',top:'34px'}}>*/}
{/*<li><a href={schooldata.major_training} >专业培养目标</a></li>*/}
{/*<li><a href={schooldata.graduation_requirement_url} >毕业要求指标点</a></li>*/}
{/*<li><a href={schooldata.requirement_vs_objective_url} >毕业要求vs培养目标</a></li>*/}
{/*<li><a href={schooldata.requirement_vs_standard} >毕业要求vs通用要求</a></li>*/}
{/*<li><a href={schooldata.requirement_vs_courses} >毕业要求vs课程体系</a></li>*/}
{/*</ul>*/}
{/*</li>*/}
{/*<li className={ecComponentState==="ecCourseEvaluations"?"active edu-menu-panel":"edu-menu-panel"}>*/}
{/*<a href={schooldata.course_setting_url}>课程配置</a>*/}
{/*</li>*/}
{/*<li className={ecComponentState==="ecCompletion"?"active edu-menu-panel":"edu-menu-panel"}>*/}
{/*<a>达成度计算</a>*/}
{/*<i className="iconfont icon-xiajiantou font-14 ml5" style={{display:ecComponentState==="ecCompletion"?"inline-block":"none"}}></i>*/}
{/*<ul className="edu-menu-list" style={{width:'200px',right:'unset',top:'34px'}}>*/}
{/*<li><a href={schooldata.completion_calculation_url}>课程达成计算</a></li>*/}
{/*<li><a href={schooldata.reach_calculation_info_url}>毕业要求指标点达成计算</a></li>*/}
{/*</ul>*/}
{/*</li>*/}
{/*<a className="fr color-grey-6 font-16" href={schooldata.go_back_url}>返回</a>*/}
</ul>
</div>
)}
}
export default EcTitleCourseEvaluations;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -0,0 +1,814 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import axios from 'axios';
import { TPMIndexHOC } from '../../../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder'
import { message,Modal,Spin,Icon} from 'antd';
import 'antd/dist/antd.css';
import EcTitleCourseEvaluations from '../../ecTitle/ecTitle'
import '../../css/ecCourseSupports.css';
import '../../css/ecCourseEvaluations.css';
const $ = window.$;
class EcCompletionCalculation extends Component {
constructor(props) {
super(props)
this.state={
schooldata:{},
ecComponentState:"ecCompletion",
course_total_score:[],
ec_course_targets:0,
graduation_list:[],
target_list:[],
target_score:[],
evaluate_result:"",
ec_course_targets_count:0,
new_target_ec_year_id:0,
total_rate_data:undefined,
calculatetype:false,
ec_course_id:0,
morelisttype:false,
titlemessage:"提示",
completiontype:false,
completionlist:"",
course_total_scoreaverage:0,
calculatesetype:false,
Spintype:false,
ismanager:false
}
}
componentWillMount(){
window.document.title = '课程达成评价结果';
}
componentDidMount(){
let ec_course_id =this.props.match.params.ec_course_id;
this.UpdateClassData(true);
const Url =`/ec_major_schools/get_navigation_data?ec_course_id=`+ec_course_id;
axios.get(Url, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
// if(response.data.allow_visit===false){
// window.location.href="/403"
// }
this.setState({
schooldata:response.data,
ec_course_id:ec_course_id
})
}
})
.catch(function (error) {
console.log(error);
});
}
targetsget_navigation_data=(ec_year_id,ec_course_id)=>{
const Url =`/ec_major_schools/get_navigation_data?ec_year_id=`+ec_year_id+"&ec_course_id="+ec_course_id;
axios.get(Url, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
// if(response.data.allow_visit===false){
// window.location.href="/403"
// }
this.setState({
schooldata:response.data,
ec_course_id:ec_course_id
})
}
})
.catch(function (error) {
console.log(error);
});
}
showmorelist=()=>{
this.setState({
morelisttype:false
})
this.UpdateClassData(false)
}
UpdateClassData=(key)=>{
let {calculatetype} =this.state;
let ec_course_id =this.props.match.params.ec_course_id;
this.setState({
ec_course_id:ec_course_id
})
const Arl =`/ec_courses/`+ec_course_id+`/calculation_info_data`;
axios.get(Arl, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
// var list=[];
// if(key===true){
// for(var i=0; i<response.data.course_total_score.length;i++){
// if(i<10){
// list.push(response.data.course_total_score[i])
// }
// }
// }else{
// list=response.data.course_total_score
// }
// let newgraduation_list= response.data.graduation_list.reverse();
let newmorelisttype=false;
if(response.data.course_total_score>10){
newmorelisttype=true
}
let course_total_scoreaverage;
let newlist=response.data.course_total_score[response.data.course_total_score.length-1].total_rate;
for(var i=0; i<newlist.length;i++){
if(i===newlist.length-1){
course_total_scoreaverage=newlist[i].total_score
}
}
this.setState({
evaluate_result:response.data.evaluate_result,
course_total_score:response.data.course_total_score[response.data.course_total_score.length-1].total_rate,
total_rate_data:response.data.course_total_score[response.data.course_total_score.length-1].total_rate.length,
graduation_list:response.data.graduation_list,
target_list:response.data.target_list,
target_score:response.data.target_score,
ec_course_targets_count:response.data.ec_course_targets_count,
morelisttype:newmorelisttype,
course_total_scoreaverage:course_total_scoreaverage,
ismanager:response.data.is_manager
})
// ec_course_targets:response.data.ec_course_targets,
this.targetsget_navigation_data(response.data.ec_year_id,ec_course_id)
if(calculatetype===true){
this.setState({
calculatetype:false,
completiontype:true,
completionlist:'刷新列表数据成功',
calculatesetype:true
})
}
}
})
.catch(function (error) {
console.log(error);
});
//
// let newcourse_total_score=[
// {
// student_scores:{
// name: "黎子豪",
// student_number: "13408100113",
// target_info: [
// {position: 1, score: 73.3},
// {position: 2, score: 71.8},
// {position: 3, score: 92.2},
// {position: 4, score: 82.1},
// {position: 5, score: 87.7}
// ],
// total_score: 81.4
// }
// },{
// total_rate:[
// {position: 1, score: 65.35, rate: 0.1},
// {position: 2, score: 68.81, rate: 0.1},
// {position: 3, score: 68.34, rate: 0.1},
// {position: 4, score: 78.09, rate: 0.35},
// {position: 5, score: 77, rate: 0.35},
// {total_score: 74.5},
// ]
// }
// ]
//
// var list=[];
// if(key===true){
// for(var i=0; i<newcourse_total_score.length;i++){
// if(i<10){
// list.push(newcourse_total_score[i])
// }
// }
// }else{
// list=newcourse_total_score
// }
// let graduation_list=[
// {
// ec_graduation_name: "5-1",
// ec_subitem_content: "能够针对计算机系统的设计、开发、部署、运行和维护等方面的复杂工程问题,开发、选择与使用恰当的技术、资源、现代工程工具和信息技术工具,进行科学合理的预测与模拟,并充分认识到问题的复杂性与解决手段的局限性。",
// reach_real_target: 0.078,
// reach_target: 0.07,
// result: "达成",
// target_position: [0, 0, 0, 1, 0],
// weight: 0.1
// }
// ]
// let newgraduation_list= graduation_list.reverse();
// this.setState({
// course_total_score:list,
// total_rate_data:newcourse_total_score[newcourse_total_score.length-1].total_rate.length,
// graduation_list:newgraduation_list,
// evaluate_result:false,
// target_list:[
// {
// content: "理解数据管理技术和数据库技术的发展,区分不同数据模型的作用和特点,描述数据库系统的类型、结构、数据独立性。",
// real_grade: 65.35,
// result: "达成",
// standard_grade: 65,
// weigths: 0.1
// }
// ],
// target_score:[
// {average_score: 65.35,
// ec_course_targets_count: 5,
// from50: [9, 20.45],
// from60: [13, 29.55],
// from70: [14, 31.82],
// from80: [3, 6.82],
// from90: [1, 2.27],
// from_down: [4, 0.09],
// graduation_list: [],
// low_score: 40,
// top_score: 93.4}
// ],
// ec_course_targets_count:5
//
// })
// if(calculatetype===true){
// message.success('刷新列表数据成功!');
// this.setState({
// calculatetype:false,
// completiontype:true,
// completionlist:'刷新列表数据成功!'
// })
// }
}
newrightcalculatebutton=()=>{
this.setState({
Spintype:true
})
let {ec_course_id}=this.state;
const Orl =`/ec_courses/`+ec_course_id+`/sync_data`;
axios.get(Orl, {
withCredentials:true,
})
.then((response) => {
if(response.data.status===1){
this.setState({
calculatetype:true,
completiontype:true,
completionlist:'计算成功',
calculatesetype:true,
Spintype:false
})
this.UpdateClassData(true);
}
})
.catch(function (error) {
console.log(error)
});
}
hidecompletion=()=>{
this.setState({
completiontype:false,
completionlist:"",
calculatesetype:false
})
}
render() {
let {Spintype,calculatesetype,ec_course_id,course_total_scoreaverage,ec_course_targets_count,schooldata,ecComponentState,course_total_score,total_rate_data,ec_course_targets,graduation_list,target_list,target_score,evaluate_result,morelisttype,titlemessage,completiontype,completionlist,ismanager} = this.state;
let TargetresList = (length) => {
let target_listres = [];
for(let i = 0; i < length; i++) {
// target_listres.push(<span className="column-1 operationleft color-666" key={i}>目标{length-i}</span>)
// target_listres.push(<span className="column-2 operationleft color-666" key={i}>目标{i+1}</span>)
target_listres.push(<span className="column-1 operationright color-666" key={i}>目标{length-i}</span>)
}
return target_listres
}
let TargetresLists = (length) => {
let target_listress = [];
for(let i = 0; i < length; i++) {
// target_listres.push(<span className="column-1 operationleft color-666" key={i}>目标{length-i}</span>)
target_listress.push(<span className="column-2 operationleft color-666" key={i}>目标{i+1}</span>)
// target_listres.push(<span className="column-1 operationright color-666" key={i}>目标{length-i}</span>)
}
return target_listress
}
let TargetresContentList = (length,value) => {
let target_listres = [];
if(value!=undefined){
for(let i = 0; i < length; i++) {
if(value[i]===1){
target_listres.push(<span className="column-1 operationright color-green" key={i}><i class="iconfont icon-gouxuan color-green font-16 mr5"></i></span>)
}else{
target_listres.push(<span className="column-1 operationright color-666" key={i}><i class="iconfont icon-guanbi font-14 mr5"></i></span>)
}
}
target_listres.reverse()
return target_listres
}
}
let Total_rate_dataList = (value) => {
let target_listres = [];
if(value!=undefined){
for(let i = 0; i < value.length; i++) {
if(i===value.length-1){
target_listres.push(<span className="column-1 operationright" key={i}>
{/*<div className="color-red">{value[i].total_score}</div>*/}
<div className="color-red">100%</div>
</span>)
}else{
target_listres.push(<span className={i===0?" column-2 operationleft":"column-2 operationleft"} key={i}>
{/*<div>{value[i].score}</div>*/}
{/*<div className="color-redFF">占比{(value[i].rate*100).toFixed(2)}%</div>*/}
<div>
{(value[i].rate*100).toFixed(2)}%
</div>
</span>)
}
}
return target_listres
}else{
target_listres.push(<span className="column-1 operationright">
{/*<div className="color-red">{value[i].total_score}</div>*/}
<div className="">--</div>
</span>)
return target_listres
}
}
let newTotal_rate_dataList = (length,value) => {
let target_listres = [];
if(value!=undefined){
for(let i = 0; i < value.length; i++) {
// if(i===0){
// target_listres.push(<span className="column-2 color-05101A" key={i}>
// <div>{value[i].score.toFixed(2)}</div>
// </span>)
// }else{
// target_listres.push(<span className="column-2 color-05101A" key={i}>
// <div>{value[i].score.toFixed(2)}</div>
// </span>)
// }
if(i<value.length-1){
target_listres.push(<span className="column-2 color-05101A" key={i}>
<div>{value[i].score.toFixed(2)}</div>
</span>)
}
}
return target_listres
}
}
return (
<div className="newMain clearfix">
<Modal
title={titlemessage}
visible={completiontype}
className={"ecmodeldelet"}
closable={false}
footer={null}
>
<div className="task-popup-content">
<div className="task-popup-text-center font-14">{completionlist}</div>
</div>
{
calculatesetype===true?
<div className="task-popup-submit clearfix"
style={{width:'69px'}}
>
<a className="task-btn task-btn-orange fr"
style={{fontWeight: '400'}}
onClick={this.hidecompletion}
>知道啦</a>
</div>
:
<div className="task-popup-submit clearfix">
<a onClick={this.hidecompletion} className="task-btn fl">取消</a>
<a className="task-btn task-btn-orange fr"
onClick={this.hidecompletion}
>确定</a>
</div>
}
</Modal>
<div className="educontent mb290">
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecComponentState={'ecCompletion'}
ecpath={"show"}
/>
<div className="edu-back-white eacourse">
<div className="clearfix padding20-30 bor-bottom-greyE">
<a href={schooldata.course_setting_url} className="color-grey-9 TrainingLecturer">课程体系</a> >
<a className="TrainingTheory major_name"> {schooldata.ec_course_name} 达成评价详情</a>
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<div className="color-grey-9 mr10">系统根据课程目标课程考核方式与课程目标评价方法一键计算评价课程目标的达成情况 <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
</div>
<div className="padding20-30" id="training_objective_contents"
style={{
position: 'relative'
}}
>
<a className="fl SystemParameters" style={{display:schooldata.ec_course_support_setting_url===null?"none":"block"}}
href={schooldata.ec_course_support_setting_url}>1.课程目标</a>
<a className="fl SystemParameters ml40"
style={{display:schooldata.ec_course_reach_setting_url===null?"none":"block"}}
href={schooldata.ec_course_reach_setting_url}>2.课程考核方式与数据来源</a>
<a className="fl SystemParameters4CACFF ml40 color4D4D4D"
href={schooldata.score_level_setting_url}
>3.成绩等级设置</a>
<a className="fl SystemParameters ml40"
style={{display:schooldata.evaluation_methods_url===null?"none":"block"}}
href={schooldata.evaluation_methods_url}>4.课程目标评价方法</a>
<a className="fl SystemParameters ml40"
style={{display:schooldata.competition_calculation_info_url===null?"none":"block",color:'#4CACFF'}}
href={schooldata.competition_calculation_info_url}>5.课程达成评价结果</a>
{/* <span className="right ml20 SystemParameters">
{
evaluate_result===false?<span className="Systemnum">未达成</span>:<span className="Systemnum color-green"></span>
}
</span> */}
<span className={ismanager===false?"none":"right newrightcalculatebutton"}
style={{
marginLeft: '26px',
position: 'absolute',
right: '157px'
}}
onClick={this.newrightcalculatebutton}>计算</span>
<span className={ismanager===false?"none":"Importclassroomdata"} style={{top: "26px"}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={"/ec_courses/"+ec_course_id+"/export_evaluation_result.xls"}>导出评价详情</a>
</span>
</div>
</div>
<div className="ListTableLine newSystem mb20" id="school_major_list">
<p className="clearfix padding10im" >
<span className="column-1 color-666">课程目标</span>
<span className="column-1 operationright color-666">达成结果</span>
<span className="column-1 operationright color-666">达成标准()</span>
<span className="column-1 operationright color-666">实际达成</span>
<span className="column-1 operationright color-666">权重</span>
</p>
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" }
{ target_list.length===0&&Spintype===false?
<li className={ "clearfix newtarget_scoreclass lipadding10im"}>
<span className="column-1 color-05101A">--</span>
<span className="column-575 color-05101A">--</span>
<span className={"column-1 operationright Systemnum"}>--</span>
<span className="column-1 operationright color-05101A">--</span>
<span className="column-1 operationright">--</span>
<span className="column-1 operationright">--</span>
</li>:""}
{Spintype===false?target_list.map((item,key)=>{
return(
<li className={key+1===target_list.length?"clearfix newtarget_target lipadding10im":"clearfix newtarget_scoreclass lipadding10im"} key={key}>
<span className="column-1 color-05101A">{key+1}</span>
<span className="column-575 color-05101A">{item.content}</span>
<span className={item.result==="未达成"?"column-1 operationright Systemnum":"column-1 operationright color-green"}>{item.result}</span>
<span className="column-1 operationright color-05101A">{item.standard_grade}</span>
<span className="column-1 operationright">{item.real_grade}</span>
<span className="column-1 op erationright">{item.weigths}</span>
</li>
)
}):""
}
</div>
<div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents">
<span className="fl SystemParameters lineheight60" style={{height:'46px'}}> 毕业要求指标点达成评价结果</span>
<span className="right ml20 SystemParameters" style={{height:'46px'}}><span className="color-green"><i class="iconfont icon-gouxuan color-green font-16 mr5"></i></span> <i class="iconfont icon-guanbi font-14 mr5"></i></span>
</div>
</div>
<div className="ListTableLine newSystem mb20 graduateRequirement " id="school_major_list">
{
graduation_list.length===0?
<p className="clearfix lipadding20im" style={{minWidth:'1200px'}}>
<span className="column-1 color-666 mr16">毕业要求</span>
<span className="nowrap329">{5}</span>
<span className="column-1 operationright color-666">达成结果</span>
<span className="column-1 operationright color-666">达成目标值</span>
<span className="column-1 operationright color-666">达成实际值</span>
<span className="column-1 operationright color-666">课程权重</span>
{TargetresList(5)}
</p>
:""
}
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" }
{
graduation_list.length===0&&Spintype===false?
<li className={'clearfix newtarget_scoreclass marlr19'} style={{minWidth:'1137px'}}>
{/* <span className="column-1 color-05101A ec_graduation_name">{item.ec_graduation_name}</span> */}
<span className="column-1 color-05101A ec_graduation_name">{1}</span>
<span className="column-500 color-05101A">{"--"}</span>
<span className={"column-1 operationright Systemnum mrj15"}>{"--"}</span>
<span className="column-1 operationright color-05101A">{"--"}</span>
<span className="column-1 operationright">{"--"}</span>
<span className="column-1 operationright"> <a href={schooldata.requirement_vs_courses} style={{color:'rgb(76, 172, 255)'}}>立即配置</a></span>
{TargetresContentList(5,[2,2,2,2,2])}
</li>
:""
}
{
Spintype===false?graduation_list.map((item,key)=>{
if(key===0){
return(
<p key={key} className="clearfix lipadding20im" style={{minWidth: ec_course_targets_count > 5 ? (76*(ec_course_targets_count+4)+380+15):1200+"px"}}>
<span className="column-1 color-666 mr16">毕业要求</span>
<span className="nowrap329">{item.ec_subitem_content}</span>
<span className="column-1 operationright color-666">达成结果</span>
<span className="column-1 operationright color-666">达成目标值</span>
<span className="column-1 operationright color-666">达成实际值</span>
<span className="column-1 operationright color-666">课程权重</span>
{TargetresList(ec_course_targets_count)}
</p>
)
}
}):""
}
{
Spintype===false?graduation_list.map((item,key)=>{
return(
<li className={key+1===target_list.length?"clearfix newtarget_target marlr19":"clearfix newtarget_scoreclass marlr19"} key={key} style={{minWidth: ec_course_targets_count > 5 ? (76*(ec_course_targets_count+4)+380):1200+"px"}}>
{/* <span className="column-1 color-05101A ec_graduation_name">{item.ec_graduation_name}</span> */}
<span className="column-1 color-05101A ec_graduation_name">{key+1}</span>
<span className="column-500 color-05101A" data-tip-down={item.content}>{item.ec_subitem_content}</span>
<span className={item.result==="未达成"?"column-1 operationright Systemnum mrj15":"column-1 operationright color-green mrj15"}>{item.result}</span>
<span className="column-1 operationright color-05101A">{item.reach_target===null?0:item.reach_target}</span>
<span className="column-1 operationright">{item.reach_real_target===null?0:item.reach_real_target}</span>
{item.weight===null||item.weight===0?<span className="column-1 operationright" ><a href={schooldata.requirement_vs_courses} style={{color:'rgb(76, 172, 255)'}}>立即配置</a></span>:<span className="column-1 operationright">{item.weight}</span>}
{TargetresContentList(ec_course_targets_count,item.target_position)}
</li>
)
}):""
}
</div>
<div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents">
<span className="fl SystemParameters lineheight60" style={{height:'46px'}}>课程总评成绩表</span>
</div>
</div>
<div className="ListTableLine newSystem mb20" id="school_major_list">
<p className="clearfix padding10im" style={{width: total_rate_data > 5 ? (180 * total_rate_data+226+16) : 1200+"px"}}>
{/*<span className="column-1 color-666 mr16 width86">序号</span>*/}
<span className="column-1 color-666 mr16 width86">课程目标</span>
{/*<span className="column-1 color-666 mr16">姓名</span>*/}
{/*<span className="column-1 color-666 mr16">学号</span>*/}
{TargetresLists(total_rate_data-1)}
<span className="column-1 operationright color-666">总评成绩</span>
</p>
{/*style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4.5):1136+"px"}}*/}
{
// course_total_score.map((i,k)=>{
// if(k===course_total_score.length-1){
// return(
// <li className={"clearfix newtarget_scoreclass lipadding10im margin64px"} key={k} style={{width: 113*(total_rate_data+4)>1200?(113*(total_rate_data+4.5))+63:1200+"px"}}>
// <span className="column-1 color-05101A mr16 width86">占比</span>
// {/*colorTransparent*/}
// {/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent"> 平均数 </span>*/}
// {/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent "> 平均数 </span>*/}
// {/* {Total_rate_dataList(total_rate_data-1,i.total_rate)}
// </li>
// )
// }
// }) */}
}
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" }
{
Spintype===false? <li className={"clearfix newtarget_scoreclass lipadding10im margin64px"} style={{width: total_rate_data > 5 ? (180 * total_rate_data+226+16) : 1200 + "px"}}>
<span className="column-1 color-05101A mr16 width86">占比</span>
{/*colorTransparent*/}
{/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent"> 平均数 </span>*/}
{/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent "> 平均数 </span>*/}
{Total_rate_dataList(course_total_score)}
{
course_total_score.length===0? <span className="column-1 operationright">--</span>:""
}
</li>:""
}
{/*style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4):1136+"px"}}*/}
{
// course_total_score.map((i,k)=>{
// if(k!=course_total_score.length-1){
// return(
// <li className={"clearfix newtarget_scoreclass lipadding10im"} style={{width: 113*(total_rate_data+4)>1200?(113*(total_rate_data+4.5))+63:1200+"px"}}>
// {/*<span className="column-1 color-05101A mr16 width86">{k+1}</span>*/}
// <span className="column-1 color-05101A mr16 width86">平均分</span>
// {/*<span className="column-1 color-05101A ec_graduation_name mr16">{i.student_scores.name}</span>*/}
// {/*<span className="column-1 color999 ec_graduation_name mr16 ">{i.student_scores.student_number}</span>*/}
// {newTotal_rate_dataList(total_rate_data-1,i.student_scores.target_info)}
// <span className="column-1 color-red operationright">{i.student_scores.total_score.toFixed(2)}</span>
// </li>
// )
// }
// })
}
{
Spintype===false?<li className={"clearfix newtarget_scoreclass lipadding10im bordereaeaea"} style={{width: 113*(total_rate_data+4)>1200?(113*(total_rate_data+4.5))+63:1200+"px"}}>
{/*<span className="column-1 color-05101A mr16 width86">{k+1}</span>*/}
<span className="column-1 color-05101A mr16 width86">平均分</span>
{/*<span className="column-1 color-05101A ec_graduation_name mr16">{i.student_scores.name}</span>*/}
{/*<span className="column-1 color999 ec_graduation_name mr16 ">{i.student_scores.student_number}</span>*/}
{newTotal_rate_dataList(course_total_score-1,course_total_score)}
{/* <span className="column-1 color-red operationright">{course_total_score.length===0?"":course_total_score[course_total_score-1].total_score}</span> */}
{
course_total_score.length===0? <span className="column-1 operationright">--</span>:<span className="column-1 color-red operationright">{course_total_scoreaverage}</span>
}
</li>:""
}
<li class="clearfix newtarget_scoreclass" style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4):1136+"px",display:morelisttype===true?"block":"none"}}>
<a className={"ecmorelist"} onClick={()=>this.showmorelist()}>加载更多</a>
</li>
</div>
<div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents">
<span className="fl SystemParameters lineheight60" style={{height:'46px'}}>课程目标成绩分析</span>
</div>
</div>
<div className="ListTableLine newSystem mb20" id="school_major_list">
<p className="clearfix padding10im">
<span className="column-1 color-666">课程目标</span>
<span className="column-1 color-666">平均分</span>
<span className="column-1 color-666">最高分数</span>
<span className="column-1 color-666">最低分数</span>
<span className="column-1 color-666">90分以上</span>
<span className="column-1 color-666">80-89</span>
<span className="column-1 color-666">70-79</span>
<span className="column-1 color-666">60-69</span>
<span className="column-1 color-666">50-59</span>
<span className="column-1 color-666">低于50分</span>
</p>
{
Spintype===false?target_score.map((i,k)=>{
return(
<li className={"clearfix newtarget_scoreclass lipadding10im"} key={k}>
<span className="column-1 color-05101A">{k+1}</span>
<span className="column-1 color-05101A">{i.average_score}</span>
<span className="column-1 colorFF6800">{i.top_score}</span>
<span className="column-1 color-green">{i.low_score}</span>
<span className="column-1 color-05101A">
<div>{i.from90[0]}</div>
<div className="color999">{(i.from90[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from80[0]}</div>
<div className="color999">{(i.from80[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from70[0]}</div>
<div className="color999">{(i.from70[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from60[0]}</div>
<div className="color999">{(i.from60[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from50[0]}</div>
<div className="color999">{(i.from50[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from_down[0]}</div>
<div className="color999">{(i.from_down[1]).toFixed(2)}%</div>
</span>
</li>
)
}):""
}
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" }
{target_score.length===0&&Spintype===false?
<li className={"clearfix newtarget_scoreclass lipadding10im"}>
<span className="column-1 color-05101A">--</span>
<span className="column-1 color-05101A">--</span>
<span className="column-1 colorFF6800">--</span>
<span className="column-1 color-green">--</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
</li>:""}
</div>
</div>
</div>
);
}
}
export default SnackbarHOC() ( TPMIndexHOC ( EcCompletionCalculation ) );

@ -0,0 +1,656 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import classNames from 'classnames'
import axios from 'axios';
import { TPMIndexHOC } from '../../../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder'
import { Select,message,Modal,Input,Spin,Icon,Tooltip } from 'antd';
import EcTitleCourseEvaluations from '../../ecTitle/ecTitle'
import 'antd/dist/antd.css';
import '../../css/ecCourseSupports.css';
const $ = window.$;
class EcCourseSupports extends Component {
constructor(props) {
super(props)
this.state={
data:'',
ec_courses_list:[],
editcourse:[{"weigths": 0,
"ec_course_name":'',
"top_relation": false,
"ec_course_id":''
}],
editnum:0,
index:0,
ec_graduation_subitem_id:0,
ec_year_id:0,
schooldata:{},
spinning:true,
ecComponentState:'EcCourseSupports',
supportid:null,
Editkey:null,
titlemessage:"提示",
Supportstype:false,
Supportslist:'',
Supportssum:false,
Supportsclass:false
}
}
componentWillMount(){
this.setState({
ec_year_id:this.props.match.params.ec_year_id,
major_school_id:this.props.match.params.major_school_id
})
window.document.title = '课程体系 vs 毕业要求';
}
UpdateClassData=()=>{
let ec_year_id=this.props.match.params.ec_year_id;
this.setState({
ec_year_id:ec_year_id
})
const jol =`/ec_major_schools/get_navigation_data?ec_year_id=`+ec_year_id;
axios.get(jol, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
// if(response.data.allow_visit===false){
// window.location.href="/403"
// }
this.setState({
schooldata:response.data
})
}
})
.catch(function (error) {
console.log(error);
});
const url = `/ec_course_supports?ec_year_id=`+ec_year_id;
axios.get(url, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
this.setState({
data:response.data
})
}
if(response.data.course_support_data.length===0){
this.setState({
Supportstype:true,
Supportslist:'数据为空,请去毕业要求——>毕业要求指标点分解列表配置数据'
})
}
})
.catch(function (error) {
console.log(error);
});
// this.setState({
// data:{course_count: 14,
// course_support_data: [
// {course_data: [{
// name: "军事课堂",
// top_relation: true,
// weigths: 0.1
// }, {
// name: "大学生心理健康教育",
// top_relation: true,
// weigths: 0.2
// }],
// ec_graduation_subitem_id: 2,
// num_total: 2,
// sequence_num: "1-1",
// weights_total: 0.30000000000000004,
// },
// ],
// course_url: "/ec_major_schools/1/academic_years/1/ec_course_setting",
// ec_year_id: 1,
// max_support_count: 12,
// subitems_count: 7,
// subitems_url: "/ec_major_schools/1/academic_years/1/graduation_requirement"
// }
// })
}
componentDidMount(){
this.setState({
ec_year_id:this.props.match.params.ec_year_id,
major_school_id:this.props.match.params.major_school_id
})
this.UpdateClassData();
}
EditSupportCourse=(key,e)=>{
$('#school_major_list').scrollLeft(0);
let id=e.target.id;
id=parseInt(id);
let subindex =e.target.getAttribute("subindex");
const url = `/ec_course_supports/edit_require_vs_course?subitem_id=`+id
axios.get(url, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
var support_data;
if(response.data.edit_support_data.length>0){
support_data=response.data.edit_support_data;
}else if(response.data.edit_support_data.length===0){
support_data=[{weights: 0,top_relation: false,ec_course_name:'',ec_course_id:''}];
}
this.setState({
ec_courses_list:response.data.ec_courses_list,
editcourse:support_data,
index:subindex,
ec_graduation_subitem_id:id,
Supportssum:false,
Supportsclass:false,
})
let {editcourse} =this.state;
let neweditcourse=editcourse;
let newnum=0;
for(var j=0;j<neweditcourse.length;j++){
if(neweditcourse[j].weigths===undefined){
newnum=0
}else{
newnum=newnum+neweditcourse[j].weigths;
}
}
newnum= Math.round(newnum*100)/100;
this.setState({
editnum:newnum
})
}
})
.catch(function (error) {
console.log(error);
});
this.setState({
Editkey:key
})
// $("#school_ListTableLine").show();
// let offsettop=$("#school_ListTableLine").position().top||$("#school_ListTableLine").scrollTop || $("#school_ListTableLine").pageYOffset;
// window.scrollTo(0, offsettop)
}
Addcourse=(e)=>{
let {editcourse} =this.state;
let neweditcourse=editcourse;
let newadd = {weigths: 0,top_relation: false,ec_course_name:'',ec_course_id:''};
neweditcourse.push(newadd);
this.setState({
editcourse:neweditcourse
})
}
editcourse=(neweditcourse)=>{
this.setState({
editcourse:neweditcourse
})
}
Deletcourse=(e)=>{
// 删除
// let id =e.target.getAttribute("index");
let {editcourse} = this.state;
let neweditcourse=editcourse;
neweditcourse.splice(e,1);
let newnum=0;
for(var j=0;j<neweditcourse.length;j++){
if(neweditcourse[j].weigths===undefined){
newnum=0
}else{
newnum=newnum+neweditcourse[j].weigths;
}
}
newnum= Math.round(newnum*100)/100;
this.setState({
Supportstype:false,
supportid:null,
Supportslist:"",
editcourse:neweditcourse,
editnum:newnum
})
}
enterweight=(e)=>{
let {editcourse} = this.state;
let neweditcourse=editcourse;
var id=e.target.id;
var value=parseFloat(e.target.value);
if(isNaN(value)){
value=""
}
var x = String(value).indexOf('.') + 1;
var y = String(value).length - x;
if(y > 2){
this.setState({
// Supportstype:true,
Supportslist:'请精确到2位数',
Supportssum:true
})
return
}
const person = new Object ();
person.weigths=value;
person.ec_course_id= neweditcourse[id].ec_course_id;
person.ec_course_name=neweditcourse[id].ec_course_name;
person.top_relation=neweditcourse[id].top_relation;
neweditcourse[id]=person;
let newnum=0;
for(var j=0;j<neweditcourse.length;j++){
if(neweditcourse[j].weigths===undefined){
newnum=newnum+0;
}else if(neweditcourse[j].weigths===""){
newnum=newnum+0;
}else{
newnum=newnum+neweditcourse[j].weigths;
}
}
newnum= Math.round(newnum*100)/100;
this.setState({
editnum:newnum,
editcourse:neweditcourse
})
if(newnum>1){
this.setState({
// Supportstype:true,
Supportslist:'权重之和不能大于1',
Supportssum:true
})
}
}
handleChange=(e)=> {
let {editcourse} = this.state;
let value=`${e[0]}`;
value=parseInt(value)
let neweditcourse=editcourse;
let num=`${e[1]}`;
num=parseInt(num)
for(var z=0;z<editcourse.length;z++){
if(neweditcourse[z].ec_course_name===`${e[2]}`){
this.setState({
Supportstype:true,
Supportslist:"请勿选择重复的支持课程"
})
return
}
}
for(var i=0;i<1;i++){
neweditcourse[num].ec_course_id=value;
neweditcourse[num].ec_course_name=`${e[2]}`
}
this.editcourse(neweditcourse);
}
relevancetop=(e)=>{
let {editcourse} = this.state;
let neweditcourse=editcourse;
let id =e.target.getAttribute("itindex");
for(var i=0;i<1;i++){
neweditcourse[id].top_relation=false;
}
this.editcourse(neweditcourse);
}
relevancebottom=(e)=>{
let {editcourse} = this.state;
let neweditcourse=editcourse;
let id =e.target.getAttribute("itindex");
for(var i=0;i<1;i++){
neweditcourse[id].top_relation=true;
}
this.editcourse(neweditcourse);
}
focus() {
this.inputNumberRef.focus();
}
blur() {
this.inputNumberRef.blur();
}
CancelSupports=()=>{
this.setState({
Editkey:null,
Supportssum:false,
Supportsclass:false,
})
}
SubmitClassData=()=>{
let {editcourse,editnum,ec_graduation_subitem_id,ec_year_id} = this.state;
if(editcourse.length===0){
this.setState({
// Supportstype:true,
Supportslist:'保存失败,至少保留一个课程',
Supportssum:true
})
return
}
if(editnum>1||editnum===0){
this.setState({
// Supportstype:true,
Supportslist:'保存失败,权重大于1或为空',
Supportssum:true
})
return
}
for(var p=0; p<editcourse.length;p++){
if(editcourse[p].weigths===""){
editcourse[p].weigths=0;
}
if(editcourse[p].ec_course_id===""){
this.setState({
// Supportstype:true,
Supportslist:'保存失败,课程不能为空',
Supportsclass:true
})
return
}
}
var Url = '/ec_course_supports';
axios.post(Url, {
ec_year_id: ec_year_id,
ec_graduation_subitem_id:ec_graduation_subitem_id,
course: editcourse
},
{
withCredentials: true
}
).then((response) => {
if(response.data.status===0){
this.setState({
Editkey:null,
Supportslist:response.data.messsage,
Supportstype:true,
Supportssum:false,
Supportsclass:false,
})
this.UpdateClassData();
}else if(response.data.status===-1){
this.setState({
Supportslist:"参数错误",
Supportstype:true,
Supportssum:false,
Supportsclass:false,
})
}
}).catch((error) => {
console.log(error)
})
}
Deletcourses=(key)=>{
this.setState({
supportid:key,
Supportslist:"您确定要删除吗?",
Supportstype:true
})
}
hideSupports=()=>{
this.setState({
Supportstype:false,
supportid:null,
Supportslist:"",
})
}
render() {
const Option = Select.Option;
let {data,ec_courses_list,editcourse,editnum,index,ec_year_id,schooldata,ecComponentState,hidesupport,supportid,Editkey,titlemessage,Supportstype,Supportslist,Supportssum,Supportsclass,major_school_id} = this.state;
var list = (length) => {
var res = [];
for(var i = 0; i < length; i++) {
res.push( <span key={i} className="column-1 color-666">
<div style={{lineHeight: '20px'}}>支撑课程
<br/> 权值
</div>
</span>)
}
return res
}
return (
<div className="newMain clearfix">
<Modal
title={titlemessage}
// Supportstype
visible={Supportstype}
className={"ecmodeldelet"}
closable={false}
footer={null}
>
<div className="task-popup-content">
<div className="task-popup-text-center font-14">{Supportslist}</div>
</div>
<div className="task-popup-submit clearfix">
<a onClick={this.hideSupports} className="task-btn fl">取消</a>
{ supportid===null?<a className="task-btn task-btn-orange fr"
onClick={this.hideSupports}
>确定</a>:
<a className="task-btn task-btn-orange fr"
onClick={()=>this.Deletcourse(supportid)}
>确定</a>}
</div>
</Modal>
<div className="educontent mb290">
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecComponentState={ecComponentState}
ecpath={"requirement_vs_courses"}
/>
<div className="edu-back-white eacourse">
<div className="clearfix padding20-30 bor-bottom-greyE" style={{position:'relative'}}>
<span className="font-18 courseSystem">课程体系对毕业要求的支撑</span>
{/* <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>
<div className="color-grey-9 mr10">用矩阵图的形式说明本专业课程体系对毕业要求的支撑关系 <a className={"color-blue"} onClick={() => window.elasticLayer(3534)} >查看详情</a></div>
</div>
<div className="padding20-30" id="training_objective_contents">
<span className="fl SystemParameters" >毕业要求指标点<a href={data.subitems_url}><span className="Systemnum">{data.subitems_count}</span></a></span>
<span className="fl ml20 SystemParameters">课程体系<a href={data.course_url}><span className="Systemnum">{data.course_count}</span></a></span>
</div>
</div>
<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"}}>
<span className="color-666 finishtarget">毕业要求指标点</span>
{list(data.max_support_count<5||data.max_support_count===undefined?5:data.max_support_count)}
<span className="column-1 operationright color-666"
style={{
paddingLeft: '28px'
}}
>合计</span>
</p>
<div className="paddingLF" style={{background:'#fff'}}>
{
data.course_support_data===undefined? <Spin delay={500} className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:data.course_support_data.map((item,key)=>{
return (
<li className={data.course_support_data.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'}}>
<Tooltip placement="bottom" title={item.sequence_title}>
<span className="column-1 columnlocation" style={{display:Editkey!=key?"block":'none',width: '95px', paddingLeft: '23px'}}>{item.sequence_num}</span>
</Tooltip>
{
item.course_data.map((t,kes)=>{
return(
<span key={kes} className="column-1"
style={{
display:Editkey!=key?"block":'none',
marginRight: '-1px'
}}>
<div data-tip-down={t.name} className={t.top_relation===true?"DDred columnbox":"columnbox"}
style={{textAlign: 'center'}}
>{t.name.length>12?t.name.substring(0, 10)+"...":t.name}</div>
<div className={t.top_relation===true?"DDred":""}
style={{textAlign: 'center'}}
>{t.weigths}</div>
</span>
)
})
}
<span className="column-1 operationright" style={{display:Editkey!=key?"block":'none',width:'75px'}}>
<div className="operationColumn">
<div className="left">
<div className="width20 columnbox">{item.num_total===0?" ":item.num_total}</div>
<div className="width20">{Math.round(item.weights_total*100)/100===0?" ":(Math.round(item.weights_total*100)/100)}</div>
</div>
<div className="left operationalter">
{data.is_manager===false?"":<a className="editSubentry" data-tip-down="编辑">
<i className="iconfont icon-bianjidaibeijing color-green" id={item.ec_graduation_subitem_id} subindex={item.sequence_num} onClick={this.EditSupportCourse.bind(this,key)}></i>
</a>}
</div>
</div>
</span>
<p className="ListTableLine" id="school_ListTableLine" style={{width: '1134px',display:Editkey===key?"block":'none'}} >
<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 className="Systempoint">精确到两位小数</span>
</span>
<span className="column-1 ml50">关联度最高</span>
</p>
<div className="clearfix editorModify">
{
editcourse.map((it,key)=>{
return(
<div className="mb15" key={key}>
<Select className={Supportsclass===true?"bor-red heightimportant":"heightimportant"} showSearch value={it.ec_course_name} onChange={this.handleChange}>
{
ec_courses_list.map((qva,qk)=>{
return(
<Option value={[qva.id,key,qva.name]} key={qk}>{qva.name}</Option>
)
})
}
</Select>
<Input
type="number"
size="large"
className={Supportssum===true?"inputWeight bor-red":"inputWeight"}
id={key}
value={it.weigths}
onInput={this.enterweight.bind(this)}
/>
<div className="SetTheAssociated">
<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 gouxuanwhite" style={{display:it.top_relation===false?'block':'none'}} itindex={key} onClick={this.relevancebottom.bind(this)}></i>
</div>
<div className="left operatebutton">
<a className="mr15 delSubentry" data-tip-down="删除">
<i className="iconfont icon-shanchu color-grey-c font-15" onClick={()=>this.Deletcourses(key)}></i>
</a>
<a className="newAddSubentry" data-tip-down="添加"
style={{display:key===editcourse.length-1?"inline-block":'none'}}
><i className="iconfont icon-tianjiafangda color-green" onClick={this.Addcourse}></i></a>
</div>
</div>
</div>
)
})
}
</div>
<span className="c_red none ml35" id="error_tip" style={{display:Supportssum===true||Supportsclass===true?'inline':'none'}}>{Supportslist}</span>
<div className="clearfix editorModify">
<span className="column-1"
style={{
width: '580px',
paddingLeft: '37px',
display: 'inline-block'
}}
>合计: <span>{editcourse.length}</span></span>
<span className="ml30">合计: <span>{editnum}</span></span>
</div>
<div className="right editglybuttonboxs">
<div className="defalutSubmitbtn fr" onClick={this.SubmitClassData}>保存</div>
<div className="defalutCancelbtn fr mr20" onClick={this.CancelSupports}>取消</div>
</div>
</p>
</li>
)
})
}
</div>
</div>
</div>
</div>
);
}
}
export default SnackbarHOC() ( TPMIndexHOC ( ecCourseSupports ) );

@ -391,9 +391,16 @@ class MainContentContainer extends Component {
// var fileUpdatePromise = this.doFileUpdateRequest(true)
// });
// }
window.addEventListener("beforeunload", this.beforeunload);
}
componentWillUnmount() {
// window.$(window).off( "unload" )
window.removeEventListener("beforeunload", this.beforeunload);
}
beforeunload = () => {
this.doFileUpdateRequestOnCodeMirrorBlur()
}

@ -1,10 +1,11 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import {Modal,Input,Checkbox,Tooltip,Spin} from "antd";
import {Modal,Input,Checkbox,Tooltip,Spin,notification} from "antd";
import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd';
import Modals from '../../modals/Modals';
import '../ShixunPaths.css';
import axios from 'axios';
import NewShixunModel from '../../courses/coursesPublic/NewShixunModel';
const $ = window.$;
const Search = Input.Search;
@ -60,36 +61,34 @@ class DetailCardsEditAndAdd extends Component{
this.setState({
selectShixun:true,
patheditarry:[],
page:1
})
this.changeTag(0,"");
// this.changeTag(0,"");
}
//关闭选择实训弹框
cloasShixunBox =()=>{
this.setState({
selectShixun:false,
page:1,
patheditarry:[]
})
}
clickShixunchoose=()=>{
let{patheditarry,shixuns_listeditlist,shixuns_listedit}=this.state
showNotification = (description, message = "提示", icon) => {
const data = {
message,
description
}
if (icon) {
data.icon = icon;
}
notification.open(data);
}
clickShixunchoose=(patheditarry)=>{
let{shixuns_listeditlist,shixuns_listedit}=this.state
let newshixuns_listedit=shixuns_listedit;
let list=shixuns_listeditlist
if(patheditarry.length===0){
this.setState({
Modalstype:true,
Modalstopval:'请选择实训',
cardsModalsave:this.cardsModalsave
})
return
}
let url='/paths/append_to_stage.json'
axios.post(url,{
shixun_id:patheditarry
@ -98,6 +97,19 @@ class DetailCardsEditAndAdd extends Component{
if(response.data){
let newshixun_lists=response.data.shixun_lists;
for(var j=0; j<newshixuns_listedit.length; j++){
for(var a=0; a<newshixun_lists.length; a++){
if(newshixuns_listedit[j].shixun_id===newshixun_lists[a].shixun_id){
// this.setState({
// Modalstype:true,
// Modalstopval:'请勿重复选择'+newshixun_lists[a].shixun_name+'实训',
// })
this.showNotification('请勿重复选择:'+newshixun_lists[a].shixun_name+'实训')
return
}
}
}
for(var z=0; z<newshixun_lists.length; z++){
newshixuns_listedit.push(newshixun_lists[z]);
}
@ -148,38 +160,7 @@ class DetailCardsEditAndAdd extends Component{
})
}
//打开选择实训弹框初始化tag标签和列表
changeTag=(id,search)=>{
this.setState({
ChooseShixunListshixun_list:[],
page:1,
hometypepvisible:true,
})
let pathId=this.props.pathid;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
if(search!="" && search!=undefined){
url+="&search="+search;
}
if(id!=0){
url+="&type="+id;
}
axios.get(encodeURI(url)).then((result)=>{
if(result.status===200){
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:id,
ChooseShixunListshixun_list:result.data.shixun_list
})
}
}).catch((error)=>{
console.log(error);
})
}
//勾选实训
shixunhomeworkedit=(list)=>{
@ -307,57 +288,7 @@ class DetailCardsEditAndAdd extends Component{
}
contentViewScrolladd=(e)=>{
const {ChooseShixunList}=this.state;
//滑动到底判断
let newscrollTop=parseInt(e.currentTarget.scrollTop);
let allclientHeight=e.currentTarget.clientHeight+newscrollTop;
if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){
if(ChooseShixunList.shixun_list.length===0){
return
}else{
// console.log("到达底部");
this.setState({
hometypepvisible:true
})
let pathId=this.props.pathid;
let {search,page,type,ChooseShixunListshixun_list}=this.state;
let newpage=page+1;
let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
if(search!="" && search!=undefined){
url+="&search="+search;
}
if(type!=0){
url+="&type="+type;
}
axios.get(encodeURI(url)).then((result)=>{
if(result.status===200){
let list =result.data.shixun_list;
for(var i=0; i<list.length; i++){
newChooseShixunListshixun_list.push(list[i])
}
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:type,
search:search,
page:newpage,
ChooseShixunListshixun_list:newChooseShixunListshixun_list
})
}
}).catch((error)=>{
console.log(error);
})
}
}
}
onDragEnd (result) {
let {shixuns_listedit,shixuns_listeditlist} =this.state;
@ -456,99 +387,13 @@ class DetailCardsEditAndAdd extends Component{
`
}
</style>:""}
{selectShixun===true?<NewShixunModel
NewShixunModelType={selectShixun}
hideNewShixunModelType={this.cloasShixunBox}
pathShixun={this.clickShixunchoose}
{...this.props}
></NewShixunModel>:""}
<Modal
keyboard={false}
title="选择实训"
visible={selectShixun}
closable={false}
footer={null}
width="840px"
destroyOnClose={true}
>
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
{
ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
return(
<li className="fl mr5 mt5" key={key}>
<a onClick={()=>this.changeTag(`${item.tag_id}`,`${search}`)} className={ parseInt(type) === parseInt(item.tag_id) ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>{item.tag_name}</a>
</li>
)
})
}
</div>
<div className="clearfix mb20" id="shixun_search_form_div">
<span className="fl color-grey-9 font-16 mt3">
<span></span>
<span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
<span>个实训</span>
</span>
<div className="fr search-new mb0">
<Search
placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput}
onSearch={()=>this.changeTag(`${type}`,`${search}`)}
style={{width: '115%'}}
></Search>
</div>
</div>
<ul className="clearfix greybackHead edu-txt-center" style={{marginBottom: '0px'}}>
<li className="fl with40 paddingleft22">实训名称</li>
<li className="fl with30 edu-txt-left">使用院校</li>
<li className="fl with10">使用人数</li>
<li className="fl with10">评价等级</li>
<li className="fl with10"></li>
</ul>
<style>
{
`
.over180{min-height: 180px;max-height: 180px;overflow-y: auto}
`
}
</style>
{ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"": <div className="over180 pl20 pr20"
onScroll={this.contentViewScrolladd}
>
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
{
ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl with40">
<Checkbox
id={"shixun_input_"+item.shixun_id}
value={item.shixun_id}
key={item.shixun_id}
className="fl task-hide edu-txt-left"
style={{"width":"298px"}}
name="shixun_homework[]"
>
<label style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name" title={item.shixun_name}>{item.shixun_name}</label>
</Checkbox>
</li>
<li className="fl with30 edu-txt-left task-hide paddingl5">{item.school_users}</li>
<li className="fl with10 paddingl10">{item.myshixuns_count}</li>
<li className="fl with10 color-orange-tip paddingl10">{item.preference}</li>
<li className="fl with10"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
</div>
)
})
}
</Checkbox.Group>
</div>}
<div className="mt20 marginauto clearfix edu-txt-center">
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.cloasShixunBox}>取消</a>
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>
</div>
</div>
</Spin>
</Modal>
</div>
{/* 可拖拽选择实训列表*/}
@ -650,4 +495,185 @@ class DetailCardsEditAndAdd extends Component{
)
}
}
export default DetailCardsEditAndAdd;
export default DetailCardsEditAndAdd;
//
// <Modal
// keyboard={false}
// title="选择实训"
// visible={selectShixun}
// closable={false}
// footer={null}
// width="840px"
// destroyOnClose={true}
// >
// <Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
// <div className="newupload_conbox">
// <div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
// <li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
// {
// ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
// return(
// <li className="fl mr5 mt5" key={key}>
// <a onClick={()=>this.changeTag(`${item.tag_id}`,`${search}`)} className={ parseInt(type) === parseInt(item.tag_id) ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>{item.tag_name}</a>
// </li>
// )
// })
// }
//
//
// </div>
// <div className="clearfix mb20" id="shixun_search_form_div">
// <span className="fl color-grey-9 font-16 mt3">
// <span>共</span>
// <span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
// <span>个实训</span>
// </span>
// <div className="fr search-new mb0">
// <Search
// placeholder="请输入创建者或者实训名称进行搜索"
// onInput={this.searchNameInput}
// onSearch={()=>this.changeTag(`${type}`,`${search}`)}
// style={{width: '115%'}}
// ></Search>
// </div>
// </div>
// <ul className="clearfix greybackHead edu-txt-center" style={{marginBottom: '0px'}}>
// <li className="fl with40 paddingleft22">实训名称</li>
// <li className="fl with30 edu-txt-left">使用院校</li>
// <li className="fl with10">使用人数</li>
// <li className="fl with10">评价等级</li>
// <li className="fl with10"></li>
// </ul>
//
// <style>
// {
// `
// .over180{min-height: 180px;max-height: 180px;overflow-y: auto}
// `
// }
// </style>
// {ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"": <div className="over180 pl20 pr20"
// onScroll={this.contentViewScrolladd}
// >
// <Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
// {
// ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{
// return(
// <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
// <li className="fl with40">
// <Checkbox
// id={"shixun_input_"+item.shixun_id}
// value={item.shixun_id}
// key={item.shixun_id}
// className="fl task-hide edu-txt-left"
// style={{"width":"298px"}}
// name="shixun_homework[]"
// >
// <label style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name" title={item.shixun_name}>{item.shixun_name}</label>
// </Checkbox>
// </li>
// <li className="fl with30 edu-txt-left task-hide paddingl5">{item.school_users}</li>
// <li className="fl with10 paddingl10">{item.myshixuns_count}</li>
// <li className="fl with10 color-orange-tip paddingl10">{item.preference}</li>
// <li className="fl with10"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
// </div>
// )
// })
// }
// </Checkbox.Group>
// </div>}
// <div className="mt20 marginauto clearfix edu-txt-center">
// <a className="pop_close task-btn mr30 margin-tp26" onClick={this.cloasShixunBox}>取消</a>
// <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>
// </div>
// </div>
// </Spin>
// </Modal>
// contentViewScrolladd=(e)=>{
// const {ChooseShixunList}=this.state;
// //滑动到底判断
// let newscrollTop=parseInt(e.currentTarget.scrollTop);
// let allclientHeight=e.currentTarget.clientHeight+newscrollTop;
//
// if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){
//
// if(ChooseShixunList.shixun_list.length===0){
// return
// }else{
// // console.log("到达底部");
// this.setState({
// hometypepvisible:true
// })
// let pathId=this.props.pathid;
// let {search,page,type,ChooseShixunListshixun_list}=this.state;
// let newpage=page+1;
// let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
// if(search!="" && search!=undefined){
// url+="&search="+search;
// }
// if(type!=0){
// url+="&type="+type;
// }
// axios.get(encodeURI(url)).then((result)=>{
// if(result.status===200){
// let list =result.data.shixun_list;
//
// for(var i=0; i<list.length; i++){
// newChooseShixunListshixun_list.push(list[i])
// }
// this.setState({
// ChooseShixunList:result.data,
// hometypepvisible:false,
// type:type,
// search:search,
// page:newpage,
// ChooseShixunListshixun_list:newChooseShixunListshixun_list
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
//
// }
//
// }
//
// }
//
// //打开选择实训弹框初始化tag标签和列表
// changeTag=(id,search)=>{
//
// this.setState({
// ChooseShixunListshixun_list:[],
// page:1,
// hometypepvisible:true,
// })
//
// let pathId=this.props.pathid;
//
// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
// if(search!="" && search!=undefined){
// url+="&search="+search;
// }
// if(id!=0){
// url+="&type="+id;
// }
//
// axios.get(encodeURI(url)).then((result)=>{
// if(result.status===200){
// this.setState({
// ChooseShixunList:result.data,
// hometypepvisible:false,
// type:id,
// ChooseShixunListshixun_list:result.data.shixun_list
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
// }

@ -1,8 +1,9 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import {Modal,Input,Checkbox,Tooltip,Spin} from "antd";
import {Modal,Input,Checkbox,Tooltip,Spin,notification} from "antd";
import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd';
import Modals from '../../modals/Modals';
import NewShixunModel from '../../courses/coursesPublic/NewShixunModel';
import '../ShixunPaths.css';
import axios from 'axios';
const $ = window.$;
@ -63,7 +64,7 @@ class DetailCardsEditAndEdit extends Component{
selectShixun:true,
patheditarry:[]
})
this.changeTag(0,"");
// this.changeTag(0,"");
}
//关闭选择实训弹框
cloasShixunBox =()=>{
@ -79,36 +80,7 @@ class DetailCardsEditAndEdit extends Component{
})
}
//打开选择实训弹框初始化tag标签和列表
changeTag(id,search){
this.setState({
ChooseShixunListshixun_list:[],
page:1,
hometypepvisible:true
})
let pathId=this.props.pathid;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
if(search!="" && search!=undefined){
url+="&search="+search;
}
if(id!=0){
url+="&type="+id;
}
axios.get(encodeURI(url)).then((result)=>{
if(result.status===200){
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:id,
search:search,
ChooseShixunListshixun_list:result.data.shixun_list
})
}
}).catch((error)=>{
console.log(error);
})
}
shixunhomeworkedit=(list)=>{
@ -158,22 +130,12 @@ class DetailCardsEditAndEdit extends Component{
}
clickShixunchoose=()=>{
clickShixunchoose=(patheditarry)=>{
let{patheditarry,shixuns_listedit,shixuns_listeditlist}=this.state
let{shixuns_listedit,shixuns_listeditlist}=this.state
let newshixuns_listedit=shixuns_listedit;
let list=shixuns_listeditlist
if(patheditarry.length===0){
this.setState({
Modalstype:true,
Modalstopval:'请选择实训',
})
return
}
let url='/paths/append_to_stage.json'
axios.post(url,{
shixun_id:patheditarry
@ -184,10 +146,11 @@ class DetailCardsEditAndEdit extends Component{
for(var j=0; j<newshixuns_listedit.length; j++){
for(var a=0; a<newshixun_lists.length; a++){
if(newshixuns_listedit[j].shixun_id===newshixun_lists[a].shixun_id){
this.setState({
Modalstype:true,
Modalstopval:'请勿重复选择'+newshixun_lists[a].shixun_name+'实训',
})
// this.setState({
// Modalstype:true,
// Modalstopval:'请勿重复选择'+newshixun_lists[a].shixun_name+'实训',
// })
this.showNotification('请勿重复选择:'+newshixun_lists[a].shixun_name+'实训')
return
}
}
@ -338,69 +301,16 @@ class DetailCardsEditAndEdit extends Component{
})
}
contentViewScrolledit=(e)=>{
//滑动到底判断
const {ChooseShixunList}=this.state;
let newscrollTop=parseInt(e.currentTarget.scrollTop);
let allclientHeight=e.currentTarget.clientHeight+newscrollTop;
if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){
if(ChooseShixunList.shixun_list.length===0){
return
}else{
this.setState({
hometypepvisible:true
})
// console.log("到达底部");
let {page,type,search,ChooseShixunListshixun_list}=this.state;
let newpage=page+1;
let pathId=this.props.pathid;
let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
if(search!="" && search!=undefined){
url+="&search="+search;
}
if(type!=0){
url+="&type="+type;
}
axios.get(encodeURI(url)).then((result)=>{
if(result.status===200){
let list =result.data.shixun_list;
for(var i=0; i<list.length; i++){
newChooseShixunListshixun_list.push(list[i])
}
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:type,
page:newpage,
search:search,
ChooseShixunListshixun_list:newChooseShixunListshixun_list
})
}
}).catch((error)=>{
console.log(error);
})
}
}
}
showNotification = (description, message = "提示", icon) => {
const data = {
message,
description
}
if (icon) {
data.icon = icon;
}
notification.open(data);
}
render(){
let {selectShixun,
@ -483,99 +393,13 @@ class DetailCardsEditAndEdit extends Component{
}
</style>:""}
{selectShixun===true?<NewShixunModel
NewShixunModelType={selectShixun}
hideNewShixunModelType={this.cloasShixunBox}
pathShixun={this.clickShixunchoose}
{...this.props}
></NewShixunModel>:""}
<Modal
keyboard={false}
title="选择实训"
visible={selectShixun}
closable={false}
footer={null}
width="840px"
destroyOnClose={true}
>
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
{
ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
return(
<li className="fl mr5 mt5" key={key}>
<a onClick={()=>this.changeTag(`${item.tag_id}`,`${search}`)} className={ parseInt(type) === parseInt(item.tag_id) ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>{item.tag_name}</a>
</li>
)
})
}
</div>
<div className="clearfix mb20" id="shixun_search_form_div">
<span className="fl color-grey-9 font-16 mt3">
<span></span>
<span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
<span>个实训</span>
</span>
<div className="fr search-new mb0">
<Search
placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput}
onSearch={()=>this.changeTag(`${type}`,`${search}`)}
style={{width: '115%'}}
></Search>
</div>
</div>
<ul className="clearfix greybackHead edu-txt-center" style={{marginBottom: '0px'}}>
<li className="fl with40 paddingleft22">实训名称</li>
<li className="fl with30 edu-txt-left">使用院校</li>
<li className="fl with10">使用人数</li>
<li className="fl with10">评价等级</li>
<li className="fl with10"></li>
</ul>
<style>
{
`
.over180{min-height: 180px;max-height: 180px;overflow-y: auto}
`
}
</style>
{ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"":<div className="over180 pl20 pr20"
onScroll={this.contentViewScrolledit}
>
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
{
ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl with40">
<Checkbox
id={"shixun_input_"+item.shixun_id}
value={item.shixun_id}
key={item.shixun_id}
className="fl task-hide edu-txt-left"
style={{"width":"298px"}}
name="shixun_homework[]"
>
<label style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name" title={item.shixun_name}>{item.shixun_name}</label>
</Checkbox>
</li>
<li className="fl with30 edu-txt-left task-hide paddingl5">{item.school_users}</li>
<li className="fl with10 paddingl10">{item.myshixuns_count}</li>
<li className="fl with10 color-orange-tip paddingl10">{item.preference}</li>
<li className="fl with10"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
</div>
)
})
}
</Checkbox.Group>
</div>}
<div className="mt20 marginauto clearfix edu-txt-center">
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.cloasShixunBox}>取消</a>
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>
</div>
</div>
</Spin>
</Modal>
</div>
{/* 可拖拽选择实训列表*/}
@ -716,4 +540,191 @@ export default DetailCardsEditAndEdit;
// </div>
// )
// })
// }
// }
// <Modal
// keyboard={false}
// title="选择实训"
// visible={selectShixun}
// closable={false}
// footer={null}
// width="840px"
// destroyOnClose={true}
// >
// <Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
// <div className="newupload_conbox">
// <div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
// <li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
// {
// ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
// return(
// <li className="fl mr5 mt5" key={key}>
// <a onClick={()=>this.changeTag(`${item.tag_id}`,`${search}`)} className={ parseInt(type) === parseInt(item.tag_id) ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>{item.tag_name}</a>
// </li>
// )
// })
// }
//
//
// </div>
// <div className="clearfix mb20" id="shixun_search_form_div">
// <span className="fl color-grey-9 font-16 mt3">
// <span>共</span>
// <span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
// <span>个实训</span>
// </span>
// <div className="fr search-new mb0">
// <Search
// placeholder="请输入创建者或者实训名称进行搜索"
// onInput={this.searchNameInput}
// onSearch={()=>this.changeTag(`${type}`,`${search}`)}
// style={{width: '115%'}}
// ></Search>
// </div>
// </div>
// <ul className="clearfix greybackHead edu-txt-center" style={{marginBottom: '0px'}}>
// <li className="fl with40 paddingleft22">实训名称</li>
// <li className="fl with30 edu-txt-left">使用院校</li>
// <li className="fl with10">使用人数</li>
// <li className="fl with10">评价等级</li>
// <li className="fl with10"></li>
// </ul>
//
// <style>
// {
// `
// .over180{min-height: 180px;max-height: 180px;overflow-y: auto}
// `
// }
// </style>
// {ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"":<div className="over180 pl20 pr20"
// onScroll={this.contentViewScrolledit}
// >
// <Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
// {
// ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{
// return(
// <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
// <li className="fl with40">
// <Checkbox
// id={"shixun_input_"+item.shixun_id}
// value={item.shixun_id}
// key={item.shixun_id}
// className="fl task-hide edu-txt-left"
// style={{"width":"298px"}}
// name="shixun_homework[]"
// >
// <label style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name" title={item.shixun_name}>{item.shixun_name}</label>
// </Checkbox>
// </li>
// <li className="fl with30 edu-txt-left task-hide paddingl5">{item.school_users}</li>
// <li className="fl with10 paddingl10">{item.myshixuns_count}</li>
// <li className="fl with10 color-orange-tip paddingl10">{item.preference}</li>
// <li className="fl with10"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
// </div>
// )
// })
// }
// </Checkbox.Group>
// </div>}
// <div className="mt20 marginauto clearfix edu-txt-center">
// <a className="pop_close task-btn mr30 margin-tp26" onClick={this.cloasShixunBox}>取消</a>
// <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>
// </div>
// </div>
// </Spin>
// </Modal>
// //打开选择实训弹框初始化tag标签和列表
// changeTag(id,search){
//
// this.setState({
// ChooseShixunListshixun_list:[],
// page:1,
// hometypepvisible:true
// })
// let pathId=this.props.pathid;
// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
// if(search!="" && search!=undefined){
// url+="&search="+search;
// }
// if(id!=0){
// url+="&type="+id;
// }
// axios.get(encodeURI(url)).then((result)=>{
// if(result.status===200){
// this.setState({
// ChooseShixunList:result.data,
// hometypepvisible:false,
// type:id,
// search:search,
// ChooseShixunListshixun_list:result.data.shixun_list
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
// }
// contentViewScrolledit=(e)=>{
// //滑动到底判断
// const {ChooseShixunList}=this.state;
// let newscrollTop=parseInt(e.currentTarget.scrollTop);
// let allclientHeight=e.currentTarget.clientHeight+newscrollTop;
//
// if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){
//
// if(ChooseShixunList.shixun_list.length===0){
// return
// }else{
// this.setState({
// hometypepvisible:true
// })
// // console.log("到达底部");
//
// let {page,type,search,ChooseShixunListshixun_list}=this.state;
//
// let newpage=page+1;
//
// let pathId=this.props.pathid;
//
// let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
//
// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
//
// if(search!="" && search!=undefined){
// url+="&search="+search;
// }
//
// if(type!=0){
// url+="&type="+type;
// }
// axios.get(encodeURI(url)).then((result)=>{
// if(result.status===200){
//
// let list =result.data.shixun_list;
//
// for(var i=0; i<list.length; i++){
// newChooseShixunListshixun_list.push(list[i])
// }
// this.setState({
// ChooseShixunList:result.data,
// hometypepvisible:false,
// type:type,
// page:newpage,
// search:search,
// ChooseShixunListshixun_list:newChooseShixunListshixun_list
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
//
//
// }
//
//
//
// }
//
// }

@ -362,6 +362,9 @@ class PathDetailIndex extends Component{
.head-right{
line-height: 30px;
}
.padding40-20-30{
padding:40px 20px 30px;
}
`
}
</style>
@ -457,7 +460,7 @@ class PathDetailIndex extends Component{
}
{
this.props.checkIfLogin()===false?"":progress === undefined ? "" : progress === null ? "" :
<div className="edu-back-white myProgress padding40-20 mb10">
<div className="edu-back-white myProgress padding40-20-30 mb10">
<p className="mb20">
<span className="font-16 mr10">关卡数</span>
<Tooltip placement="bottom" title="已通关数/关卡总数">
@ -468,7 +471,8 @@ class PathDetailIndex extends Component{
<span className="fl color-green">已学 {progress.learned}%</span>
<span className="fr color-grey-9" id="time-consuming">学习耗时{this.timeStamp(progress.time)} </span>
</p>
<div className="myProgressNav"><div className="myProgressGreen" style={{"width":`${progress.learned+"%"}`}}></div></div>
<div className="myProgressNav mb20"><div className="myProgressGreen" style={{"width":`${progress.learned+"%"}`}}></div></div>
<span className="font-14 color-grey-8">: 我的进展以已发布的实训详情关卡数为准</span>
</div>
}

@ -8,6 +8,7 @@ class ShixunPath extends Component{
super(props)
}
componentDidMount() {
console.log('configShareForPaths')
configShareForPaths()
}

@ -220,6 +220,7 @@ export default class TPMsettings extends Component {
can_copy: undefined,
task_pass: undefined,
test_set_permission: undefined,
code_edit_permission: undefined,
hide_code: undefined,
code_hidden: undefined,
forbid_copy: undefined,
@ -352,6 +353,7 @@ export default class TPMsettings extends Component {
task_pass: response.data.shixun.task_pass,
test_set_permission: response.data.shixun.test_set_permission,
hide_code: response.data.shixun.hide_code,
code_edit_permission: response.data.shixun.code_edit_permission,
code_hidden: response.data.shixun.code_hidden,
is_secret_repository: response.data.shixun.is_secret_repository,
init_is_secret_repository: response.data.shixun.is_secret_repository,
@ -546,7 +548,11 @@ export default class TPMsettings extends Component {
});
}
code_edit_permission = (e) => {
this.setState({
code_edit_permission: e.target.checked
})
}
code_hidden=(e)=>{
let sum = ""
if (e.target.checked === false) {
@ -869,7 +875,7 @@ export default class TPMsettings extends Component {
let {
name, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum, vnc_evaluate,
evaluate_script, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh,
opening_time,shixunmemoMDvalue,shixun_service_configlist, is_secret_repository
opening_time,shixunmemoMDvalue,shixun_service_configlist, is_secret_repository, code_edit_permission
} = this.state;
let newshixun_service_configlist = shixun_service_configlist.map(v => {
@ -982,6 +988,7 @@ export default class TPMsettings extends Component {
vnc_evaluate: vnc_evaluate===null?undefined:vnc_evaluate,
test_set_permission: test_set_permission,
code_hidden: code_hidden,
code_edit_permission: code_edit_permission,
trainee: trainee,
task_pass: task_pass,
hide_code: hide_code,
@ -1563,6 +1570,7 @@ export default class TPMsettings extends Component {
test_set_permission,
hide_code,
forbid_copy,
code_edit_permission,
code_hidden,
vnc,
vnc_evaluate,
@ -2274,6 +2282,15 @@ export default class TPMsettings extends Component {
</span>
</div>
{!code_hidden && !hide_code && <div className="clearfix mt20 ml30">
<span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>代码开放修改:</span>
<span className="fl mt5">
<Checkbox checked={code_edit_permission === undefined ? false : code_edit_permission}
onChange={this.code_edit_permission}></Checkbox>
<label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则学员可以修改版本库目录中的任意文件内容</label>
</span>
</div>}
<div className="clearfix mt20 ml30">
<span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>隐藏代码窗口:</span>
<span className="fl mt5">

@ -16,8 +16,8 @@ require('codemirror/lib/codemirror.css');
let origin = getUrl();
let path = getUrl("/editormd/lib/")
let path = '/editormd/lib/'
path = getUrl("/editormd/lib/")
const $ = window.$;
let timeout;
@ -171,7 +171,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV
$("#" + _id + " [type=\"inline\"]").bind("click", function () {
_editorName.cm.replaceSelection("`$$$$`");
var __Cursor = _editorName.cm.getDoc().getCursor();
_editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2);
_editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 3);
_editorName.cm.focus();
});
$("[type=\"inline\"]").attr("title", "行内公式");

@ -12,7 +12,7 @@
height: 55px;
width:663px !important;
font-size: 18px;
color: #681616 !important;
/*color: #681616 !important;*/
border-color: #E1EDF8 !important;
}

Loading…
Cancel
Save