Merge branch 'dev_aliyun' into dev_ec

dev_ec
hjm 5 years ago
commit da488e7baf

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

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

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

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

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

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

File diff suppressed because one or more lines are too long

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

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

File diff suppressed because one or more lines are too long

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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

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

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

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

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

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

File diff suppressed because one or more lines are too long

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save