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

dev_cs
杨树林 6 years ago
commit 0e1805ce05

@ -0,0 +1,6 @@
function show_add_manager(id) {
$(".auth-schools-user-add").modal("show");
$(".auth-schools-user-add").find("#school_id_input").val(id)
}

@ -0,0 +1,13 @@
$(document).on('turbolinks:load', function() {
if ($('body.admins-major-informations-index-page').length > 0) {
var box_contain = $(".major-informations-list-container");
box_contain.on("click",".collapse-item",function () {
var a_fa = $(this).find("i");
if(a_fa.hasClass("fa-caret-right")){
a_fa.removeClass("fa-caret-right").addClass("fa-caret-down");
}else{
a_fa.removeClass("fa-caret-down").addClass("fa-caret-right");
}
});
}
});

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

@ -51,3 +51,5 @@ input.form-control {
position: absolute;
}
.position-r{position:relative;}
.color-grey-c{color:#ccc}
.inline-block{display:inline-block;}

@ -0,0 +1,66 @@
.admins-auth-schools-index-page{
.list-item-title{
padding-bottom:5px;
padding-left: 33px;
color: #555;
}
.list-item-title-1{
width: 100px;
display: inline-block;
}
.list-item-title-2{
width: 200px;
display: inline-block;
}
.collegeManage{
float: left;
padding: 0px 8px;
border-radius: 6px;
background-color: #f5f5f5;
margin: 3px 0px 3px 10px;
height: 34px;
line-height: 34px;
a{
color: #05101a;
}
a:hover{
color: #007bff;
}
}
i:hover{
color: #333;
}
.add-manager-i{
float: left;
i{
padding: 10px 5px;
}
}
.auth-schools-new-add, .auth-schools-user-add{
.flex-column{
input{
height: 38px;
}
}
.search-school{
margin-left: 15px;
}
}
.school-search-list{
background: #F4FAFF;
height: 280px;
overflow-y: scroll;
padding: 10px 0;
}
.school-list-item{
padding: 2px 10px;
input{
font-size: 20px;
margin-right: 5px;
}
}
}

@ -0,0 +1,37 @@
.admins-major-informations-index-page{
.fr{
float:right;
}
.panel-default{
margin-bottom: 10px;
background-color: rgb(245, 245, 245);
.panel-heading{
i{
margin-right:15px;
font-size:16px;
color:rgb(204, 204, 204);
}
a{
padding: 8px 10px;
display: inline-block;
width:100%;
color:rgb(102, 102, 102);
}
}
.panel-collapse{
padding-top: 10px;
background: #fff;
table{
text-align:center;
th,td{
padding: 8px;
}
td{
color:#888;
}
}
}
}
}

@ -33,4 +33,8 @@ input.form-control {
.font-12 { font-size: 12px !important; }
.font-14 { font-size: 14px !important; }
.font-16 { font-size: 16px !important; }
.font-18 { font-size: 18px !important; }
.font-18 { font-size: 18px !important; }
.padding10-5 { padding: 10px 5px;}
.width100 { width: 100%;}
.mb10 { margin-bottom: 10px ;}
.mt10 { margin-top: 10px ;}

@ -0,0 +1,3 @@
// Place all the styles related to the course_stages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

@ -0,0 +1,57 @@
class Admins::AuthSchoolsController < Admins::BaseController
def index
schools = School.where(ec_auth: 1).includes(:users).order("updated_at desc")
@params_page = params[:page] || 1
@schools = paginate schools
end
def destroy
ActiveRecord::Base.transaction do
school = School.where(id: params[:id]).first
school.destroy
end
end
# 工程认证单位列表搜索学校
def search_school
@schools = School.where("ec_auth != 1 and name like '%#{params[:name]}%'").limit(10)
end
# 添加认证学校
def add_school
all_schools = School.all
all_schools.where(id: params[:school_id]).update_all(ec_auth: 1)
schools = all_schools.where(ec_auth: 1).order("updated_at desc")
@params_page = params[:page] || 1
@schools = paginate schools
end
# 搜索用户
def search_manager
school = School.find_by(id: params[:school_id])
user_ids = school&.ec_school_users&.pluck(:user_id)
@users = User.where.not(id: user_ids).where("concat(lastname, firstname) like ?", "%#{params[:name].strip.to_s}%").limit(10)
end
# 添加认证学校管理员
def add_manager
ActiveRecord::Base.transaction do
user_ids = params[:user_id]
@school_id = params[:school_id]
user_ids.each do |id|
EcSchoolUser.create(user_id: id, school_id: @school_id)
end
@school_users = User.where(id: user_ids)
end
end
# 删除学校管理员
def remove_manager
ActiveRecord::Base.transaction do
manager = EcSchoolUser.where(school_id: params[:school_id], user_id: params[:user_id]).first
manager&.destroy
end
end
end

@ -0,0 +1,8 @@
class Admins::MajorInformationsController < Admins::BaseController
def index
disciplines = EcDiscipline.includes(ec_discipline_firsts: {ec_majors: :schools}).order("ec_disciplines.code asc")
@disciplines = paginate disciplines
end
end

@ -253,7 +253,7 @@ class ApplicationController < ActionController::Base
# 测试版前端需求
logger.info("subdomain:#{request.subdomain}")
if request.subdomain == "pre-newweb"
if request.subdomain == "test-newweb"
if params[:debug] == 'teacher' #todo 为了测试,记得讲debug删除
User.current = User.find 81403
elsif params[:debug] == 'student'

@ -0,0 +1,105 @@
class CourseStagesController < ApplicationController
before_action :require_login
before_action :find_course, only: [:create]
before_action :find_course_stage, only: [:update, :destroy, :edit, :up_position, :down_position]
before_action :user_course_identity, :teacher_allowed
def create
ActiveRecord::Base.transaction do
begin
@stage = CourseStage.new(stage_params)
@stage.course_id = @course.id
@stage.position = @course.course_stages.count + 1
@stage.save!
unless params[:shixun_id].blank?
shixuns = Shixun.where(id: params[:shixun_id]).order("field(id, #{params[:shixun_id].join(",")})")
shixuns.each do |shixun|
CourseStageShixun.create!(course_stage_id: @stage.id, course_id: @course.id, shixun_id: shixun.id, position: @stage.course_stage_shixuns.count + 1)
end
end
normal_status("创建成功")
rescue Exception => e
uid_logger_error(e.message)
tip_exception(e.message)
raise ActiveRecord::Rollback
end
end
end
def edit
end
def update
ActiveRecord::Base.transaction do
begin
@stage.update_attributes!(stage_params)
@stage.course_stage_shixuns.destroy_all
unless params[:shixun_id].blank?
params[:shixun_id].each do |shixun_id|
shixun = Shixun.where(id: shixun_id).first
@stage.course_stage_shixuns.create!(course_id: @course.id, shixun_id: shixun.id, position: @stage.course_stage_shixuns.count + 1) if shixun.present?
end
end
normal_status("更新成功")
rescue Exception => e
uid_logger_error(e.message)
tip_exception(e.message)
raise ActiveRecord::Rollback
end
end
end
def destroy
ActiveRecord::Base.transaction do
@course.course_stages.where("position > ?", @stage.position).update_all("position = position - 1")
@stage.destroy!
normal_status("删除成功")
end
end
def up_position
ActiveRecord::Base.transaction do
begin
position = @stage.position
tip_exception("第一章不能向上移动") if @stage.position == 1
pre_stage = @course.course_stages.where(position: position - 1).first
pre_stage.update_attributes(position: position)
@stage.update_attributes(position: position - 1)
normal_status("更新成功")
rescue Exception => e
uid_logger("stage up failed: #{e.message}")
raise ActiveRecord::Rollback
end
end
end
def down_position
ActiveRecord::Base.transaction do
begin
position = @stage.position
rails "最后一章不能向下移动" if @stage.position == @course.course_stages.count
next_stage = @course.course_stages.where(position: position + 1).first
next_stage.update_attributes(position: position)
@stage.update_attributes(position: position + 1)
normal_status("更新成功")
rescue Exception => e
uid_logger("stage up failed: #{e.message}")
raise ActiveRecord::Rollback
end
end
end
private
def find_course_stage
@stage = CourseStage.find_by!(id: params[:id])
@course = @stage.course
end
def stage_params
tip_exception("章节名称不能为空") if params[:name].blank?
params.permit(:name, :description)
end
end

@ -167,6 +167,8 @@ class CoursesController < ApplicationController
end
Inform.create(container: @course, description: @subject.learning_notes, name: "学习须知")
@course.create_stages @course.subject
end
course_module_types = params[:course_module_types]
@ -266,9 +268,9 @@ class CoursesController < ApplicationController
def online_learning
@subject = @course.subject
@stages = @subject&.stages
@stages = @course.course_stages
@user = current_user
@start_learning = @user_course_identity == Course::STUDENT && @subject&.learning?(current_user.id)
@start_learning = @user_course_identity == Course::STUDENT && @course.learning?(current_user.id)
end
def search_course_list
@ -708,6 +710,7 @@ class CoursesController < ApplicationController
def students
search = params[:search].present? ? params[:search].strip : nil
order = params[:order].present? ? params[:order].to_i : 0
sort = params[:sort].present? ? params[:sort] : "desc"
course_group_id = params[:course_group_id].present? ? params[:course_group_id].to_i : nil
@students = CourseMember.students(@course)
@ -719,12 +722,12 @@ class CoursesController < ApplicationController
if order == 1
# REDO:Extension
@students = @students.includes(user: :user_extension).order("user_extensions.student_id, users.login")
@students = @students.includes(user: :user_extension).order("user_extensions.student_id #{sort}, users.login #{sort}")
elsif order == 2
@students = @students.includes(:course_group).order("course_groups.position, users.login")
@students = @students.includes(:course_group).order("course_groups.position #{sort}, users.login #{sort}")
else
# REDO:Extension
@students = @students.includes(user: :user_extension).order("user_extensions.student_id, users.login")
@students = @students.includes(user: :user_extension).order("user_extensions.student_id #{sort}, users.login #{sort}")
end
if course_group_id.present?

@ -442,7 +442,6 @@ class SubjectsController < ApplicationController
# 用户进展和获取的标签
def user_subject_progress challenge_ids
pass_games = Game.select(:id, :cost_time, :challenge_id).where(status: 2, user_id: current_user.id, challenge_id: challenge_ids) if current_user.logged?
@all_score = Challenge.where(id: challenge_ids).sum(:score)
# 如果没有通关的,没必要再继续统计了
if pass_games.blank?
@ -451,6 +450,7 @@ class SubjectsController < ApplicationController
@time = 0
@user_tags = []
else
@all_score = Challenge.where(id: challenge_ids).size
pass_challenge_ids = pass_games.map(&:challenge_id).uniq # 按道理是不用去重的,但是历史数据与重复
subject_challenge_count = @subject.shixuns.sum(:challenges_count)
# 用户通关获得的标签
@ -460,7 +460,7 @@ class SubjectsController < ApplicationController
subject_challenge_count == 0 ? 0 :
((pass_challenge_ids.size.to_f / subject_challenge_count).round(2) * 100).to_i
# 用户通关分数
@my_score = Challenge.where(id: pass_challenge_ids).pluck(:score).sum
@my_score = Challenge.where(id: pass_challenge_ids).size
@time = pass_games.map(&:cost_time).sum
end

@ -103,4 +103,8 @@ module Admins::BaseHelper
def unsafe_params
params.except(:controller, :action).to_unsafe_h
end
def list_index_no(page,index)
(page - 1) * 20 + index + 1
end
end

@ -0,0 +1,2 @@
module CourseStagesHelper
end

@ -269,10 +269,10 @@ module CoursesHelper
group_info
end
def last_subject_shixun user_id, subject
myshixun = Myshixun.where(user_id: user_id, shixun_id: subject&.shixuns).order("updated_at desc").first
def last_subject_shixun user_id, course
myshixun = Myshixun.where(user_id: user_id, shixun_id: course.shixuns).order("updated_at desc").first
return "" unless myshixun
stage_shixun = subject&.stage_shixuns.where(shixun_id: myshixun.shixun_id).take
progress = stage_shixun&.stage&.position.to_s + "-" + stage_shixun&.position.to_s + " " + myshixun.shixun&.name
stage_shixun = course.course_stage_shixuns.where(shixun_id: myshixun.shixun_id).take
progress = stage_shixun&.course_stage&.position.to_s + "-" + stage_shixun&.position.to_s + " " + myshixun.shixun&.name
end
end

@ -70,6 +70,11 @@ class Course < ApplicationRecord
has_many :course_acts, class_name: 'CourseActivity', as: :course_act, dependent: :destroy
has_many :tidings, as: :container, dependent: :destroy
# 开放课堂
has_many :course_stages, -> { order("course_stages.position ASC") }, dependent: :destroy
has_many :course_stage_shixuns, dependent: :destroy
has_many :shixuns, through: :course_stage_shixuns
# 老版的members弃用 现用course_members
has_many :members
@ -77,6 +82,7 @@ class Course < ApplicationRecord
scope :ended, ->(is_end = true) { where(is_end: is_end) }
scope :processing, -> { where(is_end: false) }
scope :not_deleted, -> { where(is_delete: 0) }
scope :not_excellent, -> { where(excellent: 0) }
scope :deleted, ->(is_delete = 1) { where(is_delete: is_delete) }
scope :by_user, ->(user) { joins(:course_members).where('course_members.user_id = ?', user.id).order(updated_at: :desc) }
scope :by_keywords, lambda { |keywords|
@ -333,6 +339,28 @@ class Course < ApplicationRecord
teacher_power_courses
end
def create_stages subject
if subject
subject.stages.each do |stage|
new_stage = CourseStage.create!(course_id: id, name: stage.name, description: stage.description, position: stage.position)
stage.stage_shixuns.each do |stage_shixun|
CourseStageShixun.create!(course_id: id, course_stage_id: new_stage.id, shixun_id: stage_shixun.shixun_id, position: stage_shixun.position)
end
end
end
end
def learning? user_id
Myshixun.where(user_id: user_id, shixun_id: shixuns).exists?
end
def my_subject_progress
my_challenge_count = Game.joins(:challenge).where(user_id: User.current.id, status: 2, challenges: {shixun_id: shixuns.published_closed}).
pluck(:challenge_id).uniq.size
course_challeng_count = course.shixuns.pluck(:challenges_count).sum
count = course_challeng_count == 0 ? 0 : ((my_challenge_count.to_f / course_challeng_count).round(2) * 100).to_i
end
private
#创建课程后,给该用户发送消息

@ -0,0 +1,9 @@
class CourseStage < ApplicationRecord
belongs_to :course
has_many :course_stage_shixuns, -> { order("course_stage_shixuns.position ASC") }, dependent: :destroy
has_many :shixuns, :through => :course_stage_shixuns
validates :name, length: { maximum: 60 }
validates :description, length: { maximum: 300 }
end

@ -0,0 +1,5 @@
class CourseStageShixun < ApplicationRecord
belongs_to :course
belongs_to :course_stage, counter_cache: :shixuns_count
belongs_to :shixun
end

@ -0,0 +1,12 @@
class EcDiscipline < ActiveRecord::Base
validates_presence_of :code, :name
has_many :ec_discipline_firsts
# 专业数目
def major_count
count = 0
self.ec_discipline_firsts.map{|f| count += f.ec_majors.count}
count
end
end

@ -0,0 +1,6 @@
class EcDisciplineFirst < ActiveRecord::Base
validates_presence_of :code, :name
has_many :ec_majors
belongs_to :ec_discipline
end

@ -1,7 +1,10 @@
class EcMajor < ApplicationRecord
# 主页对应的学校,不同学校可以选用同样的专业,而每个专业又各具特色
has_many :schools, through: :ec_major_schools
has_many :ec_major_schools, dependent: :destroy
has_many :schools, through: :ec_major_schools
# 一级专业
belongs_to :ec_discipline_first
scope :search_name_or_code, -> (keyword) { where('name LIKE :keyword OR code LIKE :keyword', keyword: "%#{keyword.strip}%") }
end

@ -38,7 +38,11 @@ class Users::ApplyProfessionalAuthService < ApplicationService
move_image_file! unless params[:upload_image].to_s == 'false'
sms_notify_admin
# sms_cache = Rails.cache.read("apply_pro_certification")
# if sms_cache.nil?
# sms_notify_admin
Rails.cache.write("apply_pro_certification", 1)
# end
end
end

@ -11,7 +11,7 @@ class Users::CourseService
end
def call
courses = category_scope_courses.not_deleted
courses = category_scope_courses.not_deleted.not_excellent
courses = status_filter(courses)

@ -0,0 +1,6 @@
if($(".auth-schools-user-add").length > 0){
$(".auth-schools-user-add").modal("hide")
}
<% if @school_users.size > 0 %>
$("#table-school-<%= @school_id %>").find(".school_user_list").html("<%= j render partial: "admins/auth_schools/shared/school_user_list", locals: {users: @school_users, school_id: @school_id} %> ")
<% end %>

@ -0,0 +1,2 @@
$(".auth-schools-list-container").html("<%= j render partial: "admins/auth_schools/shared/list", locals: {schools: @schools} %>")
$(".auth-schools-new-add").modal("hide")

@ -0,0 +1 @@
$("#table-school-<%= params[:id] %>").remove()

@ -0,0 +1,14 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('认证单位列表') %>
<% end %>
<div class="box search-form-container auth-schools-list-form">
<%= javascript_void_link '新增', class: 'btn btn-primary', data: { toggle: 'modal', target: '.auth-schools-new-add' } %>
</div>
<div class="box auth-schools-list-container">
<%= render(partial: 'admins/auth_schools/shared/list', locals: { schools: @schools }) %>
</div>
<%= render partial: "admins/auth_schools/shared/new_modal" %>
<%= render partial: "admins/auth_schools/shared/user_add_modal" %>

@ -0,0 +1 @@
$(".auth-schools-list-container").html("<%= j render partial: "admins/auth_schools/shared/list", locals: {schools: @schools} %>")

@ -0,0 +1,2 @@
$("#table-school-<%= params[:school_id] %>").find("#manager-<%= params[:user_id] %>").remove()

@ -0,0 +1,4 @@
if($("#add-users-list").length > 0){
$("#add-users-list").html("<%= j render partial: "admins/auth_schools/shared/add_users_list", locals: {users: @users, school_id: params[:school_id]} %>")
}

@ -0,0 +1,3 @@
if($("#add-schools-list").length > 0){
$("#add-schools-list").html("<%= j render partial: "admins/auth_schools/shared/add_schools_list", locals: {schools: @schools} %>")
}

@ -0,0 +1,23 @@
<%= form_tag(add_school_admins_auth_schools_path, method: :post, remote: true) do %>
<div class="add-school-list-item">
<div class="list-item-title">单位名称</div>
<div class="school-search-list">
<% if schools.size > 0 %>
<% schools.each do |school| %>
<div class="school-list-item">
<%= check_box_tag("school_id[]", school.id, false, id: "check_school_#{school.id}") %>
<label for="check_school_<%= school.id %>">
<%= school.try(:name) %>
</label>
</div>
<% end %>
<% else %>
<p class="padding10-5 color-grey-c">没有相关的单位</p>
<% end %>
</div>
</div>
<div class="text-right mt10">
<%= submit_tag("确认",class: "btn btn-primary submit-btn") %>
</div>
<% end %>

@ -0,0 +1,31 @@
<%= form_tag(add_manager_admins_auth_schools_path, method: :post, remote: true) do %>
<%= hidden_field_tag("school_id",school_id) %>
<div class="add-school-list-item">
<div class="list-item-title">
<span class="list-item-title-1">姓名</span>
<span class="list-item-title-2">单位</span>
</div>
<div class="school-search-list">
<% if users.size > 0 %>
<% users.each do |user| %>
<div class="school-list-item">
<%= check_box_tag("user_id[]", user.id, false, id: "check_user_#{user.id}") %>
<label for="check_user_<%= user.id %>">
<span class="list-item-title-1">
<%= user.try(:show_real_name) %>
</span>
<span class="list-item-title-2">
<%= user.try(:school_name) %>
</span>
</label>
</div>
<% end %>
<% else %>
<p class="padding10-5 color-grey-c">没有相关的单位</p>
<% end %>
</div>
</div>
<div class="text-right mt10">
<%= submit_tag("确认",class: "btn btn-primary submit-btn") %>
</div>
<% end %>

@ -0,0 +1,38 @@
<table class="table" cellspacing="0" cellpadding="0">
<thead>
<th width="10%">序号</th>
<th width="30%">学校名称</th>
<th width="50%">学校管理员</th>
<th width="10%">操作</th>
</thead>
<tbody>
<% if schools.size > 0 %>
<% schools.each_with_index do |school, index| %>
<tr id="table-school-<%= school.id %>">
<td><%= list_index_no(@params_page.to_i, index) %></td>
<td>
<%= link_to "#{school.name}", "/ecs/department?school_id=#{school.id}", target: "_blank" %>
</td>
<td>
<div class="add-manager-i">
<%= link_to "<i class='fa fa-plus-circle font-18 color-grey-c'></i>".html_safe, "javascript:void(0)", class: "action", onclick: "show_add_manager('#{school.id}')" %>
</div>
<div class="inline-block school_user_list">
<% if school.users.size > 0 %>
<%= render partial: "admins/auth_schools/shared/school_user_list", locals: {users: school.users, school_id: school.id} %>
<% end %>
</div>
</td>
<td>
<%= link_to "<i class='fa fa-trash-o color-grey-c font-18 padding10-5'></i>".html_safe, admins_auth_school_path(school), method: :delete, data: {confirm: "确认删除吗?"}, remote: true %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: schools } %>

@ -0,0 +1,32 @@
<div class="modal fade auth-schools-new-add" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">新增认证单位</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<%= form_tag(search_school_admins_auth_schools_path,method: :get ,remote: true) do %>
<div class="form-group d-flex mbt10">
<div class="w-75 d-flex flex-column">
<%= text_field_tag(:name, nil, class: 'form-control', placeholder: '请输入单位名称搜索') %>
</div>
<%= submit_tag("搜索",class:"btn btn-primary search-school", 'data-disable-with': "搜索中...") %>
</div>
<% end %>
<div id="add-schools-list">
<div class="add-school-list-item">
<div class="list-item-title">单位名称</div>
<div class="school-search-list">
<div class="school-list-item">
<span class="color-grey-c">请输入单位名称</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,6 @@
<% users.each do |user| %>
<span class="collegeManage" id="manager-<%= user.id %>">
<%= link_to user.show_real_name, "/users/#{user.login}", target: "_blank" %>
<%= link_to "×", remove_manager_admins_auth_schools_path(user_id: user.id, school_id: school_id),method: :post, class: "font-16 ml3", remote: true %>
</span>
<% end %>

@ -0,0 +1,36 @@
<div class="modal fade auth-schools-user-add" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">添加管理员</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<%= form_tag(search_manager_admins_auth_schools_path, method: :get ,remote: true) do %>
<%= hidden_field("school_id","",id:"school_id_input") %>
<div class="form-group d-flex mbt10">
<div class="w-75 d-flex flex-column">
<%= text_field_tag(:name, nil, class: 'form-control', placeholder: '请输入用户姓名搜索') %>
</div>
<%= submit_tag("搜索",class:"btn btn-primary search-school", 'data-disable-with': "搜索中...") %>
</div>
<% end %>
<div id="add-users-list">
<div class="add-school-list-item">
<div class="list-item-title">
<span class="list-item-title-1">姓名</span>
<span class="list-item-title-2">单位</span>
</div>
<div class="school-search-list">
<div class="school-list-item">
<span class="color-grey-c">请输入用户姓名搜索</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,7 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('本科专业目录') %>
<% end %>
<div class="box major-informations-list-container">
<%= render(partial: 'admins/major_informations/shared/list', locals: { majors: @disciplines }) %>
</div>

@ -0,0 +1,48 @@
<div class="panel-group" id="accordion">
<% if @disciplines.size > 0 %>
<% @disciplines.each_with_index do |d,index| %>
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-title">
<a data-toggle="collapse" data-parent="#accordion"
href="#collapse-<%= index %>" class="collapse-item">
<i class="fa fa-caret-right fa-fw"></i>
<span><%= "#{d.code} #{d.name}" %></span>
<span class="fr"><%= d.major_count %></span>
</a>
</div>
</div>
<div id="collapse-<%= index %>" class="panel-collapse collapse in">
<div class="panel-body">
<table class="table table-bordered" cellpadding="0" cellspacing="0">
<thead>
<th class="with20">一级学科代码</th>
<th class="with20">一级学科名称</th>
<th class="with20">专业代码</th>
<th class="with20">专业名称</th>
<th class="with20">认证学校数量</th>
</thead>
<tbody>
<% d.ec_discipline_firsts.each do |f| %>
<% f.ec_majors.each_with_index do |m, index| %>
<tr>
<td><%= index == 0 ? f.code : "" %></td>
<td><%= index == 0 ? f.name : "" %></td>
<td><%= m.code %></td>
<td><%= m.name %></td>
<td><%= m.schools.size.to_i %></td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</div>
<%= render partial: 'admins/shared/paginate', locals: { objects: @disciplines } %>

@ -66,6 +66,12 @@
<% end %>
</li>
<li>
<%= sidebar_item_group('#major-identification-submenu', '工程认证', icon: 'anchor') do %>
<li><%= sidebar_item(admins_major_informations_path, '本科专业目录', icon: 'outdent', controller: 'admins-major_informations') %></li>
<li><%= sidebar_item(admins_auth_schools_path, '认证单位列表', icon: 'th', controller: 'admins-auth_schools') %></li>
<% end %>
</li>
<li>
<%= sidebar_item_group('#helps-submenu', '帮助中心', icon: 'info-circle') do %>

@ -17,7 +17,7 @@
<% if shixuns.present? %>
<% shixuns.each_with_index do |shixun,index| %>
<tr>
<td><%= (@params_page.to_i - 1) * 20 + index + 1%></td>
<td><%= list_index_no(@params_page.to_i, index) %></td>
<td><%= shixun.identifier %></td>
<td class="text-left"><span><%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %></span></td>
<td>

@ -0,0 +1,11 @@
json.stage_id @stage.id
json.stage_name @stage.name
json.stage_description @stage.description
json.delete_path "/course_stages/#{@stage.id}"
json.shixuns_list do
json.array! @stage.shixuns.each do |shixun|
json.shixun_identifier shixun.identifier
json.shixun_name shixun.name
json.shixun_id shixun.id
end
end

@ -2,10 +2,10 @@ json.stages @stages do |stage|
json.partial! 'stages/stage', locals: {stage: stage, user:@user, subject:@subject}
end
json.description @subject&.description
# json.description @subject&.description
json.start_learning @start_learning
json.learned @start_learning ? @subject&.my_subject_progress : 0
json.learned @start_learning ? @course.my_subject_progress : 0
json.last_shixun @start_learning ? last_subject_shixun(@user.id, @subject) : ""

@ -373,6 +373,13 @@ Rails.application.routes.draw do
get 'search_slim'
end
resources :course_stages, shallow: true do
member do
post :up_position
post :down_position
end
end
resources :polls, only:[:index,:new,:create] do
collection do
post :publish # 立即发布
@ -802,6 +809,17 @@ Rails.application.routes.draw do
namespace :admins do
get '/', to: 'dashboards#index'
resources :major_informations, only: [:index]
resources :auth_schools, only: [:index, :destroy] do
collection do
get :search_school
post :add_school
get :search_manager
post :add_manager
post :remove_manager
end
end
resources :dashboards, only: [:index] do
collection do
get :month_active_user

@ -0,0 +1,13 @@
class CreateCourseStages < ActiveRecord::Migration[5.2]
def change
create_table :course_stages do |t|
t.references :course, index: true
t.string :name
t.text :description
t.integer :position
t.integer :shixuns_count
t.timestamps
end
end
end

@ -0,0 +1,12 @@
class CreateCourseStageShixuns < ActiveRecord::Migration[5.2]
def change
create_table :course_stage_shixuns do |t|
t.references :course, index: true
t.references :course_stage, index: true
t.references :shixun, index: true
t.integer :position
t.timestamps
end
end
end

@ -0,0 +1,14 @@
class MigrateCourseStages < ActiveRecord::Migration[5.2]
def change
Course.where(excellent: 1).each do |course|
if course.subject
course.subject.stages.each do |stage|
new_stage = CourseStage.create!(course_id: course.id, name: stage.name, description: stage.description, position: stage.position)
stage.stage_shixuns.each do |stage_shixun|
CourseStageShixun.create!(course_id: course.id, course_stage_id: new_stage.id, shixun_id: stage_shixun.shixun_id, position: stage_shixun.position)
end
end
end
end
end
end

@ -22,7 +22,6 @@
-->
<title>EduCoder</title>
<script type="text/javascript">
window.__testImageUrl = "https://pre-newweb.educoder.net/react/build/images/share_logo_icon.jpg"
window.__isR = true;
// 不支持ie9 ie10

@ -101,7 +101,7 @@
height : "100%",
path : "./lib/", // Dependents module file directory
pluginPath : "", // If this empty, default use settings.path + "../plugins/"
delay : 300, // Delay parse markdown to html, Uint : ms
delay : 500, // Delay parse markdown to html, Uint : ms
autoLoadModules : true, // Automatic load dependent module files
watch : true,
placeholder : "Enjoy Markdown! coding now...",

File diff suppressed because one or more lines are too long

@ -71,7 +71,10 @@ html, body {
/* 某些情况下被cm盖住了 */
z-index: 99;
}
/* 解决鼠标框选时,左边第一列没高亮的问题 */
.CodeMirror .CodeMirror-lines pre.CodeMirror-line, .CodeMirror .CodeMirror-lines pre.CodeMirror-line-like {
padding: 0 12px ;
}
/* antd扩展 */

@ -326,7 +326,7 @@ class App extends Component {
});
wx.ready(function () {
console.log('wx is ready')
configShareForIndex()
configShareForIndex('/')
});
wx.error(function (res) {
console.log('wx is error')

@ -19,12 +19,12 @@ function share(shareData) {
单个课程和实训 获取课程/实训的简介 该课程或者实训展示的缩略图
*/
export function configShareForIndex () {
export function configShareForIndex (path) {
if (!wx) return;
var shareData = {
title: 'EduCoder - 首页',
desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台提供企业级工程实训以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动将传统的知识传授和时兴的工程实战一体化。',
link: host,
link: host + (path || ''),
imgUrl: window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
};

@ -527,14 +527,14 @@ class CoursesIndex extends Component{
></Route>
{/* 新建作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/works/new"
<Route path="/courses/:coursesId/graduation_tasks/:category_id/works/:task_Id/new"
render={
(props) => (<GraduationTasksSubmitnewApp {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 修改作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:work_Id/works/edit"
<Route path="/courses/:coursesId/graduation_tasks/:category_id/works/:work_Id/edit"
render={
(props) => (<GraduationTasksSubmiteditApp {...this.props} {...props} {...this.state} {...common}/>)
}

@ -131,7 +131,6 @@ class CommonWorkPost extends Component{
let coursesId=this.props.match.params.coursesId;
window.location.href="courses/"+coursesId+"/graduation_tasks/"+workId+"/appraise";
// window.location.href="/courses/"+coursesId+"/graduation/graduation_tasks/"+workId+"/"+workId+"/works/edit";
}
handleSubmit=(e) => {

@ -302,7 +302,7 @@ class GraduateTaskItem extends Component{
{item==="提交作品"?
<WordsBtn style="blue" className="colorblue font-16 ml20 fr mt12">
<a className="btn colorblue" href={"/courses/"+this.props.coursesId+"/graduation_tasks/"+this.props.categoryid+"/"+this.props.taskid+"/works/new"}>提交作品</a>
<a className="btn colorblue" href={"/courses/"+this.props.coursesId+"/graduation_tasks/"+this.props.categoryid+"/works"+"/"+this.props.taskid+"/new"}>提交作品</a>
</WordsBtn>
:""}
@ -310,7 +310,7 @@ class GraduateTaskItem extends Component{
{item==="补交作品"?
<WordsBtn style="blue" className="colorblue font-16 ml20 fr mt12">
<a className="btn colorblue" href={"/courses/"+this.props.coursesId+"/graduation_tasks/"+this.props.categoryid+"/"+this.props.taskid+"/works/new"}>补交作品</a>
<a className="btn colorblue" href={"/courses/"+this.props.coursesId+"/graduation_tasks/"+this.props.categoryid+"/works"+"/"+this.props.taskid+"/new"}>补交作品</a>
</WordsBtn>
:""}
@ -318,7 +318,7 @@ class GraduateTaskItem extends Component{
{item==="修改作品"?
<WordsBtn style="blue" className="font-16 colorblue ml20 fr mt12">
<a className="btn colorblue" href={"/courses/"+this.props.coursesId+"/graduation_tasks/"+this.props.categoryid+"/"+this.props.workid+"/works/edit"}>修改作品</a>
<a className="btn colorblue" href={"/courses/"+this.props.coursesId+"/graduation_tasks/"+this.props.categoryid+"/works"+"/"+this.props.workid+"/edit"}>修改作品</a>
</WordsBtn>
:""}

@ -168,8 +168,29 @@ class GraduationTaskDetail extends Component{
typs:"end",
})
}
coursetaskend=()=>{
const coursesId = this.props.match.params.coursesId;
const task_Id = this.props.match.params.task_Id;
let url = `/courses/${coursesId}/graduation_tasks/end_task.json`;
axios.post(url,{
task_ids:[task_Id],
group_ids: this.state.course_groupslist,
}).then((response)=>{
if (response.data.status == 0) {
this.props.showNotification(response.data.message);
this.cancelmodel();
this.getdatas();
this.child && this.child.reInit();
}
}).catch((error)=>{
})
}
// 取消
cancelmodel=()=>{
debugger
this.setState({
Modalstype:false,
Loadtype:false,
@ -255,6 +276,7 @@ class GraduationTaskDetail extends Component{
avisible:false
})
}
bindRef = ref => { this.child = ref } ;
render(){
@ -391,21 +413,21 @@ class GraduationTaskDetail extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
<li><a onClick={()=>this.child.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.child.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}
{questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{
return(
<span key={key}>
{item==="提交作品"?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>提交作品</a>:""}
{item==="补交作品"?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>补交作品</a>:""}
{item==="修改作品"?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+questionslist.work_id+"/works/edit"}>修改作品</a>:""}
{item==="查看作品"?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+questionslist.work_id+"/works/edit"}>查看作品</a> :""}
{item==="创建项目"?<a className={"fr color-blue font-16"} href={'/projects/new'} target="_blank">创建项目</a>:""}
{item==="关联项目"?<a className={"fr color-blue font-16"} onClick={this.AssociationItems}>关联项目</a>:""}
{item==="取消关联"?<a className={"fr color-blue font-16"} onClick={this.cannelAssociation}>取消关联</a>:""}
{item==="补交附件"?<a className={"fr color-blue font-16"} onClick={this.handaccessory}>补交附件</a>:""}
<span key={key} className="fr mt20">
{item==="提交作品"?<a className={"fr color-blue font-16 ml20"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>提交作品</a>:""}
{item==="补交作品"?<a className={"fr color-blue font-16 ml20"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>补交作品</a>:""}
{item==="修改作品"?<a className={"fr color-blue font-16 ml20"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/works"+"/"+ questionslist.work_id + "/edit"}>修改作品</a>:""}
{item==="查看作品"?<a className={"fr color-blue font-16 ml20"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/works"+"/"+ questionslist.work_id + "/edit"}>查看作品</a> :""}
{item==="创建项目"?<a className={"fr color-blue font-16 ml20"} href={'/projects/new'} target="_blank">创建项目</a>:""}
{item==="关联项目"?<a className={"fr color-blue font-16 ml20"} onClick={this.AssociationItems}>关联项目</a>:""}
{item==="取消关联"?<a className={"fr color-blue font-16 ml20"} onClick={this.cannelAssociation}>取消关联</a>:""}
{item==="补交附件"?<a className={"fr color-blue font-16 ml20"} onClick={this.handaccessory}>补交附件</a>:""}
</span>
)
@ -428,13 +450,13 @@ class GraduationTaskDetail extends Component{
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/setting"
render={
(props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} {...commom} tab={`setting`}/>)
(props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`setting`}/>)
}
></Route>
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/questions"
render={
(props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} {...commom} tab={`questions`}/>)
(props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`questions`}/>)
}></Route>
</Switch>

@ -496,7 +496,8 @@ class GraduationTasksSubmitedit extends Component{
Modalstype,Modalstopval,ModalCancel,ModalSave,memberslist,task_status,selectmemberslist,shixunsreplace} =this.state;
let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id;
let task_Id=this.props.match.params.coursesId;
// let category_id=this.props.match.params.category_id;
let work_Id=this.props.match.params.work_Id
const uploadProps = {
width: 600,
@ -570,7 +571,7 @@ class GraduationTasksSubmitedit extends Component{
{/*<span className="color-grey-9 fl ml3 mr3">&gt;</span>*/}
<WordsBtn style="grey" className="fl"> <a onClick={this.goback} className="color-grey-6">毕设任务</a></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/detail/"+work_Id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn>
<WordsBtn style="grey" className="fl"> <Link to={`/courses/${courseId}/graduation_tasks/${workslist && workslist.graduation_id}/detail/${workslist && workslist.task_id}/list`} className="color-grey-6">任务详情</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
{/*<WordsBtn style="grey" className="fl">*/}
{/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{workslist&&workslist.task_name}</Link>*/}
@ -580,7 +581,7 @@ class GraduationTasksSubmitedit extends Component{
</p>
<div style={{ width:'100%',height:'75px'}} >
<p className=" fl color-black mt25 summaryname">{workslist&&workslist.task_name}</p>
<p className=" fl color-black mt25 summaryname">{ workslist && workslist.task_name }</p>
<a className="color-grey-6 fr font-16 ml30 mt10 mr20" onClick={this.goback}>返回</a>
</div>
@ -768,7 +769,7 @@ class GraduationTasksSubmitedit extends Component{
<div className={"fl ml5 fonthidden width100"} style={{width: '70px'}} title={item.user_name}>{item.user_name}</div>
<div className={"fl ml5 fonthidden width100 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width100"}>{item.student_id}</div>
<div className={"fl ml20"}>{item.commit_status===false?<span className={"color-orange"}>已提交</span> :""}</div>
<div className={"fl ml20"}>{item.commit_status===true?<span className={"color-orange"}>已提交</span> :""}</div>
</div>
)
})}

@ -81,7 +81,6 @@ class GraduationTasksSubmitnew extends Component{
let coursesId=this.props.match.params.coursesId;
window.location.href="/courses/"+coursesId+"/graduation_tasks/"+workId+"/appraise";
// window.location.href="/courses/"+coursesId+"/graduation/graduation_tasks/"+task_Id+"/"+workId+"/works/edit";
}
handleSubmit=(e) => {

@ -83,6 +83,10 @@ class GraduationTaskssettingapp extends Component{
}
}
reInit=()=>{
this.getsettings();
}
getsettings=()=>{
let task_Id=this.props.match.params.task_Id;
@ -155,7 +159,11 @@ class GraduationTaskssettingapp extends Component{
let tab = this.props.tab;
this.props.setTab && this.props.setTab(tab);
try{
this.props.triggerRef(this)
}catch(e){
}
}
@ -846,6 +854,8 @@ class GraduationTaskssettingapp extends Component{
}
/// 确认是否下载
confirmysl(url){
debugger;
console.log(3);
axios.get(url + '?export=true' ).then((response) => {
if(response === undefined){
return

@ -81,6 +81,15 @@ class GraduationTaskssettinglist extends Component{
this.props.history.replace(`/courses/${this.state.taskslistdata.course_id}/graduation_tasks/${this.state.taskslistdata.graduation_id}`);
}
reInit=()=>{
this.setState({
course_groupslist:[],
checkAllValue:false
})
let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search} = this.state;
this.seacthdata(teacher_comment, task_status, course_group, cross_comment, order, b_order, search,this.state.page);
}
seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{
let{page,limit}=this.state;
// console.log(teacher_comment,task_status,course_group,cross_comment,order,b_order,search)
@ -97,7 +106,7 @@ class GraduationTaskssettinglist extends Component{
order:order===null?undefined:order,
b_order:b_order===null?undefined:b_order,
search:search===null?undefined:search,
page:pages===null?undefined:pages,
page:pages===null?undefined:page,
limit:20,
},
paramsSerializer: function(params) {
@ -646,6 +655,8 @@ class GraduationTaskssettinglist extends Component{
/// 确认是否下载
confirmysl(url){
debugger;
console.log(1);
let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search,page} =this.state;
let params ={

@ -35,8 +35,18 @@ class GraduationTasksquestions extends Component{
let tab = this.props.tab;
this.props.setTab && this.props.setTab(tab);
this.getdatas()
this.getdatas();
try{
this.props.triggerRef(this)
}catch(e){
}
}
reInit=()=>{
this.getdatas();
}
getdatas=()=>{
const task_Id = this.props.match.params.task_Id;
let url="/graduation_tasks/"+task_Id+".json";
@ -46,7 +56,6 @@ class GraduationTasksquestions extends Component{
this.setState({
questionslist:result.data
})
}
}).catch((error)=>{
console.log(error)
@ -204,6 +213,8 @@ class GraduationTasksquestions extends Component{
/// 确认是否下载
confirmysl(url){
debugger;
console.log(2);
axios.get(url + '?export=true').then((response) => {
if(response === undefined){
return
@ -299,82 +310,6 @@ class GraduationTasksquestions extends Component{
/>
{questionslist&&questionslist?<div className="newMain clearfix">
<div className={"educontent mb20"}>
{/* <p className="clearfix mt10">
<a onClick={this.goback} className="color-grey-9 fl">{questionslist.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+questionslist.graduation_id} className="color-grey-9 fl">{questionslist.graduation_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span className="color-grey-6">任务详情</span>
</p>
<div className="clearfix mt20 mb20 lineh-25 linbox">
<p className=" fl color-black summaryname">
<Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-3">{questionslist.task_name}</Link>
</p>
<CoursesListType
typelist={questionslist.task_status}
/>
<a className="color-grey-3 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div> */}
{/* <div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20"> */}
{/* <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/list"}></Link>
<Link className="active" to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/questions"}>毕设描述</Link>
<Link style={{paddingLeft:'38px'}}
to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/setting?tab=3"}>设置</Link> */}
{/*<a className={"fr color-blue font-16"}>导出成绩</a>*/}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xls"} className={"fr color-blue font-16"}>导出成绩</a>:""}*/}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className={"fr color-blue font-16"}>导出作品附件</a>:""}*/}
{/* <style>
{ `
.drop_down_menu{
height: 118px;
left:0px;
width: 121px;
}
.drop_down_menu li {
overflow: visible;
width: 121px;
}
.drop_down_menu li a{
padding: 0px;
font-size: 14px;
}
.mt19{
margin-top:19px;
}
.drop_down_menu, .drop_down_normal{
padding-top: 10px;
padding-bottom: 8px;
}
.drop_down_menu li .color-dark{
color: #666 !important;
}
`}
</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr20 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""} */}
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
{/* {this.props.isAdmin()?questionslist.status===1? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.end()} }></a>:"":""}
{this.props.isAdmin()?questionslist.status===0? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.publish()} }>立即发布</a>:"":""}
{this.props.isAdmin()?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a>:""}
</div>
</div> */}
<div className="justify break_full_word new_li markdown-body edu-back-white"
id="challenge_editorMd_description">
<p id="ReactMarkdown">
@ -390,22 +325,6 @@ class GraduationTasksquestions extends Component{
}
<div>
{/*{questionslist&&questionslist.attachments.map((item,key)=>{*/}
{/*return(*/}
{/*<div className="color-grey mt5">*/}
{/*<a className="color-grey">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/}
{/*<a href={item.url}*/}
{/*className="mr12" length="58">*/}
{/*{item.title}*/}
{/*</a>*/}
{/*<span className="color-grey mt2 color-grey-6 font-12">{item.filesize}</span>*/}
{/*</div>*/}
{/*)*/}
{/*})}*/}
<AttachmentList {...this.props} {...this.state} attachments={questionslist&&questionslist.attachments}></AttachmentList>
</div>

@ -215,10 +215,10 @@ class AddStudentModal extends Component{
<p className="clearfix mb2" style={{ margin: '0px 15px 6px' }}>
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'姓名'}</label></span>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'学号'}</label></span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'单位'}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px;"}}>{''}</label></span>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>{'姓名'}</span>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>{'学号'}</span>
<span className="fl task-hide with35" style={{"maxWidth":"208px;"}}>{'单位'}</span>
<span className="fl task-hide with10" style={{"maxWidth":"48px;"}}>{''}</span>
</p>
<Spin size="large" spinning={isSpin}>
@ -239,24 +239,21 @@ class AddStudentModal extends Component{
return (
<p className="clearfix mb7" key={candidate.id}>
<Checkbox className="fl" value={candidate.id} key={candidate.id} disabled={candidate.added}></Checkbox>
<span className="fl with25">
<span className="fl task-hide with25 ml5" style={{"maxWidth":"208px;"}}>
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>
{ candidate.name ?
<a href={`/users/${candidate.login}`} target="_blank" style={{"maxWidth":"208px;"}}>
<a href={`/users/${candidate.login}`} target="_blank">
{ candidate.name }
</a> : <span> </span> }
</label>
</ConditionToolTip>
</span>
<span className="fl with25">
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>
<ConditionToolTip title={candidate.student_id} condition={candidate.student_id && candidate.student_id.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.student_id || ' '}</label>
{candidate.student_id || ' '}
</ConditionToolTip>
</span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span>
<span className="fl with10"><label className="task-hide fl"
style={{"maxWidth":"48px", color: theme.foreground_select }}>{candidate.added ? '已加入' : ''}</label></span>
<span className="fl task-hide with35" style={{"maxWidth":"208px;"}}>{candidate.school_name}</span>
<span className="fl task-hide with10" style={{"maxWidth":"48px", color: theme.foreground_select }}>{candidate.added ? '已加入' : ''}</span>
</p>
)

@ -109,6 +109,11 @@ class AddTeacherModal extends Component{
checkBoxValues: []
})
}
this.setState({
name:undefined,
graduationGroup:undefined,
courseGroup:undefined
})
}
onSendOk = () => {
@ -259,10 +264,10 @@ class AddTeacherModal extends Component{
<p className="clearfix mb2" style={{ margin: '0px 15px 6px' }}>
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'姓名'}</label></span>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'昵称'}</label></span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'单位'}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px"}}>{''}</label></span>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>{'姓名'}</span>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>{'昵称'}</span>
<span className="fl task-hide with35" style={{"maxWidth":"208px;"}}>{'单位'}</span>
<span className="fl task-hide with10" style={{"maxWidth":"48px"}}>{''}</span>
</p>
{ loading || candidates.length ? <div>
@ -281,26 +286,22 @@ class AddTeacherModal extends Component{
{ candidates && candidates.map( candidate => {
return (
<p className="clearfix mb7" key={candidate.id}>
<Checkbox className="fl" value={candidate.id} key={candidate.id}></Checkbox>
<span className="fl with25">
<Checkbox className="fl" value={candidate.id} key={candidate.id} disabled={candidate.added}></Checkbox>
<span className="fl task-hide with25 ml5" style={{"maxWidth":"208px;"}}>
{/* "color":"#4c4c4c" */}
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}
>
<a href={`/users/${candidate.login}`} target="_blank"
style={{}}
>{candidate.name}</a>
</label>
<a href={`/users/${candidate.login}`} target="_blank"
style={{}}
>{candidate.name}</a>
</ConditionToolTip>
</span>
<span className="fl with25">
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>
<ConditionToolTip title={candidate.nickname} condition={candidate.nickname && candidate.nickname.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.nickname || ' '}</label>
{candidate.nickname || ' '}
</ConditionToolTip>
</span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px;"}}>{candidate.added ? '已加入' : ''}</label></span>
<span className="fl task-hide with35" style={{"maxWidth":"208px;"}}>{candidate.school_name}</span>
<span className="fl task-hide with10 color-blue" style={{"maxWidth":"48px;"}}>{candidate.added ? '已加入' : ''}</span>
</p>
)
}) }

@ -7,7 +7,7 @@ import CourseLayoutcomponent from '../common/CourseLayoutComponent'
import Titlesearchsection from '../common/titleSearch/TitleSearchSection'
import ColorCountText from '../common/titleSearch/ColorCountText'
import { WordsBtn, trigger, on, off, getUrl, downloadFile } from 'educoder'
import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections } from 'educoder'
import Modals from "../../modals/Modals";
import axios from 'axios'
import _ from 'lodash'
@ -17,8 +17,9 @@ import CreateGroupByImportModal from './modal/CreateGroupByImportModal'
const Search =Input.Search;
const buildColumns = (that) => {
const { course_groups } = that.state
const buildColumns = (that,isParent) => {
const { course_groups , sortedInfo } = that.state
let showSorter = isParent==true
const columns=[{
title: '序号',
dataIndex: 'id',
@ -59,6 +60,9 @@ const buildColumns = (that) => {
align:'center',
width:"10%",
className:"color-grey-6",
sorter: true,
sortDirections: sortDirections,
sortOrder: sortedInfo.columnKey === 'student_id' && sortedInfo.order,
render: (student_id, record) => {
return <span className="color-dark overflowHidden1 " title={student_id && student_id.length > 10 ? student_id : ''}
style={{maxWidth: '160px'}} >{student_id}</span>
@ -71,7 +75,10 @@ const buildColumns = (that) => {
key: 'course_group_name',
align:'center',
width:"40%",
className:"color-grey-6"
className:"color-grey-6",
sorter:showSorter,
sortDirections: sortDirections,
sortOrder: sortedInfo.columnKey === 'course_group_name' && sortedInfo.order,
})
}
const isAdminOrStudent = that.props.isAdminOrStudent()
@ -124,6 +131,7 @@ class studentsList extends Component{
isSpin:false,
DownloadType:false,
DownloadMessageval:undefined,
sortedInfo: {order:'ascend',columnKey: 'student_id'}
}
}
/// 确认是否下载
@ -319,8 +327,19 @@ class studentsList extends Component{
this.setState({ page: argPage })
}
let page = argPage || this.state.page
let { order, searchValue }=this.state
let url=`/courses/${id}/students.json?order=${order}&page=${page}&limit=20&course_group_id=${course_group_id}`;
let { searchValue , sortedInfo }=this.state
let order = 1;
if (sortedInfo.columnKey == 'student_id') {
order = 1;
} else if (sortedInfo.columnKey == 'course_group_name') {
order = 2;
}
let sort = 'desc';
if (sortedInfo.order == 'ascend') {
sort = 'asc'
}
let url=`/courses/${id}/students.json?order=${order}&sort=${sort}&page=${page}&limit=20&course_group_id=${course_group_id}`;
if(!!searchValue){
url+='&search='+searchValue;
}
@ -494,6 +513,15 @@ class studentsList extends Component{
this.props.showNotification('复制成功')
}
onTableChange = (pagination, filters, sorter) =>{
this.setState({
sortedInfo: sorter,
}, () => {
this.fetchAll();
});
}
render(){
const isAdmin = this.props.isAdmin()
const isSuperAdmin = this.props.isSuperAdmin()
@ -653,7 +681,7 @@ class studentsList extends Component{
{isAdmin && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox>}
<div className="studentList_operation_ul">
{isAdmin && <li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>}
{isAdmin && <li className="li_line drop_down">
{isAdmin && <li className="drop_down">
移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"0px","left":"unset", minWidth: '160px', maxHeight: '324px', overflowY: 'auto'}}>
{
@ -687,7 +715,7 @@ class studentsList extends Component{
</ul>
</li>}
<li className="drop_down">
{/* <li className="drop_down">
{currentOrderName}
{ course_groups && !!course_groups.length &&
<React.Fragment>
@ -698,13 +726,13 @@ class studentsList extends Component{
</ul>
</React.Fragment>
}
</li>
</li> */}
</div>
</div>
<Spin size="large" spinning={this.state.isSpin}>
<div className="clearfix stu_table">
{!this.state.isSpin && <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
<Table columns={buildColumns(this)} dataSource={students} pagination={false}></Table>
<Table columns={buildColumns(this,isParent)} dataSource={students} onChange={this.onTableChange} pagination={false}></Table>
</Checkbox.Group> }
</div>
</Spin>

@ -20,6 +20,7 @@ import Startshixuntask from "../coursesPublic/Startshixuntask";
import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor";
import DownloadMessageysl from "../../modals/DownloadMessageysl";
import Modals from "../../modals/Modals";
class ShixunHomeworkPage extends Component {
constructor(props) {
super(props);
@ -34,6 +35,9 @@ class ShixunHomeworkPage extends Component {
showmodel:false,
child:undefined,
yslpros:false,
Modalstopval:"你在该实训的学习记录将被清空,无法恢复",
ModalsBottomval:"是否确认重做?",
ModalsType:false,
}
}
@ -107,9 +111,28 @@ class ShixunHomeworkPage extends Component {
workshowmodels(child){
child.workshowmodel();
}
/// 确认是否下载
/// 重做的确认
ModalSaves=()=>{
this.setState({
ModalsType:false,
Modalstopval:""
})
};
//取消重做
ModalCancels=()=>{
this.setState({
ModalsType:false,
Modalstopval:""
})
};
//打开重做弹框
Modalcancelss=()=>{
this.setState({
Modalstopval:"你在该实训的学习记录将被清空,无法恢复",
ModalsBottomval:"是否确认重做?",
ModalsType:true,
})
}
bindRef = ref => { this.child = ref }
///////////////教师截止
gotohome=()=>{
@ -128,7 +151,15 @@ class ShixunHomeworkPage extends Component {
return (
<div className="newMain clearfix ">
{/*<Modals*/}
{/* modalsType={this.state.ModalsType}*/}
{/* modalsTopval={this.state.Modalstopval}*/}
{/* modalsBottomval={this.state.ModalsBottomval}*/}
{/* modalSave={this.ModalSaves}*/}
{/* modalCancel={this.ModalCancels}*/}
{/* loadtype={false}*/}
{/*>*/}
{/*</Modals>*/}
<div className={"educontent mt10 mb20"} style={{width: "1200px"}}>
@ -251,6 +282,9 @@ class ShixunHomeworkPage extends Component {
{...this.props}
data={teacherdatapage}
/>}
{/*{this.props.isStudent() ?*/}
{/* <a className="fr color-blue font-16" onClick={()=>this.Modalcancelss()}>重做</a>*/}
{/* : "" }*/}
</div>
</div>
</div>

@ -107,7 +107,7 @@ class ShowAppraiseList extends Component{
{data===undefined?"":data.stage_list.map((item,key)=>{
{data===undefined?"":data.stage_list===undefined||data.stage_list===null?"":data.stage_list.map((item,key)=>{
let challenge_comment_hidden=item.challenge_comment_hidden===undefined||item.challenge_comment_hidden===null||item.challenge_comment_hidden==="";
let challenge_comment=item.challenge_comment===undefined||item.challenge_comment===null||item.challenge_comment==="";

@ -48,7 +48,7 @@ function startechart(data){
xAxis: [
{
type : 'value',
name: '学生排名',
name: '学生效率位置',
scale:true,
axisLabel : {
formatter: ' ',

@ -1,172 +1,172 @@
.winput-300-35{
width: 300px;
height: 35px;
padding: 5px;
box-sizing: border-box;
}
.library_nav li {
float: left;
cursor: pointer;
margin-right: 30px;
position: relative;
color: #05101A;
height: 40px;
line-height: 20px;
font-size: 16px;
}
.library_nav li.active a, .library_nav li:hover a{
color: #4cacff!important;
}
.library_list {
margin-bottom: 30px;
}
.library_list_item:hover {
box-shadow: 0px 4px 8px rgba(158,158,158,0.16);
}
.library_list_item {
background: #fff;
padding: 20px 30px;
margin-bottom: 30px;
display: flex;
}
.library_list_item .library_l_name {
max-width: 600px;
float: left;
}
.edu-activity-red {
background-color: #FC2B6A;
color: #fff!important;
cursor: pointer;
border: 1px solid #FC2B6A;
line-height: 17px;
}
.edu-activity-green {
background-color: green;
color: #fff!important;
cursor: pointer;
border: 1px solid green;
line-height: 17px;
}
.edu-activity-orange {
background-color: #ff6800;
color: #fff!important;
cursor: pointer;
border: 1px solid #ff6800;
line-height: 17px;
}
.edu-activity-blue {
background-color: #4CACFF;
color: #fff!important;
cursor: pointer;
border: 1px solid #4CACFF;
line-height: 17px;
}
.edu-activity-orange-sub {
background-color: #FF781B;
color: #fff!important;
cursor: pointer;
border: 1px solid #ff6800;
line-height: 17px;
}
.pointsBtn {
width: 70px;
height: 70px;
background-color: #4cacff;
border-radius: 50%;
color: #fff;
text-align: center;
margin: 0 auto;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 2px 0;
cursor: pointer;
line-height: 22px;
padding-top: 12px;
}
.pointedBtn{
background: #BCD1E3;
cursor: default
}
.pointsBtn span{
display: block;
}
.upload_Title {
position: relative;
margin-right: 20px;
float: left;
line-height: 35px;
font-size: 16px;
width: 56px;
color:rgba(0, 0, 0, 0.85);
text-align: center
}
.upload_Title.must:before {
display: inline-block;
margin-right: 4px;
color: #f5222d;
font-size: 14px;
font-family: SimSun, sans-serif;
line-height: 1;
content: '*';
}
.upload_Title:after{
content: ':';
position: relative;
top: -0.5px;
margin: 0 8px 0 2px;
}
.libraries_tab li {
width: 120px;
height: 35px;
line-height: 33px;
border-radius: 18px;
border: 1px solid #4C98FF;
color: #4C98FF;
cursor: pointer;
margin-right: 30px;
float: left;
text-align: center;
}
.libraries_tab li.active {
background: #4C98FF;
color: #fff;
}
.librariesField .ant-upload{
width: 100%;
background: #F2F9FF;
justify-content: center;
align-items: center;
display: -webkit-flex;
text-align: center;
height: 120px!important;
border-radius: 4px;
border: 1px dashed #4cacff!important;
display: block;
cursor: pointer;
}
.librariesField .ant-upload.ant-upload-drag{
border:none!important;
}
.uploadImage .ant-upload.ant-upload-select-picture-card{
width:120px;
height: 90px;
}
.uploadImage .ant-upload.ant-upload-select-picture-card > .ant-upload{
padding:0px!important;
}
.successPage {
justify-content: center;
align-items: center;
display: -webkit-flex;
height: 570px;
text-align: center;
margin-bottom: 50px;
}
.changebtn {
width:166px;
font-size: 16px;
height: 45px;
line-height: 45px;
.winput-300-35{
width: 300px;
height: 35px;
padding: 5px;
box-sizing: border-box;
}
.library_nav li {
float: left;
cursor: pointer;
margin-right: 30px;
position: relative;
color: #05101A;
height: 40px;
line-height: 20px;
font-size: 16px;
}
.library_nav li.active a, .library_nav li:hover a{
color: #4cacff!important;
}
.library_list {
margin-bottom: 30px;
}
.library_list_item:hover {
box-shadow: 0px 4px 8px rgba(158,158,158,0.16);
}
.library_list_item {
background: #fff;
padding: 20px 30px;
margin-bottom: 30px;
display: flex;
}
.library_list_item .library_l_name {
max-width: 600px;
float: left;
}
.edu-activity-red {
background-color: #FC2B6A;
color: #fff!important;
cursor: pointer;
border: 1px solid #FC2B6A;
line-height: 17px;
}
.edu-activity-green {
background-color: green;
color: #fff!important;
cursor: pointer;
border: 1px solid green;
line-height: 17px;
}
.edu-activity-orange {
background-color: #ff6800;
color: #fff!important;
cursor: pointer;
border: 1px solid #ff6800;
line-height: 17px;
}
.edu-activity-blue {
background-color: #4CACFF;
color: #fff!important;
cursor: pointer;
border: 1px solid #4CACFF;
line-height: 17px;
}
.edu-activity-orange-sub {
background-color: #FF781B;
color: #fff!important;
cursor: pointer;
border: 1px solid #ff6800;
line-height: 17px;
}
.pointsBtn {
width: 70px;
height: 70px;
background-color: #4cacff;
border-radius: 50%;
color: #fff;
text-align: center;
margin: 0 auto;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 2px 0;
cursor: pointer;
line-height: 22px;
padding-top: 12px;
}
.pointedBtn{
background: #BCD1E3;
cursor: default
}
.pointsBtn span{
display: block;
}
.upload_Title {
position: relative;
margin-right: 20px;
float: left;
line-height: 35px;
font-size: 16px;
/*width: 56px;*/
color:rgba(0, 0, 0, 0.85);
text-align: center
}
.upload_Title.must:before {
display: inline-block;
margin-right: 4px;
color: #f5222d;
font-size: 14px;
font-family: SimSun, sans-serif;
line-height: 1;
content: '*';
}
.upload_Title:after{
content: ':';
position: relative;
top: -0.5px;
margin: 0 8px 0 2px;
}
.libraries_tab li {
width: 120px;
height: 35px;
line-height: 33px;
border-radius: 18px;
border: 1px solid #4C98FF;
color: #4C98FF;
cursor: pointer;
margin-right: 30px;
float: left;
text-align: center;
}
.libraries_tab li.active {
background: #4C98FF;
color: #fff;
}
.librariesField .ant-upload{
width: 100%;
background: #F2F9FF;
justify-content: center;
align-items: center;
display: -webkit-flex;
text-align: center;
height: 120px!important;
border-radius: 4px;
border: 1px dashed #4cacff!important;
display: block;
cursor: pointer;
}
.librariesField .ant-upload.ant-upload-drag{
border:none!important;
}
.uploadImage .ant-upload.ant-upload-select-picture-card{
width:120px;
height: 90px;
}
.uploadImage .ant-upload.ant-upload-select-picture-card > .ant-upload{
padding:0px!important;
}
.successPage {
justify-content: center;
align-items: center;
display: -webkit-flex;
height: 570px;
text-align: center;
margin-bottom: 50px;
}
.changebtn {
width:166px;
font-size: 16px;
height: 45px;
line-height: 45px;
}

@ -408,13 +408,13 @@ export default class TPMchallengesnew extends Component {
} = this.state;
let options;
options = optionsums.map((d, k) => {
return (
<Option key={d} id={k}>{d}</Option>
)
})
console.log(this.state.shixunExec_timeType )
if(optionsums!=undefined){
options = optionsums.map((d, k) => {
return (
<Option key={d} id={k}>{d}</Option>
)
})
}
return (
<React.Fragment>
@ -565,7 +565,7 @@ export default class TPMchallengesnew extends Component {
<div className="mt20 clearfix" id="task_tag_content">
{
shixunsskillvaluelist.length === 0 ? "" : shixunsskillvaluelist.map((itme, key) => {
shixunsskillvaluelist===undefined?"":shixunsskillvaluelist.length === 0 ? "" : shixunsskillvaluelist.map((itme, key) => {
return (
<li className="task_tag_span" key={key}><span>{itme}</span>
<a onClick={() => this.delshixunsskilllist(key)}>×</a>

@ -421,7 +421,11 @@ class AccountBasic extends Component {
identity
}=this.state;
const { getFieldDecorator } = this.props.form;
let{basicInfo}=this.props
let{ basicInfo }=this.props
// 已职业认证的账户不能修改职业,学校/单位,院系/部门产品还未确定先默认为false--可以更改
// basicInfo && basicInfo.professional_certification == "certified"
const professionalFlag = false;
// form合并了
const propsWithoutForm = Object.assign({}, this.props)
@ -607,7 +611,7 @@ class AccountBasic extends Component {
message: '请先选择职业',
}],
})(
<Select style={{width:"190px",marginRight:"20px"}} onChange={this.changeJob}>
<Select style={{width:"190px",marginRight:"20px"}} onChange={this.changeJob} disabled={professionalFlag}>
<Option value="teacher">教师</Option>
<Option value="student">学生</Option>
<Option value="professional">专业人士</Option>
@ -628,7 +632,7 @@ class AccountBasic extends Component {
message: '请先输入学号',
}],
})(
<Input type="text" placeholder="请输入学号" style={{width:"190px"}}></Input>
<Input type="text" placeholder="请输入学号" style={{width:"190px"}} disabled={professionalFlag}></Input>
)}
</Form.Item>
}
@ -646,7 +650,7 @@ class AccountBasic extends Component {
message: '请先选择职称',
}],
})(
<Select style={{width:"190px"}}>
<Select style={{width:"190px"}} disabled={professionalFlag}>
<Option value="教授">教授</Option>
<Option value="副教授">副教授</Option>
<Option value="讲师">讲师</Option>
@ -669,7 +673,7 @@ class AccountBasic extends Component {
message: '请先选择职称',
}],
})(
<Select style={{width:"190px"}}>
<Select style={{width:"190px"}} disabled={professionalFlag}>
<Option value="企业管理者">企业管理者</Option>
<Option value="部门管理者">部门管理者</Option>
<Option value="高级工程师">高级工程师</Option>
@ -703,7 +707,7 @@ class AccountBasic extends Component {
}],
})(
<AutoComplete width={400} showSearch onSearch={this.filterList} onChange={this.changeList}>
<AutoComplete width={400} showSearch onSearch={this.filterList} onChange={this.changeList} disabled={professionalFlag}>
{
filterSchoolList && filterSchoolList.map((item,key)=>{
return(<Option value={item.name} key={item.id}>{item.name}</Option>)
@ -741,7 +745,7 @@ class AccountBasic extends Component {
// }
}],
})(
<AutoComplete width={400} showSearch onSearch={this.searchDepartment} onChange={this.changeDepartment}>
<AutoComplete width={400} showSearch onSearch={this.searchDepartment} onChange={this.changeDepartment} disabled={professionalFlag}>
{
filterDepartments && filterDepartments.map((item,key)=>{
return(

@ -124,7 +124,7 @@ class InfosBanner extends Component{
</li>}
{/*自己的主页且不是学生显示题库按钮*/}
{(is_current && current_user)
{(is_current && current_user&& current_user.is_teacher )
&&<li className={`${moduleName == 'topics' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'topics'})}

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe CourseStagesController, type: :controller do
end

@ -0,0 +1,15 @@
require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the CourseStagesHelper. For example:
#
# describe CourseStagesHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# end
RSpec.describe CourseStagesHelper, type: :helper do
pending "add some examples to (or delete) #{__FILE__}"
end

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe CourseStageShixun, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe CourseStage, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading…
Cancel
Save