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

dev_aliyun_beta
杨树林 5 years ago
commit 0cd9ef84a4

@ -3,6 +3,7 @@ $(document).on('turbolinks:load', function() {
if ($refuseModal.length > 0) { if ($refuseModal.length > 0) {
var $form = $refuseModal.find('form.admin-common-refuse-form'); var $form = $refuseModal.find('form.admin-common-refuse-form');
var $applyIdInput = $refuseModal.find('.modal-body input[name="apply_id"]'); var $applyIdInput = $refuseModal.find('.modal-body input[name="apply_id"]');
var $applyTitle = $refuseModal.find('.modal-title');
$form.validate({ $form.validate({
errorElement: 'span', errorElement: 'span',
@ -21,9 +22,19 @@ $(document).on('turbolinks:load', function() {
var applyId = $link.data('id'); var applyId = $link.data('id');
var url = $link.data('url'); var url = $link.data('url');
var title = $link.data('title');
var type = $link.data('type');
var form_method = "POST";
if(typeof title !== 'undefined'){
$applyTitle.html(title)
}
if(typeof type !== 'undefined'){
form_method = type;
}
$applyIdInput.val(applyId); $applyIdInput.val(applyId);
$form.data('url', url); $form.data('url', url);
$form.data('type', form_method);
}); });
// modal visited fire // modal visited fire
$refuseModal.on('shown.bs.modal', function(){ $refuseModal.on('shown.bs.modal', function(){
@ -40,9 +51,10 @@ $(document).on('turbolinks:load', function() {
if ($form.valid()) { if ($form.valid()) {
var url = $form.data('url'); var url = $form.data('url');
var form_method = $form.data('type');
$.ajax({ $.ajax({
method: 'POST', method: form_method,
dataType: 'script', dataType: 'script',
url: url, url: url,
data: $form.serialize(), data: $form.serialize(),

@ -1,14 +1,22 @@
$(document).on('turbolinks:load', function() { $(document).on('turbolinks:load', function() {
var $modal = $('.modal.admin-message-modal'); var $modal = $('.modal.admin-message-modal');
var $submitBtn = $modal.find('.submit-btn');
if ($modal.length > 0) { if ($modal.length > 0) {
$modal.on('hide.bs.modal', function(){ $modal.on('hide.bs.modal', function(){
$modal.find('.modal-body').html(''); $modal.find('.modal-body').html('');
$submitBtn.unbind();
}); });
} }
}); });
function showMessageModal(html) { function showMessageModal(html, callback) {
var $modal = $('.modal.admin-message-modal'); var $modal = $('.modal.admin-message-modal');
var $submitBtn = $modal.find('.submit-btn');
$submitBtn.unbind();
if(callback !== undefined && typeof callback === 'function'){
$submitBtn.on('click', callback);
}
$modal.find('.modal-body').html(html); $modal.find('.modal-body').html(html);
$modal.modal('show'); $modal.modal('show');
} }

@ -0,0 +1,78 @@
$(document).on('turbolinks:load', function() {
var $modal = $('.modal.admin-import-course-member-modal');
if ($modal.length > 0) {
var $form = $modal.find('form.admin-import-course-member-form');
var resetFileInputFunc = function(file){
file.after(file.clone().val(""));
file.remove();
}
$modal.on('show.bs.modal', function(){
$modal.find('.file-names').html('选择文件');
$modal.find('.upload-file-input').trigger('click');
});
$modal.on('hide.bs.modal', function(){
resetFileInputFunc($modal.find('.upload-file-input'));
});
$modal.on('change', '.upload-file-input', function(e){
var file = $(this)[0].files[0];
$modal.find('.file-names').html(file ? file.name : '请选择文件');
})
var importFormValid = function(){
if($form.find('input[name="file"]').val() == undefined || $form.find('input[name="file"]').val().length == 0){
$form.find('.error').html('请选择文件');
return false;
}
return true;
};
var buildResultMessage = function(data){
var messageHtml = "<div>导入结果:成功" + data.success + "条,失败"+ data.fail.length + "条</div>";
if(data.fail.length > 0){
messageHtml += '<table class="table"><thead class="thead-light"><tr><th>数据</th><th>失败原因</th></tr></thead><tbody>';
data.fail.forEach(function(item){
messageHtml += '<tr><td>' + item.data + '</td><td>' + item.message + '</td></tr>';
});
messageHtml += '</tbody></table>'
}
return messageHtml;
}
$modal.on('click', '.submit-btn', function(){
$form.find('.error').html('');
if (importFormValid()) {
$('body').mLoading({ text: '正在导入...' });
$.ajax({
method: 'POST',
dataType: 'json',
url: '/admins/import_course_members',
data: new FormData($form[0]),
processData: false,
contentType: false,
success: function(data){
$('body').mLoading('destroy');
$modal.modal('hide');
showMessageModal(buildResultMessage(data), function(){
window.location.reload();
});
},
error: function(res){
$('body').mLoading('destroy');
var data = res.responseJSON;
$form.find('.error').html(data.message);
}
});
}
});
}
});

@ -66,10 +66,11 @@ $(document).on('turbolinks:load', function() {
var $link = $(event.relatedTarget); var $link = $(event.relatedTarget);
var schoolId = $link.data('schoolId'); var schoolId = $link.data('schoolId');
var url = $link.data('url');
$schoolIdInput.val(schoolId); $schoolIdInput.val(schoolId);
$originDepartmentIdInput.val($link.data('departmentId')); $originDepartmentIdInput.val($link.data('departmentId'));
$form.data('url', url);
$.ajax({ $.ajax({
url: '/api/schools/' + schoolId + '/departments/for_option.json', url: '/api/schools/' + schoolId + '/departments/for_option.json',
dataType: 'json', dataType: 'json',

@ -122,14 +122,18 @@ $(document).on('turbolinks:load', function(){
// 导入学生 // 导入学生
var $importUserModal = $('.modal.admin-import-user-modal'); var $importUserModal = $('.modal.admin-import-user-modal');
var $importUserForm = $importUserModal.find('form.admin-import-user-form') var $importUserForm = $importUserModal.find('form.admin-import-user-form')
var resetFileInputFunc = function(file){
file.after(file.clone().val(""));
file.remove();
}
$importUserModal.on('show.bs.modal', function(){ $importUserModal.on('show.bs.modal', function(){
resetFileInputFunc($importUserModal.find('.upload-file-input'));
$importUserModal.find('.file-names').html('选择文件'); $importUserModal.find('.file-names').html('选择文件');
$importUserModal.find('.upload-file-input').trigger('click'); $importUserModal.find('.upload-file-input').trigger('click');
}); });
$importUserModal.find('.upload-file-input').on('change', function(e){ $importUserModal.on('change', '.upload-file-input', function(e){
var file = $(this)[0].files[0]; var file = $(this)[0].files[0];
$importUserModal.find('.file-names').html(file ? file.name : '请选择文件'); $importUserModal.find('.file-names').html(file ? file.name : '请选择文件');
}) })
@ -175,7 +179,9 @@ $(document).on('turbolinks:load', function(){
$('body').mLoading('destroy'); $('body').mLoading('destroy');
$importUserModal.modal('hide'); $importUserModal.modal('hide');
showMessageModal(buildResultMessage(data)); showMessageModal(buildResultMessage(data), function(){
window.location.reload();
});
}, },
error: function(res){ error: function(res){
$('body').mLoading('destroy'); $('body').mLoading('destroy');

@ -0,0 +1,103 @@
class Admins::DepartmentAppliesController < Admins::BaseController
before_action :get_apply,only:[:agree,:destroy]
def index
params[:status] ||= 0
params[:sort_by] = params[:sort_by].presence || 'created_at'
params[:sort_direction] = params[:sort_direction].presence || 'desc'
applies = Admins::DepartmentApplyQuery.call(params)
@depart_applies = paginate applies.preload(:school,user: :user_extension)
end
def agree
ActiveRecord::Base.transaction do
@depart_apply.update_attribute("status",1)
@depart_apply&.applied_messages&.update_all(status:1)
@depart_apply&.department&.update_attribute("is_auth",1)
@depart_apply&.user&.user_extension&.update_attribute("department_id",@depart_apply.department_id)
render_success_js
end
end
def merge
apply_id = params[:origin_department_id]
apply_add =ApplyAddDepartment.find(apply_id)
origin_id = apply_add&.department_id
new_id = params[:department_id]
return render_error('请选择其它部门') if origin_id.to_s == new_id.to_s
origin_department = apply_add&.department
to_department = Department.find(new_id)
return render_error('部门所属单位不相同') if origin_department&.school_id != to_department&.school_id
ActiveRecord::Base.transaction do
applied_message = AppliedMessage.where(applied_id: origin_id, applied_type: "ApplyAddDepartment")
applied_message.update_all(:status => 4)
apply_add.update_attribute(:status, 2)
apply_add.tidings.update_all(:status => 1)
extra = to_department&.name + "(#{apply_add&.department&.school&.try(:name)})"
tiding_params = {
user_id: apply_add.user_id,
trigger_user_id: 0,
container_id: apply_add.id,
container_type: 'ApplyAddDepartment',
belong_container_id: apply_add&.department&.school_id,
belong_container_type: "School",
tiding_type: "System",
status: 3,
extra: extra
}
Tiding.create(tiding_params)
origin_department.apply_add_departments.delete_all
origin_department.user_extensions.update_all(department_id: new_id)
if to_department.identifier.blank? && origin_department.identifier.present?
to_department.update!(identifier: origin_department.identifier)
end
origin_department.destroy!
apply_add.destroy!
end
render_ok
end
def destroy
ActiveRecord::Base.transaction do
@depart_apply.update_attribute("status",3)
@depart_apply&.applied_messages&.update_all(status:3)
if params[:tip] == 'unapplied' #未审批时候删除
UserExtension.where(department_id: @depart_apply.department_id).update_all(department_id:nil)
tiding_params = {
user_id: @depart_apply.user_id,
trigger_user_id: 0,
container_id: @depart_apply.id,
container_type: 'ApplyAddDepartment',
belong_container_id: @depart_apply&.department&.school_id,
belong_container_type: "School",
tiding_type: "System",
status: 2,
extra: params[:reason]
}
Tiding.create(tiding_params)
end
@depart_apply&.department&.destroy
@depart_apply.destroy
render_success_js
end
end
private
def get_apply
@depart_apply = ApplyAddDepartment.find_by(id:params[:id])
end
end

@ -0,0 +1,122 @@
class Admins::UnitAppliesController < Admins::BaseController
before_action :get_apply,only: [:agree,:destroy,:edit,:update]
def index
params[:sort_by] ||= 'created_at'
params[:sort_direction] ||= 'desc'
unit_applies = Admins::UnitApplyQuery.call(params)
@unit_applies = paginate unit_applies.preload(:school, :user)
end
def agree
ActiveRecord::Base.transaction do
begin
@unit_apply.update_attribute("status",1)
@unit_apply&.applied_messages&.update_all(status:1)
@unit_apply&.school&.update_attribute("province",@unit_apply.province)
# #申请信息的创建
apply_message_params = {
user_id: @unit_apply&.user_id,
status: 1,
viewed: 0,
applied_id: @unit_apply.school_id,
applied_type: "ApplyAddSchools",
name: @unit_apply.name,
}
AppliedMessage.new(apply_message_params).save(validate: false)
Tiding.where(user_id: 1, trigger_user_id: @unit_apply.user_id, container_id: @unit_apply.id,
container_type: 'ApplyAddSchools', status: 0, tiding_type: "Apply").update_all(status: 1)
#消息的创建
tiding_params = {
user_id: @unit_apply.user_id,
trigger_user_id: 0,
container_id: @unit_apply.id,
container_type: 'ApplyAddSchools',
belong_container_id: @unit_apply.school_id,
belong_container_type: "School",
tiding_type: "System",
status: 1
}
Tiding.create(tiding_params)
render_success_js
rescue Exception => e
Rails.logger.info("############_________________#########{e}")
end
end
end
def destroy
Admins::DeleteUnitApplyService.call(@unit_apply, params)
render_success_js
end
def edit
@all_schools = School.where.not(id: @unit_apply.school_id).pluck("name","id")
end
def update
school = School.find_by(id: params[:school_id])
ActiveRecord::Base.transaction do
@unit_apply&.applied_messages&.update_all(status:4)
Tiding.where(user_id: 1, trigger_user_id: @unit_apply.user_id, container_id: @unit_apply.id,
container_type: 'ApplyAddSchools', status: 0, tiding_type: "Apply").update_all(status: 1)
#消息的创建
tiding_params = {
user_id: @unit_apply.user_id,
trigger_user_id: 0,
container_id: @unit_apply.id,
container_type: 'ApplyAddSchools',
belong_container_id: params[:school_id],
belong_container_type: "School",
tiding_type: "System",
status: 3,
extra: school.try(:name).to_s
}
Tiding.create(tiding_params)
UserExtension.where(school_id: @unit_apply.school_id).update_all(school_id: params[:school_id].to_i)
ApplyAddDepartment.where(:school_id => @unit_apply.school_id).update_all(school_id: params[:school_id].to_i)
# 判断重复
before_apply_departments = Department.where(school_id: @unit_apply.school_id)
before_apply_departments.each do |department|
after_dep = Department.where(school_id: params[:school_id].to_i, name: department.name)&.first
if after_dep.present?
UserExtension.where(school_id: @unit_apply.school_id, department_id: department.id).update_all(department_id: after_dep.id)
department.destroy
department.apply_add_departments.destroy_all
else
department.apply_add_departments.update_all(school_id: school.id)
department.update_attribute(:school_id, school.id)
end
end
@unit_apply&.school&.destroy
apply_params = {
status: 2,
name: school&.name.to_s,
school_id: params[:school_id],
province: params[:province],
city: params[:city],
address: params[:address]
}
@unit_apply.update_attributes(apply_params)
# render_success_js
end
end
private
def get_apply
@unit_apply = ApplyAddSchool.find_by(id:params[:id])
end
def disk_auth_filename(source_type, source_id, type)
File.join(storage_path, "#{source_type}", "#{source_id}#{type}")
end
end

@ -27,7 +27,7 @@ class CoursesController < ApplicationController
:attahcment_category_list,:export_member_scores_excel, :duplicate_course, :attahcment_category_list,:export_member_scores_excel, :duplicate_course,
:switch_to_teacher, :switch_to_assistant, :switch_to_student, :exit_course, :switch_to_teacher, :switch_to_assistant, :switch_to_student, :exit_course,
:informs, :update_informs, :online_learning, :update_task_position, :tasks_list, :informs, :update_informs, :online_learning, :update_task_position, :tasks_list,
:join_excellent_course, :export_couser_info, :export_member_act_score, :new_informs] :join_excellent_course, :export_couser_info, :export_member_act_score, :new_informs, :delete_informs]
before_action :user_course_identity, except: [:join_excellent_course, :index, :create, :new, :apply_to_join_course, before_action :user_course_identity, except: [:join_excellent_course, :index, :create, :new, :apply_to_join_course,
:search_course_list, :get_historical_course_students, :mine, :search_slim, :board_list] :search_course_list, :get_historical_course_students, :mine, :search_slim, :board_list]
before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate, before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate,
@ -36,7 +36,7 @@ class CoursesController < ApplicationController
:add_teacher, :export_couser_info, :export_member_act_score] :add_teacher, :export_couser_info, :export_member_act_score]
before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin, before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin,
:set_course_group, :create_group_by_importing_file, :update_informs, :new_informs, :set_course_group, :create_group_by_importing_file, :update_informs, :new_informs,
:update_task_position, :tasks_list] :update_task_position, :tasks_list, :delete_informs]
before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group, before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group,
:change_course_teacher, :course_group_list, :change_course_teacher, :course_group_list,
:teacher_application_review, :apply_teachers, :delete_course_teacher] :teacher_application_review, :apply_teachers, :delete_course_teacher]
@ -212,7 +212,7 @@ class CoursesController < ApplicationController
@course.update_attributes!(course_params.merge(extra_params)) @course.update_attributes!(course_params.merge(extra_params))
@course.update_course_modules(params[:course_module_types]) @course.update_course_modules(params[:course_module_types])
Rails.logger.info("###############course_update_end")
normal_status(0, "成功") normal_status(0, "成功")
rescue => e rescue => e
uid_logger_error(e.message) uid_logger_error(e.message)
@ -257,6 +257,12 @@ class CoursesController < ApplicationController
normal_status("更新成功") normal_status("更新成功")
end end
def delete_informs
inform = @course.informs.find_by(id: params[:inform_id])
inform.destroy!
normal_status("删除成功")
end
def online_learning def online_learning
@subject = @course.subject @subject = @course.subject
@stages = @subject&.stages @stages = @subject&.stages
@ -1478,8 +1484,10 @@ class CoursesController < ApplicationController
shixun_titles = shixun_homeworks.pluck(:name) + ["总得分"] shixun_titles = shixun_homeworks.pluck(:name) + ["总得分"]
# 更新实训作业成绩 # 更新实训作业成绩
shixun_homeworks.includes(:homework_challenge_settings, :published_settings, :homework_commons_shixun).each do |homework| unless course.is_end
homework.update_homework_work_score shixun_homeworks.includes(:homework_challenge_settings, :published_settings, :homework_commons_shixun).each do |homework|
homework.update_homework_work_score
end
end end
shixun_homeworks = shixun_homeworks&.includes(score_student_works: :user) shixun_homeworks = shixun_homeworks&.includes(score_student_works: :user)

@ -916,7 +916,8 @@ class GamesController < ApplicationController
# 更新关卡状态和一些学习进度 # 更新关卡状态和一些学习进度
def update_game_parameter game def update_game_parameter game
game.update_attribute(:status, 0) if game.status == 1 game.update_attribute(:status, 0) if game.status == 1
game.update_attributes(status: 0, open_time: Time.now) if game.status == 3 # 第一次进入关卡更新时间
game.update_attributes(status: 0, open_time: Time.now) if game.open_time.blank? || game.status == 3
# 开启实训更新myshixuns的时间方便跟踪用于的学习进度。 # 开启实训更新myshixuns的时间方便跟踪用于的学习进度。
game.myshixun.update_column(:updated_at, Time.now) game.myshixun.update_column(:updated_at, Time.now)
end end

@ -230,6 +230,7 @@ class GraduationTopicsController < ApplicationController
topic_repeat: topic.topic_repeat, topic_repeat: topic.topic_repeat,
province: topic.province, province: topic.province,
city: topic.city, city: topic.city,
topic_type: topic.topic_type,
course_list_id: @course.course_list_id) course_list_id: @course.course_list_id)
topic_bank.attachments.destroy_all topic_bank.attachments.destroy_all
else else
@ -241,6 +242,7 @@ class GraduationTopicsController < ApplicationController
topic_repeat: topic.topic_repeat, topic_repeat: topic.topic_repeat,
province: topic.province, province: topic.province,
city: topic.city, city: topic.city,
topic_type: topic.topic_type,
course_list_id: @course.course_list_id, course_list_id: @course.course_list_id,
user_id: current_user.id, user_id: current_user.id,
graduation_topic_id: topic.id) graduation_topic_id: topic.id)

@ -82,8 +82,7 @@ class HomeworkCommonsController < ApplicationController
end end
@task_count = @homework_commons.size @task_count = @homework_commons.size
@homework_commons = @homework_commons.order("IF(ISNULL(homework_commons.publish_time),0,1), homework_commons.publish_time DESC, @homework_commons = @homework_commons.order("position DESC").page(page).per(15)
homework_commons.created_at DESC").page(page).per(15)
if @homework_type == 4 if @homework_type == 4
@homework_commons = @homework_commons.includes(:homework_detail_manual, :published_settings, :shixuns) @homework_commons = @homework_commons.includes(:homework_detail_manual, :published_settings, :shixuns)
@ -931,6 +930,7 @@ class HomeworkCommonsController < ApplicationController
shixuns.each do |shixun| shixuns.each do |shixun|
homework = HomeworksService.new.create_homework shixun, @course, @category, current_user homework = HomeworksService.new.create_homework shixun, @course, @category, current_user
@homework_ids << homework.id @homework_ids << homework.id
CreateStudentWorkJob.perform_later(homework.id)
end end
rescue Exception => e rescue Exception => e
uid_logger(e.message) uid_logger(e.message)
@ -1032,6 +1032,7 @@ class HomeworkCommonsController < ApplicationController
stage.shixuns.where.not(shixuns: {id: none_shixun_ids}).unhidden.each do |shixun| stage.shixuns.where.not(shixuns: {id: none_shixun_ids}).unhidden.each do |shixun|
homework = HomeworksService.new.create_homework shixun, @course, category, current_user homework = HomeworksService.new.create_homework shixun, @course, category, current_user
@homework_ids << homework.id @homework_ids << homework.id
CreateStudentWorkJob.perform_later(homework.id)
end end
end end
end end

@ -8,11 +8,11 @@ class ShixunsController < ApplicationController
before_action :find_shixun, except: [:index, :new, :create, :menus, :get_recommend_shixuns, before_action :find_shixun, except: [:index, :new, :create, :menus, :get_recommend_shixuns,
:propaedeutics, :departments, :apply_shixun_mirror, :propaedeutics, :departments, :apply_shixun_mirror,
:get_mirror_script, :download_file] :get_mirror_script, :download_file, :shixun_list]
before_action :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns, before_action :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns,
:propaedeutics, :departments, :apply_shixun_mirror, :propaedeutics, :departments, :apply_shixun_mirror,
:get_mirror_script, :download_file] :get_mirror_script, :download_file, :shixun_list]
before_action :find_repo_name, only: [:repository, :commits, :file_content, :update_file, :shixun_exec, :copy, :add_file] before_action :find_repo_name, only: [:repository, :commits, :file_content, :update_file, :shixun_exec, :copy, :add_file]
before_action :allowed, only: [:update, :close, :update_propaedeutics, :settings, :publish, before_action :allowed, only: [:update, :close, :update_propaedeutics, :settings, :publish,
@ -98,6 +98,45 @@ class ShixunsController < ApplicationController
.each_with_object({}) { |r, obj| obj[r.shixun_id] = r.name } .each_with_object({}) { |r, obj| obj[r.shixun_id] = r.name }
end end
def shixun_list
# 全部实训/我的实训
type = params[:type] || "all"
# 状态:已发布/未发布
status = params[:status] || "all"
# 超级管理员用户显示所有未隐藏的实训、非管理员显示所有已发布的实训(对本单位公开且未隐藏未关闭)
if type == "mine"
@shixuns = current_user.shixuns.none_closed
else
if current_user.admin?
@shixuns = Shixun.none_closed.where(hidden: 0)
else
none_shixun_ids = ShixunSchool.where("school_id != #{current_user.school_id}").pluck(:shixun_id)
@shixuns = Shixun.where.not(id: none_shixun_ids).none_closed.where(hidden: 0)
end
end
unless status == "all"
@shixuns = status == "published" ? @shixuns.where(status: 2) : @shixuns.where(status: [0, 1])
end
## 筛选 难度
if params[:diff].present? && params[:diff].to_i != 0
@shixuns = @shixuns.where(trainee: params[:diff])
end
page = params[:page] || 1
limit = params[:limit] || 10
offset = (page.to_i - 1) * limit
order = params[:order] || "desc"
## 搜索关键字创建者、实训名称、院校名称
keyword = params[:search]
@shixuns = Shixun.search keyword, where: {id: @shixuns.pluck(:id)}, order: {"myshixuns_count" => order}, limit: limit, offset: offset
@total_count = @shixuns.total_count
end
## 获取顶部菜单 ## 获取顶部菜单
def menus def menus
@repertoires = Repertoire.includes(sub_repertoires: [:tag_repertoires]).order("updated_at asc") @repertoires = Repertoire.includes(sub_repertoires: [:tag_repertoires]).order("updated_at asc")
@ -601,7 +640,7 @@ class ShixunsController < ApplicationController
challenges.each_with_index do |challenge, index| challenges.each_with_index do |challenge, index|
status = (index == 0 ? 0 : 3) status = (index == 0 ? 0 : 3)
game_identifier = generate_identifier(Game, 12) game_identifier = generate_identifier(Game, 12)
worker.add(base_attr.merge(challenge_id: challenge.id, status: status, open_time: Time.now, worker.add(base_attr.merge(challenge_id: challenge.id, status: status,
identifier: game_identifier, modify_time: challenge.modify_time)) identifier: game_identifier, modify_time: challenge.modify_time))
end end
end end
@ -865,6 +904,7 @@ class ShixunsController < ApplicationController
def send_to_course def send_to_course
@course = Course.find(params[:course_id]) @course = Course.find(params[:course_id])
homework = HomeworksService.new.create_homework @shixun, @course, nil, current_user homework = HomeworksService.new.create_homework @shixun, @course, nil, current_user
CreateStudentWorkJob.perform_later(homework.id)
end end
# 二维码扫描下载 # 二维码扫描下载

@ -214,6 +214,7 @@ class SubjectsController < ApplicationController
stage.shixuns.where(id: params[:shixun_ids], status: 2).each do |shixun| stage.shixuns.where(id: params[:shixun_ids], status: 2).each do |shixun|
homework = HomeworksService.new.create_homework shixun, @course, category, current_user homework = HomeworksService.new.create_homework shixun, @course, category, current_user
CreateStudentWorkJob.perform_later(homework.id)
end end
end end
rescue Exception => e rescue Exception => e

@ -1,5 +1,6 @@
class Users::QuestionBanksController < Users::BaseController class Users::QuestionBanksController < Users::BaseController
before_action :require_login before_action :require_login
before_action :private_user_resources!
before_action :check_query_params! before_action :check_query_params!
before_action :check_user_permission! before_action :check_user_permission!

@ -1,7 +1,10 @@
class Wechats::JsSdkSignaturesController < ApplicationController class Wechats::JsSdkSignaturesController < ApplicationController
def create def create
signature = Util::Wechat.js_sdk_signature(params[:url], params[:noncestr], params[:timestamp]) timestamp = (Time.now.to_f * 1000).to_i
render_ok(signature: signature) noncestr = ('A'..'z').to_a.sample(8).join
signature = Util::Wechat.js_sdk_signature(params[:url], noncestr, timestamp)
render_ok(appid: Util::Wechat.appid, timestamp: timestamp, noncestr: noncestr, signature: signature)
rescue Util::Wechat::Error => ex rescue Util::Wechat::Error => ex
render_error(ex.message) render_error(ex.message)
end end

@ -108,6 +108,8 @@ module CoursesHelper
course_board.present? ? course_board.messages.size : 0 course_board.present? ? course_board.messages.size : 0
when "course_group" when "course_group"
course.course_groups_count course.course_groups_count
when "announcement"
course.informs.count
end end
end end

@ -1,10 +1,12 @@
class ApplyAddSchool < ApplicationRecord class ApplyAddSchool < ApplicationRecord
belongs_to :school belongs_to :school
belongs_to :user
has_many :applied_messages, as: :applied has_many :applied_messages, as: :applied
has_many :tidings, as: :container, dependent: :destroy has_many :tidings, as: :container, dependent: :destroy
after_create :send_notify after_create :send_notify
# after_destroy :after_delete_apply
private private
@ -12,4 +14,9 @@ class ApplyAddSchool < ApplicationRecord
Tiding.create!(user_id: 1, status: 0, container_id: id, container_type: 'ApplyAddSchools', Tiding.create!(user_id: 1, status: 0, container_id: id, container_type: 'ApplyAddSchools',
trigger_user_id: user_id, belong_container: school, tiding_type: 'Apply') trigger_user_id: user_id, belong_container: school, tiding_type: 'Apply')
end end
# def after_delete_apply
#
# end
end end

@ -16,6 +16,8 @@ class School < ApplicationRecord
has_many :customers, dependent: :destroy has_many :customers, dependent: :destroy
has_many :partners, dependent: :destroy has_many :partners, dependent: :destroy
has_many :apply_add_departments, dependent: :destroy
# 学校管理员 # 学校管理员
def manager?(user) def manager?(user)
ec_school_users.exists?(user_id: user.id) ec_school_users.exists?(user_id: user.id)

@ -14,7 +14,9 @@ module Searchable::Shixun
def search_data def search_data
{ {
name: name, name: name,
description: Util.extract_content(description)[0..Searchable::MAXIMUM_LENGTH] description: Util.extract_content(description)[0..Searchable::MAXIMUM_LENGTH],
status: status,
myshixuns_count: myshixuns_count
}.merge!(searchable_user_data) }.merge!(searchable_user_data)
.merge!(searchable_challenge_data) .merge!(searchable_challenge_data)
end end
@ -37,7 +39,7 @@ module Searchable::Shixun
end end
def should_index? def should_index?
status == 2 # published [0, 1, 2].include?(status) # published
end end
def to_searchable_json def to_searchable_json

@ -59,6 +59,7 @@ class Shixun < ApplicationRecord
scope :visible, -> { where.not(status: -1) } scope :visible, -> { where.not(status: -1) }
scope :published, lambda{ where(status: 2) } scope :published, lambda{ where(status: 2) }
scope :published_closed, lambda{ where(status: [2, 3]) } scope :published_closed, lambda{ where(status: [2, 3]) }
scope :none_closed, lambda{ where(status: [0, 1, 2]) }
scope :unhidden, lambda{ where(hidden: 0, status: 2) } scope :unhidden, lambda{ where(hidden: 0, status: 2) }
scope :field_for_recommend, lambda{ select([:id, :name, :identifier, :myshixuns_count]) } scope :field_for_recommend, lambda{ select([:id, :name, :identifier, :myshixuns_count]) }
scope :find_by_ids,lambda{|k| where(id:k)} scope :find_by_ids,lambda{|k| where(id:k)}

@ -0,0 +1,25 @@
class Admins::DepartmentApplyQuery < ApplicationQuery
include CustomSortable
attr_reader :params
sort_columns :created_at, default_by: :created_at, default_direction: :desc
def initialize(params)
@params = params
end
def call
status = params[:status]
applies = ApplyAddDepartment.where(status: status) if status.present?
# 关键字模糊查询
keyword = params[:keyword].to_s.strip
if keyword.present?
applies = applies.where('name LIKE :keyword', keyword: "%#{keyword}%")
end
custom_sort(applies, params[:sort_by], params[:sort_direction])
end
end

@ -0,0 +1,24 @@
class Admins::UnitApplyQuery < ApplicationQuery
include CustomSortable
attr_reader :params
sort_columns :created_at, default_by: :created_at, default_direction: :desc
def initialize(params)
@params = params
end
def call
unit_applies = ApplyAddSchool.where(status:0)
# 关键字模糊查询
keyword = params[:keyword].to_s.strip
if keyword.present?
unit_applies = unit_applies.where("name like ?","%#{keyword}%")
end
custom_sort(unit_applies, params[:sort_by], params[:sort_direction])
end
end

@ -0,0 +1,56 @@
class Admins::DeleteUnitApplyService < ApplicationService
attr_reader :department, :params
def initialize(unit_apply, params)
@unit_apply = unit_apply
@params = params
end
def call
ActiveRecord::Base.transaction do
@unit_apply.update_attribute("status",3)
@unit_apply&.applied_messages&.update_all(status:3)
@unit_apply&.school&.apply_add_departments&.update_all(status:3)
applied_departments = ApplyAddDepartment.where(school_id: @unit_apply.school_id)
applied_departments.update_all(status: 3)
use_extensions = UserExtension&.where(school_id: @unit_apply.school_id)
user_ids = UserExtension&.where(school_id: @unit_apply.school_id)&.pluck(:user_id)
User.where(id: user_ids).update_all(profile_completed: false)
use_extensions.update_all(school_id: nil,department_id: nil)
@unit_apply&.user&.user_extension&.update_attribute("department_id", nil)
# 申请了职业认证的用户撤销申请
apply_user_auth = ApplyUserAuthentication.where(user_id: user_ids, auth_type: 2, status: 0)
apply_user_auth.each do |apply|
apply.tidings.destroy_all
apply.update_attribute('status', 3)
diskfile2 = disk_auth_filename('UserAuthentication', apply.user_id, 'PRO')
diskfilePRO = diskfile2 + 'temp'
File.delete(diskfilePRO) if File.exist?(diskfilePRO)
File.delete(diskfile2) if File.exist?(diskfile2)
end
# 未审批删除
if params[:tip] == "unapplied"
Tiding.where(:user_id => 1, :trigger_user_id => @unit_apply.user_id, :container_id => @unit_apply.id, :container_type => 'ApplyAddSchools', :status => 0, :tiding_type => "Apply").update_all(status: 1)
Tiding.create(:user_id => @unit_apply.user_id, :trigger_user_id => 0, :container_id => @unit_apply.id, :container_type =>'ApplyAddSchools', :belong_container_id => @unit_apply.school_id, :belong_container_type=> 'School', :tiding_type => "System", :status => 2, :extra => params[:reason])
Tiding.where(:user_id => 1, :container_id => applied_departments.pluck(:id), :container_type => 'ApplyAddDepartment', :status => 0, :tiding_type => "Apply").update_all(status: 1)
if applied_departments&.first.present?
Tiding.create(:user_id => applied_departments.first.user_id, :trigger_user_id => 0, :container_id => applied_departments.first.id, :container_type =>'ApplyAddDepartment', :belong_container_id => @unit_apply.school_id, :belong_container_type=> 'School', :tiding_type => "System", :status => 2)
AppliedMessage.create(:user_id => applied_departments.first.user_id, :status => 3, :viewed => 0, :applied_id => applied_departments.first.id, :applied_type => "ApplyAddDepartment", :name => applied_departments.first.name )
end
@unit_apply&.school&.destroy
@unit_apply&.school&.departments&.destroy_all
elsif params[:tip] == "applied"
applied_departments.destroy_all
@unit_apply.destroy
end
end
end
end

@ -46,6 +46,7 @@ class Admins::ImportUserService < ApplicationService
department = school.departments.find_by(name: data.department_name) department = school.departments.find_by(name: data.department_name)
attr = { attr = {
type: 'User',
status: User::STATUS_ACTIVE, status: User::STATUS_ACTIVE,
login: "#{prefix}#{data.student_id}", login: "#{prefix}#{data.student_id}",
firstname: '', firstname: '',
@ -54,7 +55,9 @@ class Admins::ImportUserService < ApplicationService
professional_certification: 1, professional_certification: 1,
certification: 1, certification: 1,
password: '12345678', password: '12345678',
phone: data.phone phone: data.phone,
mail: "#{prefix}#{data.student_id}@qq.com",
profile_completed: true
} }
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
user = User.create!(attr) user = User.create!(attr)
@ -66,8 +69,8 @@ class Admins::ImportUserService < ApplicationService
extension_attr[:technical_title] = extension_attr[:technical_title] =
case data.identity.to_i case data.identity.to_i
when 0 then %w(教授 副教授 讲师 助教).include?(data.technical_title) || '讲师' when 0 then %w(教授 副教授 讲师 助教).include?(data.technical_title) ? data.technical_title : '讲师'
when 2 then %w(企业管理者 部门管理者 高级工程师 工程师 助理工程师).include?(data.technical_title) || '助理工程师' when 2 then %w(企业管理者 部门管理者 高级工程师 工程师 助理工程师).include?(data.technical_title) ? data.technical_title : '助理工程师'
else nil else nil
end end

@ -15,7 +15,6 @@ class HomeworksService
homework_detail_manual.save! if homework_detail_manual homework_detail_manual.save! if homework_detail_manual
HomeworkCommonsShixun.create!(homework_common_id: homework.id, shixun_id: shixun.id) HomeworkCommonsShixun.create!(homework_common_id: homework.id, shixun_id: shixun.id)
HomeworksService.new.create_shixun_homework_cha_setting(homework, shixun) HomeworksService.new.create_shixun_homework_cha_setting(homework, shixun)
CreateStudentWorkJob.perform_later(homework.id)
# HomeworksService.new.create_works_list(homework, course) # HomeworksService.new.create_works_list(homework, course)
end end
homework homework

@ -14,10 +14,12 @@ class SearchService < ApplicationService
private private
def search_options def search_options
{ model_options = {
index_name: index_names, index_name: index_names,
model_includes: model_includes model_includes: model_includes
}.merge(default_options) }
model_options.merge(where: { status: 2 }) if index_names == [Shixun]
model_options.merge(default_options)
end end
def index_names def index_names

@ -0,0 +1,30 @@
<div class="modal fade admin-import-course-member-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">导入课堂成员</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="admin-import-course-member-form" enctype="multipart/form-data">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">文件</span>
</div>
<div class="custom-file">
<input type="file" name="file" id="import-course-member-input" class="upload-file-input" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
<label class="custom-file-label file-names" for="import-course-member-input">选择文件</label>
</div>
</div>
<div class="error text-danger"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

@ -0,0 +1,18 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('部门审批') %>
<% end %>
<div class="box search-form-container flex-column mb-0 pb-0 department-applies-list-form">
<%= form_tag(admins_department_applies_path(unsafe_params), method: :get, class: 'form-inline search-form mt-3', remote: true) do %>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '部门名称检索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with':"搜索中...") %>
<%= link_to "清除",admins_department_applies_path(keyword:nil),class:"btn btn-default",remote:true %>
<% end %>
</div>
<div class="box department-applies-list-container">
<%= render(partial: 'admins/department_applies/shared/list', locals: { applies: @depart_applies }) %>
</div>
<%= render(partial: 'admins/shared/admin_common_refuse_modal') %>
<%= render 'admins/departments/shared/merge_department_modal' %>

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

@ -0,0 +1,39 @@
<table class="table table-hover text-center department_applies-list-table">
<thead class="thead-light">
<tr>
<th width="8%">ID</th>
<th width="22%" class="text-left">部门名称</th>
<th width="20%" class="text-left">单位名称</th>
<th width="15%">创建者</th>
<th width="15%"><%= sort_tag('创建于', name: 'created_at', path: admins_department_applies_path) %></th>
<th width="20%">操作</th>
</tr>
</thead>
<tbody>
<% if applies.present? %>
<% applies.each do |apply| %>
<tr class="department-apply-<%= apply.id %>">
<td><%= apply.id %></td>
<td class="text-left"> <%= apply.name %></td>
<td class="text-left"> <%= apply.school.try(:name) %></td>
<td><%= apply.user.show_real_name %></td>
<td><%= format_time apply.created_at %></td>
<td class="action-container">
<%= agree_link '批准', agree_admins_department_apply_path(apply, element: ".department-apply-#{apply.id}"), 'data-confirm': '确认批准通过?' %>
<%= javascript_void_link('删除', class: 'action refuse-action',
data: {
toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id, title: "删除原因", type: "delete",
url: admins_department_apply_path(apply,tip:"unapplied", element: ".department-apply-#{apply.id}")
}) %>
<%= javascript_void_link '更改', class: 'action', data: { school_id: apply.school_id, department_id: apply.id,
toggle: 'modal', target: '.admin-merge-department-modal', url: merge_admins_department_applies_path } %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>

@ -28,7 +28,8 @@
<%= javascript_void_link '添加管理员', class: 'action', data: { department_id: department.id, toggle: 'modal', target: '.admin-add-department-member-modal' } %> <%= javascript_void_link '添加管理员', class: 'action', data: { department_id: department.id, toggle: 'modal', target: '.admin-add-department-member-modal' } %>
<%= javascript_void_link '更改', class: 'action', data: { school_id: department.school_id, department_id: department.id, toggle: 'modal', target: '.admin-merge-department-modal' } %> <%= javascript_void_link '更改', class: 'action', data: { school_id: department.school_id, department_id: department.id,
toggle: 'modal', target: '.admin-merge-department-modal', url: merge_admins_departments_path } %>
<%= delete_link '删除', admins_department_path(department, element: ".department-item-#{department.id}"), class: 'delete-department-action' %> <%= delete_link '删除', admins_department_path(department, element: ".department-item-#{department.id}"), class: 'delete-department-action' %>
</td> </td>

@ -18,7 +18,6 @@
<select id="department_id" name="department_id" class="form-control department-select"></select> <select id="department_id" name="department_id" class="form-control department-select"></select>
</div> </div>
</div> </div>
<div class="error text-danger"></div> <div class="error text-danger"></div>
</form> </form>
</div> </div>

@ -56,15 +56,15 @@
<%= sidebar_item_group('#apply-review-submenu', '审核', icon: 'gavel') do %> <%= sidebar_item_group('#apply-review-submenu', '审核', icon: 'gavel') do %>
<li><%= sidebar_item(admins_identity_authentications_path, '实名认证', icon: 'id-card-o', controller: 'admins-identity_authentications') %></li> <li><%= sidebar_item(admins_identity_authentications_path, '实名认证', icon: 'id-card-o', controller: 'admins-identity_authentications') %></li>
<li><%= sidebar_item(admins_professional_authentications_path, '职业认证', icon: 'drivers-license', controller: 'admins-professional_authentications') %></li> <li><%= sidebar_item(admins_professional_authentications_path, '职业认证', icon: 'drivers-license', controller: 'admins-professional_authentications') %></li>
<li><%= sidebar_item(admins_department_applies_path, '部门审批', icon: 'newspaper-o', controller: 'admins-department_applies') %></li>
<li><%= sidebar_item(admins_unit_applies_path, '单位审批', icon: 'building-o', controller: 'admins-unit_applies') %></li>
<li><%= sidebar_item(admins_shixun_authorizations_path, '实训发布', icon: 'object-ungroup', controller: 'admins-shixun_authorizations') %></li> <li><%= sidebar_item(admins_shixun_authorizations_path, '实训发布', icon: 'object-ungroup', controller: 'admins-shixun_authorizations') %></li>
<li><%= sidebar_item(admins_subject_authorizations_path, '实践课程发布', icon: 'object-group', controller: 'admins-subject_authorizations') %></li> <li><%= sidebar_item(admins_subject_authorizations_path, '实践课程发布', icon: 'object-group', controller: 'admins-subject_authorizations') %></li>
<li><%= sidebar_item(admins_library_applies_path, '教学案例发布', icon: 'language', controller: 'admins-library_applies') %></li> <li><%= sidebar_item(admins_library_applies_path, '教学案例发布', icon: 'language', controller: 'admins-library_applies') %></li>
<li><%= sidebar_item(admins_project_package_applies_path, '众包需求发布', icon: 'joomla', controller: 'admins-project_package_applies') %></li> <li><%= sidebar_item(admins_project_package_applies_path, '众包需求发布', icon: 'joomla', controller: 'admins-project_package_applies') %></li>
<li><%= sidebar_item(admins_video_applies_path, '视频发布', icon: 'film', controller: 'admins-video_applies') %></li> <li><%= sidebar_item(admins_video_applies_path, '视频发布', icon: 'film', controller: 'admins-video_applies') %></li>
<% end %>
<% end %>
</li> </li>
<li><%= sidebar_item('/', '返回主站', icon: 'sign-out', controller: 'root') %></li> <li><%= sidebar_item('/', '返回主站', icon: 'sign-out', controller: 'root') %></li>
</ul> </ul>
</nav> </nav>

@ -11,7 +11,7 @@
保存成功 保存成功
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">确认</button> <button type="button" class="btn btn-primary submit-btn" data-dismiss="modal">确认</button>
</div> </div>
</div> </div>
</div> </div>

@ -0,0 +1,56 @@
$("body").append("<%= j render partial: "admins/unit_applies/shared/edit_modal",locals: {apply: @unit_apply, schools: @all_schools} %>")
var uni_edit_modal = $(".admin-unit-edit-modal")
uni_edit_modal.modal("show")
uni_edit_modal.on("hidden.bs.modal",function () {
$(".admin-unit-edit-modal").remove()
$("body").removeClass("modal-open")
})
// 初始化学校选择器
var matcherFunc = function(params, data){
if ($.trim(params.term) === '') {
return data;
}
if (typeof data.text === 'undefined') {
return null;
}
if (data.name && data.name.indexOf(params.term) > -1) {
var modifiedData = $.extend({}, data, true);
return modifiedData;
}
// Return `null` if the term should not be displayed
return null;
}
$.ajax({
url: '/api/schools/for_option.json',
dataType: 'json',
type: 'GET',
success: function(data) {
$("#all-schools").select2({
theme: 'bootstrap4',
placeholder: '查询学校/单位',
minimumInputLength: 1,
data: data.schools,
templateResult: function (item) {
if(!item.id || item.id === '') return item.text;
return item.name;
},
templateSelection: function(item){
return item.name || item.text;
},
matcher: matcherFunc
})
}
});
$("#all-schools").select2({})
$("#show-province-<%= @unit_apply.id %>").select2()
$("#schoolCity_<%= @unit_apply.id %>").select2()
// **************** 地区选择 ****************
$('.province-city-select').cxSelect({
url: '/javascripts/educoder/province-data.json',
selects: ['province-select', 'city-select']
});

@ -0,0 +1,17 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('单位审批') %>
<% end %>
<div class="box search-form-container flex-column mb-0 pb-0 unit-applies-list-form">
<%= form_tag(admins_unit_applies_path(unsafe_params), method: :get, class: 'form-inline search-form mt-3', remote: true) do %>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '单位名称检索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with':"搜索中...") %>
<%= link_to "清除",admins_unit_applies_path(keyword:nil),class:"btn btn-default",remote:true %>
<% end %>
</div>
<div class="box unit-applies-list-container">
<%= render(partial: 'admins/unit_applies/shared/list', locals: { applies: @unit_applies }) %>
</div>
<%= render(partial: 'admins/shared/admin_common_refuse_modal') %>

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

@ -0,0 +1,17 @@
<td><%= apply.id %></td>
<td class="text-left"><%= overflow_hidden_span apply.name %></td>
<td class="text-left">
<%= "#{apply&.province.to_s}"+"#{apply&.city.to_s}" %>
</td>
<td class="text-left"><%= overflow_hidden_span apply.address %></td>
<td><%= apply.user.try(:show_real_name) %></td>
<td><%= format_time apply.created_at %></td>
<td class="action-container">
<%= agree_link '批准', agree_admins_unit_apply_path(apply, element: ".unit-apply-#{apply.id}"), 'data-confirm': '确认批准通过?' %>
<%= javascript_void_link('删除', class: 'action refuse-action',
data: {
toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id, title: "删除原因", type: "delete",
url: admins_unit_apply_path(apply, tip: "unapplied", element: ".unit-apply-#{apply.id}")
}) %>
<%= link_to "更改",edit_admins_unit_apply_path(apply), remote: true, class:"action",'data-disable-with': '打开中...' %>
</td>

@ -0,0 +1,43 @@
<div class="modal fade admin-unit-edit-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">修改申请</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<%= form_tag(admins_unit_apply_path, method: :put, remote: true) do %>
<div class="modal-body">
<div class="form-group d-flex">
<label for="school_id" class="col-form-label">更改学校:</label>
<div class="d-flex flex-column-reverse w-75">
<%= select_tag :school_id, [apply&.school_id], class: 'form-control school-select optional',id: "all-schools" %>
</div>
</div>
<div class="form-group d-flex">
<label for="school_id" class="col-form-label">更改城市:</label>
<div class="d-flex w-75 province-city-select">
<div class="w-50 mr-3">
<%= select_tag('province', [], class: 'form-control province-select optional', 'data-value': apply.province, 'data-first-title': '请选择', id:"show-province-#{apply.id}") %>
</div>
<div class="w-50">
<%= select_tag('city', [], class: 'form-control city-select optional', 'data-value': apply.city, id: "schoolCity_#{apply.id}") %>
</div>
</div>
</div>
<div class="form-group d-flex">
<label for="school_id" class="col-form-label">更改地址:</label>
<div class="d-flex w-75 flex-column-reverse">
<%= text_field_tag :address,apply.address,class:"form-control" %>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<%= submit_tag "确认",class:"btn btn-primary" %>
</div>
<% end %>
</div>
</div>
</div>

@ -0,0 +1,26 @@
<table class="table table-hover text-center unit-applies-list-table">
<thead class="thead-light">
<tr>
<th width="8%">ID</th>
<th width="20%" class="text-left">单位名称</th>
<th width="12%" class="text-left">地区</th>
<th width="20%" class="text-left">详细地址</th>
<th width="10%">申请者</th>
<th width="15%"><%= sort_tag('创建于', name: 'created_at', path: admins_unit_applies_path) %></th>
<th width="15%">操作</th>
</tr>
</thead>
<tbody>
<% if applies.present? %>
<% applies.each do |apply| %>
<tr class="unit-apply-<%= apply.id %>">
<%= render partial: "admins/unit_applies/shared/apply_item", locals: {apply: apply} %>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>

@ -0,0 +1,3 @@
$('.modal.admin-unit-edit-modal').modal('hide');
$('.unit-applies-list-table .unit-apply-<%= @unit_apply.id %>').remove()
$.notify({ message: '操作成功' });

@ -28,6 +28,7 @@
<% end %> <% end %>
<%= javascript_void_link '导入用户', class: 'btn btn-secondary btn-sm', data: { toggle: 'modal', target: '.admin-import-user-modal'} %> <%= javascript_void_link '导入用户', class: 'btn btn-secondary btn-sm', data: { toggle: 'modal', target: '.admin-import-user-modal'} %>
<%= javascript_void_link '导入课堂成员', class: 'btn btn-secondary btn-sm ml-2', data: { toggle: 'modal', target: '.admin-import-course-member-modal'} %>
</div> </div>
<div class="box users-list-container"> <div class="box users-list-container">
@ -35,4 +36,7 @@
</div> </div>
<%= render partial: 'admins/users/shared/reward_grade_modal' %> <%= render partial: 'admins/users/shared/reward_grade_modal' %>
<%= render partial: 'admins/users/shared/import_user_modal' %> <%= render partial: 'admins/users/shared/import_user_modal' %>
<!-- TODO: move to course list page -->
<%= render partial: 'admins/courses/shared/import_course_member_modal' %>

@ -14,8 +14,8 @@
<span class="input-group-text">文件</span> <span class="input-group-text">文件</span>
</div> </div>
<div class="custom-file"> <div class="custom-file">
<input type="file" name="file" class="upload-file-input" id="upload-file-input" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"> <input type="file" name="file" class="upload-file-input" id="import-user-input" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
<label class="custom-file-label file-names" for="upload-file-input">选择文件</label> <label class="custom-file-label file-names" for="import-user-input">选择文件</label>
</div> </div>
</div> </div>
<div class="error text-danger"></div> <div class="error text-danger"></div>

@ -0,0 +1,17 @@
json.shixuns_count @total_count
json.shixun_list do
json.array! @shixuns.with_highlights(multiple: true) do |obj, highlights|
puts obj
json.merge! obj.to_searchable_json
json.challenge_names obj.challenges.pluck(:subject)
json.title highlights.delete(:name)&.join('...') || obj.searchable_title
# json.description highlights.values[0,5].each { |arr| arr.is_a?(Array) ? arr.join('...') : arr }.join('<br/>')
json.content highlights
json.level level_to_s(obj.trainee)
json.subjects obj.subjects do |subject|
json.(subject, :id, :name)
end
end
end

@ -20,6 +20,7 @@ if @course
json.group_info @course.teacher_group(@user.id) if @course_identity < Course::STUDENT json.group_info @course.teacher_group(@user.id) if @course_identity < Course::STUDENT
end end
json.first_category_url module_url(@course.none_hidden_course_modules.first, @course) json.first_category_url module_url(@course.none_hidden_course_modules.first, @course)
json.course_is_end @course.is_end
end end
if params[:school] if params[:school]

@ -179,6 +179,7 @@ Rails.application.routes.draw do
get :get_mirror_script get :get_mirror_script
post :apply_shixun_mirror post :apply_shixun_mirror
get :download_file get :download_file
get :shixun_list
end end
member do member do
@ -353,6 +354,7 @@ Rails.application.routes.draw do
get 'informs' get 'informs'
post 'update_informs' post 'update_informs'
post 'new_informs' post 'new_informs'
delete 'delete_informs'
get 'online_learning' get 'online_learning'
post 'join_excellent_course' post 'join_excellent_course'
get 'tasks_list' get 'tasks_list'
@ -775,6 +777,10 @@ Rails.application.routes.draw do
end end
post 'callbacks/aliyun_vod', to: 'callbacks/aliyun_vods#create' post 'callbacks/aliyun_vod', to: 'callbacks/aliyun_vods#create'
namespace :wechats do
resource :js_sdk_signature, only: [:create]
end
end end
namespace :admins do namespace :admins do
@ -850,18 +856,29 @@ Rails.application.routes.draw do
end end
resources :shixuns, only: [:index,:destroy] resources :shixuns, only: [:index,:destroy]
resources :shixun_settings, only: [:index,:update] resources :shixun_settings, only: [:index,:update]
resources :department_applies,only: [:index,:destroy] do
collection do
post :merge
end
member do
post :agree
end
end
resources :unit_applies,only: [:index,:destroy,:edit,:update] do
member do
post :agree
end
end
resources :mirror_repositories, only: [:index, :new, :create, :edit, :update, :destroy] do resources :mirror_repositories, only: [:index, :new, :create, :edit, :update, :destroy] do
collection do collection do
post :merge post :merge
get :for_select get :for_select
end end
resources :mirror_scripts, only: [:index, :new, :create, :edit, :update, :destroy] resources :mirror_scripts, only: [:index, :new, :create, :edit, :update, :destroy]
end end
resources :choose_mirror_repositories, only: [:new, :create] resources :choose_mirror_repositories, only: [:new, :create]
resources :departments, only: [:index, :create, :edit, :update, :destroy] do resources :departments, only: [:index, :create, :edit, :update, :destroy] do
resource :department_member, only: [:create, :update, :destroy] resource :department_member, only: [:create, :update, :destroy]
post :merge, on: :collection post :merge, on: :collection
end end
resources :myshixuns, only: [:index] resources :myshixuns, only: [:index]
@ -880,10 +897,6 @@ Rails.application.routes.draw do
end end
end end
namespace :wechats do
resource :js_sdk_signature, only: [:create]
end
#git 认证回调 #git 认证回调
match 'gitauth/*url', to: 'gits#auth', via: :all match 'gitauth/*url', to: 'gits#auth', via: :all

Binary file not shown.

@ -0,0 +1,152 @@
#coding=utf-8
# 执行示例 RAILS_ENV=production bundle exec rake public_classes:student args=3,3056,'2019-03-01','2019-03-31',10,1
# args 第一个参数是subject_id第二个参数是课程course_id
# 第一期时间2018-12-16 至2019-03-31
# 第二期时间2019-04-07 至2019-07-28
#
# 这次学习很有收获,感谢老师提供这么好的资源和细心的服务🎉🎉🎉
#
desc "同步精品课数据"
namespace :public_classes do
if ENV['args']
subject_id = ENV['args'].split(",")[0] # 对应课程的id
course_id = ENV['args'].split(",")[1] # 对应课堂的id
start_time = ENV['args'].split(",")[2] # 表示课程模块
end_time = ENV['args'].split(",")[3] # 表示课程模块
limit = ENV['args'].split(",")[4] # 限制导入的数量
type = ENV['args'].split(",")[5] # 表示课程模块
end
task :student => :environment do
puts "subject_id is #{subject_id}"
puts "course_id is #{course_id}"
puts "start time is #{start_time}"
puts "end time is #{end_time}"
puts "limt is #{limit}"
user_ids = Myshixun.find_by_sql("select distinct(user_id) from myshixuns where created_at between '#{start_time}' and '#{end_time}' and shixun_id in (select shixun_id from stage_shixuns
where stage_id in (select id from stages where subject_id=#{subject_id})) limit #{limit}").map(&:user_id)
puts "user_ids count is #{user_ids.count}"
if user_ids.present?
user_ids.each do |user_id|
puts user_id
begin
CourseMember.create!(course_id: course_id, user_id: user_id, role: 4)
rescue Exception => e
Rails.logger(e.message)
end
end
end
end
task :test_user => :environment do
users = User.where(is_test: true).limit(limit)
users.find_each do |user|
puts user.id
CourseMember.create!(course_id: course_id, user_id: user.id, role: 4)
end
end
# 更新某个课程的某类时间
# 执行示例 RAILS_ENV=production bundle exec rake public_course:time args=-1,2932,1,1
task :time => :environment do
# course_id = ENV['args'].split(",")[0] # 对应课堂的id
# type = ENV['args'].split(",")[1]
course = Course.find(course_id)
case type.to_i
when 1
# 讨论区
messages = Message.where(board_id: course.boards)
messages.each do |message|
created_on = random_time start_time, end_time
puts created_on
message.update_columns(created_on: created_on, updated_on: created_on)
MessageDetail.where(message_id: message.id).each do |detail|
rand_created_on = random_time start_time, end_time
detail.update_columns(created_at: rand_created_on, updated_at: rand_created_on)
end
end
when 2
# 作业
course.homework_commons.each do |homework|
created_at = random_time(start_time, end_time)
publish_time = random_larger_time created_at, start_time, end_time
end_time = random_larger_time publish_time, start_time, end_time
updated_at = end_time
homework.update_columns(publish_time: publish_time, end_time: end_time, created_at: created_at, updated_at: updated_at)
homework.homework_detail_manual.update_columns(comment_status: 6, created_at: created_at, updated_at: updated_at)
homework.student_works.where("work_status !=0 and update_time > '#{end_time}'").update_all(update_time: end_time)
end
when 3
# 试卷
course.exercises.each do |exercise|
created_at = random_time start_time, end_time
publish_time = random_larger_time created_at, start_time, end_time
end_time = random_larger_time publish_time, start_time, end_time
updated_at = end_time
exercise.update_columns(publish_time: publish_time, end_time: end_time, created_at: created_at, updated_at: updated_at, exercise_status: 3)
end
when 4
# 资源
course.attachments.each do |atta|
created_on = random_time start_time, end_time
atta.update_columns(is_publish: 1, created_on: created_on, publish_time: created_on)
end
end
end
task :create_homework_work => :environment do
course = Course.find(course_id)
course.practice_homeworks.each do |homework|
if homework.student_works.count == 0
str = ""
CourseMember.students(course).each do |student|
str += "," if str != ""
str += "(#{homework.id},#{student.user_id}, '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')"
end
if str != ""
sql = "insert into student_works (homework_common_id, user_id, created_at, updated_at) values" + str
ActiveRecord::Base.connection.execute sql
end
end
end
end
def min_swith(time)
puts time
return time < 9 ? "0#{time}" : time
end
def random_time(start_time, end_time)
hour = (6..23).to_a.sample(1).first
min = rand(60)
sec = rand(60)
start_time = Date.parse(start_time)
end_time = Date.parse(end_time)
date = (start_time..end_time).to_a.sample(1).first
time = "#{date} #{min_swith(hour)}:#{min_swith(min)}:#{min_swith(sec)}"
puts time
time
end
def random_larger_time(time, start_time, end_time)
large_time = random_time(start_time, end_time)
while large_time <= time
large_time = random_time(start_time, end_time)
end
large_time
end
end

@ -1,30 +1,22 @@
# bundle exec rake sync:public_message args=149,2903 # bundle exec rake sync:public_message args=149,2903
namespace :sync do namespace :sync do
task :public_message => :environment do if ENV['args']
subject_id = ENV['args'].split(",")[0] # 对应课程的id subject_id = ENV['args'].split(",")[0] # 对应课程的id
shixun_id = ENV['args'].split(",")[1] # 对应课程的id shixun_id = ENV['args'].split(",")[1] # 对应课程的id
board_id = ENV['args'].split(",")[2] board_id = ENV['args'].split(",")[2]
message_id = ENV['args'].split(",")[3] message_id = ENV['args'].split(",")[3]
status = ENV['args'].split(",")[4] # 表示相应的期数 start_time = ENV['args'].split(",")[4] # 表示课程模块
end_time = ENV['args'].split(",")[5] # 表示课程模块
if status.to_i == 1 limit = ENV['args'].split(",")[6] # 限制导入的数量
start_time = '2018-12-16' end
end_time = '2019-04-01'
elsif status.to_i == 2
start_time = '2019-04-07'
end_time = '2019-07-28'
else
# 这种情况是取所有的
start_time = '2015-01-01'
end_time = '2022-07-28'
end
task :public_message => :environment do
shixun_ids = Shixun.find_by_sql("select shixun_id from stage_shixuns where stage_id in (select id from stages where shixun_ids = Shixun.find_by_sql("select shixun_id from stage_shixuns where stage_id in (select id from stages where
subject_id=#{subject_id}) ").map(&:shixun_id) subject_id=#{subject_id}) ").map(&:shixun_id)
discusses = Discuss.where(dis_id: shixun_ids).where("created_at >? and created_at <?", start_time, end_time) discusses = Discuss.where(dis_id: shixun_ids).where("created_at >? and created_at <?", start_time, end_time)
if discusses.present? if discusses.present?
discusses.find_each do |discuss| discusses.limit(limit).find_each do |discuss|
puts discuss.user_id puts discuss.user_id
puts board_id puts board_id
puts message_id puts message_id
@ -35,23 +27,6 @@ namespace :sync do
end end
task :sigle_message => :environment do task :sigle_message => :environment do
subject_id = ENV['args'].split(",")[0] # 对应课程的id
shixun_id = ENV['args'].split(",")[1] # 对应课程的id
board_id = ENV['args'].split(",")[2]
message_id = ENV['args'].split(",")[3]
status = ENV['args'].split(",")[4] # 表示相应的期数
if status.to_i == 1
start_time = '2018-12-16'
end_time = '2019-04-01'
elsif status.to_i == 2
start_time = '2019-04-07'
end_time = '2019-07-28'
else
# 这种情况是取所有的
start_time = '2015-01-01'
end_time = '2022-07-28'
end
if subject_id.to_i == -1 if subject_id.to_i == -1
discusses = Discuss.where("parent_id is null and dis_id=?", shixun_id) discusses = Discuss.where("parent_id is null and dis_id=?", shixun_id)
@ -119,18 +94,8 @@ namespace :sync do
end end
end end
task :board_count => :environment do task :delete_boards => :environment do
Course.find_each do |course| course = Course.find(course_id)
puts course.id course.boards.destroy
begin
messages_count = Message.find_by_sql("select count(*) as count from messages where board_id in (select id from boards where course_id=#{course.id})").first.try(:count)
Board.update_column(messages_count: messages_count)
rescue
end
end
end end
end end

File diff suppressed because one or more lines are too long

@ -128079,6 +128079,7 @@ $(document).on('turbolinks:load', function() {
if ($refuseModal.length > 0) { if ($refuseModal.length > 0) {
var $form = $refuseModal.find('form.admin-common-refuse-form'); var $form = $refuseModal.find('form.admin-common-refuse-form');
var $applyIdInput = $refuseModal.find('.modal-body input[name="apply_id"]'); var $applyIdInput = $refuseModal.find('.modal-body input[name="apply_id"]');
var $applyTitle = $refuseModal.find('.modal-title');
$form.validate({ $form.validate({
errorElement: 'span', errorElement: 'span',
@ -128097,9 +128098,19 @@ $(document).on('turbolinks:load', function() {
var applyId = $link.data('id'); var applyId = $link.data('id');
var url = $link.data('url'); var url = $link.data('url');
var title = $link.data('title');
var type = $link.data('type');
var form_method = "POST";
if(typeof title !== 'undefined'){
$applyTitle.html(title)
}
if(typeof type !== 'undefined'){
form_method = type;
}
$applyIdInput.val(applyId); $applyIdInput.val(applyId);
$form.data('url', url); $form.data('url', url);
$form.data('type', form_method);
}); });
// modal visited fire // modal visited fire
$refuseModal.on('shown.bs.modal', function(){ $refuseModal.on('shown.bs.modal', function(){
@ -128116,9 +128127,10 @@ $(document).on('turbolinks:load', function() {
if ($form.valid()) { if ($form.valid()) {
var url = $form.data('url'); var url = $form.data('url');
var form_method = $form.data('type');
$.ajax({ $.ajax({
method: 'POST', method: form_method,
dataType: 'script', dataType: 'script',
url: url, url: url,
data: $form.serialize(), data: $form.serialize(),
@ -128208,6 +128220,28 @@ $(document).on('turbolinks:load', function() {
// }); // });
} }
}); });
$(document).on('turbolinks:load', function() {
var $editModal = $('.department-apply-edit-modal');
if($editModal.length > 0){
var $form = $editModal.find('form.department-apply-form');
var $applyIdInput = $form.find('input[name="id"]');
$editModal.on('show.bs.modal', function (event) {
var $link = $(event.relatedTarget);
var applyId = $link.data('id');
$applyIdInput.val(applyId);
});
$editModal.on('click', '.submit-btn', function(){
$.ajax({
method: "PUT",
dataType: 'script',
url: "/admins/department_applies/"+ $applyIdInput.val(),
data: $form.serialize(),
}).done(function(){
$editModal.modal('hide');
});
});
}
});
$(document).on('turbolinks:load', function() { $(document).on('turbolinks:load', function() {
if ($('body.admins-departments-index-page').length > 0) { if ($('body.admins-departments-index-page').length > 0) {
var $searchContainer = $('.department-list-form'); var $searchContainer = $('.department-list-form');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -23,7 +23,6 @@
<title>EduCoder</title> <title>EduCoder</title>
<script type="text/javascript"> <script type="text/javascript">
window.__isR = true; window.__isR = true;
// 不支持ie9 ie10 // 不支持ie9 ie10
if ( if (
( navigator.userAgent.indexOf('MSIE 9') != -1 ( navigator.userAgent.indexOf('MSIE 9') != -1
@ -32,8 +31,11 @@
location.pathname.indexOf("/compatibility") == -1) { location.pathname.indexOf("/compatibility") == -1) {
// location.href = './compatibility' // location.href = './compatibility'
location.href = '/compatibility.html' location.href = '/compatibility.html'
}
const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
if (isMobile) {
document.write('<script type="text/javascript" src="/javascripts/wx/jweixin-1.3.0.js"><\/script>');
} }
</script> </script>

@ -3601,9 +3601,9 @@
return text; return text;
}; };
markedRenderer.em = function (text) { markedRenderer.em = function (text, capInput) {
if (text && text.indexOf('$$') != -1) { if (text && text.indexOf('$$') != -1 || (capInput && capInput.indexOf('$$') != -1)) {
return text; return '_' + text + '_';
} else { } else {
return '<em>' + text + '</em>'; return '<em>' + text + '</em>';
} }

File diff suppressed because one or more lines are too long

@ -292,7 +292,62 @@ class App extends Component {
mydisplay:true, mydisplay:true,
}) })
}; };
initWXShare = () => {
if (window.wx) {
const wx = window.wx
const url = '/wechats/js_sdk_signature.json'
axios.post(url, {
url: 'http://pre-newweb.educoder.net',
}).then((response) => {
console.log('got res')
const data = response.data;
wx.config({
debug: false,
appId: data.appid,
timestamp: data.timestamp,
nonceStr: data.nonceStr,
signature: data.signature,
jsApiList: [
'onMenuShareTimeline',//
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo',
'onMenuShareQZone'
]
});
wx.ready(function () {
console.log('wx is ready')
var shareData = {
title: '这是是分享标题',
desc: '这是是摘要',
link: 'http://pre-newweb.educoder.net',
imgUrl: 'http://pre-newweb.educoder.net/images/educoder/index/subject/subject15.jpg'
};
wx.onMenuShareAppMessage(shareData);//分享给好友
wx.onMenuShareTimeline(shareData);//分享到朋友圈
wx.onMenuShareQQ(shareData);//分享给手机QQ
wx.onMenuShareWeibo(shareData);//分享腾讯微博
wx.onMenuShareQZone(shareData);//分享到QQ空间
});
wx.error(function (res) {
console.log('wx is error')
console.log(res)
//alert(res.errMsg);//错误提示
});
}).catch((error) => {
console.log(error)
})
}
}
componentDidMount() { componentDidMount() {
// force an update if the URL changes // force an update if the URL changes
history.listen(() => { history.listen(() => {
this.forceUpdate() this.forceUpdate()
@ -302,7 +357,7 @@ class App extends Component {
}); });
initAxiosInterceptors(this.props) initAxiosInterceptors(this.props)
this.initWXShare()
// //
// axios.interceptors.response.use((response) => { // axios.interceptors.response.use((response) => {
// // console.log("response"+response); // // console.log("response"+response);

@ -1,3 +1,6 @@
export function isDev() { export function isDev() {
return window.location.port === "3007"; return window.location.port === "3007";
} }
// const isMobile
export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));

@ -20,8 +20,7 @@ export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, ap
downloadFile, sortDirections } from './TextUtil' downloadFile, sortDirections } from './TextUtil'
export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil' export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil'
export { isDev as isDev, isMobile } from './Env'
export { isDev as isDev } from './Env'
export { toStore as toStore, fromStore as fromStore } from './Store' export { toStore as toStore, fromStore as fromStore } from './Store'

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 KiB

@ -383,12 +383,12 @@ class Comments extends Component {
{/* <span className="ml5 mr5 color-grey-8">|</span>*/} {/* <span className="ml5 mr5 color-grey-8">|</span>*/}
<a href={`javascript:void(0)`} className="color-grey-8" {(this.props.showReply == undefined || this.props.showReply == true) && <a href={`javascript:void(0)`} className="color-grey-8"
onClick={() => this.initReply(item) } > onClick={() => this.initReply(item) } >
<Tooltip title={ "回复" }> <Tooltip title={ "回复" }>
<i className="iconfont icon-huifu1 mr5"></i> <i className="iconfont icon-huifu1 mr5"></i>
</Tooltip> </Tooltip>
</a> </a>}
{/* <span className="ml5 mr5 color-grey-8">|</span>*/} {/* <span className="ml5 mr5 color-grey-8">|</span>*/}

@ -30,7 +30,8 @@ class Fileslistitem extends Component{
showfiles=(list)=>{ showfiles=(list)=>{
if(list.is_history_file===false){ if(list.is_history_file===false){
// this.props.DownloadFileA(list.title,list.url) // this.props.DownloadFileA(list.title,list.url)
window.location.href=list.url; //window.location.href=list.url;
window.open(list.url, '_blank');
}else{ }else{
let {discussMessage,coursesId}=this.props let {discussMessage,coursesId}=this.props
let file_id=discussMessage.id let file_id=discussMessage.id
@ -49,7 +50,7 @@ class Fileslistitem extends Component{
// //
// } // }
// this.props.DownloadFileA(result.data.title,result.data.url) // this.props.DownloadFileA(result.data.title,result.data.url)
window.location.href=list.url; window.open(list.url, '_blank');
}else{ }else{
this.setState({ this.setState({
Showoldfiles:true, Showoldfiles:true,

@ -287,7 +287,7 @@ class BoardsNew extends Component{
const isAdmin = this.props.isAdmin() const isAdmin = this.props.isAdmin()
const courseId=this.props.match.params.coursesId; const courseId=this.props.match.params.coursesId;
const boardId = this.props.match.params.boardId const boardId = this.props.match.params.boardId
const isCourseEnd = this.props.isCourseEnd()
return( return(
<div className="newMain "> <div className="newMain ">
<AddDirModal {...this.props} <AddDirModal {...this.props}
@ -381,7 +381,7 @@ class BoardsNew extends Component{
<div> <div>
{menu} {menu}
{ {
isAdmin && isAdmin && !isCourseEnd &&
<React.Fragment> <React.Fragment>
<Divider style={{ margin: '4px 0' }} /> <Divider style={{ margin: '4px 0' }} />
<div style={{ padding: '8px', cursor: 'pointer' }} onMouseDown={() => this.refs['addDirModal'].open()}> <div style={{ padding: '8px', cursor: 'pointer' }} onMouseDown={() => this.refs['addDirModal'].open()}>

@ -527,6 +527,7 @@ class TopicDetail extends Component {
// TODO 图片上传地址 // TODO 图片上传地址
const courseId=this.props.match.params.coursesId; const courseId=this.props.match.params.coursesId;
const boardId = this.props.match.params.boardId const boardId = this.props.match.params.boardId
const isCourseEnd = this.props.isCourseEnd()
return ( return (
<div className="edu-back-white edu-class-container edu-position course-message topicDetail" id="yslforum_index_list"> {/* fl with100 */} <div className="edu-back-white edu-class-container edu-position course-message topicDetail" id="yslforum_index_list"> {/* fl with100 */}
<style>{` <style>{`
@ -678,8 +679,8 @@ class TopicDetail extends Component {
} }
</div> </div>
<MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么" {!isCourseEnd && <MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
height={160} showError={true} buttonText={'发表'} className={comments && comments.length && 'borderBottom'}></MemoDetailMDEditor> height={160} showError={true} buttonText={'发表'} className={comments && comments.length && 'borderBottom'}></MemoDetailMDEditor>}
{/* onClick={ this.createNewComment } {/* onClick={ this.createNewComment }
enableReplyTo={true} enableReplyTo={true}
@ -704,6 +705,7 @@ class TopicDetail extends Component {
loadMoreChildComments={this.loadMoreChildComments} loadMoreChildComments={this.loadMoreChildComments}
initReply={this.initReply} initReply={this.initReply}
showRewardButton={false} showRewardButton={false}
showReply={!isCourseEnd}
onlySuperAdminCouldHide={true} onlySuperAdminCouldHide={true}
></Comments> ></Comments>
@ -720,7 +722,7 @@ class TopicDetail extends Component {
{ total_count > REPLY_PAGE_COUNT && { total_count > REPLY_PAGE_COUNT &&
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/> <Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/>
} }
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div> {!isCourseEnd && <div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>}
</div> </div>
</div> </div>

@ -51,10 +51,7 @@ class Boards extends Component{
const sort_type = this.state.sort_type const sort_type = this.state.sort_type
// page_size // page_size
const url = `/boards/${bid}/messages.json?page_size=15&search=${_serachText || ''}&page=${_page}&sort=0&sort_type=${sort_type}` const url = `/boards/${bid}/messages.json?page_size=15&search=${_serachText || ''}&page=${_page}&sort=0&sort_type=${sort_type}`
axios.get(url, { axios.get(encodeURI(url)).then((response) => {
})
.then((response) => {
if (response.data.status == 0 && response.data.data) { if (response.data.status == 0 && response.data.data) {
let _newBoards = response.data.data.messages let _newBoards = response.data.data.messages
// if (_page > 1) { // if (_page > 1) {
@ -327,6 +324,7 @@ class Boards extends Component{
} }
render(){ render(){
const isAdmin = this.props.isAdmin() const isAdmin = this.props.isAdmin()
const isCourseEnd = this.props.isCourseEnd()
const isAdminOrStudent = this.props.isAdminOrStudent() const isAdminOrStudent = this.props.isAdminOrStudent()
let { boardName, searchValue, boards, messages, checkBoxValues, let { boardName, searchValue, boards, messages, checkBoxValues,
checkAllValue, pagination, sort_type, parent_id } = this.state; checkAllValue, pagination, sort_type, parent_id } = this.state;
@ -350,9 +348,9 @@ class Boards extends Component{
searchPlaceholder={ '请输入帖子名称进行搜索' } searchPlaceholder={ '请输入帖子名称进行搜索' }
firstRowRight={ firstRowRight={
<React.Fragment> <React.Fragment>
{ isAdmin && !parent_id && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加目录</WordsBtn> } { !isCourseEnd && isAdmin && !parent_id && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加目录</WordsBtn> }
{ isAdmin && !!parent_id && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>目录重命名</WordsBtn> } { isAdmin && !!parent_id && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>目录重命名</WordsBtn> }
{ isAdminOrStudent && <WordsBtn style="blue" className="" onClick={()=>this.onToBoardsNew()}>我要发贴</WordsBtn> } { !isCourseEnd && isAdminOrStudent && <WordsBtn style="blue" className="" onClick={()=>this.onToBoardsNew()}>我要发贴</WordsBtn> }
</React.Fragment> </React.Fragment>
} }
secondRowLeft={ secondRowLeft={
@ -390,7 +388,7 @@ class Boards extends Component{
return <li onClick={() => this.moveTo(item)} title={item.name}>{item.name}</li> return <li onClick={() => this.moveTo(item)} title={item.name}>{item.name}</li>
}) })
} }
{ isAdmin && { isAdmin && !isCourseEnd &&
<p className="drop_down_btn"> <p className="drop_down_btn">
<a href="javascript:void(0)" className="color-grey-6" <a href="javascript:void(0)" className="color-grey-6"
onClick={()=>this.addDir()} onClick={()=>this.addDir()}

@ -646,7 +646,7 @@ render(){
{/*<span className="color-grey-9 ml3 mr3">&gt;</span>*/} {/*<span className="color-grey-9 ml3 mr3">&gt;</span>*/}
{/*</WordsBtn>*/} {/*</WordsBtn>*/}
<span>{`${current_user ? current_user.username : ''} ${ this.isEdit ? '编辑' : '提交'}作品` }</span> <span>{`${current_user ? current_user.real_name : ''} ${ this.isEdit ? '编辑' : '提交'}作品` }</span>
</p> </p>
<div style={{ width:'100%',height:'75px'}} > <div style={{ width:'100%',height:'75px'}} >

@ -124,7 +124,7 @@ class commonWork extends Component{
if(search!=""){ if(search!=""){
url+="&search="+search; url+="&search="+search;
} }
axios.get((url)).then((result)=>{ axios.get(encodeURI(url)).then((result)=>{
if(result.status==200){ if(result.status==200){
this.setState({ this.setState({
mainList:result.data, mainList:result.data,

@ -63,7 +63,7 @@ class Groupjobbandetails extends Component {
render() { render() {
let{datas}=this.props; let{datas}=this.props;
return ( return (
<div className=" clearfix edu-back-white" ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}> <div className=" clearfix edu-back-white " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
<div className="yslquestionbank1"> <div className="yslquestionbank1">
{ {
datas&&(datas.description===null? datas&&(datas.description===null?
@ -74,7 +74,7 @@ class Groupjobbandetails extends Component {
datas.description===""? datas.description===""?
<NoneData></NoneData> <NoneData></NoneData>
: :
<MarkdownToHtml content={datas.description} selector="work_content" className="mb10"></MarkdownToHtml> <MarkdownToHtml content={datas.description} selector="work_content" className="mb10 yslquesHeigth"></MarkdownToHtml>
// <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/> // <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/>
) )
} }

@ -1,21 +1,20 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom'; import {BrowserRouter as Router,Route,Switch,Link, NavLin} from 'react-router-dom';
import {WordsBtn, ActionBtn,MarkdownToHtml} from 'educoder'; import {WordsBtn, ActionBtn,getImageUrl} from 'educoder';
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form } from "antd";
import axios from 'axios'; import axios from 'axios';
import { import BanksMenu from '../../user/usersInfo/banks/banksMenu'
notification import Loadable from 'react-loadable';
} from "antd"; import Loading from '../../../Loading';
import SendTopics from '../../modals/SendTopics';
import Modals from '../../modals/Modals';
import CoursesListType from '../coursesPublic/CoursesListType';
import Completetaskdetails from './Completetaskdetails';
import '../css/members.css'; import '../css/members.css';
import "../common/formCommon.css"; import "../common/formCommon.css";
import '../css/Courses.css'; import '../css/Courses.css';
import '../css/busyWork.css'; import '../css/busyWork.css';
import '../poll/pollStyle.css'; import '../poll/pollStyle.css';
const Completetaskdetails = Loadable({
loader: () => import('./Completetaskdetails'),
loading: Loading,
})
class Completetaskpage extends Component { class Completetaskpage extends Component {
@ -27,7 +26,8 @@ class Completetaskpage extends Component {
workid:1, workid:1,
isSpin:false, isSpin:false,
datas:[], datas:[],
visible:false visible:false,
banksMenu:undefined
} }
} }
@ -71,7 +71,21 @@ class Completetaskpage extends Component {
crumbArray:[ crumbArray:[
{content:'详情'} {content:'详情'}
] ]
};
const menuData={
tab:'0',//tab选中的index
menuArray:[//tab以及tab路由
{to:`/banks/gtask/${workids}/${this.props.match.params.type}`,content:'内容详情'},
],
category:'gtask',//毕设选题
tos:`/banks/gtask/${workids}/edit/${this.props.match.params.type}`,
id:workids,
is_public:response && response.data && response.data.is_public,
type:this.props.match.params.type,
} }
this.setState({
banksMenu:menuData
})
this.props.initPublic(crumbData); this.props.initPublic(crumbData);
}catch (e) { }catch (e) {
@ -100,130 +114,33 @@ class Completetaskpage extends Component {
}) })
}); });
} }
//发送至相关
sendTopics=()=>{
this.setState({
visible:true
})
}
topicscancelmodel=()=>{
this.setState({
Modalstype:false,
Loadtype:false,
visible:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
checkBoxValues:[],
checkedtype:false
})
}
//删除相关
deletecheckBoxValues=()=>{
this.setState({
Modalstype:true,
Modalstopval:"是否确认删除?",
ModalCancel:this.topicscancelmodel,
ModalSave:this.topicssavedelete,
})
}
topicssavedelete=()=>{
const url = `/question_banks/multi_delete.json`;
axios.delete(url, { data: {
object_id: [this.props.match.params.workid],
object_type:"gtask"
}})
.then((response) => {
if(response.data.status===0){
this.props.showNotification(response.data.message)
window.location.href=`/users/${this.props.current_user.login}/topics/personal`;
}else{
this.props.showNotification(response.data.message)
}
})
.catch(function (error) {
console.log(error);
});
this.topicscancelmodel()
}
render() { render() {
let{datas,visible}=this.state; let {datas} = this.state;
let{
// console.log(119) banksMenu
}=this.state;
let user_id=this.props.current_user&&this.props.current_user.user_id;
let user_type=this.props.current_user&&this.props.current_user.user_identity;
let targetuserid=this.props.data&&this.props.data.id;
return ( return (
<div className="newMain clearfix "> <React.Fragment>
<div className="pd30">
{this.state.Modalstype&&this.state.Modalstype===true?<Modals {
modalsType={this.state.Modalstype} banksMenu &&
modalsTopval={this.state.Modalstopval} <BanksMenu
modalCancel={this.state.ModalCancel} banksMenu={banksMenu}
modalSave={this.state.ModalSave}
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
/>:""}
{/*发送至弹窗*/}
{
visible&&visible===true?
<SendTopics
{...this.state}
{...this.props} {...this.props}
visible={visible} {...this.state}
category={"gtask"} ></BanksMenu>
checkBoxValues={[this.props.match.params.workid]} }
topicscancelmodel={()=>this.topicscancelmodel()} <Switch {...this.props}>
/>:"" <Route path={`/banks/gtask/:workid/${this.props.match.params.type}`}
} render={
(props) => {
<div className={"educontent mt10 mb20"} style={{width: "1200px"}}> return (<Completetaskdetails {...this.props} {...props} {...this.state} datas={datas} />)
}
{/*<div className="educontent mb20">*/} }></Route>
{/* <p className="clearfix mb20 mt10">*/} </Switch>
{/* <a className="btn colorgrey fl hovercolorblue ">题库</a>*/}
{/* <span className="color-grey-9 fl ml3 mr3">&gt;</span>*/}
{/* <a*/}
{/* className=" btn colorgrey fl hovercolorblue "*/}
{/* >详情</a>*/}
{/* </p>*/}
{/*</div>*/}
{/*<div className="educontent mb20">*/}
{/* <p className=" fl color-black summaryname" style={{heigth: "33px"}}>*/}
{/* {datas&&datas.name}*/}
{/* </p>*/}
{/* <CoursesListType*/}
{/* typelist={datas&&datas.is_public?["公开"]:["私有"]}*/}
{/* />*/}
{/*</div>*/}
<div className="edu-back-white ">
<div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list">
<a className={"active ml12"}>内容详情</a>
<a className="fr color-blue font-16 pointer" onClick={()=>this.sendTopics()}>发送</a>
<Link className="fr color-blue font-16 pointer" to={`/banks/gtask/${this.props.match.params.workid}/edit`} >编辑</Link>
<a className="fr color-blue font-16 pointer" onClick={()=>this.deletecheckBoxValues()}>删除</a>
</div>
</div>
</div>
<Completetaskdetails {...this.state} {...this.props} datas={datas}/>
</div> </div>
</div> </React.Fragment>
) )
} }
} }

@ -6,6 +6,7 @@
padding-bottom: 14px !important; padding-bottom: 14px !important;
} }
.yslquesHeigth{ .yslquesHeigth{
width: 100% !important;
min-height: 500px !important; min-height: 500px !important;
} }
@ -62,4 +63,7 @@
} }
.mt24{ .mt24{
margin-top: 24px !important ; margin-top: 24px !important ;
} }
.pd30{
margin-bottom: 30px;
}

@ -1,21 +1,20 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom'; import {BrowserRouter as Router,Route,Switch,Link, NavLin} from 'react-router-dom';
import {WordsBtn, ActionBtn} from 'educoder'; import {WordsBtn, ActionBtn,getImageUrl} from 'educoder';
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form } from "antd"; import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form } from "antd";
import axios from 'axios'; import axios from 'axios';
import { import BanksMenu from '../../user/usersInfo/banks/banksMenu'
notification import Loadable from 'react-loadable';
} from "antd"; import Loading from '../../../Loading';
import CoursesListType from '../coursesPublic/CoursesListType';
import Completetopicdetails from './Completetopicdetails';
import SendTopics from '../../modals/SendTopics';
import Modals from '../../modals/Modals';
import '../css/members.css'; import '../css/members.css';
import "../common/formCommon.css"; import "../common/formCommon.css";
import '../css/Courses.css'; import '../css/Courses.css';
import '../css/busyWork.css'; import '../css/busyWork.css';
import '../poll/pollStyle.css'; import '../poll/pollStyle.css';
const Completetopicdetails = Loadable({
loader: () => import('./Completetopicdetails'),
loading: Loading,
})
class CompletetopicdePage extends Component { class CompletetopicdePage extends Component {
//毕设选题内容详情 //毕设选题内容详情
constructor(props) { constructor(props) {
@ -25,8 +24,8 @@ class CompletetopicdePage extends Component {
workid:1, workid:1,
isSpin:false, isSpin:false,
datas:[], datas:[],
visible:false visible:false,
banksMenu:undefined
} }
} }
@ -68,6 +67,20 @@ class CompletetopicdePage extends Component {
{content:'详情'} {content:'详情'}
] ]
} }
const menuData={
tab:'0',//tab选中的index
menuArray:[//tab以及tab路由
{to:`/banks/gtopic/${workids}/${this.props.match.params.type}`,content:'内容详情'},
],
category:'gtopic',//毕设选题
tos:`/banks/gtopic/${workids}/edit/${this.props.match.params.type}`,
id:workids,
is_public:response && response.data && response.data.is_public,
type:this.props.match.params.type,
}
this.setState({
banksMenu:menuData
})
this.props.initPublic(crumbData); this.props.initPublic(crumbData);
}catch (e) { }catch (e) {
@ -97,127 +110,37 @@ class CompletetopicdePage extends Component {
}); });
} }
//发送至相关
sendTopics=()=>{
this.setState({
visible:true
})
}
topicscancelmodel=()=>{
this.setState({
Modalstype:false,
Loadtype:false,
visible:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
checkBoxValues:[],
checkedtype:false
})
}
//删除相关
deletecheckBoxValues=()=>{
this.setState({
Modalstype:true,
Modalstopval:"是否确认删除?",
ModalCancel:this.topicscancelmodel,
ModalSave:this.topicssavedelete,
})
}
topicssavedelete=()=>{
const url = `/question_banks/multi_delete.json`;
axios.delete(url, { data: {
object_id: [this.props.match.params.workid],
object_type:"gtopic"
}})
.then((response) => {
if(response.data.status===0){
this.props.showNotification(response.data.message)
window.location.href=`/users/${this.props.current_user.login}/topics/personal`;
}else{
this.props.showNotification(response.data.message)
}
})
.catch(function (error) {
console.log(error);
});
this.topicscancelmodel()
}
render() { render() {
let{datas,visible}=this.state; let {tab,datas,visible} = this.state;
// console.log(119)
let user_id=this.props.current_user&&this.props.current_user.user_id;
let user_type=this.props.current_user&&this.props.current_user.user_identity;
let targetuserid=this.props.data&&this.props.data.id;
let{
banksMenu
}=this.state
//
// const common={
// initPublic:this.initPublic,
// }
return ( return (
<div className="newMain clearfix "> <React.Fragment>
{this.state.Modalstype&&this.state.Modalstype===true?<Modals <div className="pd30">
modalsType={this.state.Modalstype} {
modalsTopval={this.state.Modalstopval} banksMenu &&
modalCancel={this.state.ModalCancel} <BanksMenu
modalSave={this.state.ModalSave} banksMenu={banksMenu}
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
/>:""}
{/*发送至弹窗*/}
{
visible&&visible===true?
<SendTopics
{...this.state}
{...this.props} {...this.props}
visible={visible} {...this.state}
category={"gtopic"} ></BanksMenu>
checkBoxValues={[this.props.match.params.workid]} }
topicscancelmodel={()=>this.topicscancelmodel()} <Switch {...this.props}>
/>:"" <Route path={`/banks/gtopic/:workid/${this.props.match.params.type}`}
} render={
(props) => {
return (<Completetopicdetails {...this.props} {...props} {...this.state} datas={datas} />)
<div className={"educontent mt10 mb20"} style={{width: "1200px"}}> }
}></Route>
{/*<div className="educontent mb20">*/} </Switch>
{/* <p className="clearfix mb20 mt10">*/}
{/* <a className="btn colorgrey fl hovercolorblue ">题库</a>*/}
{/* <span className="color-grey-9 fl ml3 mr3">&gt;</span>*/}
{/* <a*/}
{/* className=" btn colorgrey fl hovercolorblue "*/}
{/* >详情</a>*/}
{/* </p>*/}
{/*</div>*/}
{/*<div className="educontent mb20">*/}
{/* <p className=" fl color-black summaryname" style={{heigth: "33px"}}>*/}
{/* {datas&&datas.name}*/}
{/* </p>*/}
{/* <CoursesListType*/}
{/* typelist={datas&&datas.is_public?["公开"]:["私有"]}*/}
{/* />*/}
{/*</div>*/}
<div className="edu-back-white ">
<div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list">
<a className="active ml12" >内容详情</a>
<a className="fr color-blue font-16 pointer" onClick={()=>this.sendTopics()}>发送</a>
<Link className="fr color-blue font-16 pointer" to={`/banks/gtopic/${this.props.match.params.workid}/edit`} >编辑</Link>
<a className="fr color-blue font-16 pointer" onClick={()=>this.deletecheckBoxValues()}>删除</a>
</div>
</div>
</div>
<Completetopicdetails {...this.state} {...this.props} datas={datas}/>
{/*{parseInt(tab) === 1 ? <Completetopicdeswer/>:""}*/}
</div> </div>
</div> </React.Fragment>
) )
} }
} }

@ -72,7 +72,7 @@ class Completetopicdetails extends Component {
datas.description===""? datas.description===""?
<NoneData></NoneData> <NoneData></NoneData>
: :
<MarkdownToHtml content={datas.description} selector="work_content" className="mb10"></MarkdownToHtml> <MarkdownToHtml content={datas.description} selector="work_content" className="mb10 yslquesHeigth"></MarkdownToHtml>
// <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/> // <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/>
) )
@ -94,25 +94,25 @@ class Completetopicdetails extends Component {
<div className="yslboomdivs"> <div className="yslboomdivs">
<p> <p>
<span className="yslboomdivsy">课题类型</span> <span className="yslboomdivsy">课题类型</span>
<span className="yslboomdivsys">{datas&&datas.topic_type===1?"设计":datas&&datas.topic_type===2?"论文":datas&&datas.topic_type===3?"创作":"设计"}</span> <span className="yslboomdivsys">{datas&&datas.topic_type===1?"设计":datas&&datas.topic_type===2?"论文":datas&&datas.topic_type===3?"创作":""}</span>
</p> </p>
<p> <p>
<span className="yslboomdivsy">课题来源</span> <span className="yslboomdivsy">课题来源</span>
<span className="yslboomdivsys">{datas&&datas.topic_source===1?"生产/社会实际":datas&&datas.topic_source===2?"结合科研":datas&&datas.topic_source===3?"其它":"生产/社会实际"}</span> <span className="yslboomdivsys">{datas&&datas.topic_source===1?"生产/社会实际":datas&&datas.topic_source===2?"结合科研":datas&&datas.topic_source===3?"其它":""}</span>
</p> </p>
<p> <p>
<span className="yslboomdivsy">课题性质1</span> <span className="yslboomdivsy">课题性质1</span>
<span className="yslboomdivsys">{datas&&datas.topic_property_first===1?"真题":datas&&datas.topic_property_first===2?"模拟题":"真题"}</span> <span className="yslboomdivsys">{datas&&datas.topic_property_first===1?"真题":datas&&datas.topic_property_first===2?"模拟题":""}</span>
</p> </p>
<p> <p>
<span className="yslboomdivsy">课题性质2</span> <span className="yslboomdivsy">课题性质2</span>
<span className="yslboomdivsys">{datas&&datas.topic_property_second===1?"纵向课题":datas&&datas.topic_property_second===2?"横向课题":datas&&datas.topic_property_second===3?"自选":"纵向课题"}</span> <span className="yslboomdivsys">{datas&&datas.topic_property_second===1?"纵向课题":datas&&datas.topic_property_second===2?"横向课题":datas&&datas.topic_property_second===3?"自选":""}</span>
</p> </p>
</div> </div>
<div className="yslboomdivs mt7"> <div className="yslboomdivs mt7">
<p> <p>
<span className="yslboomdivsy">课题重复情况 </span> <span className="yslboomdivsy">课题重复情况 </span>
<span className="yslboomdivsys">{datas&&datas.topic_repeat===1?"新题":datas&&datas.topic_repeat===2?"往届题,有新要求":datas&&datas.topic_repeat===3?"往届题,无新要求":"新题"}</span> <span className="yslboomdivsys">{datas&&datas.topic_repeat===1?"新题":datas&&datas.topic_repeat===2?"往届题,有新要求":datas&&datas.topic_repeat===3?"往届题,无新要求":""}</span>
</p> </p>
<p> <p>
<span className="yslboomdivsy">调研或实习地点</span> <span className="yslboomdivsy">调研或实习地点</span>

@ -4,6 +4,7 @@
padding-left: 30px !important; padding-left: 30px !important;
} }
.yslquesHeigth{ .yslquesHeigth{
width: 100% !important;
min-height: 500px !important; min-height: 500px !important;
} }
@ -59,4 +60,7 @@
.mb29px{ .mb29px{
padding-top: 14px !important; padding-top: 14px !important;
margin-bottom: 29px !important; margin-bottom: 29px !important;
}
.pd30{
margin-bottom: 30px;
} }

@ -426,7 +426,7 @@ class CoursesBanner extends Component {
render() { render() {
let { Addcoursestypes, coursedata,excellent, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide,AccountProfiletype} = this.state; let { Addcoursestypes, coursedata,excellent, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide,AccountProfiletype} = this.state;
const isCourseEnd = this.props.isCourseEnd()
return ( return (
<div> <div>
{ {
@ -625,7 +625,7 @@ class CoursesBanner extends Component {
) )
: ""} : ""}
{this.props.isStudent()?<a className="fr user_default_btn user_blue_btn mr20 font-18" {this.props.isStudent()?this.props.current_user&&this.props.current_user.course_is_end===true?"":<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={() => this.exitclass()} onClick={() => this.exitclass()}
> 退出课堂 </a>:""} > 退出课堂 </a>:""}
@ -714,24 +714,24 @@ class CoursesBanner extends Component {
position: "relative" position: "relative"
}} }}
> >
<li className={"mt7 mr10im"}> {!isCourseEnd && <li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(true)}> <a onClick={()=>this.addTeacher(true)}>
<span className="color-white fl font-16 bannerurli width100f">添加老师</span> <span className="color-white fl font-16 bannerurli width100f">添加老师</span>
</a> </a>
</li> </li>}
<li className={"mt7 mr10im"}> {!isCourseEnd && <li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(false)}> <a onClick={()=>this.addTeacher(false)}>
<span className="color-white fl font-16 bannerurli width100f">添加助教</span> <span className="color-white fl font-16 bannerurli width100f">添加助教</span>
</a> </a>
</li> </li>}
<li className={"mt7 mr10im"}> {!isCourseEnd && <li className={"mt7 mr10im"}>
<a onClick={()=>this.addStudent()}> <a onClick={()=>this.addStudent()}>
<span className={"color-white fl font-16 bannerurli width100f"}>添加学生</span> <span className={"color-white fl font-16 bannerurli width100f"}>添加学生</span>
</a> </a>
</li> </li>}
{excellent===false? {excellent===false?
<li className={"mt7 mr10im ml10"} style={{overflow:"hidden"}}> <li className={"mt7 mr10im ml10"} style={{overflow:"hidden"}}>
<a> <a>

@ -749,9 +749,9 @@ class Coursesleftnav extends Component{
{/*毕业设计*/} {/*毕业设计*/}
{/*{item.type==="graduation"?<div onClick={()=>this.Navmodalnames(1,"attachment",item.id)}>添加目录</div>:""}*/} {/*{item.type==="graduation"?<div onClick={()=>this.Navmodalnames(1,"attachment",item.id)}>添加目录</div>:""}*/}
{/*讨论区*/} {/*讨论区*/}
{item.type==="board"?<div onClick={e=>this.Navmodalnames(e,6,"board",item.main_id)}>添加目录</div>:""} {item.type==="board"?this.props.current_user&&this.props.current_user.course_is_end===true?"":<div onClick={e=>this.Navmodalnames(e,6,"board",item.main_id)}>添加目录</div>:""}
{/*分班*/} {/*分班*/}
{item.type==="course_group"?<div onClick={e=>this.Navmodalnames(e,2,"course_group",item.id)}>添加分班</div>:""} {item.type==="course_group"?this.props.current_user&&this.props.current_user.course_is_end===true?"":<div onClick={e=>this.Navmodalnames(e,2,"course_group",item.id)}>添加分班</div>:""}
{/*分班*/} {/*分班*/}
{/*{item.type==="course_group"? :""}*/} {/*{item.type==="course_group"? :""}*/}
<div onClick={e=>this.Navmodalnames(e,3,"editname",item.id,item.name)}>重命名</div> <div onClick={e=>this.Navmodalnames(e,3,"editname",item.id,item.name)}>重命名</div>
@ -798,7 +798,6 @@ class Coursesleftnav extends Component{
// console.log("778"); // console.log("778");
// console.log("CoursesLeftNav"); // console.log("CoursesLeftNav");
// console.log(this.props);
// console.log(course_modules); // console.log(course_modules);
return( return(

@ -40,15 +40,17 @@ class AccessoryModal extends Component{
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
let fileList = info.fileList; if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
console.log(fileList) let fileList = info.fileList;
// for(var list of fileList ){ console.log(fileList)
// console.log(fileList) // for(var list of fileList ){
// } // console.log(fileList)
this.setState({ // }
fileList:fileList, this.setState({
Errormessage:false, fileList:fileList,
}); Errormessage:false,
});
}
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {

@ -34,12 +34,15 @@ class AccessoryModal2 extends Component{
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
let fileList = info.fileList; if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed'){
console.log(fileList) let fileList = info.fileList;
// for(var list of fileList ){ console.log(fileList)
// console.log(fileList) // for(var list of fileList ){
// } // console.log(fileList)
this.setState({ fileList }); // }
this.setState({ fileList });
}
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {

@ -253,19 +253,19 @@ class Selectsetting extends Component{
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList; let fileList = info.fileList;
if(info.file.status!="removed"){ if (info.file.status != "removed") {
this.setState({ this.setState({
fileList: appendFileSizeToUploadFileAll(fileList), fileList: appendFileSizeToUploadFileAll(fileList),
fileListtype:true fileListtype: true
}); });
}else{ } else {
this.setState({ this.setState({
fileList: appendFileSizeToUploadFileAll(fileList), fileList: appendFileSizeToUploadFileAll(fileList),
}); });
}
} }
} }
// onAttachmentRemove = (file) => { // onAttachmentRemove = (file) => {

@ -178,7 +178,7 @@ class Showoldfiles extends Component{
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={allfiles.id}> <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={allfiles.id}>
<li className="fl fontlefts"> <li className="fl fontlefts">
<a className={"isabox"} href={allfiles.url} >{allfiles.title}</a> <a className={"isabox"} href={allfiles.url} target="_blank" >{allfiles.title}</a>
{/*{allfiles.is_pdf===false?*/} {/*{allfiles.is_pdf===false?*/}
{/*<a className={"isabox"} href={allfiles.url} >{allfiles.title}</a>:*/} {/*<a className={"isabox"} href={allfiles.url} >{allfiles.title}</a>:*/}
{/*<a className={"isabox"} onClick={()=>this.showfiless(allfiles.url)} >{allfiles.title}</a>*/} {/*<a className={"isabox"} onClick={()=>this.showfiless(allfiles.url)} >{allfiles.title}</a>*/}
@ -198,7 +198,7 @@ class Showoldfiles extends Component{
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={item.id} key={key}> <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={item.id} key={key}>
<li className="fl fontlefts"> <li className="fl fontlefts">
<a className={"isabox"} href={item.url}>{item.title}</a> <a className={"isabox"} href={item.url} target="_blank" >{item.title}</a>
{/*{item.is_pdf===false?*/} {/*{item.is_pdf===false?*/}
{/*<a className={"isabox"} href={item.url}>{item.title}</a>:*/} {/*<a className={"isabox"} href={item.url}>{item.title}</a>:*/}
{/*<a className={"isabox"} onClick={()=>this.showfiless(item.url)} >{item.title}</a>*/} {/*<a className={"isabox"} onClick={()=>this.showfiless(item.url)} >{item.title}</a>*/}

@ -86,17 +86,18 @@ class Sendresource extends Component{
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList; let fileList = info.fileList;
if(info.file.status!="removed"){ if (info.file.status != "removed") {
this.setState({ this.setState({
fileList: appendFileSizeToUploadFileAll(fileList), fileList: appendFileSizeToUploadFileAll(fileList),
fileListtype:true fileListtype: true
}); });
}else{ } else {
this.setState({ this.setState({
fileList: appendFileSizeToUploadFileAll(fileList), fileList: appendFileSizeToUploadFileAll(fileList),
}); });
}
} }
} }

@ -262,7 +262,8 @@ class ExerciseNewCommon extends Component{
if (this._checkIsEditing()) { if (this._checkIsEditing()) {
return; return;
} }
const url = `/exercise_questions/${question_id}/up_down.json`
const url = `/${this.props.exercise_url_questions || 'exercise_questions'}/${question_id}/up_down.json`
axios.post(url, { opr: isUp ? 'up' : 'down'}) axios.post(url, { opr: isUp ? 'up' : 'down'})
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
@ -351,7 +352,7 @@ class ExerciseNewCommon extends Component{
this.props.confirm({ this.props.confirm({
content: `确认要删除这个问题吗?`, content: `确认要删除这个问题吗?`,
onOk: () => { onOk: () => {
const url = `/exercise_questions/${question_id}.json` const url = `/${this.props.exercise_url_questions || 'exercise_questions'}/${question_id}.json`
axios.delete(url) axios.delete(url)
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
@ -609,6 +610,8 @@ class ExerciseNewCommon extends Component{
{/* <i className="iconfont icon-tianjiafangda color-white font-14 mr5" style={{ marginTop: '-1px', display: 'inline-block'}}></i> */} {/* <i className="iconfont icon-tianjiafangda color-white font-14 mr5" style={{ marginTop: '-1px', display: 'inline-block'}}></i> */}
试卷预览 试卷预览
</ActionBtn>} </ActionBtn>}
{this.props.bottomSection && this.props.bottomSection}
</div>} </div>}
</div> </div>
</React.Fragment> </React.Fragment>

@ -38,7 +38,6 @@ class ExerciseReviewAndAnswer extends Component{
super(props); super(props);
this.state={ this.state={
data:undefined, data:undefined,
userName:undefined,
questionPanelFixed:false, questionPanelFixed:false,
e_ReviewInfo:undefined, e_ReviewInfo:undefined,
e_AnswerInfo:undefined, e_AnswerInfo:undefined,
@ -166,7 +165,6 @@ class ExerciseReviewAndAnswer extends Component{
getInfo=()=>{ getInfo=()=>{
this.setState({ this.setState({
courseName:this.props.current_user.course_name, courseName:this.props.current_user.course_name,
userName:this.props.current_user.username,
isSpin:true isSpin:true
}) })
@ -493,7 +491,6 @@ class ExerciseReviewAndAnswer extends Component{
let{ let{
data, data,
questionPanelFixed, questionPanelFixed,
userName,
courseName, courseName,
exercise, exercise,
exercise_types, exercise_types,
@ -545,7 +542,7 @@ class ExerciseReviewAndAnswer extends Component{
width:100%; width:100%;
cursor:pointer; cursor:pointer;
} }
.setRadioStyle span:last-child{ .setRadioStyle > span:last-child{
flex:1; flex:1;
display:flex; display:flex;
} }

@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Spin,Tooltip} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Spin,Tooltip} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl ,bytesToSize,getImageUrl,appendFileSizeToUploadFileAll} from 'educoder'; import { WordsBtn,getUrl ,bytesToSize,getImageUrl,appendFileSizeToUploadFileAll,appendFileSizeToUploadFile} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
const Search = Input.Search; const Search = Input.Search;
@ -49,13 +49,23 @@ class GraduationTasksSubmitedit extends Component{
if(result){ if(result){
console.log(result.data.description); console.log(result.data.description);
const fileList = result.data.attachments.map(item => {
return {
id: item.id,
uid: item.id,
name: appendFileSizeToUploadFile(item),
url: item.url,
filesize: item.filesize,
status: 'done'
}
})
this.setState({ this.setState({
workslist:result.data, workslist:result.data,
attachments:result.data.attachments, attachments:result.data.attachments,
selectmemberslist:result.data.members, selectmemberslist:result.data.members,
selectobjct:result.data.members, selectobjct:result.data.members,
description:result.data.description, description:result.data.description,
fileList:fileList
}) })
if(result.data.task_type===1){ if(result.data.task_type===1){
@ -122,44 +132,34 @@ class GraduationTasksSubmitedit extends Component{
} }
} }
//onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){
// confirm({ this.setState({
// title: '确定要删除这个附件吗?', Modalstype:true,
// okText: '确定', Modalstopval:'确定要删除这个附件吗?',
// cancelText: '取消', ModalSave: ()=>this.deleteAttachment(file),
// // content: 'Some descriptions', ModalCancel:this.cancelAttachment
// onOk: () => { })
// this.deleteAttachment(file) return false;
// }, }
// onCancel() {
// console.log('Cancel'); }
// },
// });
// return false;
// this.setState({
// Modalstype:true,
// Modalstopval:'确定要删除这个附件吗?',
// ModalSave: ()=>this.deleteAttachment(file),
// ModalCancel:this.cancelAttachment
// })
// return false;
//}
cancelAttachment=()=>{ cancelAttachment=()=>{
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
Modalstopval:'确定要删除这个附件吗?', Modalstopval:'',
ModalSave:"", ModalSave:"",
ModalCancel:"" ModalCancel:""
}) })
} }
onAttachmentRemove = (file) => {
deleteAttachment = (file) => {
if(!file.percent || file.percent == 100){ if(!file.percent || file.percent == 100){
let {attachments,fileList}=this.state; let {attachments,fileList}=this.state;
const url = `/attachments/${file}.json` let id=file.response ==undefined ? file.id : file.response.id;
const url = `/attachments/${id}.json`
axios.delete(url, { axios.delete(url, {
}) })
.then((response) => { .then((response) => {
@ -176,17 +176,15 @@ class GraduationTasksSubmitedit extends Component{
} }
} }
// this.setState({
// Modalstype:true,
this.setState({ // Modalstopval:response.data.message,
Modalstype:true, // ModalSave:this.cancelAttachment,
Modalstopval:response.data.message, // Loadtype:true,
ModalSave:this.cancelAttachment, // attachments:newattachments
Loadtype:true, // })
attachments:newattachments
}) this.cancelAttachment();
this.setState((state) => { this.setState((state) => {
const index = state.fileList.indexOf(file); const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice(); const newFileList = state.fileList.slice();
@ -578,7 +576,7 @@ class GraduationTasksSubmitedit extends Component{
{/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{workslist&&workslist.task_name}</Link>*/} {/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{workslist&&workslist.task_name}</Link>*/}
{/*<span className="color-grey-9 ml3 mr3">&gt;</span>*/} {/*<span className="color-grey-9 ml3 mr3">&gt;</span>*/}
{/*</WordsBtn>*/} {/*</WordsBtn>*/}
<span>{this.props.user&&this.props.user.username} 提交作品</span> <span>{this.props.current_user&&this.props.current_user.real_name} 修改作品</span>
</p> </p>
<div style={{ width:'100%',height:'75px'}} > <div style={{ width:'100%',height:'75px'}} >
@ -631,34 +629,34 @@ class GraduationTasksSubmitedit extends Component{
</Upload> </Upload>
{attachments&&attachments.map((item,key)=>{ {/*{attachments&&attachments.map((item,key)=>{*/}
return( {/*return(*/}
<div className="color-grey mt5" {/*<div className="color-grey mt5"*/}
key={key} {/*key={key}*/}
> {/*>*/}
<a className="color-grey ml3"> {/*<a className="color-grey ml3">*/}
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i> {/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
</a> {/*</a>*/}
<a {/*<a*/}
href={item.url} {/*href={item.url}*/}
className="mr12 color9B9B" length="58"> {/*className="mr12 color9B9B" length="58">*/}
{item.title} {/*{item.title}*/}
</a> {/*</a>*/}
<span className="color656565 mt2 color-grey-6 font-12 mr8"> {/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{item.filesize} {/*{item.filesize}*/}
</span> {/*</span>*/}
{item.delete===true? {/*{item.delete===true?*/}
<i className="font-14 iconfont icon-guanbi " {/*<i className="font-14 iconfont icon-guanbi "*/}
id={item.id} {/*id={item.id}*/}
onClick={()=>this.onAttachmentRemove(item.id)} {/*onClick={()=>this.onAttachmentRemoves(item.id)}*/}
aria-hidden="true"> {/*aria-hidden="true">*/}
</i>:""} {/*</i>:""}*/}
</div> {/*</div>*/}
) {/*)*/}
})} {/*})}*/}
{/*<style>*/} {/*<style>*/}
{/*{*/} {/*{*/}

@ -161,43 +161,46 @@ class GraduationTasksSubmitnew extends Component{
cancelAttachment=()=>{ cancelAttachment=()=>{
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
Modalstopval:'确定要删除这个附件吗?', Modalstopval:'',
ModalSave:"", ModalSave:"",
ModalCancel:"" ModalCancel:""
}) })
} }
deleteAttachment = (file) => { deleteAttachment = (file) => {
const url = `/attachments/${file}.json` if(!file.percent || file.percent == 100){
axios.delete(url, { let id = file.response == undefined ? file.id : file.response.id;
}) const url = `/attachments/${id}.json`
.then((response) => { axios.delete(url, {})
if (response.data) { .then((response) => {
// const { status } = response.data; if (response.data) {
if (response.data.status === 0) { // const { status } = response.data;
if (response.data.status === 0) {
console.log('--- success')
this.setState({ console.log('--- success')
Modalstype:true, // this.setState({
Modalstopval:response.data.message, // Modalstype: true,
ModalSave:this.cancelAttachment, // Modalstopval: response.data.message,
Loadtype:true, // ModalSave: this.cancelAttachment,
}) // Loadtype: true,
// })
this.setState((state) => { this.cancelAttachment();
const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice(); this.setState((state) => {
newFileList.splice(index, 1); const index = state.fileList.indexOf(file);
return { const newFileList = state.fileList.slice();
fileList: newFileList, newFileList.splice(index, 1);
}; return {
}); fileList: newFileList,
} };
} });
}) }
.catch(function (error) { }
console.log(error); })
}); .catch(function (error) {
console.log(error);
});
}
} }
inputSearchValue=(e)=>{ inputSearchValue=(e)=>{
@ -549,7 +552,7 @@ render(){
}, },
}; };
// console.log(this.props) console.log(this.props)
@ -598,7 +601,7 @@ render(){
{/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{workslist&&workslist.task_name}</Link>*/} {/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{workslist&&workslist.task_name}</Link>*/}
{/*<span className="color-grey-9 ml3 mr3">&gt;</span>*/} {/*<span className="color-grey-9 ml3 mr3">&gt;</span>*/}
{/*</WordsBtn>*/} {/*</WordsBtn>*/}
<span>{this.props.user&&this.props.user.username} 提交作品</span> <span>{this.props.current_user&&this.props.current_user.real_name} 提交作品</span>
</p> </p>
<div style={{ width:'100%',height:'75px'}} > <div style={{ width:'100%',height:'75px'}} >

@ -84,8 +84,10 @@ class GraduationTasksappraiseMainEditor extends Component{
componentDidMount(){ componentDidMount(){
} }
handleUploadChange = (info) => { handleUploadChange = (info) => {
let fileList = info.fileList; if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
this.setState({ fileList }); let fileList = info.fileList;
this.setState({ fileList });
}
} }
onAttachmentRemove = (file, stateName) => { onAttachmentRemove = (file, stateName) => {
if(!file.percent || file.percent == 100){ if(!file.percent || file.percent == 100){

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

Loading…
Cancel
Save