Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hs
杨树林 6 years ago
commit ec75a08b34

@ -38,7 +38,7 @@ class AccountsController < ApplicationController
return normal_status(-2, "验证码已失效") if !verifi_code&.effective? return normal_status(-2, "验证码已失效") if !verifi_code&.effective?
end end
code = generate_identifier User, 8 code = generate_identifier User, 8, pre
login = pre + code login = pre + code
@user = User.new(admin: false, login: login, mail: email, phone: phone, type: "User") @user = User.new(admin: false, login: login, mail: email, phone: phone, type: "User")
@user.password = params[:password] @user.password = params[:password]

@ -396,10 +396,10 @@ class ApplicationController < ActionController::Base
end end
# 随机生成字符 # 随机生成字符
def generate_identifier(container, num) def generate_identifier(container, num, pre='')
code = DCODES.sample(num).join code = DCODES.sample(num).join
if container == User if container == User
while container.exists?(login: code) do while container.exists?(login: pre+code) do
code = DCODES.sample(num).join code = DCODES.sample(num).join
end end
else else
@ -451,7 +451,7 @@ class ApplicationController < ActionController::Base
cpu_limit = config.cpu_limit.presence || 1 cpu_limit = config.cpu_limit.presence || 1
cpu_request = config.lower_cpu_limit.presence || 0.1 cpu_request = config.lower_cpu_limit.presence || 0.1
memory_limit = config.memory_limit.presence || 1024 memory_limit = config.memory_limit.presence || 1024
request_limit = config.resource_limit.presence || 10 request_limit = config.request_limit.presence || 10
resource_limit = config.resource_limit.presence || 10000 resource_limit = config.resource_limit.presence || 10000
container << {:image => mirror.name, container << {:image => mirror.name,
:cpuLimit => cpu_limit, :cpuLimit => cpu_limit,

@ -12,7 +12,7 @@ class CoursesController < ApplicationController
end end
before_action :require_login, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups, before_action :require_login, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
:left_banner, :top_banner] :left_banner, :top_banner, :informs, :online_learning]
before_action :check_account, only: [:new, :create, :apply_to_join_course, :join_excellent_course] before_action :check_account, only: [:new, :create, :apply_to_join_course, :join_excellent_course]
before_action :check_auth, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups, before_action :check_auth, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
:left_banner, :top_banner, :apply_to_join_course, :exit_course] :left_banner, :top_banner, :apply_to_join_course, :exit_course]
@ -26,18 +26,21 @@ class CoursesController < ApplicationController
:base_info, :get_historical_courses, :create_group_by_importing_file, :base_info, :get_historical_courses, :create_group_by_importing_file,
:attahcment_category_list,:export_member_scores_excel, :duplicate_course, :attahcment_category_list,:export_member_scores_excel, :duplicate_course,
:switch_to_teacher, :switch_to_assistant, :switch_to_student, :exit_course, :switch_to_teacher, :switch_to_assistant, :switch_to_student, :exit_course,
:informs, :update_informs, :join_excellent_course, :online_learning] :informs, :update_informs, :join_excellent_course, :online_learning,
:update_task_position, :tasks_list]
before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate, before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate,
:transfer_to_course_group, :delete_from_course, :transfer_to_course_group, :delete_from_course,
:search_users, :add_students_by_search, :get_historical_courses, :add_teacher_popup, :add_teacher] :search_users, :add_students_by_search, :get_historical_courses, :add_teacher_popup, :add_teacher]
before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin, before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin,
:set_course_group, :create_group_by_importing_file, :update_informs] :set_course_group, :create_group_by_importing_file, :update_informs,
:update_task_position, :tasks_list]
before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group, before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group,
:change_course_teacher, :export_member_scores_excel, :course_group_list, :change_course_teacher, :export_member_scores_excel, :course_group_list,
:teacher_application_review, :apply_teachers, :delete_course_teacher] :teacher_application_review, :apply_teachers, :delete_course_teacher]
before_action :validate_course_name, only: [:create, :update] before_action :validate_course_name, only: [:create, :update]
before_action :find_board, only: :board_list before_action :find_board, only: :board_list
before_action :validate_page_size, only: :mine before_action :validate_page_size, only: :mine
before_action :course_tasks, only: [:tasks_list, :update_task_position]
if RUBY_PLATFORM =~ /linux/ if RUBY_PLATFORM =~ /linux/
require 'simple_xlsx_reader' require 'simple_xlsx_reader'
@ -58,6 +61,9 @@ class CoursesController < ApplicationController
@courses = Course.where(is_delete: 0, is_hidden: 0, is_end: 0) @courses = Course.where(is_delete: 0, is_hidden: 0, is_end: 0)
end end
# 金课未开课的不显示在首页
@courses = @courses.where("start_date is null or start_date <= '#{Date.today}'")
# 根据搜索关键字进一步筛选 # 根据搜索关键字进一步筛选
if params[:search].present? if params[:search].present?
# REDO:Extension # REDO:Extension
@ -100,7 +106,12 @@ class CoursesController < ApplicationController
# GET /courses/new # GET /courses/new
def new def new
@course = Course.new @course = Course.new
normal_status("成功") unless params[:subject_id].blank?
subject = Subject.find_by(id: params[:subject_id], excellent: 1)
render :json => {status: 0, course_name: "#{subject&.name}#{subject&.courses&.count.to_i + 1}"}
else
normal_status("成功")
end
end end
# Get /courses/:id/settings # Get /courses/:id/settings
@ -152,7 +163,7 @@ class CoursesController < ApplicationController
end end
rescue => e rescue => e
uid_logger_error(e.message) uid_logger_error(e.message)
tip_exception("课堂创建失败!") tip_exception(e.message)
raise ActiveRecord::Rollback raise ActiveRecord::Rollback
end end
end end
@ -685,12 +696,12 @@ class CoursesController < ApplicationController
if order == 1 if order == 1
# REDO:Extension # REDO:Extension
@students = @students.includes(user: :user_extension).order("user_extensions.student_id") @students = @students.includes(user: :user_extension).order("user_extensions.student_id, course_members.id")
elsif order == 2 elsif order == 2
@students = @students.includes(:course_group).order("course_groups.position") @students = @students.includes(:course_group).order("course_groups.position, course_members.id")
else else
# REDO:Extension # REDO:Extension
@students = @students.includes(user: :user_extension).order("user_extensions.student_id") @students = @students.includes(user: :user_extension).order("user_extensions.student_id, course_members.id")
end end
if course_group_id.present? if course_group_id.present?
@ -918,10 +929,10 @@ class CoursesController < ApplicationController
return normal_status(-1, "课堂已结束,无法加入") if course.is_end return normal_status(-1, "课堂已结束,无法加入") if course.is_end
# 实名认证和职业认证的身份判断 # 实名认证和职业认证的身份判断
return normal_status(-1, "该课堂要求成员完成实名和职业认证") if course.authentication && return normal_status(-2, "该课堂要求成员完成实名和职业认证") if course.authentication &&
course.professional_certification && (!current_user.authentication || !current_user.professional_certification) course.professional_certification && (!current_user.authentication && !current_user.professional_certification)
return normal_status(-1, "该课堂要求成员完成实名认证") if course.authentication && !current_user.authentication return normal_status(-2, "该课堂要求成员完成实名认证") if course.authentication && !current_user.authentication
return normal_status(-1, "该课堂要求成员完成职业认证") if course.professional_certification && !current_user.professional_certification return normal_status(-2, "该课堂要求成员完成职业认证") if course.professional_certification && !current_user.professional_certification
# 身份验证 # 身份验证
if params[:professor].blank? && params[:assistant_professor].blank? && params[:student].blank? if params[:professor].blank? && params[:assistant_professor].blank? && params[:student].blank?
@ -1117,6 +1128,47 @@ class CoursesController < ApplicationController
render_ok(count: count, courses: courses.select(:id, :name).as_json) render_ok(count: count, courses: courses.select(:id, :name).as_json)
end end
def tasks_list
case params[:container_type]
when 'shixun_homework'
@tasks = @course.practice_homeworks
when 'common_homework'
@tasks = @course.normal_homeworks
when 'group_homework'
@tasks = @course.group_homeworks
when 'exercise'
@tasks = @course.exercises
when 'poll'
@tasks = @course.polls
when 'graduation_topic'
@tasks = @course.graduation_topics
when 'graduation_task'
@tasks = @course.graduation_tasks
when 'attachment'
@tasks = @course.attachments
else
tip_exception("请指定任务类型")
end
end
def update_task_position
Rails.logger.info("#######task_ids_length#{params[:task_ids].uniq.length}#########task_count:#{@tasks.count}")
tip_exception("task_ids参数有误") if params[:task_ids].blank? || params[:task_ids].uniq.length != @tasks.count
ActiveRecord::Base.transaction do
begin
@tasks.each do |task|
position = params[:task_ids].reverse.index(task.id).to_i + 1
task.update_attributes!(position: position)
end
normal_status(0, "移动成功")
rescue Exception => e
uid_logger(e.message)
tip_exception(e.message)
raise ActiveRecord::Rollback
end
end
end
private private
# Use callbacks to share common setup or constraints between actions. # Use callbacks to share common setup or constraints between actions.
@ -1177,6 +1229,48 @@ class CoursesController < ApplicationController
end end
end end
def course_tasks
case params[:container_type]
when 'shixun_homework'
@tasks = @course.practice_homeworks
when 'common_homework'
@tasks = @course.normal_homeworks
when 'group_homework'
@tasks = @course.group_homeworks
when 'exercise'
@tasks = @course.exercises
when 'poll'
@tasks = @course.polls
when 'graduation_topic'
@tasks = @course.graduation_topics
when 'graduation_task'
@tasks = @course.graduation_tasks
when 'attachment'
@tasks = @course.attachments
else
tip_exception("请指定任务类型")
end
end
# def find_container
# case params[:container_type]
# when 'shixun_homework', 'common_homework', 'group_homework'
# @task = HomeworkCommon.find_by(id: params[:container_id])
# when 'exercise'
# @task = Exercise.find_by(id: params[:container_id])
# when 'poll'
# @task = Poll.find_by(id: params[:container_id])
# when 'graduation_topic'
# @task = GraduationTopic.find_by(id: params[:container_id])
# when 'graduation_task'
# @task = GraduationTask.find_by(id: params[:container_id])
# when 'attachment'
# @task = Attachment.find_by(id: params[:container_id])
# else
# tip_exception("container_type参数有误")
# end
# end
def student_act_score group_id, search def student_act_score group_id, search
sql_select = %Q{SELECT cm.*,( sql_select = %Q{SELECT cm.*,(
SELECT SUM(student_works.work_score) SELECT SUM(student_works.work_score)

@ -348,7 +348,7 @@ class ExerciseQuestionsController < ApplicationController
#当试卷已发布时(试卷的总状态),当标准答案修改时,如有已提交的学生,需重新计算分数. #当试卷已发布时(试卷的总状态),当标准答案修改时,如有已提交的学生,需重新计算分数.
if @exercise.exercise_status == Exercise::PUBLISHED if @exercise.exercise_status >= Exercise::PUBLISHED
ex_users_committed = @exercise.exercise_users.exercise_user_committed ex_users_committed = @exercise.exercise_users.exercise_user_committed
if ex_users_committed.size > 0 if ex_users_committed.size > 0
ex_users_committed.each do |ex_user| ex_users_committed.each do |ex_user|

@ -37,8 +37,6 @@ class HomeworkCommonsController < ApplicationController
@category = @main_category.course_second_categories.find_by(id: params[:category]) @category = @main_category.course_second_categories.find_by(id: params[:category])
tip_exception("子目录id有误") if !@category.present? tip_exception("子目录id有误") if !@category.present?
@homework_commons = @homework_commons.where(course_second_category_id: params[:category]) @homework_commons = @homework_commons.where(course_second_category_id: params[:category])
elsif @homework_type == 4
@homework_commons = @homework_commons
end end
@all_count = @homework_commons.size @all_count = @homework_commons.size

@ -563,15 +563,15 @@ class ShixunsController < ApplicationController
end end
# 如果该实训是金课中的实训,则将当前用户加入到当期开课的课堂 # 如果该实训是金课中的实训,则将当前用户加入到当期开课的课堂
# if StageShixun.exists?(shixun_id: @shixun.id, subject_id: Subject.where(excellent: 1)) if StageShixun.exists?(shixun_id: @shixun.id, subject_id: Subject.where(excellent: 1))
# subject = Subject.where(excellent: 1, id: StageShixun.where(shixun_id: @shixun.id).pluck(:subject_id)).take subject = Subject.find_by(id: StageShixun.where(shixun_id: @shixun.id).pluck(:subject_id), excellent: 1)
# course = subject.courses.where("start_date is not null and start_date <= '#{Date.today}' and end_date is not null and end_date >= '#{Date.today}'").take course = subject.courses.where("start_date is not null and start_date <= '#{Date.today}' and end_date is not null and end_date >= '#{Date.today}'").take
# if course.present? && !CourseMember.exists?(course_id: course.id, user_id: current_user.id) if course.present? && !CourseMember.exists?(course_id: course.id, user_id: current_user.id)
# # 为了不影响后续操作用create而不是create! # 为了不影响后续操作用create而不是create!
# CourseMember.create(course_id: course.id, user_id: current_user.id, role: 4) CourseMember.create(course_id: course.id, user_id: current_user.id, role: 4)
# CourseAddStudentCreateWorksJob.perform_later(course.id, [current_user.id]) CourseAddStudentCreateWorksJob.perform_later(course.id, [current_user.id])
# end end
# end end
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
begin begin

@ -1,7 +1,7 @@
class SubjectsController < ApplicationController class SubjectsController < ApplicationController
before_action :require_login, :check_auth, except: [:index, :show, :right_banner] before_action :require_login, :check_auth, except: [:index, :show, :right_banner]
# before_action :check_auth, except: [:index] # before_action :check_auth, except: [:index]
before_action :check_account, except: [:index, :show] before_action :check_account, except: [:index, :show, :right_banner]
before_action :find_subject, except: [:index, :create, :new, :append_to_stage] before_action :find_subject, except: [:index, :create, :new, :append_to_stage]
before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish, before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish,
:search_members, :add_subject_members, :statistics, :shixun_report, :school_report, :search_members, :add_subject_members, :statistics, :shixun_report, :school_report,

@ -403,6 +403,12 @@ module ExercisesHelper
end end
user_answer_content = answer_choice_array.sort user_answer_content = answer_choice_array.sort
standard_answer = q.exercise_standard_answers.pluck(:exercise_choice_id).sort #该问题的标准答案,可能有多个 standard_answer = q.exercise_standard_answers.pluck(:exercise_choice_id).sort #该问题的标准答案,可能有多个
#TODO: 旧版多选题的标准答案是放在一个里面的新版又做成了一个题有多个标准答案exercise_choice_id存放的是标准答案的位置..
if q.question_type == 1 && standard_answer.size == 1
standard_answer = standard_answer.first.to_s.split("").map(&:to_i)
end
if user_answer_content == standard_answer #答案一致,多选或单选才给分,答案不对不给分 if user_answer_content == standard_answer #答案一致,多选或单选才给分,答案不对不给分
if standard_answer.size > 0 if standard_answer.size > 0
q_score_1 = q.question_score q_score_1 = q.question_score

@ -32,7 +32,12 @@ class Course < ApplicationRecord
has_many :teacher_course_members, -> { teachers_and_admin }, class_name: 'CourseMember' has_many :teacher_course_members, -> { teachers_and_admin }, class_name: 'CourseMember'
has_many :teacher_users, through: :teacher_course_members, source: :user has_many :teacher_users, through: :teacher_course_members, source: :user
has_many :course_messages, dependent: :destroy has_many :course_messages, dependent: :destroy
has_many :homework_commons, dependent: :destroy has_many :homework_commons, dependent: :destroy
has_many :normal_homeworks, -> { normals }, class_name: 'HomeworkCommon'
has_many :group_homeworks, -> { groups }, class_name: 'HomeworkCommon'
has_many :practice_homeworks, -> { practices }, class_name: 'HomeworkCommon'
has_many :homework_group_settings has_many :homework_group_settings
has_many :graduation_works, dependent: :destroy has_many :graduation_works, dependent: :destroy

@ -12,6 +12,7 @@ class HomeworkCommon < ApplicationRecord
belongs_to :course, counter_cache: true belongs_to :course, counter_cache: true
belongs_to :homework_bank, optional: true belongs_to :homework_bank, optional: true
belongs_to :user
has_many :homework_challenge_settings, dependent: :destroy has_many :homework_challenge_settings, dependent: :destroy
has_one :homework_commons_shixun, dependent: :destroy has_one :homework_commons_shixun, dependent: :destroy
@ -48,6 +49,9 @@ class HomeworkCommon < ApplicationRecord
scope :search_homework_type, lambda {|num| where(homework_type:num)} scope :search_homework_type, lambda {|num| where(homework_type:num)}
scope :unified_setting, -> {where("unified_setting = ? ", 1)} scope :unified_setting, -> {where("unified_setting = ? ", 1)}
scope :normals, -> {where(homework_type: %i[normal]).order("position desc")}
scope :groups, -> {where(homework_type: %i[group]).order("position desc")}
scope :practices, -> {where(homework_type: %i[practice]).order("position desc")}
# 是否显示参考答案 # 是否显示参考答案
def view_answer identity, user_id def view_answer identity, user_id

@ -19,9 +19,9 @@ class Subject < ApplicationRecord
has_many :stages, -> { order("stages.position ASC") }, dependent: :destroy has_many :stages, -> { order("stages.position ASC") }, dependent: :destroy
# 开放课堂 # 开放课堂
has_many :courses, -> { order("courses.id ASC") } has_many :courses, -> { where("is_delete = 0").order("courses.id ASC") }
validates :name, length: { maximum: 40 } validates :name, length: { maximum: 60 }
validates :description, length: { maximum: 5000 } validates :description, length: { maximum: 5000 }
validates :learning_notes, length: { maximum: 500 } validates :learning_notes, length: { maximum: 500 }

@ -9,6 +9,7 @@ class HomeworksService
homework_detail_manual = HomeworkDetailManual.new homework_detail_manual = HomeworkDetailManual.new
homework.homework_detail_manual = homework_detail_manual homework.homework_detail_manual = homework_detail_manual
homework.position = course.practice_homeworks.first&.position.to_i + 1
if homework.save! if homework.save!
homework_detail_manual.save! if homework_detail_manual homework_detail_manual.save! if homework_detail_manual
@ -328,10 +329,13 @@ class HomeworksService
work.late_penalty = work.work_status == 2 ? homework.late_penalty : 0 work.late_penalty = work.work_status == 2 ? homework.late_penalty : 0
work.commit_time = myshixun.created_at > setting_time.publish_time ? setting_time.publish_time : myshixun.created_at work.commit_time = myshixun.created_at > setting_time.publish_time ? setting_time.publish_time : myshixun.created_at
work.myshixun_id = myshixun.id work.myshixun_id = myshixun.id
work.update_time = if myshixun_endtime.present? work.update_time = if myshixun_endtime.present? && myshixun_endtime <= homework_end_or_late_time
myshixun_endtime > homework_end_or_late_time ? homework_end_or_late_time : myshixun_endtime myshixun_endtime
elsif myshixun.updated_at > homework_end_or_late_time
last_pass_time = games.select{|game| game.status == 2 && game.end_time < homework_end_or_late_time}.map(&:end_time).max
last_pass_time.present? ? last_pass_time : myshixun.created_at
else else
myshixun.updated_at > homework_end_or_late_time ? homework_end_or_late_time : myshixun.updated_at myshixun.updated_at
end end
work.final_score = final_score work.final_score = final_score

@ -0,0 +1,7 @@
json.tasks @tasks.each do |task|
json.user_name task.user.real_name
json.task_id task.id
json.task_name task.name
json.category task.course_second_category&.name
json.position task.position
end

@ -352,6 +352,8 @@ Rails.application.routes.draw do
post 'update_informs' post 'update_informs'
get 'online_learning' get 'online_learning'
post 'join_excellent_course' post 'join_excellent_course'
get 'tasks_list'
post 'update_task_position'
end end
collection do collection do

@ -0,0 +1,5 @@
class MigrateCourseTaskPosition < ActiveRecord::Migration[5.2]
def change
add_column :homework_commons, :position, :integer, :default => 0
end
end

@ -0,0 +1,29 @@
class ChangeExercise1930Position < ActiveRecord::Migration[5.2]
def change
exs = Exercise.all.includes(:exercise_questions)
exs.each do |ex|
ex_questions = ex&.exercise_questions&.select(:id,:question_number,:exercise_id)&.order("question_number ASC") #试卷的位置迁移
if ex_questions.present?
ex_questions.each_with_index do |q,index|
puts index
q_num = index + 1
if q.question_number.to_i != q_num
q.update_attributes(question_number: q_num)
end
end
end
ex_q_bank = ex&.exercise_bank&.exercise_bank_questions&.select(:id,:question_number,:exercise_bank_id,:shixun_id)&.order("question_number ASC") #试卷的习题库位置迁移
if ex_q_bank.present?
ex_q_bank.each_with_index do |q,index|
puts index
q_num_1 = index + 1
if q.question_number.to_i != q_num_1
q.update_attributes(question_number: q_num_1)
end
end
end
end
end
end

@ -0,0 +1,11 @@
class MigrateCourseShixunHomeworkPosition < ActiveRecord::Migration[5.2]
def change
Course.find_each do |course|
puts course.id
course.practice_homeworks.order("IF(ISNULL(homework_commons.publish_time),0,1), homework_commons.publish_time DESC,
homework_commons.created_at DESC").reverse.each_with_index do |homework, index|
homework.update_columns(position: index + 1)
end
end
end
end

@ -103,6 +103,13 @@ namespace :excellent_course_exercise do
end end
user_answer_content = answer_choice_array.sort user_answer_content = answer_choice_array.sort
standard_answer = q.exercise_standard_answers.pluck(:exercise_choice_id).sort #该问题的标准答案,可能有多个 standard_answer = q.exercise_standard_answers.pluck(:exercise_choice_id).sort #该问题的标准答案,可能有多个
#TODO: 旧版多选题的标准答案是放在一个里面的新版又做成了一个题有多个标准答案exercise_choice_id存放的是标准答案的位置..
if q.question_type == 1 && standard_answer.size == 1
standard_answer = standard_answer.first.to_s.split("").map(&:to_i)
end
if user_answer_content == standard_answer #答案一致,多选或单选才给分,答案不对不给分 if user_answer_content == standard_answer #答案一致,多选或单选才给分,答案不对不给分
if standard_answer.size > 0 if standard_answer.size > 0
q_score_1 = q.question_score q_score_1 = q.question_score

@ -43,12 +43,18 @@ namespace :sync do
is_test: true is_test: true
} }
user = User.create!(edit_params) user = User.create!(edit_params)
puts "aa" user.password = "edu12345678"
user.save!
UserExtension.create!(user_id: user.id, school_id: 117) UserExtension.create!(user_id: user.id, school_id: 117)
puts i puts i
end end
end end
task :password => :environment do
end
# 随机生成字符 # 随机生成字符
def generate_identifier(container, num) def generate_identifier(container, num)
code = DCODES.sample(num).join code = DCODES.sample(num).join

@ -112,10 +112,26 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.smallSquare:nth-child(3n+0){margin-right: 0px;} .smallSquare:nth-child(3n+0){margin-right: 0px;}
.partimg{height: 180px;width: 100%;border-radius: 6px 6px 0px 0px;} .partimg{height: 180px;width: 100%;border-radius: 6px 6px 0px 0px;}
/*块状列表上面的绿色标签*/ /*块状列表上面的绿色标签*/
.tag-green{position: absolute;left: 0px;top:20px;} .tag-green{
.tag-green .tag-name{display: block;width: auto;background-image: url("/images/educoder/tag1.png");background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;} position: absolute;
.tag-orange{position: absolute;right: 0px;top:20px;} left: 10px;
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;} bottom: 90px;}
.tag-green .tag-name{display: block;width: auto;
/*background-image: url("/images/educoder/tag1.png");*/
background: #000000;
border: 1px solid #fff;
border-radius: 3px;
font-size: 14px;
opacity: 0.56;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:12px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;
height: 28px;
line-height: 28px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
/*发送至弹框里的下拉框*/ /*发送至弹框里的下拉框*/
.downSelectOption{position: relative;height: 35px;} .downSelectOption{position: relative;height: 35px;}
.downSelectOption .showOption{background-color: #F4F4F4;border: 1px solid #EAEAEA;width: 100%;padding: 5px 40px 5px 5px;outline: none;height: 100%;box-sizing: border-box;} .downSelectOption .showOption{background-color: #F4F4F4;border: 1px solid #EAEAEA;width: 100%;padding: 5px 40px 5px 5px;outline: none;height: 100%;box-sizing: border-box;}
@ -3424,3 +3440,7 @@ a.singlepublishtwo{
.detail_for_paragraph p{ .detail_for_paragraph p{
white-space: pre-wrap; white-space: pre-wrap;
} }
.ant-tooltip{
max-width: 100% !important;
}

@ -828,7 +828,7 @@ class CoursesIndex extends Component{
{/*新建精品课堂*/} {/*新建精品课堂*/}
{/*coursesId 课堂id */} {/*coursesId 课堂id */}
{/*id 是否是私有或者公有*/} {/*id 是否是私有或者公有*/}
<Route path="/courses/:subjectid/newgold/:id" <Route path="/courses/news/:subjectid/newgold/:id"
render={ render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} />) (props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} />)
} }

@ -56,7 +56,11 @@ class CommonWorkAnswer extends Component{
} }
componentDidMount() { componentDidMount() {
this.fetchData() this.fetchData()
try {
this.props.triggerRef(this);
}catch (e) {
}
on('commonwork_fetch_all', this.fetchAllListener) on('commonwork_fetch_all', this.fetchAllListener)
} }
componentWillUnmount() { componentWillUnmount() {

@ -17,7 +17,7 @@ import PublishRightnow from './PublishRightnow'
import '../css/Courses.css' import '../css/Courses.css'
import CBreadcrumb from '../common/CBreadcrumb' import CBreadcrumb from '../common/CBreadcrumb'
import DownloadMessageysl from "../../modals/DownloadMessageysl"; import DownloadMessageysl from "../../modals/DownloadMessageysl";
import ConnectProject from './ConnectProject'
import { Spin } from 'antd' import { Spin } from 'antd'
//引入对应跳转的组件 //引入对应跳转的组件
@ -158,6 +158,30 @@ class CommonWorkDetailIndex extends Component{
} }
bindRef = ref => { this.child = ref }; bindRef = ref => { this.child = ref };
// 关联项目
openConnectionProject = (work) => {
this.refs['connectProject'].openConnectionProject(work)
}
connectSuccess = () => {
this.child.fetchData && this.child.fetchData()
}
cancelConnectionProject = (work) => {
let workId=this.props.match.params.workId;
let courseId=this.props.match.params.coursesId;
const url = `/homework_commons/${work.homework_id}/student_works/cancel_relate_project.json`
axios.get(url).then((response)=> {
if (response.data.status == 0) {
this.child.fetchData && this.child.fetchData()
this.props.showNotification('取消关联成功')
}
}).catch((error)=>{
console.log(error)
})
}
// 关联项目 END
render() { render() {
let {course_name, homework_name, homework_status, noTab let {course_name, homework_name, homework_status, noTab
@ -180,7 +204,8 @@ class CommonWorkDetailIndex extends Component{
const childModuleName = this.state.moduleName const childModuleName = this.state.moduleName
const commonHandler = { const commonHandler = {
initWorkDetailCommonState: this.initWorkDetailCommonState initWorkDetailCommonState: this.initWorkDetailCommonState,
triggerRef: this.bindRef
} }
const isAdmin = this.props.isAdmin() const isAdmin = this.props.isAdmin()
@ -191,7 +216,7 @@ class CommonWorkDetailIndex extends Component{
let params = {} let params = {}
if (isListModule) { if (isListModule) {
// TODO // TODO
if(this.child!=undefined) { if(this.child && this.child._getRequestParams) {
params = this.child._getRequestParams() !== undefined ? this.child._getRequestParams() : {}; params = this.child._getRequestParams() !== undefined ? this.child._getRequestParams() : {};
} }
} }
@ -345,6 +370,20 @@ class CommonWorkDetailIndex extends Component{
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/} {/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
{isAdmin && <a className={"fr color-blue font-16"} onClick={() => this.props.toEditPage(this.props.match.params, workId)}>编辑作业</a>} {isAdmin && <a className={"fr color-blue font-16"} onClick={() => this.props.toEditPage(this.props.match.params, workId)}>编辑作业</a>}
{ //
work_statuses && work_statuses.indexOf('关联项目') != -1 &&
<React.Fragment>
<ConnectProject ref="connectProject" {...this.props} connectSuccess={this.connectSuccess}></ConnectProject>
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.openConnectionProject({ homework_id: workId })}>关联项目</WordsBtn>
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.props.toCreateProject()}>创建项目</WordsBtn>
</React.Fragment>
}
{ //
work_statuses && work_statuses.indexOf('取消关联') != -1 &&
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.cancelConnectionProject( {homework_id: workId} )}>取消关联</WordsBtn>
}
{work_statuses && work_statuses.indexOf('提交作品') != -1 && <a className={"fr color-blue font-16"} href={"javascript:void(0)"} {work_statuses && work_statuses.indexOf('提交作品') != -1 && <a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={() => { this.props.toWorkPostPage(this.props.match.params)}} onClick={() => { this.props.toWorkPostPage(this.props.match.params)}}
>提交作品</a>} >提交作品</a>}

@ -38,10 +38,10 @@ function renderScore(score, content) {
function getScoreTip(score, dom) { function getScoreTip(score, dom) {
return score == '--' ? '未评分' : score == '**' ? '未公开' : dom return score == '--' ? '未评分' : score == '**' ? '未公开' : dom
} }
function buildColumns(that, student_works) { function buildColumns(that, student_works, studentData) {
let gotWorkGroup = false; let gotWorkGroup = false;
let gotProjectInfo = false; let gotProjectInfo = false;
if (student_works) { if (student_works && student_works.length) {
student_works.forEach(item => { student_works.forEach(item => {
if (item.work_group) { if (item.work_group) {
gotWorkGroup = true gotWorkGroup = true
@ -50,6 +50,13 @@ function buildColumns(that, student_works) {
gotProjectInfo = true; gotProjectInfo = true;
} }
}) })
} else if (studentData && studentData[0]) {
if (studentData[0].work_group) {
gotWorkGroup = true
}
if (studentData[0].project_info) {
gotProjectInfo = true;
}
} }
let courseId= that.props.match.params.coursesId; let courseId= that.props.match.params.coursesId;
let workId= that.props.match.params.workId; let workId= that.props.match.params.workId;
@ -431,6 +438,9 @@ class CommonWorkList extends Component{
group_id:arg_course_group, group_id:arg_course_group,
} }
} }
fetchData = () => {
this.fetchList()
}
fetchList = () => { fetchList = () => {
let workId=this.props.match.params.workId; let workId=this.props.match.params.workId;
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
@ -542,7 +552,7 @@ class CommonWorkList extends Component{
late_penalty, absence_penalty, appeal_penalty late_penalty, absence_penalty, appeal_penalty
,end_immediately ,publish_immediately ,end_immediately ,publish_immediately
, homework_id, visible , homework_id, visible, work_group, project_info
} =this.state; } =this.state;
@ -566,7 +576,6 @@ class CommonWorkList extends Component{
return { label: `${item.name}(${item.count})`, value: item.id } return { label: `${item.name}(${item.count})`, value: item.id }
}) })
const columns = buildColumns(this, student_works)
const isAdmin = this.props.isAdmin() const isAdmin = this.props.isAdmin()
const isStudent = this.props.isStudent() const isStudent = this.props.isStudent()
@ -579,9 +588,11 @@ class CommonWorkList extends Component{
}else{ }else{
StudentData=isStudent ? [{ id, user_name, user_login, student_id, group_name, work_status, update_time, teacher_score, teaching_asistant_score, student_score, StudentData=isStudent ? [{ id, user_name, user_login, student_id, group_name, work_status, update_time, teacher_score, teaching_asistant_score, student_score,
ultimate_score, work_score, student_comment_count, appeal_all_count, appeal_deal_count, ultimate_score, work_score, student_comment_count, appeal_all_count, appeal_deal_count,
late_penalty, absence_penalty, appeal_penalty, late_penalty, absence_penalty, appeal_penalty, project_info,
work_group: '', isMine: true }] : [] work_group, isMine: true }] : []
} }
const columns = buildColumns(this, student_works, StudentData)
let params = this._getRequestParams() let params = this._getRequestParams()
let exportUrl = `/api/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`; let exportUrl = `/api/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`;
const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx`; const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx`;

@ -55,7 +55,11 @@ class CommonWorkQuestion extends Component{
} }
componentDidMount() { componentDidMount() {
this.fetchData() this.fetchData()
try {
this.props.triggerRef(this);
}catch (e) {
}
on('commonwork_fetch_all', this.fetchAllListener) on('commonwork_fetch_all', this.fetchAllListener)
} }
componentWillUnmount() { componentWillUnmount() {

@ -77,7 +77,7 @@ class CommonWorkSetting extends Component{
} }
} }
getsettings=()=>{ fetchData=()=>{
let workId=this.props.match.params.workId; let workId=this.props.match.params.workId;
const isAdmin = this.props.isAdmin() const isAdmin = this.props.isAdmin()
const url = `/homework_commons/${workId}/settings.json` const url = `/homework_commons/${workId}/settings.json`
@ -160,14 +160,19 @@ class CommonWorkSetting extends Component{
componentDidMount(){ componentDidMount(){
this.getsettings(); this.fetchData();
try {
this.props.triggerRef(this);
}catch (e) {
}
on('commonwork_fetch_all', this.fetchAllListener) on('commonwork_fetch_all', this.fetchAllListener)
} }
componentWillUnmount() { componentWillUnmount() {
off('commonwork_fetch_all', this.fetchAllListener) off('commonwork_fetch_all', this.fetchAllListener)
} }
fetchAllListener = () => { fetchAllListener = () => {
this.getsettings() this.fetchData()
} }
@ -477,7 +482,7 @@ class CommonWorkSetting extends Component{
// checkBoxValues:[], // checkBoxValues:[],
// checkAllValue:false // checkAllValue:false
// }) // })
// this.getsettings(); // this.fetchData();
// } // }
// }).catch((error)=>{ // }).catch((error)=>{
@ -988,11 +993,11 @@ class CommonWorkSetting extends Component{
Saves={Saves} Saves={Saves}
course_groups={course_groups} course_groups={course_groups}
/> */} /> */}
<PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]} action={this.getsettings} <PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]} action={this.fetchData}
isPublish={true} doWhenSuccess={this.doWhenSuccess} checkBeforePost={this.saveWorkSetting} isPublish={true} doWhenSuccess={this.doWhenSuccess} checkBeforePost={this.saveWorkSetting}
onToPublishClick={this.onToPublishClick} onToPublishClick={this.onToPublishClick}
></PublishRightnow> ></PublishRightnow>
<PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]} action={this.getsettings} <PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]} action={this.fetchData}
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow> isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
<style>{` <style>{`

@ -401,6 +401,12 @@ class CoursesBanner extends Component {
window.location.reload(); window.location.reload();
}; };
setHistoryFun=(url)=>{
this.props.history.replace(url)
}
render() { render() {
let { Addcoursestypes, coursedata,excellent, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide,AccountProfiletype} = this.state; let { Addcoursestypes, coursedata,excellent, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide,AccountProfiletype} = this.state;
@ -606,10 +612,10 @@ class CoursesBanner extends Component {
`} `}
</style> </style>
<Breadcrumb separator="|" className={"mt5"}> <Breadcrumb separator="|" className={"mt5"}>
<Breadcrumb.Item href={"/courses/"+this.props.match.params.coursesId+"/teachers"}> <Breadcrumb.Item onClick={()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/teachers")}>
<span className="color-grey-c font-16"><span className={"mr10"}>教师</span> <span className={"mr10"}>{coursedata.teacher_count}</span></span> <span className="color-grey-c font-16"><span className={"mr10"}>教师</span> <span className={"mr10"}>{coursedata.teacher_count}</span></span>
</Breadcrumb.Item> </Breadcrumb.Item>
<Breadcrumb.Item href={"/courses/"+this.props.match.params.coursesId+"/students"}> <Breadcrumb.Item onClick={()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/students")}>
<span className="color-grey-c font-16"><span className={"mr10 ml10"}>学生</span> <span className={"mr10"}>{coursedata.student_count}</span></span> <span className="color-grey-c font-16"><span className={"mr10 ml10"}>学生</span> <span className={"mr10"}>{coursedata.student_count}</span></span>
</Breadcrumb.Item> </Breadcrumb.Item>
<Breadcrumb.Item>{coursedata.credit===null?"": <Breadcrumb.Item>{coursedata.credit===null?"":

@ -461,11 +461,7 @@ class Selectsetting extends Component{
</ul> </ul>
<style>{`
<div className="pl20 pr20"
style={{"Height":"204px"}}>
<style>{`
.color-grey-9a{color: #9A9A9A !important;} .color-grey-9a{color: #9A9A9A !important;}
.datastyle{ .datastyle{
width: 120px; width: 120px;
@ -480,7 +476,12 @@ class Selectsetting extends Component{
display: inline-block; display: inline-block;
float: left; float: left;
} }
.settingbox{
max-height: 123px;
overflow-y: auto;
}
`}</style> `}</style>
<div className="pl20 pr20 settingbox">
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE"> <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE">
<li className="fl" style={{width: '241px'}}> <li className="fl" style={{width: '241px'}}>
<span className={"isabox"} title={datalist&&datalist.title}> {datalist&&datalist.title} </span> <span className={"isabox"} title={datalist&&datalist.title}> {datalist&&datalist.title} </span>
@ -632,7 +633,7 @@ class Selectsetting extends Component{
{this.state.newfileListtypes===true?<p className={"color-red"}>请先上传资源</p>:""} {this.state.newfileListtypes===true?<p className={"color-red"}>请先上传资源</p>:""}
<p className={"winth540"}> <p className={this.state.fileListtype===true?"mt15":""}>
<style>{` <style>{`
.ant-checkbox-wrapper{ .ant-checkbox-wrapper{
margin-left:0px !important; margin-left:0px !important;
@ -640,19 +641,19 @@ class Selectsetting extends Component{
} }
`}</style> `}</style>
<div className={this.state.fileListtype===true?"mt30":""}> {/*<div className={this.state.fileListtype===true?"mt30":""}>*/}
<Checkbox {/*<Checkbox*/}
checked={is_public} {/*checked={is_public}*/}
onChange={this.onChangepublics}> {/*onChange={this.onChangepublics}>*/}
<span className={"font-14"}>勾选后所有用户可见否则仅课堂成员可见</span> {/*<span className={"font-14"}>勾选后所有用户可见,否则仅课堂成员可见</span>*/}
</Checkbox> {/*</Checkbox>*/}
</div> {/*</div>*/}
{/*{this.props.has_course_groups&&this.props.has_course_groups===true?:""}*/} {/*{this.props.has_course_groups&&this.props.has_course_groups===true?:""}*/}
{/*{this.state.course_groupss&&this.state.course_groupss.length>0?<Checkbox*/} {this.state.course_groupss&&this.state.course_groupss.length>0?<Checkbox
{/*checked={unified_setting}*/} checked={unified_setting}
{/*onChange={this.onChangesettings}>*/} onChange={this.onChangesettings}>
{/*<span>统一设置</span><span className={"font-14 color-grey-9"}>(选中则所有分班使用相同的发布设置,否则各个单独设置)</span>*/} <span>统一设置</span><span className={"font-14 color-grey-9"}>(使)</span>
{/*</Checkbox>:""}*/} </Checkbox>:""}
<style> <style>
{` {`
@ -744,6 +745,7 @@ class Selectsetting extends Component{
{/*{this.state.course_group_idtypes===true?<p className={"color-red"}>请选择分班</p>:""}*/} {/*{this.state.course_group_idtypes===true?<p className={"color-red"}>请选择分班</p>:""}*/}
{/*{course_group_publish_timestype===true?<p className={"color-red mt10"}>请填写完整</p>:""}*/} {/*{course_group_publish_timestype===true?<p className={"color-red mt10"}>请填写完整</p>:""}*/}
<textarea placeholder="请输入资源描述最大限制100个字符" className={"mt10"} value={description} onInput={this.settextarea} style={{ <textarea placeholder="请输入资源描述最大限制100个字符" className={"mt10"} value={description} onInput={this.settextarea} style={{
width: '100%', width: '100%',
height:'120px', height:'120px',

@ -469,7 +469,7 @@ class Sendresource extends Component{
{newfileListtype===true&&this.state.fileListtype===false?<p className={"color-red"}>请先上传资源</p>:""} {newfileListtype===true&&this.state.fileListtype===false?<p className={"color-red"}>请先上传资源</p>:""}
<p className={"winth540"}> <p className={this.state.fileListtype===true?"mt25":""}>
<style>{` <style>{`
.ant-checkbox-wrapper{ .ant-checkbox-wrapper{
margin-left:0px !important; margin-left:0px !important;
@ -477,13 +477,13 @@ class Sendresource extends Component{
} }
`}</style> `}</style>
<div className={this.state.fileListtype===true?"mt30":""}></div><Checkbox checked={is_public} onChange={this.onChangepublic}> {/*<div className={this.state.fileListtype===true?"mt30":""}></div><Checkbox checked={is_public} onChange={this.onChangepublic}>*/}
<span className={"font-14"}>勾选后所有用户可见否则仅课堂成员可见</span> {/*<span className={"font-14"}>勾选后所有用户可见,否则仅课堂成员可见</span>*/}
</Checkbox> {/*</Checkbox>*/}
{/*{this.state.course_groups_count&&this.state.course_groups_count>0?<Checkbox checked={is_unified_setting} onChange={this.onChangesetting}>*/} {this.state.course_groups_count&&this.state.course_groups_count>0?<Checkbox checked={is_unified_setting} onChange={this.onChangesetting}>
{/*<span>统一设置</span><span className={"font-14 color-grey-9"}>(选中则所有分班使用相同的发布设置,否则各个单独设置)</span>*/} <span>统一设置</span><span className={"font-14 color-grey-9"}>(使)</span>
{/*</Checkbox>:""}*/} </Checkbox>:""}
<style>{` <style>{`
.Selectleft20{ .Selectleft20{
margin-left: 20px !important; margin-left: 20px !important;

@ -4,7 +4,9 @@ import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder';
import './myelearning.css' import './myelearning.css'
import axios from 'axios'; import axios from 'axios';
import YslDetailCards from "./YslDetailCards.js"; import YslDetailCards from "./YslDetailCards.js";
import Jointheclass from '../../modals/Jointheclass' import Jointheclass from '../../modals/Jointheclass';
import LoginDialog from "../../login/LoginDialog";
//在线学习 //在线学习
class Elearning extends Component{ class Elearning extends Component{
constructor(props){ constructor(props){
@ -23,7 +25,8 @@ class Elearning extends Component{
shixunsmessage:"", shixunsmessage:"",
startshixunCombattype:false, startshixunCombattype:false,
isSpins:false, isSpins:false,
userlogin:"",
isRender:false,
} }
} }
@ -58,6 +61,10 @@ class Elearning extends Component{
}) })
}); });
this.setState({
userlogin:this.props.current_user.login,
})
} }
@ -68,6 +75,19 @@ class Elearning extends Component{
}; };
//开始学习 //开始学习
Startlearning=()=>{ Startlearning=()=>{
let {userlogin} = this.state;
if (userlogin === undefined) {
this.setState({
isRender: true
})
return
}
if (userlogin === "") {
this.setState({
isRender: true
})
return;
}
if(this.props.isNotMember()===true){ if(this.props.isNotMember()===true){
this.setState({ this.setState({
yslJointhe:true yslJointhe:true
@ -206,14 +226,30 @@ class Elearning extends Component{
this.setState({ this.setState({
startshixunCombattypes:false startshixunCombattypes:false
}) })
} };
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
};
Tojoinclass=()=> {
this.setState({
isRender: true
})
};
render(){ render(){
let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun,stages} =this.state; let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun,stages,isRender} =this.state;
const isNotMembers=this.props.isNotMember();//非课堂成员 const isNotMembers=this.props.isNotMember();//非课堂成员
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />; const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return( return(
<React.Fragment > <React.Fragment >
<div id={"zhudiv"}> <div id={"zhudiv"}>
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
<Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}></Jointheclass> <Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}></Jointheclass>
<Modal <Modal
keyboard={false} keyboard={false}
@ -317,7 +353,7 @@ class Elearning extends Component{
</div>: </div>:
<div> <div>
{/*开始学习*/} {/*开始学习*/}
<YslDetailCards {...this.state} {...this.props} Startlearningtwo={()=>this.Startlearningtwo()} Myreload={()=>this.Myreload()} ></YslDetailCards> <YslDetailCards {...this.state} {...this.props} Startlearningtwo={()=>this.Startlearningtwo()} Myreload={()=>this.Myreload()} Tojoinclass={()=>this.Tojoinclass()}></YslDetailCards>
</div> </div>
} }

@ -33,11 +33,31 @@ class YslDetailCards extends Component{
}) })
}; };
startgameid=(id)=>{ startgameid=(id)=>{
if(this.props.isNotMember()===true){ // 上面传过来的方法是用来没登入弹出弹框的
//这个是外部传过来的 try {
this.props.Startlearningtwo(); let {userlogin} = this.props;
return if (userlogin === undefined) {
this.props.Tojoinclass();
return
}
if (userlogin === "") {
this.props.Tojoinclass();
return;
}
}catch (e) {
} }
try {
if(this.props.isNotMember()===true){
//这个是外部传过来的
this.props.Startlearningtwo();
return
}
}catch (e) {
}
let url = "/shixuns/" + id + "/shixun_exec.json"; let url = "/shixuns/" + id + "/shixun_exec.json";
axios.get(url).then((response) => { axios.get(url).then((response) => {

@ -322,14 +322,16 @@ class ExerciceNew extends Component{
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.props.showNotification('删除成功') this.props.showNotification('删除成功')
const { exercise_questions } = this.state this.fetchExercise()
const index = this.findIndexById(question_id)
// const { exercise_questions } = this.state
// const index = this.findIndexById(question_id)
this.setState( // this.setState(
(prevState) => ({ // (prevState) => ({
exercise_questions : update(prevState.exercise_questions, {$splice: [[index, 1]]}) // exercise_questions : update(prevState.exercise_questions, {$splice: [[index, 1]]})
}) // })
) // )
} }
}) })
.catch(function (error) { .catch(function (error) {

@ -60,12 +60,10 @@ class SingleEditor extends Component{
} }
const intScore = parseFloat(question_score) const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) { if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
} else if(!question_score || intScore == NaN) {
this.props.showNotification('分值:不能为空'); return; this.props.showNotification('分值:不能为空'); return;
} else {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
}
} }
if(!answerArray || answerArray.length == 0) { if(!answerArray || answerArray.length == 0) {
this.props.showNotification('必须设置标准答案'); return; this.props.showNotification('必须设置标准答案'); return;
@ -217,7 +215,7 @@ class SingleEditor extends Component{
<div> <div>
分值 分值
<InputNumber step={0.1} precision={1} min={0.1} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change} <InputNumber step={0.1} precision={1} min={0} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change}
disabled={exerciseIsPublish} disabled={exerciseIsPublish}
></InputNumber> ></InputNumber>

@ -51,12 +51,10 @@ class MainEditor extends Component{
} }
const intScore = parseFloat(question_score) const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) { if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
} else if(!question_score || intScore == NaN) {
this.props.showNotification('分值:不能为空'); return; this.props.showNotification('分值:不能为空'); return;
} else {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
}
} }
// if(!answerArray || answerArray.length == 0 || !answerArray[0]) { // if(!answerArray || answerArray.length == 0 || !answerArray[0]) {
// this.props.showNotification('请输入参考答案'); return; // this.props.showNotification('请输入参考答案'); return;
@ -168,7 +166,7 @@ class MainEditor extends Component{
<div className="mt10"> <div className="mt10">
分值 分值
<InputNumber step={0.1} precision={1} min={0.1} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change} <InputNumber step={0.1} precision={1} min={0} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change}
disabled={exerciseIsPublish} disabled={exerciseIsPublish}
></InputNumber> ></InputNumber>

@ -74,13 +74,13 @@ class NullEditor extends Component{
} }
const intScore = parseFloat(question_score) const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) { if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
} else if(!question_score || intScore == NaN) {
this.props.showNotification('分值:不能为空'); return; this.props.showNotification('分值:不能为空'); return;
} else {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
}
} }
let isEmpty = false; let isEmpty = false;
standard_answers.forEach((answers, index) => { standard_answers.forEach((answers, index) => {
answerArray.push({ answerArray.push({
@ -340,7 +340,7 @@ class NullEditor extends Component{
</div> </div>
<div className="clearfix mt20"> <div className="clearfix mt20">
分值 分值
<InputNumber step={0.1} precision={1} min={0.1} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change} <InputNumber step={0.1} precision={1} min={0} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change}
disabled={exerciseIsPublish} placeholder="请填写分数" disabled={exerciseIsPublish} placeholder="请填写分数"
></InputNumber > ></InputNumber >

@ -268,7 +268,7 @@ class ShixunEditor extends Component{
</div> </div>
<div> <div>
<InputNumber step={0.1} precision={1} min={0.1} max={100} <InputNumber step={0.1} precision={1} min={0} max={100}
style={{width: 100}} value={question_scores[index]} style={{width: 100}} value={question_scores[index]}
placeholder="请填写分数" disabled={exerciseIsPublish} placeholder="请填写分数" disabled={exerciseIsPublish}
onChange={(e) => this.on_question_score_change(e, index)}></InputNumber> onChange={(e) => this.on_question_score_change(e, index)}></InputNumber>

@ -92,13 +92,12 @@ class SingleEditor extends Component{
} }
const intScore = parseFloat(question_score) const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) { if (intScore == 0) {
this.props.showNotification('分值不能为空'); return; this.props.showNotification('分值必须大于0'); return;
} else { } else if(!question_score || intScore == NaN) {
if (intScore == 0) { this.props.showNotification('分值:不能为空'); return;
this.props.showNotification('分值必须大于0'); return;
}
} }
if(!answerArray || answerArray.length == 0) { if(!answerArray || answerArray.length == 0) {
this.props.showNotification('请先点击选择本选择题的正确选项'); return; this.props.showNotification('请先点击选择本选择题的正确选项'); return;
@ -301,7 +300,7 @@ class SingleEditor extends Component{
<div> <div>
分值 分值
<InputNumber step={0.1} precision={1} min={0.1} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change} <InputNumber step={0.1} precision={1} min={0} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change}
disabled={exerciseIsPublish} disabled={exerciseIsPublish}
></InputNumber>&nbsp; ></InputNumber>&nbsp;

@ -276,7 +276,7 @@ class shixunAnswer extends Component{
} }
{ {
item.operation ? item.operation ?
<a className={isAdmin ? "color-blue mt5 fr":"color-blue"} target="_blank" href='javascript:void(0)' onClick={()=>this.scrollToAnchor(`${questionType.question_id}${index+1}`)}>查看</a> <a className={isAdmin ? "color-blue mt5 fr":"color-blue"} href='javascript:void(0)' onClick={()=>this.scrollToAnchor(`${questionType.question_id}${index+1}`)}>查看</a>
: :
<span className={isAdmin ? "color-grey-9 mt5 fr":"color-grey-9"} >--</span> <span className={isAdmin ? "color-grey-9 mt5 fr":"color-grey-9"} >--</span>
} }

@ -145,24 +145,38 @@ class Goldsubject extends Component {
console.log(error); console.log(error);
}) })
}else{ }else{
let subjectid= this.props.match.params.subjectid;
let url = "/courses/new.json" let url = "/courses/new.json"
axios.get(url).then((result) => { axios.get(url,{params:{
console.log(result) subject_id:subjectid, //这是带过来的值
}}).then((response) => {
if (response) {
// this.goback
if(response.data){
console.log("获取Goldsubject.js");
console.log(response.data);
if(response.data.status===0){
this.props.form.setFieldsValue({
classroom: response.data.course_name,
name: response.data.name,
});
}
}
}
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
}) })
// console.log(user_school); // console.log(user_school);
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
school:user_school, school:user_school,
starttime:moment(new Date(),dateFormat),
}); });
this.setState({ this.setState({
school:user_school, school:user_school,
Whethertocreateanewclassroom:true, Whethertocreateanewclassroom:true,
datatimetwo: moment(new Date(),dateFormat),
}); });
this.handleSearchschool(user_school); this.handleSearchschool(user_school);
} }
@ -700,17 +714,17 @@ class Goldsubject extends Component {
{options} {options}
</AutoComplete> </AutoComplete>
)} )}
<span className={"newcoursestitle fl"}> {/*<span className={"newcoursestitle fl"}>*/}
{/*(如果本学期包含多个班级,只需创建一个课堂然后在课堂内部建立不同的分班)*/} {/* /!*(如果本学期包含多个班级,只需创建一个课堂然后在课堂内部建立不同的分班)*!/*/}
<p className="ant-progress-text"> {/* <p className="ant-progress-text">*/}
<Icon style={{ color: '#52c41a' }} type="check-circle" theme="filled"/> {/* <Icon style={{ color: '#52c41a' }} type="check-circle" theme="filled"/>*/}
<span className={"color-grey-9 font-12 ml5"}>正确示例数据结构2019春季班级</span> {/* <span className={"color-grey-9 font-12 ml5"}>正确示例数据结构2019春季班级</span>*/}
</p> {/* </p>*/}
<p className="ant-progress-text"> {/* <p className="ant-progress-text">*/}
<Icon style={{ color: 'red' }} theme="filled" type="close-circle"/> {/* <Icon style={{ color: 'red' }} theme="filled" type="close-circle"/>*/}
<span className={"color-grey-9 font-12 ml5"}>错误示例2019春季班级数据结构</span> {/* <span className={"color-grey-9 font-12 ml5"}>错误示例2019春季班级数据结构</span>*/}
</p> {/* </p>*/}
</span> {/* </span>*/}
<div id='isclassroom'></div> <div id='isclassroom'></div>
</Form.Item> </Form.Item>
@ -818,7 +832,7 @@ class Goldsubject extends Component {
{getFieldDecorator("checkboxgroup", { {getFieldDecorator("checkboxgroup", {
initialValue: [ initialValue: [
"announcement","online_learning","shixun_homework", "exercise", "announcement","online_learning","shixun_homework","common_homework",
], ],
})( })(
<Checkbox.Group style={{width: "800px", marginTop: "10px"}}> <Checkbox.Group style={{width: "800px", marginTop: "10px"}}>

@ -55,7 +55,7 @@ class Jointheclass extends Component {
width="600px" width="600px"
> >
<div className="educouddiv"> <div className="educouddiv">
<div className={"tabeltext-alignleft"}><p className={"mt20 font-16"}>是否确认该加入课堂?</p></div> <div className={"tabeltext-alignleft"}><p className={"mt70 mb70 font-16"}>是否确认该加入课堂?</p></div>
<div className="clearfix edu-txt-center mt20"> <div className="clearfix edu-txt-center mt20">
<style> <style>
{ {

@ -171,8 +171,8 @@ class TaskResultLayer extends Component {
<p className="inline inlines"><span className=" goldring"/> <p className="inline inlines"><span className=" goldring"/>
{currentPassedGameGainGold >= 0 ? `+${currentPassedGameGainGold}` : '+0'} {currentPassedGameGainGold >= 0 ? `+${currentPassedGameGainGold}` : '+0'}
</p> </p>
<p className="inline exp"> <p className="inline inlines exp">
<img src={empiricgreenImg} className=" mt5 fl"/> <img src={empiricgreenImg} className="mr8 mt5 fl"/>
{currentPassedGameGainExperience >= 0 ? `+${currentPassedGameGainExperience}` : '+0'} {currentPassedGameGainExperience >= 0 ? `+${currentPassedGameGainExperience}` : '+0'}
</p> </p>
</div> </div>

@ -60,8 +60,8 @@ class ChooseEvaluateView extends Component {
</ul> </ul>
: item.result === true ? : item.result === true ?
<ul className=" font-14"> <ul className=" font-14">
<li><span className="-task-ces-info-left color-blue">正确选项</span><span>{item.actual_output}</span></li> <li><span className="-task-ces-info-left color-blue">正确选项</span><span>{item.standard_answer}</span></li>
<li><span className="-task-ces-info-left color-blue">你的选项</span><span className="color-orange">{item.standard_answer}</span></li> <li><span className="-task-ces-info-left color-blue">你的选项</span><span className="color-orange">{item.actual_output}</span></li>
</ul> </ul>
: :
<ul className=" font-14"> <ul className=" font-14">

@ -58,3 +58,12 @@
.pd4020{ .pd4020{
padding: 0 40px 0 20px !important; padding: 0 40px 0 20px !important;
} }
.bannername780{
max-width: 780px;
overflow: hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
height: 40px;
}

@ -255,7 +255,7 @@ class DetailTop extends Component{
</Menu> </Menu>
); );
console.log(this.props.courses)
return( return(
@ -276,9 +276,12 @@ class DetailTop extends Component{
detailInfoList && detailInfoList &&
<div className={this.props.courses===undefined||this.props.courses.length===0?"subhead_content":"subhead_content pt100"}> <div className={this.props.courses===undefined||this.props.courses.length===0?"subhead_content":"subhead_content pt100"}>
<div className="font-28 color-white clearfix"> <div className="font-28 color-white clearfix">
<span className="fl lineh-40"> <Tooltip placement="bottom" title={detailInfoList.name.length>27?detailInfoList.name:""}>
{detailInfoList.name} <span className="fl lineh-40 bannername780">
</span> {detailInfoList.name}
</span>
</Tooltip>
<style> <style>
{ {
` `
@ -321,7 +324,13 @@ class DetailTop extends Component{
{ detailInfoList.allow_send === true?this.props.courses===undefined? { detailInfoList.allow_send === true?this.props.courses===undefined?
<SendPanel {...this.props} {...this.state}></SendPanel>:"":"" <SendPanel {...this.props} {...this.state}></SendPanel>:"":""
} }
<div className="fr pr">
{this.props.courses===undefined?"":detailInfoList.is_creator===true?<a className={"fl font-18 color-white mt5 kaike mr20"} onClick={()=>this.OpenCoursefun()}>开课</a>:""}
{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?this.props.courses===undefined?"":<Link to={"/paths/"+this.props.match.params.pathId+"/statistics"} className="fl font-18 color-white mt5 kaike">
学习统计
</Link>:""
}
</div>
</div> </div>
<div className="clearfix mt20"> <div className="clearfix mt20">
{ {
@ -335,11 +344,11 @@ class DetailTop extends Component{
{ detailInfoList.member_count!=0 ? <li><span>学习人数</span><span>{detailInfoList.member_count}</span></li> : ""} { detailInfoList.member_count!=0 ? <li><span>学习人数</span><span>{detailInfoList.member_count}</span></li> : ""}
</ul> </ul>
} }
{this.props.courses===undefined?<div className="fr pr"> <div className="fr pr">
{detailInfoList===undefined?"":detailInfoList.allow_delete===true?<a {detailInfoList===undefined?"":detailInfoList.allow_delete===true?<a
className={detailInfoList.publish_status===-1?"fl font-18 color-white mt5 mr20":"fl font-18 color-white mt5"} className={detailInfoList.publish_status===-1?"fl font-18 color-white mt5 mr20":"fl font-18 color-white mt5"}
style={{opacity: '0.6'}} onClick={this.allow_deletepath} style={{opacity: '0.6'}} onClick={this.allow_deletepath}
>删除路径</a>:""} >删除课程</a>:""}
{ {
detailInfoList.publish_status===0&&detailInfoList.allow_add_member===true? detailInfoList.publish_status===0&&detailInfoList.allow_add_member===true?
@ -356,15 +365,8 @@ class DetailTop extends Component{
detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true? detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true?
<a className="user_default_btn user_grey_btn font-18 fl pointer ml40" onClick={this.reovkissuePath}>撤销发布</a>:"" <a className="user_default_btn user_grey_btn font-18 fl pointer ml40" onClick={this.reovkissuePath}>撤销发布</a>:""
} }
</div>:""} </div>
{this.props.courses===undefined?"":detailInfoList.is_creator===true?<div className="fr pr">
<a className={"fl font-18 color-white mt5 kaike mr20"} onClick={()=>this.OpenCoursefun()}>开课</a>
<Link to={"/paths/"+this.props.match.params.pathId+"/statistics"} className="fl font-18 color-white mt5 kaike">
学习统计
</Link>
</div>:""}
</div> </div>
@ -393,12 +395,25 @@ class DetailTop extends Component{
` `
} }
</style> </style>
{this.props.courses===undefined?"":detailInfoList.is_creator===true?this.state.courseslist.map((item,key)=>{
return(
<Tooltip placement="bottom" title={"编辑课堂"} key={key}>
<a href={`/courses/${item.course_id}/newgolds/settings`} target={"_blank"}>
<i className="iconfont icon-bianji1 newbianji1"></i>
</a>
</Tooltip>
)}):""
}
<Dropdown <Dropdown
overlay={menu} overlay={menu}
onVisibleChange={this.onVisibleChanges} onVisibleChange={this.onVisibleChanges}
> >
<a className={"alist"}> <a className={"alist"}>
<i className="iconfont icon-bianji1 newbianji1"></i><span className={"color-orange"}>{this.state.MenuItemskey}</span> <Icon className="aIcons" type={!this.state.onVisibleChangestype?"down":"up"} /> <span className={"color-orange"}>{this.state.MenuItemskey}</span>次开课 <Icon className="aIcons" type={!this.state.onVisibleChangestype?"down":"up"} />
</a> </a>
</Dropdown> </Dropdown>
</li> </li>
@ -495,24 +510,24 @@ class DetailTop extends Component{
{item.course_status.status===0?<div className="mr51 shixun_detail pointer fl user-colorgrey-green">即将开课</div>:""} {item.course_status.status===0?<div className="mr51 shixun_detail pointer fl user-colorgrey-green">即将开课</div>:""}
{item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange">{item.course_status.time}</div>:""} {item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange">{item.course_status.time}</div>:""}
{item.course_status.status===2? {item.course_status.status===2?
detailInfoList.is_creator===true?<div className="mr51 shixun_detail pointer fl user-colorgrey-9b">已结束</div>:item.course_identity<6? detailInfoList.is_creator===true||detailInfoList.allow_add_member===true?<div className="mr51 shixun_detail pointer fl user-colorgrey-9b">已结束</div>:item.course_identity<6?
<div className="mr51 shixun_detail pointer fl user-colorgrey-9b">已结束</div>:"":""} <div className="mr51 shixun_detail pointer fl user-colorgrey-9b">已结束</div>:"":""}
{item.course_status.status===0? {item.course_status.status===0?
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank"> detailInfoList.is_creator===true||detailInfoList.allow_add_member===true?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
进入课堂 进入课堂
</a>:item.course_identity<6?<div className="fr user_default_btn background191 font-18 mt28 pathbtens"></div> </a>:item.course_identity<6?<div className="fr user_default_btn background191 font-18 mt28 pathbtens"></div>
:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}>立即报名</a>:""} :<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}>立即报名</a>:""}
{item.course_status.status===1? {item.course_status.status===1?
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}> detailInfoList.is_creator===true||detailInfoList.allow_add_member===true?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}>
进入课堂 进入课堂
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank"> </a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
立即学习 立即学习
</a>:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}></a>:""} </a>:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}></a>:""}
{item.course_status.status===2? {item.course_status.status===2?
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank"> detailInfoList.is_creator===true||detailInfoList.allow_add_member===true?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
进入课堂 进入课堂
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank"> </a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
进入课堂 进入课堂

@ -26,9 +26,9 @@ class OpenCourse extends Component {
console.log(this.props.match.params.pathId) console.log(this.props.match.params.pathId)
if(value===0){ if(value===0){
window.open(`/courses/${this.props.match.params.pathId}/newgold/0 `); window.open(`/courses/news/${this.props.match.params.pathId}/newgold/0 `);
}else{ }else{
window.open(`/courses/${this.props.match.params.pathId}/newgold/1`); window.open(`/courses/news/${this.props.match.params.pathId}/newgold/1`);
} }
this.props.OpenCourseCancel(); this.props.OpenCourseCancel();
} }
@ -68,10 +68,11 @@ class OpenCourse extends Component {
<div className={"tabeltext-alignleft"}> <div className={"tabeltext-alignleft"}>
<p className={"mt20 mb20 font-16"}> <p className={"mt20 mb20 font-16"}>
<Radio.Group onChange={this.setpathradioChange} value={this.state.value}> <Radio.Group onChange={this.setpathradioChange} value={this.state.value}>
<Radio style={pathradioStyle} value={1}> <Radio style={pathradioStyle} value={1} className={"mt10"}>
开放课堂<span style={pathradioStyles}>所有用户可以随时访问</span> 开放课堂<span style={pathradioStyles}>所有用户可以随时访问</span>
</Radio> </Radio>
<Radio style={pathradioStyle} value={0}>
<Radio style={pathradioStyle} value={0} className={"mt10"}>
私有课堂<span style={pathradioStyles}>仅报名参与的课堂成员可以访问</span> 私有课堂<span style={pathradioStyles}>仅报名参与的课堂成员可以访问</span>
</Radio> </Radio>
</Radio.Group> </Radio.Group>

@ -461,7 +461,7 @@ class PathDetailIndex extends Component{
</div> </div>
<Tooltip placement="bottom" title={"显示全部"}> <Tooltip placement="bottom" title={"显示全部"}>
<div className={tags.length>15&&clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 fr":"newsubscript mb9 color-grey-9 none"} <div className={tags.length>20&&clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 fr":"newsubscript mb9 color-grey-9 none"}
onClick={()=>this.clickNewsubscript(0)} onClick={()=>this.clickNewsubscript(0)}
><span className="mr8">...</span><Icon type="caret-down" /> ><span className="mr8">...</span><Icon type="caret-down" />
</div> </div>
@ -542,7 +542,7 @@ class PathDetailIndex extends Component{
{ {
detailInfoList===undefined?"":detailInfoList.allow_add_member===true? <div> detailInfoList===undefined?"":detailInfoList.allow_add_member===true? <div>
{key!=0?<div className="fr ml15 flex1"><a onClick={()=>this.moveup(item)}><Tooltip title="上移"><i className="color-green font-18 iconfont icon-xiangshangyi"></i></Tooltip></a></div>:""} {key!=0?<div className="fr ml15 flex1"><a onClick={()=>this.moveup(item)}><Tooltip title="上移"><i className="color-green font-18 iconfont icon-xiangshangyi"></i></Tooltip></a></div>:""}
{key+1!= members&&members.length?<div className="fr ml15 flex1 "><a onClick={()=>this.movedown(item)}><Tooltip title="下移"><i className="color-green font-18 iconfont icon-xiangxiayi"></i></Tooltip></a></div>:""} {key+1== members.length?"":<div className="fr ml15 flex1 "><a onClick={()=>this.movedown(item)}><Tooltip title="下移"><i className="color-green font-18 iconfont icon-xiangxiayi"></i></Tooltip></a></div>}
</div> </div>
:"" :""
} }

@ -35,14 +35,14 @@ if (!window['indexHOCLoaded']) {
// $('head').append($('<link rel="stylesheet" type="text/css" />') // $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`)); // .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?9`)); .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?1`));
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?9`)); .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?1`));
// index.html有加载 // index.html有加载
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?9`)); .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?1`));
// $('head').append($('<link rel="stylesheet" type="text/css" />') // $('head').append($('<link rel="stylesheet" type="text/css" />')

@ -234,15 +234,15 @@ class InfosPackage extends Component{
</div> </div>
<div className="item-other"> <div className="item-other">
<div className="item-group item-other-visit"> <div className="item-group item-other-visit">
<span className="item-group-icon"><i className="fa fa-eye"></i></span> <span className="item-group-icon mr10"><i className="fa fa-eye"></i></span>
<span className="item-group-text">{item.visit_count}人浏览</span> <span className="item-group-text">{item.visit_count}人浏览</span>
</div> </div>
<div className="item-group item-other-deadline"> <div className="item-group item-other-deadline">
<span className="item-group-icon"><i className="fa fa-clock-o"></i></span> <span className="item-group-icon mr10"><i className="fa fa-clock-o"></i></span>
<span className="item-group-text">{moment(item.deadline_at).format("YYYY-MM-DD HH:mm")}竞标截止</span> <span className="item-group-text">{moment(item.deadline_at).format("YYYY-MM-DD HH:mm")}竞标截止</span>
</div> </div>
<div className="item-group item-other-bidding pagemancenter"> <div className="item-group item-other-bidding pagemancenter">
<span className="item-group-icon"><i className="fa fa-user"></i></span> <span className="item-group-icon mr10"><i className="fa fa-user"></i></span>
<span className="item-group-text">{item.bidding_users_count}人竞标</span> <span className="item-group-text">{item.bidding_users_count}人竞标</span>
</div> </div>
<div className="item-group item-other-publish-at"> <div className="item-group item-other-publish-at">

@ -435,7 +435,7 @@ function VideoUploadList (props) {
</div> </div>
{/* windows video/* 不管用 TODO */} {/* windows video/* 不管用 TODO */}
<input type="file" id="fileUpload" style={{display: 'none'}} onChange={onUploadChange} <input type="file" id="fileUpload" style={{display: 'none'}} onChange={onUploadChange}
accept=".flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*" accept=".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"
></input> ></input>
</div> </div>
) )

@ -114,10 +114,26 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.smallSquare:nth-child(3n+0){margin-right: 0px;} .smallSquare:nth-child(3n+0){margin-right: 0px;}
.partimg{height: 180px;width: 100%;border-radius: 6px 6px 0px 0px;} .partimg{height: 180px;width: 100%;border-radius: 6px 6px 0px 0px;}
/*块状列表上面的绿色标签*/ /*块状列表上面的绿色标签*/
.tag-green{position: absolute;left: 0px;top:20px;} .tag-green{
.tag-green .tag-name{display: block;width: auto;background-image: url("/images/educoder/tag1.png");background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;} position: absolute;
.tag-orange{position: absolute;right: 0px;top:20px;} left: 10px;
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;} bottom: 90px;}
.tag-green .tag-name{display: block;width: auto;
/*background-image: url("/images/educoder/tag1.png");*/
background: #000000;
border: 1px solid #fff;
border-radius: 3px;
font-size: 14px;
opacity: 0.56;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:12px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;
height: 28px;
line-height: 28px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
/*发送至弹框里的下拉框*/ /*发送至弹框里的下拉框*/
.downSelectOption{position: relative;height: 35px;} .downSelectOption{position: relative;height: 35px;}
.downSelectOption .showOption{background-color: #F4F4F4;border: 1px solid #EAEAEA;width: 100%;padding: 5px 40px 5px 5px;outline: none;height: 100%;box-sizing: border-box;} .downSelectOption .showOption{background-color: #F4F4F4;border: 1px solid #EAEAEA;width: 100%;padding: 5px 40px 5px 5px;outline: none;height: 100%;box-sizing: border-box;}
@ -3714,9 +3730,13 @@ a.singlepublishtwo{
} }
.shaiContent li.shaiItem:hover i.iconfont{ .shaiContent li.shaiItem:hover i.iconfont{
color: #4CACFF!important color: #4CACFF !important;
} }
.detail_for_paragraph p{ .detail_for_paragraph p{
white-space: pre-wrap; white-space: pre-wrap;
} }
.ant-tooltip{
max-width: 100% !important;
}
Loading…
Cancel
Save