合并阿里云

dev_local_2
杨树林 5 years ago
commit 50a7f745b9

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

@ -0,0 +1,22 @@
$(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');
});
});
}
});

@ -1,14 +1,22 @@
$(document).on('turbolinks:load', function() {
var $modal = $('.modal.admin-message-modal');
var $submitBtn = $modal.find('.submit-btn');
if ($modal.length > 0) {
$modal.on('hide.bs.modal', function(){
$modal.find('.modal-body').html('');
$submitBtn.unbind();
});
}
});
function showMessageModal(html) {
function showMessageModal(html, callback) {
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.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);
}
});
}
});
}
});

@ -122,14 +122,18 @@ $(document).on('turbolinks:load', function(){
// 导入学生
var $importUserModal = $('.modal.admin-import-user-modal');
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(){
resetFileInputFunc($importUserModal.find('.upload-file-input'));
$importUserModal.find('.file-names').html('选择文件');
$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];
$importUserModal.find('.file-names').html(file ? file.name : '请选择文件');
})
@ -175,7 +179,9 @@ $(document).on('turbolinks:load', function(){
$('body').mLoading('destroy');
$importUserModal.modal('hide');
showMessageModal(buildResultMessage(data));
showMessageModal(buildResultMessage(data), function(){
window.location.reload();
});
},
error: function(res){
$('body').mLoading('destroy');

@ -0,0 +1,71 @@
class Admins::DepartmentAppliesController < Admins::BaseController
before_action :get_apply,only:[:agree,:edit,:update,: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 update
depart_name = params[:name]
ActiveRecord::Base.transaction do
@depart_apply.update_attribute("name",depart_name)
@depart_apply&.department&.update_attribute("name",depart_name)
extra = depart_name + "(#{@depart_apply&.department&.school&.try(:name)})"
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: 3,
extra: extra
}
Tiding.create(tiding_params)
render_success_js
end
end
def destroy
ActiveRecord::Base.transaction do
@depart_apply.update_attribute("status",3)
@depart_apply&.applied_messages&.update_all(status:3)
@depart_apply&.department&.destroy
@depart_apply&.user&.user_extension&.update_attribute("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)
render_success_js
end
end
private
def get_apply
@depart_apply = ApplyAddDepartment.find_by(id:params[:id])
end
end

@ -27,7 +27,7 @@ class CoursesController < ApplicationController
:attahcment_category_list,:export_member_scores_excel, :duplicate_course,
:switch_to_teacher, :switch_to_assistant, :switch_to_student, :exit_course,
: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,
:search_course_list, :get_historical_course_students, :mine, :search_slim, :board_list]
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]
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,
: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,
:change_course_teacher, :course_group_list,
: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_course_modules(params[:course_module_types])
Rails.logger.info("###############course_update_end")
normal_status(0, "成功")
rescue => e
uid_logger_error(e.message)
@ -257,6 +257,12 @@ class CoursesController < ApplicationController
normal_status("更新成功")
end
def delete_informs
inform = @course.informs.find_by(id: params[:inform_id])
inform.destroy!
normal_status("删除成功")
end
def online_learning
@subject = @course.subject
@stages = @subject&.stages

@ -916,7 +916,8 @@ class GamesController < ApplicationController
# 更新关卡状态和一些学习进度
def update_game_parameter game
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的时间方便跟踪用于的学习进度。
game.myshixun.update_column(:updated_at, Time.now)
end

@ -82,8 +82,7 @@ class HomeworkCommonsController < ApplicationController
end
@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.created_at DESC").page(page).per(15)
@homework_commons = @homework_commons.order("position DESC").page(page).per(15)
if @homework_type == 4
@homework_commons = @homework_commons.includes(:homework_detail_manual, :published_settings, :shixuns)

@ -601,7 +601,7 @@ class ShixunsController < ApplicationController
challenges.each_with_index do |challenge, index|
status = (index == 0 ? 0 : 3)
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))
end
end

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

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

@ -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,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,2 @@
//$("#apply-id-<%= @depart_apply.id %>").remove()
//pop_box_new("批准成功", 400, 248);

@ -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 partial: 'admins/department_applies/shared/edit_modal' %>

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

@ -0,0 +1,26 @@
<div class="modal fade department-apply-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>
<div class="modal-body">
<form class="department-apply-form" data-remote="true">
<%= hidden_field_tag(:id, nil) %>
<div class="form-group">
<label for="grade" class="col-form-label">名称:</label>
<%= text_field_tag(:name,nil,class:"form-control",placeholder:"输入新的名称") %>
</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,40 @@
<table class="table table-hover text-center department_applies-list-table">
<thead class="thead-light">
<tr>
<th width="9%">ID</th>
<th width="25%" class="edu-txt-left">部门名称</th>
<th width="20%" class="edu-txt-left">单位名称</th>
<th width="15%">创建者</th>
<th width="15%"><%= sort_tag('创建于', name: 'created_at', path: admins_department_applies_path) %></th>
<th>操作</th>
</tr>
</thead>
<tbody>
<% if applies.present? %>
<% applies.each do |apply| %>
<tr class="department-apply-<%= apply.id %>">
<td><%= apply.id %></td>
<td class="edu-txt-left"> <%= apply.name %></td>
<td class="edu-txt-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, element: ".department-apply-#{apply.id}")
}) %>
<%= javascript_void_link('修改', class: 'action department-apply-action', data: { toggle: 'modal', target: '.department-apply-edit-modal', id: apply.id }) %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>

@ -56,15 +56,14 @@
<%= 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_professional_authentications_path, '职业认证', icon: 'drivers-license', controller: 'admins-professional_authentications') %></li>
<li><%= sidebar_item(admins_department_applies_path, '部门审批', icon: 'building', controller: 'admins-department_applies') %></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_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_video_applies_path, '视频发布', icon: 'film', controller: 'admins-video_applies') %></li>
<% end %>
<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_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>
<% end %>
</li>
<li><%= sidebar_item('/', '返回主站', icon: 'sign-out', controller: 'root') %></li>
</ul>
</nav>

@ -11,7 +11,7 @@
保存成功
</div>
<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>

@ -28,6 +28,7 @@
<% 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 ml-2', data: { toggle: 'modal', target: '.admin-import-course-member-modal'} %>
</div>
<div class="box users-list-container">
@ -35,4 +36,7 @@
</div>
<%= 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>
</div>
<div class="custom-file">
<input type="file" name="file" class="upload-file-input" id="upload-file-input" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
<label class="custom-file-label file-names" for="upload-file-input">选择文件</label>
<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="import-user-input">选择文件</label>
</div>
</div>
<div class="error text-danger"></div>

@ -354,6 +354,7 @@ Rails.application.routes.draw do
get 'informs'
post 'update_informs'
post 'new_informs'
delete 'delete_informs'
get 'online_learning'
post 'join_excellent_course'
get 'tasks_list'
@ -851,18 +852,21 @@ Rails.application.routes.draw do
end
resources :shixuns, only: [:index,:destroy]
resources :shixun_settings, only: [:index,:update]
resources :department_applies,only: [:index,:edit,:update,:destroy] do
member do
post :agree
end
end
resources :mirror_repositories, only: [:index, :new, :create, :edit, :update, :destroy] do
collection do
post :merge
get :for_select
end
resources :mirror_scripts, only: [:index, :new, :create, :edit, :update, :destroy]
end
resources :choose_mirror_repositories, only: [:new, :create]
resources :departments, only: [:index, :create, :edit, :update, :destroy] do
resource :department_member, only: [:create, :update, :destroy]
post :merge, on: :collection
end
resources :myshixuns, only: [:index]

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -128079,6 +128079,7 @@ $(document).on('turbolinks:load', function() {
if ($refuseModal.length > 0) {
var $form = $refuseModal.find('form.admin-common-refuse-form');
var $applyIdInput = $refuseModal.find('.modal-body input[name="apply_id"]');
var $applyTitle = $refuseModal.find('.modal-title');
$form.validate({
errorElement: 'span',
@ -128097,9 +128098,19 @@ $(document).on('turbolinks:load', function() {
var applyId = $link.data('id');
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);
$form.data('url', url);
$form.data('type', form_method);
});
// modal visited fire
$refuseModal.on('shown.bs.modal', function(){
@ -128116,9 +128127,10 @@ $(document).on('turbolinks:load', function() {
if ($form.valid()) {
var url = $form.data('url');
var form_method = $form.data('type');
$.ajax({
method: 'POST',
method: form_method,
dataType: 'script',
url: url,
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() {
if ($('body.admins-departments-index-page').length > 0) {
var $searchContainer = $('.department-list-form');

File diff suppressed because one or more lines are too long

@ -284,6 +284,14 @@ const Completetaskpage =Loadable({
loader: () => import('../../modules/courses/completetaskdetails/Completetaskpage'),
loading: Loading,
});
//排序
const Ordering=Loadable({
loader: () => import('../../modules/courses/ordering/Ordering'),
loading: Loading,
});
class CoursesIndex extends Component{
constructor(props) {
super(props)
@ -470,6 +478,13 @@ class CoursesIndex extends Component{
// console.log(commons)
return (
<Switch {...this.props}>
{/*排序*/}
<Route path="/courses/:coursesId/ordering/:ordering_type/:main_id"
render={
(props) => (<Ordering {...this.props} {...props} {...this.state} />)
}
></Route>
{/*毕设任务题库详情*/}
<Route path="/banks/gtopic_topics/:workid"
render={

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

@ -1,80 +1,81 @@
.polllisthover:hover {
box-shadow: 0px 2px 6px rgba(51,51,51,0.09);
opacity: 1;
border-radius: 2px;
}
.workList_Item{
/* padding:20px 30px; */
display: flex;
background-color: #fff;
margin-bottom: 20px;
padding-top: 10px;
}
p span{
cursor: default;
}
.mt-5{ margin-top:-5px;}
/* <20><><EFBFBD>ѡ<EFBFBD><D1A1>tab */
.bankNav li{
float: left;
margin-right: 20px;
}
.bankNav li:last-child{
margin-right: 0px;
}
.bankNav li.active a{
color: #fff!important;
background-color: #4CACFF;
}
.bankNav li a{
display: block;
padding:0px 10px;
height: 28px;
line-height: 28px;
background-color: #F5F5F5;
border-radius: 36px;
color: #666666!important;
}
.task_menu_ul{
width: 600px;
}
.task_menu_ul .ant-menu-item,.task_menu_ul .ant-menu-submenu-title{
padding:0px;
margin-right: 30px;
line-height: 68px;
font-size: 16px;
}
.ant-menu{
color: #05101a;
}
.task_menu_ul .ant-menu-horizontal{
border-bottom: none;
}
.task_menu_ul .ant-menu-horizontal > .ant-menu-item:hover{
border-bottom:2px solid transparent;
}
.task_menu_ul .ant-menu-horizontal > .ant-menu-item-selected{
border-bottom: 2px solid #4CACFF !important;
}
.sourceTag a{
display: block;
float: left;
background-color:#E5F3FF;
padding: 0px 10px;
height: 24px;
line-height: 24px;
color: #4E7A9B;
margin:5px 0px 5px 10px;
}
.sourceTag a.active{
color: #FFFFFF;background-color:#4CACFF;
}
.polllisthover:hover {
box-shadow: 0px 2px 6px rgba(51,51,51,0.09);
opacity: 1;
border-radius: 2px;
}
.workList_Item{
/* padding:20px 30px; */
display: flex;
background-color: #fff;
margin-bottom: 20px;
padding-top: 10px;
}
p span{
cursor: default;
}
.mt-5{ margin-top:-5px;}
/* <20><><EFBFBD>ѡ<EFBFBD><D1A1>tab */
.bankNav li{
float: left;
margin-right: 20px;
}
.bankNav li:last-child{
margin-right: 0px;
}
.bankNav li.active a{
color: #fff!important;
background-color: #4CACFF;
}
.bankNav li a{
display: block;
padding:0px 10px;
height: 28px;
line-height: 28px;
background-color: #F5F5F5;
border-radius: 36px;
color: #666666!important;
}
.task_menu_ul{
width: 600px;
}
.task_menu_ul .ant-menu-item,.task_menu_ul .ant-menu-submenu-title{
padding:0px;
margin-right: 30px;
line-height: 68px;
font-size: 16px;
}
.ant-menu{
color: #05101a;
}
.task_menu_ul .ant-menu-horizontal{
border-bottom: none;
}
.task_menu_ul .ant-menu-horizontal > .ant-menu-item:hover{
border-bottom:2px solid transparent;
}
.task_menu_ul .ant-menu-horizontal > .ant-menu-item-selected{
border-bottom: 2px solid #4CACFF !important;
}
.sourceTag a{
display: block;
float: left;
background-color:#E5F3FF;
padding: 0px 10px;
height: 24px;
line-height: 24px;
color: #4E7A9B;
margin:5px 0px 5px 10px;
}
.sourceTag a.active{
color: #FFFFFF;background-color:#4CACFF;
}

@ -545,7 +545,7 @@ class ExerciseReviewAndAnswer extends Component{
width:100%;
cursor:pointer;
}
.setRadioStyle span:last-child{
.setRadioStyle > span:last-child{
flex:1;
display:flex;
}

@ -122,44 +122,44 @@ class GraduationTasksSubmitedit extends Component{
}
}
//onAttachmentRemove = (file) => {
// confirm({
// title: '确定要删除这个附件吗?',
// okText: '确定',
// cancelText: '取消',
// // content: 'Some descriptions',
// onOk: () => {
// this.deleteAttachment(file)
// },
// onCancel() {
// console.log('Cancel');
// },
// });
// return false;
// this.setState({
// Modalstype:true,
// Modalstopval:'确定要删除这个附件吗?',
// ModalSave: ()=>this.deleteAttachment(file),
// ModalCancel:this.cancelAttachment
// })
// return false;
//}
onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){
this.setState({
Modalstype:true,
Modalstopval:'确定要删除这个附件吗?',
ModalSave: ()=>this.deleteAttachment(file),
ModalCancel:this.cancelAttachment
})
return false;
}
}
onAttachmentRemoves = (file) => {
if(!file.percent || file.percent == 100){
this.setState({
Modalstype:true,
Modalstopval:'确定要删除这个附件吗?',
ModalSave: ()=>this.deleteAttachments(file),
ModalCancel:this.cancelAttachment
})
return false;
}
}
cancelAttachment=()=>{
this.setState({
Modalstype:false,
Modalstopval:'确定要删除这个附件吗?',
Modalstopval:'',
ModalSave:"",
ModalCancel:""
})
}
onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){
deleteAttachments = (id) => {
let {attachments,fileList}=this.state;
const url = `/attachments/${file}.json`
const url = `/attachments/${id}.json`
axios.delete(url, {
})
.then((response) => {
@ -168,25 +168,66 @@ class GraduationTasksSubmitedit extends Component{
if (response.data.status === 0) {
console.log('--- success')
let newattachments=attachments;
if(file.uid===undefined){
for(var i=0; i<newattachments.length; i++){
if(newattachments[i].id===file.id){
if(newattachments[i].id===id){
newattachments.splice(i, 1);
}
}
}
this.setState({
Modalstype:true,
Modalstopval:response.data.message,
ModalSave:this.cancelAttachment,
Loadtype:true,
attachments:newattachments
})
this.cancelAttachment();
this.setState((state) => {
const index = state.fileList.indexOf(id);
const newFileList = state.fileList.slice();
newFileList.splice(index, 1);
return {
fileList: newFileList
};
});
}
}
})
.catch(function (error) {
console.log(error);
});
}
deleteAttachment = (file) => {
if(!file.percent || file.percent == 100){
let {attachments,fileList}=this.state;
let id=file.response ==undefined ? file.id : file.response.id;
const url = `/attachments/${id}.json`
axios.delete(url, {
})
.then((response) => {
if (response.data) {
// const { status } = response.data;
if (response.data.status === 0) {
console.log('--- success')
let newattachments=attachments;
if(file.uid===undefined){
for(var i=0; i<newattachments.length; i++){
if(newattachments[i].id===file.id){
newattachments.splice(i, 1);
}
}
}
// this.setState({
// Modalstype:true,
// Modalstopval:response.data.message,
// ModalSave:this.cancelAttachment,
// Loadtype:true,
// attachments:newattachments
// })
this.cancelAttachment();
this.setState((state) => {
const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice();
@ -578,7 +619,7 @@ class GraduationTasksSubmitedit extends Component{
{/*<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>*/}
{/*</WordsBtn>*/}
<span>{this.props.user&&this.props.user.username} 提交作品</span>
<span>{this.props.user&&this.props.user.username} 修改作品</span>
</p>
<div style={{ width:'100%',height:'75px'}} >
@ -653,7 +694,7 @@ class GraduationTasksSubmitedit extends Component{
{item.delete===true?
<i className="font-14 iconfont icon-guanbi "
id={item.id}
onClick={()=>this.onAttachmentRemove(item.id)}
onClick={()=>this.onAttachmentRemoves(item.id)}
aria-hidden="true">
</i>:""}
</div>

@ -161,43 +161,46 @@ class GraduationTasksSubmitnew extends Component{
cancelAttachment=()=>{
this.setState({
Modalstype:false,
Modalstopval:'确定要删除这个附件吗?',
Modalstopval:'',
ModalSave:"",
ModalCancel:""
})
}
deleteAttachment = (file) => {
const url = `/attachments/${file}.json`
axios.delete(url, {
})
.then((response) => {
if (response.data) {
// const { status } = response.data;
if (response.data.status === 0) {
console.log('--- success')
this.setState({
Modalstype:true,
Modalstopval:response.data.message,
ModalSave:this.cancelAttachment,
Loadtype:true,
})
this.setState((state) => {
const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice();
newFileList.splice(index, 1);
return {
fileList: newFileList,
};
});
}
}
})
.catch(function (error) {
console.log(error);
});
if(!file.percent || file.percent == 100){
let id = file.response == undefined ? file.id : file.response.id;
const url = `/attachments/${id}.json`
axios.delete(url, {})
.then((response) => {
if (response.data) {
// const { status } = response.data;
if (response.data.status === 0) {
console.log('--- success')
// this.setState({
// Modalstype: true,
// Modalstopval: response.data.message,
// ModalSave: this.cancelAttachment,
// Loadtype: true,
// })
this.cancelAttachment();
this.setState((state) => {
const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice();
newFileList.splice(index, 1);
return {
fileList: newFileList,
};
});
}
}
})
.catch(function (error) {
console.log(error);
});
}
}
inputSearchValue=(e)=>{

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

@ -103,7 +103,7 @@ class GraduationTasksedit extends Component{
}
// 附件相关 START
handleChange = (info) => {
if(info.file.status == "done" || info.file.status == "uploading"){
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList;
// console.log(fileList)
// for(var list of fileList ){

@ -2,11 +2,12 @@ import React, {Component} from "React";
import {Form, Select, Input, Button, Checkbox, Upload, Icon, message, Modal} from "antd";
import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import {WordsBtn, getUrl,bytesToSize,appendFileSizeToUploadFileAll} from 'educoder';
import {WordsBtn, getUrl,bytesToSize,appendFileSizeToUploadFileAll , getUploadActionUrl} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
import '../../css/Courses.css';
const {Option} = Select;
const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm;
@ -127,7 +128,7 @@ class GraduationTasksnew extends Component {
}
// 附件相关 START
handleChange = (info) => {
if(info.file.status == "done" || info.file.status == "uploading"){
if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){
let fileList = info.fileList;
// for(var list of fileList ){
@ -174,7 +175,26 @@ class GraduationTasksnew extends Component {
onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
this.props.confirm({
content: '确定要删除这个附件吗?',
okText: '确定',
cancelText: '取消',
// content: 'Some descriptions',
onOk: () => {
this.deleteAttachment(file)
},
onCancel() {
console.log('Cancel');
},
});
return false;
}
}
deleteAttachment = (file) =>{
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
// const url = `/attachments/${file}.json`
axios.delete(url, {})
.then((response) => {
@ -198,8 +218,6 @@ class GraduationTasksnew extends Component {
.catch(function (error) {
console.log(error);
});
}
}
//滚动
@ -267,7 +285,7 @@ class GraduationTasksnew extends Component {
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
action: `${getUploadActionUrl()}`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
beforeUpload: (file) => {

@ -11,7 +11,7 @@ import {getUrl} from 'educoder';
import "../../common/formCommon.css"
import '../style.css'
import '../../css/Courses.css'
import { WordsBtn, City } from 'educoder'
import { WordsBtn, City , getUploadActionUrl } from 'educoder'
import {Link} from 'react-router-dom'
// import City from './City'
@ -211,14 +211,16 @@ class GraduateTopicNew extends Component{
// 附件相关 START
handleChange = (info) => {
let fileList = info.fileList;
this.setState({ fileList });
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList;
this.setState({ fileList });
}
}
onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){
confirm({
title: '确定要删除这个附件吗?',
this.props.confirm({
content: '确定要删除这个附件吗?',
okText: '确定',
cancelText: '取消',
// content: 'Some descriptions',
@ -307,7 +309,7 @@ class GraduateTopicNew extends Component{
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
action: `${getUploadActionUrl()}`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
beforeUpload: (file) => {

@ -159,8 +159,10 @@ class GraduateTopicPostWorksNew extends Component{
}
// 附件相关 START
handleChange = (info) => {
let fileList = info.fileList;
this.setState({ fileList });
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList;
this.setState({ fileList });
}
}
onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){

@ -574,7 +574,7 @@ class CoursesNew extends Component {
{this.props.match.params.coursesId === undefined ?"翻转课堂":dataname}
</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl cdefault">{this.props.match.params.coursesId === undefined ?"新建课堂":"编辑课堂"}</WordsBtn>
<span className="fl cdefault">{this.props.match.params.coursesId === undefined ?"新建课堂":"编辑课堂"}</span>
</p>

@ -696,7 +696,7 @@ class Goldsubject extends Component {
<a className="btn colorgrey fl hovercolorblue " href={Whethertocreateanewclassroom===true?"/courses":this.props.current_user&&this.props.current_user.first_category_url}
>{Whethertocreateanewclassroom===true?"翻转课堂":name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl cdefault">{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</WordsBtn>
<span className="fl cdefault">{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</span>
</p>
<div style={{width: '100%', height: '50px'}}>

@ -0,0 +1,109 @@
.color4CACFF{
color: #4CACFF !important;
}
.orderingbox{
width:1200px;
height:80px;
background:rgba(255,255,255,1);
box-shadow:3px 3px 3px rgba(237,237,237,1);
opacity:1;
border-radius:2px 2px 0px 0px;
padding: 24px;
box-sizing: border-box;
line-height: 34px;
}
.orderingbtnright{
width: 90px;
height: 38px;
background: rgba(255,255,255,1);
border: 1px solid rgba(228,228,228,1);
box-shadow: 0px 1px 1px rgba(0,0,0,0.16);
opacity: 1;
border-radius: 4px;
}
.orderingbtnleft{
width: 90px;
height: 38px;
background: rgba(76,172,255,1);
box-shadow: 0px 1px 1px rgba(0,0,0,0.16);
opacity: 1;
border-radius: 4px;
}
.pd1323s{
padding: 10px 6px 25px 40px;
cursor: pointer;
}
.orderSection{
height: 80px;
padding-top: 16px;
}
.ordermidbox{
width: 960px;
height: 120px;
background: rgba(255,255,255,1);
/* border: 1px solid rgba(205,205,205,1); */
opacity: 1;
margin-left:120px;
}
.orderfonttop{
font-size: 16px !important;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 28px;
color: rgba(5,16,26,1);
opacity: 1;
}
.orderfontbom{
font-size:14px;
font-family:Microsoft YaHei;
font-weight:400;
line-height:25px;
color:rgba(153,153,153,1);
opacity:1;
}
.ordermidbox:hover {
box-shadow: 0px 2px 6px rgba(51,51,51,0.09);
opacity: 1;
}
.mb200{
margin-bottom: 200px;
}
.maxwidth865s{
max-width: 865px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.maxwidth795 {
max-width:795px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
}
.ordermidbox:active{
background:rgba(248,247,255,1);
border:1px solid rgba(76,172,255,1);
}
.ordermidbox:focus{
background:rgba(248,247,255,1);
border:1px solid rgba(76,172,255,1);
}
.ordermiddiv{
min-height: 500px;
}

@ -0,0 +1,297 @@
import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Breadcrumb,Button } from "antd";
import { WordsBtn,on, off, trigger } from 'educoder';
import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd';
import axios from'axios';
import Modals from '../../modals/Modals';
import '../css/members.css';
import '../css/busyWork.css';
import './Ordering.css';
import NoneData from "../coursesPublic/NoneData";
const reorder = (list, startIndex, endIndex) => {
const result = Array.from(list);
const [removed] = result.splice(startIndex, 1);
result.splice(endIndex, 0, removed);
return result;
};
class Ordering extends Component{
constructor(props){
super(props);
this.state={
isSpin:false,
antIcon:false,
datas:undefined,
windowsscrollTop:false,
newtask_ids:[]
}
}
componentDidMount() {
this.setState({
isSpin:true
})
let coursesId=this.props.match.params.coursesId;
let ordering_type=this.props.match.params.ordering_type;
let url=`/courses/${coursesId}/tasks_list.json`;
axios.get((url),{params:{
container_type:ordering_type
}}).then((result)=>{
if(result){
this.setState({
datas:result.data.tasks,
isSpin:false
})
}
}).catch((error)=>{
console.log(error);
this.setState({
isSpin:false
})
})
window.addEventListener('scroll', this.handleScroll.bind(this)) //监听滚动
// window.addEventListener('resize', this.handleResize.bind(this)) //监听窗口大小改变
}
// componentWillUnmount() { //一定要最后移除监听器以防多个组件之间导致this的指向紊乱
// window.removeEventListener('scroll', this.handleScroll.bind(this))
// window.removeEventListener('resize', this.handleResize.bind(this))
// }
handleScroll=(e)=>{
// console.log(
// '浏览器滚动事件',
// e.srcElement.scrollingElement.scrollTop,
// e.srcElement.scrollingElement.scrollHeight
// )
//e.srcElement.scrollingElement.scrollTop为距离滚动条顶部高度
// e.srcElement.scrollingElement.scrollHeight为整个文档高度
if(e.srcElement.scrollingElement.scrollTop>60){
this.setState({
windowsscrollTop:true,
})
}
if(e.srcElement.scrollingElement.scrollTop===0){
this.setState({
windowsscrollTop:false
})
}
}
//
// handleResize = e => {
// console.log('浏览器窗口大小改变事件', e.target.innerWidth)
// }
onDragEnd=(result)=>{
if(result.destination!=null&&result.destination!=undefined){
let {datas}=this.state;
if (!result.destination) {
console.log('dropped outside the list')
return;
}
if (result.destination.index === result.source.index) {
console.log('the same')
return;
}
const shixuns_list = reorder(
datas,
result.source.index,
result.destination.index
);
let newtask_ids=[]
shixuns_list.map((item,key)=>{
newtask_ids.push(item.task_id)
})
this.setState({
datas:shixuns_list,
newtask_ids:newtask_ids
})
}
}
updatalist=()=>{
let {datas,newtask_ids,isSpin}=this.state;
if(newtask_ids.length===0){
this.props.showNotification("请先移动需要排序的实训作业任务");
return
}
if(isSpin===true){
return
}
this.setState({
isSpin:true
})
let coursesId=this.props.match.params.coursesId;
let ordering_type=this.props.match.params.ordering_type;
let url=`/courses/${coursesId}/update_task_position.json`;
axios.post(url,{
container_type:ordering_type,
task_ids:newtask_ids
}).then((result)=>{
if(result.data.status===0){
this.props.showNotification(result.data.message);
this.setState({
isSpin:false,
datas:datas,
newtask_ids:[]
});
this.goback()
}else{
this.setState({
isSpin:false,
});
}
}).catch((error)=>{
this.setState({
isSpin:false,
});
})
}
goback=()=>{
window.location.href=`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.main_id}`
}
render(){
let {
datas,
Modalstype,
windowsscrollTop,
}=this.state;
let main_id=this.props.match.params.main_id;
let category_id=this.props.match.params.category_id;
console.log(this.props)
console.log(window)
let positiontype=null;
if(windowsscrollTop===true){
positiontype={position:'fixed',zIndex:'1000',top: '0px'}
}else{
positiontype={}
}
return(
<div className={"mb200"}>
{/*提示*/}
{Modalstype&&Modalstype===true?<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
antIcon={this.state.antIcon}
/>:""}
<div className="educontent clearfix">
{windowsscrollTop===false?<div className={"mt20 mb20"}>
<Breadcrumb separator=">">
<Breadcrumb.Item href={this.props.current_user&&this.props.current_user.first_category_url}>{this.props.current_user&&this.props.current_user.course_name}</Breadcrumb.Item>
<Breadcrumb.Item href={`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.main_id}`}>实训作业</Breadcrumb.Item>
<Breadcrumb.Item>调整排序</Breadcrumb.Item>
</Breadcrumb>
</div>:""}
<p className="clearfix bor-bottom-greyE edu-back-white orderingbox"
style={positiontype}
>
<span>温馨提示请在列表中长按鼠标左键进行拖放排序完成排序后请点击保存</span>
<Button className="fr orderingbtnleft" type="primary" onClick={()=>this.updatalist()}>保存</Button>
<Button className="fr mr30 orderingbtnright" onClick={()=>this.goback()}>取消</Button>
</p>
</div>
<Spin size="large" spinning={this.state.isSpin} >
<DragDropContext onDragEnd={this.onDragEnd} >
<Droppable droppableId={this.props.match.params.ordering_type}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={"educontent mb50 mt40 droppableul ordermiddiv"}
onScroll={this.contentViewScrolledit}
>
{datas===undefined?"":
datas.map((item, index) => {
return (
<Draggable
key={item.task_id}
draggableId={item.task_id}
index={index}
className={"TabsWarps"}
>
{(provided, snapshot) => (
<div className={"mt30 edu-back-white pd1323s relativef ordermidbox"}
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<div className={"clearfix"}>
<div className={"item-body"}>
<div className={"clearfix ds pr orderSection"}>
<p title={item.task_name} className="font-16 color-dark maxwidth865s orderfonttop"
href={`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${item.task_id}/list?tab=0`}>{item.task_name}</p>
<p className={"color-grey panel-lightgrey mt16 "}>
<span className="topicswidth400">
<span className="topsics100 color-grey9 orderfontbom mr20 maxwidth795">{item.user_name}</span>
<span className="mr50 color-grey9 orderfontbom maxwidth795">{item.category}</span>
</span>
</p>
</div>
</div>
</div>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
{
datas===undefined?"":datas.length===0? <NoneData></NoneData>:""
}
</Spin>
</div>
)
}
}
export default Ordering;

@ -831,20 +831,7 @@ class PollNew extends Component {
//保存并继续,即提交本题的新建并继续创建一个相同的题(该新题处于编辑模式,题目和选项不要清空)
Deleteadddomtwo = (indexo, object,bool) => {
var thiss = this;
if(bool === true){
this.setState({
q_countst: 1,
bindingid:undefined,
Newdisplay:false,
newoption: false,
})
}else {
this.setState({
q_countst: 1,
Newdisplay:false,
newoption: false,
})
}
var poll_questionslength = this.state.poll_questions.length;
// console.log("deleteadddomtwo|||||||||||||||||||||||||||||||||||||||||\\");
@ -995,71 +982,89 @@ class PollNew extends Component {
}
var questiontwo = {};
var other = [];
var option = [];
var answerstwos = [];
var answerstwoss = [];
for (var y = 0; y < object.question.answers.length; y++) {
if (object.question.answers[y].answer_text === "其他") {
var dataone = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
}
other.push(object.question.answers[y].answer_text);
answerstwos.push(dataone);
} else {
var datatwo = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
if(object.question.max_choices){
if(object.question.max_choices>0){
if(object.question.min_choices){
if(object.question.min_choices===0){
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
option.push(object.question.answers[y].answer_text)
answerstwoss.push(datatwo);
}
}
var arrc = option.concat(other);
var answers = answerstwoss.concat(answerstwos);
// var id
// try {
// id = newarrpoll[newarrpoll.length - 1].question.id + 1;
// } catch (e) {
// id = 1;
// }
questiontwo = {
"id": null,
"is_necessary": object.question.is_necessary,
"question_number": 2,
"question_title": object.question.question_title,
"question_type": 2,
"max_choices": object.question.max_choices,
"min_choices": object.question.min_choices,
"new": "",
"answers": answers
};
question = {"question": questiontwo};
var insindex = null;
if (this.state.problemtopicbool === true) {
insindex = this.state.problemtopic;
if(object.question.min_choices){
if(object.question.min_choices>0){
if(object.question.max_choices){
if(object.question.max_choices===0){
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}
}
this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, insindex,object.question.answers.length);
//插入多选题
// if (object.question.max_choices > arrc.length) {
// // console.log("选择题的最大可选项不能大于选项数")
// this.props.showNotification(`选择题的最大可选项不能大于选项数`);
//
// return;
// }
// if (object.question.min_choices === 0) {
// // console.log("选择题的最大可选项不能小于2项目")
// this.props.showNotification(`选择题的最大可选项不能小于2项目`);
//
// return;
//
// }
// newarrpoll.push(question);
newarrpoll.splice(thiss.state.Insertposition, 0, question);
var questiontwo = {};
var other = [];
var option = [];
var answerstwos = [];
var answerstwoss = [];
for (var y = 0; y < object.question.answers.length; y++) {
if (object.question.answers[y].answer_text === "其他") {
var dataone = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
}
other.push(object.question.answers[y].answer_text);
answerstwos.push(dataone);
} else {
var datatwo = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
}
option.push(object.question.answers[y].answer_text)
answerstwoss.push(datatwo);
}
}
var arrc = option.concat(other);
var answers = answerstwoss.concat(answerstwos);
// var id
// try {
// id = newarrpoll[newarrpoll.length - 1].question.id + 1;
// } catch (e) {
// id = 1;
// }
questiontwo = {
"id": null,
"is_necessary": object.question.is_necessary,
"question_number": 2,
"question_title": object.question.question_title,
"question_type": 2,
"max_choices": object.question.max_choices,
"min_choices": object.question.min_choices,
"new": "",
"answers": answers
};
question = {"question": questiontwo};
var insindex = null;
if (this.state.problemtopicbool === true) {
insindex = this.state.problemtopic;
}
this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, insindex,object.question.answers.length);
newarrpoll.splice(thiss.state.Insertposition, 0, question);
} else if (object.question.question_type === 3) {
//插入主观题
var answers = [];
@ -1196,74 +1201,95 @@ class PollNew extends Component {
}
}
}
if(object.question.max_choices){
if(object.question.max_choices>0){
if(object.question.min_choices){
if(object.question.min_choices===0){
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}
}
if(object.question.min_choices){
if(object.question.min_choices>0){
if(object.question.max_choices){
if(object.question.max_choices===0){
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}
}
// if (object.question.max_choices < object.question.min_choices) {
// this.props.showNotification('可选的最大限制不能小于最小限制!');
//
// return;
// }
var questiontwo = {};
var other = [];
var option = [];
var answerstwos = [];
var answerstwoss = [];
for (var y = 0; y < object.question.answers.length; y++) {
if (object.question.answers[y].answer_text === "其他") {
var dataone = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
var questiontwo = {};
var other = [];
var option = [];
var answerstwos = [];
var answerstwoss = [];
for (var y = 0; y < object.question.answers.length; y++) {
if (object.question.answers[y].answer_text === "其他") {
var dataone = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
}
other.push(object.question.answers[y].answer_text);
answerstwos.push(dataone);
} else {
var datatwo = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
}
option.push(object.question.answers[y].answer_text)
answerstwoss.push(datatwo);
}
other.push(object.question.answers[y].answer_text);
answerstwos.push(dataone);
}
var arrc = option.concat(other);
var answers = answerstwoss.concat(answerstwos);
questiontwo = {
"id": object.question.id,
"is_necessary": object.question.is_necessary,
"question_number": 2,
"question_title": object.question.question_title,
"question_type": 2,
"max_choices": object.question.max_choices,
"min_choices": object.question.min_choices,
"new": "",
"answers": answers
};
question = {"question": questiontwo};
if (uuk !== -1) {
// console.log("修改")
this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices,object.question.answers.length);
newarrpoll.splice(uuk, 1, question);
} else {
var datatwo = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
}
option.push(object.question.answers[y].answer_text)
answerstwoss.push(datatwo);
// console.log("删除")
this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, object.question.id,object.question.answers.length);
newarrpoll.push(question);
}
}
var arrc = option.concat(other);
var answers = answerstwoss.concat(answerstwos);
questiontwo = {
"id": object.question.id,
"is_necessary": object.question.is_necessary,
"question_number": 2,
"question_title": object.question.question_title,
"question_type": 2,
"max_choices": object.question.max_choices,
"min_choices": object.question.min_choices,
"new": "",
"answers": answers
};
question = {"question": questiontwo};
//插入多选题
// if (object.question.max_choices > arrc.length) {
// // console.log("选择题的最大可选项不能大于答案数")
// this.props.showNotification('选择题的最大可选项不能大于选项数!');
//
// return;
// }
// if (object.question.min_choices === 0) {
// // console.log("选择题的最大可选项不能小于2项目")
// this.props.showNotification('选择题的最大可选项不能小于2项目');
//
// return;
//
// }
if (uuk !== -1) {
// console.log("修改")
this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices,object.question.answers.length);
newarrpoll.splice(uuk, 1, question);
} else {
// console.log("删除")
this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, object.question.id,object.question.answers.length);
newarrpoll.push(question);
}
// console.log(newarrpoll)
newarr[indexo].question.new = "new"
// console.log(newarrpoll)
newarr[indexo].question.new = "new"
} else if (object.question.question_type === 3) {
//插入主观题
var answers = [];
@ -1328,6 +1354,20 @@ class PollNew extends Component {
this.state.mymainsint = this.state.mymainsint + 1;
}
if(bool === true){
this.setState({
q_countst: 1,
bindingid:undefined,
Newdisplay:false,
newoption: false,
})
}else {
this.setState({
q_countst: 1,
Newdisplay:false,
newoption: false,
})
}
this.setState({
// poll_questions: newarrpoll,
adddom: newarr,
@ -1346,11 +1386,6 @@ class PollNew extends Component {
// indexo 第几个数组
//object 单个数组数据
Deleteadddomthree = (indexo, object,bool) => {
if(bool === true) {
this.setState({
bindingid:undefined,
})
}
this.setState({
Newdisplay:false,
newoption: false,
@ -1482,66 +1517,99 @@ class PollNew extends Component {
if(object.question.max_choices>0){
if (object.question.max_choices < object.question.min_choices) {
this.props.showNotification(`可选的最大限制不能小于最小限制`);
return;
}
}
}
// if (object.question.max_choices < object.question.min_choices) {
// this.props.showNotification(`可选的最大限制不能小于最小限制`);
//
// return;
// }
var questiontwo = {};
var other = [];
var option = [];
var answerstwos = [];
var answerstwoss = [];
for (var y = 0; y < object.question.answers.length; y++) {
if (object.question.answers[y].answer_text === "其他") {
var dataone = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
}
other.push(object.question.answers[y].answer_text);
answerstwos.push(dataone);
} else {
var datatwo = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
if(object.question.max_choices){
if(object.question.max_choices>0){
if(object.question.min_choices){
if(object.question.min_choices===0){
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
option.push(object.question.answers[y].answer_text)
answerstwoss.push(datatwo);
}
}
var arrc = option.concat(other);
var answers = answerstwoss.concat(answerstwos);
questiontwo = {
"id": null,
"is_necessary": object.question.is_necessary,
"question_number": 2,
"question_title": object.question.question_title,
"question_type": 2,
"max_choices": object.question.max_choices,
"min_choices": object.question.min_choices,
"new": "",
"answers": answers
};
question = {"question": questiontwo};
if(object.question.min_choices){
if(object.question.min_choices>0){
if(object.question.max_choices){
if(object.question.max_choices===0){
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}
var insindex = null;
if (this.state.problemtopicbool === true) {
insindex = this.state.problemtopic;
}
this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, insindex,object.question.answers.length);
//插入多选题
// if (object.question.max_choices > arrc.length) {
newarrpoll.splice(thiss.state.Insertposition, 0, question);
// if (object.question.max_choices < object.question.min_choices) {
// this.props.showNotification(`可选的最大限制不能小于最小限制`);
//
// return;
// }
var questiontwo = {};
var other = [];
var option = [];
var answerstwos = [];
var answerstwoss = [];
for (var y = 0; y < object.question.answers.length; y++) {
if (object.question.answers[y].answer_text === "其他") {
var dataone = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
}
other.push(object.question.answers[y].answer_text);
answerstwos.push(dataone);
} else {
var datatwo = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
}
option.push(object.question.answers[y].answer_text)
answerstwoss.push(datatwo);
}
}
var arrc = option.concat(other);
var answers = answerstwoss.concat(answerstwos);
questiontwo = {
"id": null,
"is_necessary": object.question.is_necessary,
"question_number": 2,
"question_title": object.question.question_title,
"question_type": 2,
"max_choices": object.question.max_choices,
"min_choices": object.question.min_choices,
"new": "",
"answers": answers
};
question = {"question": questiontwo};
var insindex = null;
if (this.state.problemtopicbool === true) {
insindex = this.state.problemtopic;
}
this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, insindex,object.question.answers.length);
//插入多选题
// if (object.question.max_choices > arrc.length) {
newarrpoll.splice(thiss.state.Insertposition, 0, question);
} else if (object.question.question_type === 3) {
//插入主观题
var answers = [];
@ -1665,60 +1733,87 @@ class PollNew extends Component {
}
}
}
// if (object.question.max_choices < object.question.min_choices) {
// this.props.showNotification(`可选的最大限制不能小于最小限制`);
//
// return;
// }
var questiontwo = {};
var other = [];
var option = [];
var answerstwos = [];
var answerstwoss = [];
for (var y = 0; y < object.question.answers.length; y++) {
if (object.question.answers[y].answer_text === "其他") {
var dataone = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
}
other.push(object.question.answers[y].answer_text);
answerstwos.push(dataone);
} else {
var datatwo = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
if(object.question.max_choices){
if(object.question.max_choices>0){
if(object.question.min_choices){
if(object.question.min_choices===0){
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
option.push(object.question.answers[y].answer_text)
answerstwoss.push(datatwo);
}
}
var arrc = option.concat(other);
var answers = answerstwoss.concat(answerstwos);
questiontwo = {
"id": object.question.id,
"is_necessary": object.question.is_necessary,
"question_number": 2,
"question_title": object.question.question_title,
"question_type": 2,
"max_choices": object.question.max_choices,
"min_choices": object.question.min_choices,
"new": "",
"answers": answers
};
question = {"question": questiontwo};
//插入多选题
if (uuk !== -1) {
// console.log("修改")
this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices,object.question.answers.length);
newarrpoll.splice(uuk, 1, question);
} else {
// console.log("删除")
this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, object.question.id,object.question.answers.length);
newarrpoll.push(question);
if(object.question.min_choices){
if(object.question.min_choices>0){
if(object.question.max_choices){
if(object.question.max_choices===0){
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}
}
// console.log(newarrpoll)
var questiontwo = {};
var other = [];
var option = [];
var answerstwos = [];
var answerstwoss = [];
for (var y = 0; y < object.question.answers.length; y++) {
if (object.question.answers[y].answer_text === "其他") {
var dataone = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
}
other.push(object.question.answers[y].answer_text);
answerstwos.push(dataone);
} else {
var datatwo = {
"answer_id": object.question.answers[y].answer_id,
"answer_position": object.question.answers[y].answer_position,
"answer_text": object.question.answers[y].answer_text
}
option.push(object.question.answers[y].answer_text)
answerstwoss.push(datatwo);
}
}
var arrc = option.concat(other);
var answers = answerstwoss.concat(answerstwos);
questiontwo = {
"id": object.question.id,
"is_necessary": object.question.is_necessary,
"question_number": 2,
"question_title": object.question.question_title,
"question_type": 2,
"max_choices": object.question.max_choices,
"min_choices": object.question.min_choices,
"new": "",
"answers": answers
};
question = {"question": questiontwo};
//插入多选题
if (uuk !== -1) {
// console.log("修改")
this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices,object.question.answers.length);
newarrpoll.splice(uuk, 1, question);
} else {
// console.log("删除")
this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, object.question.id,object.question.answers.length);
newarrpoll.push(question);
}
} else if (object.question.question_type === 3) {
//插入主观题
@ -1790,6 +1885,11 @@ class PollNew extends Component {
q_countst: 0,
})
}
if(bool === true) {
this.setState({
bindingid:undefined,
})
}
this.Deleteadddom(indexo);
// console.log(indexo)
}
@ -2240,34 +2340,34 @@ class PollNew extends Component {
var minbool = false;
var maxbool = false;
let arr = this.state.adddom;
if (parseInt(value) === 0 || parseInt(value) === "0" || parseInt(value) === null || parseInt(value) === undefined || parseInt(value) < 1) {
minbool = true;
}
if (max === 0 || max === "0" || max === null || max === undefined) {
maxbool = true;
}
if (minbool === true && maxbool === true) {
for (var i = 0; i < arr.length; i++) {
if (index === i) {
arr[i].question.min_choices = parseInt(value);
}
}
this.setState({
adddom: arr
})
} else {
// if (parseInt(value) === 0 || parseInt(value) === "0" || parseInt(value) === null || parseInt(value) === undefined || parseInt(value) < 1) {
// minbool = true;
// }
// if (max === 0 || max === "0" || max === null || max === undefined) {
// maxbool = true;
// }
//
// if (minbool === true && maxbool === true) {
// for (var i = 0; i < arr.length; i++) {
// if (index === i) {
// arr[i].question.min_choices = parseInt(value);
// }
// }
// this.setState({
// adddom: arr
// })
// } else {
for (var i = 0; i < arr.length; i++) {
if (index === i) {
arr[i].question.min_choices = parseInt(value);
arr[i].question.max_choices = length;
// arr[i].question.max_choices = length;
break;
}
}
this.setState({
adddom: arr
})
}
// }
}
@ -2284,21 +2384,21 @@ class PollNew extends Component {
let arr = this.state.adddom;
for (var i = 0; i < arr.length; i++) {
if (index === i) {
if(parseInt(value)===0&&parseInt(minchoices)===0){
arr[i].question.min_choices= parseInt(0);
arr[i].question.max_choices = parseInt(0);
}else if(parseInt(minchoices)===0){
arr[i].question.min_choices= parseInt(2);
arr[i].question.max_choices = parseInt(value);
}
else if(parseInt(value)===0&&parseInt(minchoices)>0){
arr[i].question.min_choices= parseInt(minchoices);
arr[i].question.max_choices = parseInt(value);
}
else {
arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices);
// if(parseInt(value)===0&&parseInt(minchoices)===0){
// arr[i].question.min_choices= parseInt(0);
// arr[i].question.max_choices = parseInt(0);
// }else if(parseInt(minchoices)===0){
// arr[i].question.min_choices= parseInt(2);
// arr[i].question.max_choices = parseInt(value);
// }
// else if(parseInt(value)===0&&parseInt(minchoices)>0){
// arr[i].question.min_choices= parseInt(minchoices);
// arr[i].question.max_choices = parseInt(value);
// }
// else {
// arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices);
arr[i].question.max_choices = parseInt(value);
}
// }
}
}
// console.log(2119);
@ -2774,8 +2874,13 @@ class PollNew extends Component {
className="color-grey-9 fl">{item.question.question_type === 1 ? "(单选题)" : item.question.question_type === 2 ? "(多选题)" : "(主观题)"}</span>
<span
className="selectAnswer ml10">{item.question.is_necessary === 1 ? "必答" : item.question.question_type === 2 ? "选答" : "选答"}</span>
<span style={{color: "#4B4B4B"}}
className="font-16 mt10 ml10">{(item.question.min_choices === undefined && item.question.max_choices === undefined ? "不限制" : item.question.min_choices === null && item.question.max_choices === null ? "不限制" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "不限制" : "可选" + item.question.min_choices + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")}</span>
{
item.question.question_type === 2?
<span style={{color: "#4B4B4B"}}
className="font-16 mt10 ml10">{(item.question.min_choices === undefined && item.question.max_choices === undefined ? "" : item.question.min_choices === null && item.question.max_choices === null ? "" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "" : item.question.min_choices === item.question.max_choices && item.question.max_choices === item.question.min_choices ? "可选"+(item.question.max_choices)+"项" : "可选" +(item.question.min_choices===undefined||item.question.min_choices===null||item.question.min_choices===""||item.question.min_choices==="null"?2:item.question.min_choices) + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")}</span>
: ""
}
{
polls_status === undefined || polls_status === 1 ?
<span className="fr">
@ -2858,7 +2963,7 @@ class PollNew extends Component {
resultDomtwo =
<div >
<span
className="font-16 color-grey-6 mb20">{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"}
className="font-16 color-grey-6 mb20" id={"yslproblms3"}>{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"}
<Checkbox value={itemo.question.is_necessary}
checked={itemo.question.is_necessary === 1 ? true : false}
onChange={(e) => this.OnCheckAllChange(e, indexo)}
@ -2926,7 +3031,7 @@ class PollNew extends Component {
<div className="df">
{itemo.question.question_type === 1 ? (
<div>
<div className="ml10">
<div style={{minWidth: "1100px"}}>
{this.state.polls_status === undefined || this.state.polls_status === 1 ?
<ActionBtn style="grey" className="mr20 mt5"
@ -2961,7 +3066,7 @@ class PollNew extends Component {
<div style={{minWidth: "1100px"}}>
<div>
<span
className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span>
className="color-grey-6 mr20 ml10 font-16 lineh-40 fl">可选</span>
<div className="mr40 flex1 ">
{/*可选最小1*/}
<style>
@ -2992,7 +3097,7 @@ class PollNew extends Component {
</Select>
<span
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大1*/}
{/*可选最大2*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices}
@ -3020,11 +3125,11 @@ class PollNew extends Component {
}
</div>
<div>
<div >
{itemo.question.question_type === 2 ?
(
this.state.polls_status === undefined || this.state.polls_status === 1 ?
<div className="clearfix mt30" >
<div className="clearfix mt30 ml10" >
<div><ActionBtn style="grey" className="mr20 fl mt5"
onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项</ActionBtn>
@ -3100,7 +3205,7 @@ class PollNew extends Component {
resultDomtwo =
<div >
<span
className="font-16 color-grey-6 mb20">{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"}
className="font-16 color-grey-6 mb20" id={"yslproblms2"}>{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"}
<Checkbox value={itemo.question.is_necessary}
checked={itemo.question.is_necessary === 1 ? true : false}
onChange={(e) => this.OnCheckAllChange(e, indexo)}
@ -3168,7 +3273,7 @@ class PollNew extends Component {
<div className="df">
{itemo.question.question_type === 1 ? (
<div>
<div className="ml10">
<div style={{minWidth: "1100px"}}>
{this.state.polls_status === undefined || this.state.polls_status === 1 ?
<ActionBtn style="grey" className="mr20 mt5"
@ -3205,7 +3310,7 @@ class PollNew extends Component {
<span
className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span>
<div className="mr40 flex1 ">
{/*可选最小2*/}
{/*可选最小*/}
<style>
{
`
@ -3234,7 +3339,7 @@ class PollNew extends Component {
</Select>
<span
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大2*/}
{/*可选最大*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices}
@ -3266,7 +3371,7 @@ class PollNew extends Component {
{itemo.question.question_type === 2 ?
(
this.state.polls_status === undefined || this.state.polls_status === 1 ?
<div className="clearfix mt30" >
<div className="clearfix mt30 ml10" >
<div><ActionBtn style="grey" className="mr20 fl mt5"
onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项</ActionBtn>
@ -3351,7 +3456,7 @@ class PollNew extends Component {
resultDomtwo =
<div className="problemShow">
<span
className="font-16 color-grey-6 mb20">{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"}
className="font-16 color-grey-6 mb20" id={"yslproblms"}>{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"}
<Checkbox value={itemo.question.is_necessary}
checked={itemo.question.is_necessary === 1 ? true : false}
onChange={(e) => this.OnCheckAllChange(e, indexo)}
@ -3419,7 +3524,7 @@ class PollNew extends Component {
<div className="df">
{itemo.question.question_type === 1 ? (
<div>
<div className="ml10">
<div style={{minWidth: "1100px"}}>
{polls_status === undefined || polls_status === 1 ?
<ActionBtn style="grey" className="mr20 mt5"
@ -3456,7 +3561,7 @@ class PollNew extends Component {
<span
className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span>
<div className="mr40 flex1 ">
{/*可选最小3*/}
{/*可选最小*/}
<style>
{
`
@ -3485,7 +3590,7 @@ class PollNew extends Component {
</Select>
<span
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大3*/}
{/*可选最大*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices}
@ -3517,7 +3622,7 @@ class PollNew extends Component {
{itemo.question.question_type === 2 ?
(
polls_status === undefined || polls_status === 1 ?
<div className="clearfix mt30" >
<div className="clearfix mt30 ml10" >
<div><ActionBtn style="grey" className="mr20 fl mt5"
onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项</ActionBtn>

@ -1,7 +1,7 @@
import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin } from "antd";
import { WordsBtn,on, off, trigger } from 'educoder';
import CourseLayoutcomponent from '../common/CourseLayoutComponent';
import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom';
import axios from'axios';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import ShixunModal from "../coursesPublic/ShixunModal";
@ -936,6 +936,7 @@ class ShixunHomework extends Component{
let main_id=this.props.match.params.main_id;
let category_id=this.props.match.params.category_id;
return(
<React.Fragment >
<div>
@ -1036,6 +1037,13 @@ class ShixunHomework extends Component{
{/*<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>*/}
<span className="font-18 fl color-dark-21">实训作业</span>
<li className="fr">
{datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isClassManagement()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span>
<WordsBtn style="blue" className={"mr30 font-16"}>
<Link className="color4CACFF" to={`/courses/${this.props.match.params.coursesId}/ordering/shixun_homework/${main_id&&main_id}`}>调整排序</Link>
</WordsBtn>
</span>:"":"":""}
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span>
<WordsBtn style="blue" onClick={()=>this.addDir()} className={"mr30 font-16"}>添加目录</WordsBtn>

@ -1373,14 +1373,15 @@ export default class TPMsettings extends Component {
}
handleChange = (info) => {
console.log("handleChange1");
let {fileList}=this.state;
if(fileList.length===0){
let fileLists = info.fileList;
this.setState({ fileList:fileLists,
deleteisnot:false});
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
console.log("handleChange1");
let {fileList}=this.state;
if(fileList.length===0){
let fileLists = info.fileList;
this.setState({ fileList:fileLists,
deleteisnot:false});
}
}
}
onAttachmentRemove = (file) => {

@ -561,7 +561,8 @@ export default class TPMevaluation extends Component {
if(type==="sr"){
newevaluationlist[key].input=e.target.value
}else if(type==="yq"){
newevaluationlist[key].output=e.target.value
// 统一转成\r\n
newevaluationlist[key].output= e.target.value ? e.target.value.replace(/\r?\n/g, "\r\n") : e.target.value
}
this.setevaluationlist(newevaluationlist);
}

@ -760,15 +760,17 @@ class Newshixuns extends Component {
// 附件相关 START
handleChange = (info) => {
let {fileList}=this.state;
console.log("handleChange1");
if(fileList.length===0){
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let {fileList}=this.state;
console.log("handleChange1");
if(fileList.length===0){
let fileLists = info.fileList;
this.setState({
// fileList:appendFileSizeToUploadFileAll(fileList),
fileList:fileLists,
deleteisnot:false});
}
}
}
}
onAttachmentRemove = (file) => {

@ -1111,6 +1111,9 @@ class LoginRegisterComponent extends Component {
.ant-input-group-addon{
background-color: #fff;s
}
.ant-input-group .ant-input:hover {
z-index: 0 !important;
}
`
}
</style>

@ -376,7 +376,7 @@ class AccountBasic extends Component {
this.getSchoolList(this.props.basicInfo, name);
this.props.form.setFieldsValue({
name: name
org: name
})
}

Loading…
Cancel
Save