Merge branch 'dev_aliyun' into dev_cs

topic_bank
caicai8 5 years ago
commit b3dc67de3c

@ -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(),

@ -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');
});
});
}
});

@ -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, :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]
@ -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

@ -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)

@ -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!

@ -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

@ -0,0 +1,9 @@
module Util::Redis
class << self
def online_user_count
if Rails.cache.is_a?(ActiveSupport::Cache::RedisStore)
Rails.cache.data.scan(0, match: 'cache:_session_id:*', count: 100000).last.uniq.size
end
end
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

@ -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

@ -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 %> <%= 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: '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_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>

@ -353,6 +353,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'
@ -850,18 +851,21 @@ 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,:edit,:update,:destroy] 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]

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

@ -284,6 +284,14 @@ const Completetaskpage =Loadable({
loader: () => import('../../modules/courses/completetaskdetails/Completetaskpage'), loader: () => import('../../modules/courses/completetaskdetails/Completetaskpage'),
loading: Loading, loading: Loading,
}); });
//排序
const Ordering=Loadable({
loader: () => import('../../modules/courses/ordering/Ordering'),
loading: Loading,
});
class CoursesIndex extends Component{ class CoursesIndex extends Component{
constructor(props) { constructor(props) {
super(props) super(props)
@ -470,6 +478,13 @@ class CoursesIndex extends Component{
// console.log(commons) // console.log(commons)
return ( return (
<Switch {...this.props}> <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" <Route path="/banks/gtopic_topics/:workid"
render={ render={

@ -181,15 +181,16 @@ class BoardsNew 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;
this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) });
}); }
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){ if(!file.percent || file.percent == 100){
confirm({ this.props.confirm({
// title: '确定要删除这个附件吗?', // title: '确定要删除这个附件吗?',
title: '是否确认删除?', content: '是否确认删除?',
okText: '确定', okText: '确定',
cancelText: '取消', cancelText: '取消',

@ -291,7 +291,7 @@ class CommonWorkPost extends Component{
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
if (info.file.status === 'uploading' || info.file.status === 'done') { if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList; let fileList = info.fileList;
this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) }); this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) });

@ -235,13 +235,17 @@ class NewWork extends Component{
} }
handleContentUploadChange = (info) => { handleContentUploadChange = (info) => {
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let contentFileList = info.fileList; let contentFileList = info.fileList;
this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) }); this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) });
} }
}
handleAnswerUploadChange = (info) => { handleAnswerUploadChange = (info) => {
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let answerFileList = info.fileList; let answerFileList = info.fileList;
this.setState({ answerFileList: appendFileSizeToUploadFileAll(answerFileList) }); this.setState({ answerFileList: appendFileSizeToUploadFileAll(answerFileList) });
} }
}
onAttachmentRemove = (file, stateName) => { onAttachmentRemove = (file, stateName) => {
if(!file.percent || file.percent == 100){ if(!file.percent || file.percent == 100){

@ -40,6 +40,7 @@ class AccessoryModal 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;
console.log(fileList) console.log(fileList)
// for(var list of fileList ){ // for(var list of fileList ){
@ -50,6 +51,7 @@ class AccessoryModal extends Component{
Errormessage:false, Errormessage:false,
}); });
} }
}
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
// confirm({ // confirm({

@ -78,3 +78,4 @@ p span{
.sourceTag a.active{ .sourceTag a.active{
color: #FFFFFF;background-color:#4CACFF; color: #FFFFFF;background-color:#4CACFF;
} }

@ -545,7 +545,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;
} }

@ -116,50 +116,50 @@ class GraduationTasksSubmitedit extends Component{
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) }); this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
} }
if (info.file.status === 'done') { if (info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList; let fileList = info.fileList;
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) }); this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
} }
} }
//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, onAttachmentRemoves = (file) => {
// Modalstopval:'确定要删除这个附件吗?', if(!file.percent || file.percent == 100){
// ModalSave: ()=>this.deleteAttachment(file), this.setState({
// ModalCancel:this.cancelAttachment Modalstype:true,
// }) Modalstopval:'确定要删除这个附件吗?',
// return false; ModalSave: ()=>this.deleteAttachments(file),
//} ModalCancel:this.cancelAttachment
})
return false;
}
}
cancelAttachment=()=>{ cancelAttachment=()=>{
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
Modalstopval:'确定要删除这个附件吗?', Modalstopval:'',
ModalSave:"", ModalSave:"",
ModalCancel:"" ModalCancel:""
}) })
} }
onAttachmentRemove = (file) => { deleteAttachments = (id) => {
if(!file.percent || file.percent == 100){
let {attachments,fileList}=this.state; let {attachments,fileList}=this.state;
const url = `/attachments/${file}.json`
const url = `/attachments/${id}.json`
axios.delete(url, { axios.delete(url, {
}) })
.then((response) => { .then((response) => {
@ -168,25 +168,66 @@ class GraduationTasksSubmitedit extends Component{
if (response.data.status === 0) { if (response.data.status === 0) {
console.log('--- success') console.log('--- success')
let newattachments=attachments; let newattachments=attachments;
if(file.uid===undefined){
for(var i=0; i<newattachments.length; i++){ for(var i=0; i<newattachments.length; i++){
if(newattachments[i].id===file.id){ if(newattachments[i].id===id){
newattachments.splice(i, 1); newattachments.splice(i, 1);
} }
} }
}
this.setState({ this.setState({
Modalstype:true,
Modalstopval:response.data.message,
ModalSave:this.cancelAttachment,
Loadtype:true,
attachments:newattachments 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) => { 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 +619,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.user&&this.props.user.username} 修改作品</span>
</p> </p>
<div style={{ width:'100%',height:'75px'}} > <div style={{ width:'100%',height:'75px'}} >
@ -653,7 +694,7 @@ class GraduationTasksSubmitedit extends Component{
{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>

@ -125,7 +125,7 @@ class GraduationTasksSubmitnew extends Component{
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) }); this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
} }
if (info.file.status === 'done') { if (info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList; let fileList = info.fileList;
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) }); this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
} }
@ -161,28 +161,30 @@ 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`
axios.delete(url, {})
.then((response) => { .then((response) => {
if (response.data) { if (response.data) {
// const { status } = response.data; // const { status } = response.data;
if (response.data.status === 0) { if (response.data.status === 0) {
console.log('--- success') console.log('--- success')
this.setState({ // this.setState({
Modalstype:true, // Modalstype: true,
Modalstopval:response.data.message, // Modalstopval: response.data.message,
ModalSave:this.cancelAttachment, // ModalSave: this.cancelAttachment,
Loadtype:true, // Loadtype: true,
}) // })
this.cancelAttachment();
this.setState((state) => { this.setState((state) => {
const index = state.fileList.indexOf(file); const index = state.fileList.indexOf(file);
@ -199,6 +201,7 @@ class GraduationTasksSubmitnew extends Component{
console.log(error); console.log(error);
}); });
} }
}
inputSearchValue=(e)=>{ inputSearchValue=(e)=>{

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

@ -103,7 +103,7 @@ class GraduationTasksedit extends Component{
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { 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; let fileList = info.fileList;
// console.log(fileList) // console.log(fileList)
// for(var list of 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 {Form, Select, Input, Button, Checkbox, Upload, Icon, message, Modal} 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,appendFileSizeToUploadFileAll} from 'educoder'; import {WordsBtn, getUrl,bytesToSize,appendFileSizeToUploadFileAll , getUploadActionUrl} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
import '../../css/Courses.css'; import '../../css/Courses.css';
const {Option} = Select; const {Option} = Select;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm; const confirm = Modal.confirm;
@ -127,7 +128,7 @@ class GraduationTasksnew extends Component {
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { 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; let fileList = info.fileList;
// for(var list of fileList ){ // for(var list of fileList ){
@ -174,6 +175,25 @@ class GraduationTasksnew extends Component {
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){ if(!file.percent || file.percent == 100){
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.response ? file.response.id : file.uid}.json`
// const url = `/attachments/${file}.json` // const url = `/attachments/${file}.json`
axios.delete(url, {}) axios.delete(url, {})
@ -200,8 +220,6 @@ class GraduationTasksnew extends Component {
}); });
} }
}
//滚动 //滚动
ifHasAnchorJustScorll() { ifHasAnchorJustScorll() {
// let anchor = this.getURLStuff("anchor"); // let anchor = this.getURLStuff("anchor");
@ -267,7 +285,7 @@ class GraduationTasksnew extends Component {
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUploadActionUrl()}`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
beforeUpload: (file) => { beforeUpload: (file) => {

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

@ -159,9 +159,11 @@ class GraduateTopicPostWorksNew 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;
this.setState({ fileList }); this.setState({ fileList });
} }
}
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){ if(!file.percent || file.percent == 100){
confirm({ confirm({

@ -574,7 +574,7 @@ class CoursesNew extends Component {
{this.props.match.params.coursesId === undefined ?"翻转课堂":dataname} {this.props.match.params.coursesId === undefined ?"翻转课堂":dataname}
</a> </a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <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> </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} <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> >{Whethertocreateanewclassroom===true?"翻转课堂":name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <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> </p>
<div style={{width: '100%', height: '50px'}}> <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) => { Deleteadddomtwo = (indexo, object,bool) => {
var thiss = this; 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; var poll_questionslength = this.state.poll_questions.length;
// console.log("deleteadddomtwo|||||||||||||||||||||||||||||||||||||||||\\"); // console.log("deleteadddomtwo|||||||||||||||||||||||||||||||||||||||||\\");
@ -988,13 +975,43 @@ class PollNew extends Component {
if(object.question.max_choices>0){ if(object.question.max_choices>0){
if (object.question.max_choices < object.question.min_choices) { if (object.question.max_choices < object.question.min_choices) {
this.props.showNotification(`可选的最大限制不能小于最小限制`); this.props.showNotification(`可选的最大限制不能小于最小限制`);
return;
}
}
}
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; 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;
}
}
}
var questiontwo = {}; var questiontwo = {};
var other = []; var other = [];
var option = []; var option = [];
@ -1044,22 +1061,9 @@ class PollNew extends Component {
insindex = this.state.problemtopic; insindex = this.state.problemtopic;
} }
this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, insindex,object.question.answers.length); 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); newarrpoll.splice(thiss.state.Insertposition, 0, question);
} else if (object.question.question_type === 3) { } else if (object.question.question_type === 3) {
//插入主观题 //插入主观题
var answers = []; var answers = [];
@ -1191,11 +1195,44 @@ class PollNew extends Component {
if(object.question.max_choices>0){ if(object.question.max_choices>0){
if (object.question.max_choices < object.question.min_choices) { if (object.question.max_choices < object.question.min_choices) {
this.props.showNotification(`可选的最大限制不能小于最小限制`); this.props.showNotification(`可选的最大限制不能小于最小限制`);
return;
}
}
}
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; 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) { // if (object.question.max_choices < object.question.min_choices) {
// this.props.showNotification('可选的最大限制不能小于最小限制!'); // this.props.showNotification('可选的最大限制不能小于最小限制!');
// //
@ -1239,20 +1276,7 @@ class PollNew extends Component {
"answers": answers "answers": answers
}; };
question = {"question": questiontwo}; 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) { if (uuk !== -1) {
// console.log("修改") // console.log("修改")
this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices,object.question.answers.length); this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices,object.question.answers.length);
@ -1328,6 +1352,20 @@ class PollNew extends Component {
this.state.mymainsint = this.state.mymainsint + 1; 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({ this.setState({
// poll_questions: newarrpoll, // poll_questions: newarrpoll,
adddom: newarr, adddom: newarr,
@ -1346,11 +1384,6 @@ class PollNew extends Component {
// indexo 第几个数组 // indexo 第几个数组
//object 单个数组数据 //object 单个数组数据
Deleteadddomthree = (indexo, object,bool) => { Deleteadddomthree = (indexo, object,bool) => {
if(bool === true) {
this.setState({
bindingid:undefined,
})
}
this.setState({ this.setState({
Newdisplay:false, Newdisplay:false,
newoption: false, newoption: false,
@ -1482,17 +1515,49 @@ class PollNew extends Component {
if(object.question.max_choices>0){ if(object.question.max_choices>0){
if (object.question.max_choices < object.question.min_choices) { if (object.question.max_choices < object.question.min_choices) {
this.props.showNotification(`可选的最大限制不能小于最小限制`); this.props.showNotification(`可选的最大限制不能小于最小限制`);
return;
}
}
}
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; 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) { // if (object.question.max_choices < object.question.min_choices) {
// this.props.showNotification(`可选的最大限制不能小于最小限制`); // this.props.showNotification(`可选的最大限制不能小于最小限制`);
// //
// return; // return;
// } // }
var questiontwo = {}; var questiontwo = {};
var other = []; var other = [];
var option = []; var option = [];
@ -1542,6 +1607,7 @@ class PollNew extends Component {
// if (object.question.max_choices > arrc.length) { // if (object.question.max_choices > arrc.length) {
newarrpoll.splice(thiss.state.Insertposition, 0, question); newarrpoll.splice(thiss.state.Insertposition, 0, question);
} else if (object.question.question_type === 3) { } else if (object.question.question_type === 3) {
//插入主观题 //插入主观题
var answers = []; var answers = [];
@ -1660,16 +1726,43 @@ class PollNew extends Component {
if(object.question.max_choices>0){ if(object.question.max_choices>0){
if (object.question.max_choices < object.question.min_choices) { if (object.question.max_choices < object.question.min_choices) {
this.props.showNotification(`可选的最大限制不能小于最小限制`); this.props.showNotification(`可选的最大限制不能小于最小限制`);
return;
}
}
}
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; return;
} }
}else {
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
} }
} }
// if (object.question.max_choices < object.question.min_choices) {
// 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;
}
}
}
var questiontwo = {}; var questiontwo = {};
var other = []; var other = [];
var option = []; var option = [];
@ -1718,7 +1811,6 @@ class PollNew extends Component {
this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, object.question.id,object.question.answers.length); this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, object.question.id,object.question.answers.length);
newarrpoll.push(question); newarrpoll.push(question);
} }
// console.log(newarrpoll)
} else if (object.question.question_type === 3) { } else if (object.question.question_type === 3) {
//插入主观题 //插入主观题
@ -1790,6 +1882,11 @@ class PollNew extends Component {
q_countst: 0, q_countst: 0,
}) })
} }
if(bool === true) {
this.setState({
bindingid:undefined,
})
}
this.Deleteadddom(indexo); this.Deleteadddom(indexo);
// console.log(indexo) // console.log(indexo)
} }
@ -1971,6 +2068,7 @@ class PollNew extends Component {
thiss.thisinitializationdatanew(); thiss.thisinitializationdatanew();
} }
}) })
} }
//上下移到服务器中 //上下移到服务器中
@ -2240,34 +2338,34 @@ class PollNew extends Component {
var minbool = false; var minbool = false;
var maxbool = false; var maxbool = false;
let arr = this.state.adddom; let arr = this.state.adddom;
if (parseInt(value) === 0 || parseInt(value) === "0" || parseInt(value) === null || parseInt(value) === undefined || parseInt(value) < 1) { // if (parseInt(value) === 0 || parseInt(value) === "0" || parseInt(value) === null || parseInt(value) === undefined || parseInt(value) < 1) {
minbool = true; // minbool = true;
} // }
if (max === 0 || max === "0" || max === null || max === undefined) { // if (max === 0 || max === "0" || max === null || max === undefined) {
maxbool = true; // maxbool = true;
} // }
//
if (minbool === true && maxbool === true) { // if (minbool === true && maxbool === true) {
for (var i = 0; i < arr.length; i++) { // for (var i = 0; i < arr.length; i++) {
if (index === i) { // if (index === i) {
arr[i].question.min_choices = parseInt(value); // arr[i].question.min_choices = parseInt(value);
} // }
} // }
this.setState({ // this.setState({
adddom: arr // adddom: arr
}) // })
} else { // } else {
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (index === i) { if (index === i) {
arr[i].question.min_choices = parseInt(value); arr[i].question.min_choices = parseInt(value);
arr[i].question.max_choices = length; // arr[i].question.max_choices = length;
break; break;
} }
} }
this.setState({ this.setState({
adddom: arr adddom: arr
}) })
} // }
} }
@ -2284,21 +2382,21 @@ class PollNew extends Component {
let arr = this.state.adddom; let arr = this.state.adddom;
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (index === i) { if (index === i) {
if(parseInt(value)===0&&parseInt(minchoices)===0){ // if(parseInt(value)===0&&parseInt(minchoices)===0){
arr[i].question.min_choices= parseInt(0); // arr[i].question.min_choices= parseInt(0);
arr[i].question.max_choices = parseInt(0); // arr[i].question.max_choices = parseInt(0);
}else if(parseInt(minchoices)===0){ // }else if(parseInt(minchoices)===0){
arr[i].question.min_choices= parseInt(2); // arr[i].question.min_choices= parseInt(2);
arr[i].question.max_choices = parseInt(value); // arr[i].question.max_choices = parseInt(value);
} // }
else if(parseInt(value)===0&&parseInt(minchoices)>0){ // else if(parseInt(value)===0&&parseInt(minchoices)>0){
arr[i].question.min_choices= parseInt(minchoices); // arr[i].question.min_choices= parseInt(minchoices);
arr[i].question.max_choices = parseInt(value); // arr[i].question.max_choices = parseInt(value);
} // }
else { // else {
arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices); // arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices);
arr[i].question.max_choices = parseInt(value); arr[i].question.max_choices = parseInt(value);
} // }
} }
} }
// console.log(2119); // console.log(2119);
@ -2777,7 +2875,7 @@ class PollNew extends Component {
{ {
item.question.question_type === 2? item.question.question_type === 2?
<span style={{color: "#4B4B4B"}} <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===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> 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>
: "" : ""
} }
@ -2863,7 +2961,7 @@ class PollNew extends Component {
resultDomtwo = resultDomtwo =
<div > <div >
<span <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} <Checkbox value={itemo.question.is_necessary}
checked={itemo.question.is_necessary === 1 ? true : false} checked={itemo.question.is_necessary === 1 ? true : false}
onChange={(e) => this.OnCheckAllChange(e, indexo)} onChange={(e) => this.OnCheckAllChange(e, indexo)}
@ -2931,7 +3029,7 @@ class PollNew extends Component {
<div className="df"> <div className="df">
{itemo.question.question_type === 1 ? ( {itemo.question.question_type === 1 ? (
<div> <div className="ml10">
<div style={{minWidth: "1100px"}}> <div style={{minWidth: "1100px"}}>
{this.state.polls_status === undefined || this.state.polls_status === 1 ? {this.state.polls_status === undefined || this.state.polls_status === 1 ?
<ActionBtn style="grey" className="mr20 mt5" <ActionBtn style="grey" className="mr20 mt5"
@ -2966,7 +3064,7 @@ class PollNew extends Component {
<div style={{minWidth: "1100px"}}> <div style={{minWidth: "1100px"}}>
<div> <div>
<span <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 "> <div className="mr40 flex1 ">
{/*可选最小1*/} {/*可选最小1*/}
<style> <style>
@ -3029,7 +3127,7 @@ class PollNew extends Component {
{itemo.question.question_type === 2 ? {itemo.question.question_type === 2 ?
( (
this.state.polls_status === undefined || this.state.polls_status === 1 ? 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" <div><ActionBtn style="grey" className="mr20 fl mt5"
onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项</ActionBtn> onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项</ActionBtn>
@ -3105,7 +3203,7 @@ class PollNew extends Component {
resultDomtwo = resultDomtwo =
<div > <div >
<span <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} <Checkbox value={itemo.question.is_necessary}
checked={itemo.question.is_necessary === 1 ? true : false} checked={itemo.question.is_necessary === 1 ? true : false}
onChange={(e) => this.OnCheckAllChange(e, indexo)} onChange={(e) => this.OnCheckAllChange(e, indexo)}
@ -3173,7 +3271,7 @@ class PollNew extends Component {
<div className="df"> <div className="df">
{itemo.question.question_type === 1 ? ( {itemo.question.question_type === 1 ? (
<div> <div className="ml10">
<div style={{minWidth: "1100px"}}> <div style={{minWidth: "1100px"}}>
{this.state.polls_status === undefined || this.state.polls_status === 1 ? {this.state.polls_status === undefined || this.state.polls_status === 1 ?
<ActionBtn style="grey" className="mr20 mt5" <ActionBtn style="grey" className="mr20 mt5"
@ -3271,7 +3369,7 @@ class PollNew extends Component {
{itemo.question.question_type === 2 ? {itemo.question.question_type === 2 ?
( (
this.state.polls_status === undefined || this.state.polls_status === 1 ? 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" <div><ActionBtn style="grey" className="mr20 fl mt5"
onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项</ActionBtn> onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项</ActionBtn>
@ -3356,7 +3454,7 @@ class PollNew extends Component {
resultDomtwo = resultDomtwo =
<div className="problemShow"> <div className="problemShow">
<span <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} <Checkbox value={itemo.question.is_necessary}
checked={itemo.question.is_necessary === 1 ? true : false} checked={itemo.question.is_necessary === 1 ? true : false}
onChange={(e) => this.OnCheckAllChange(e, indexo)} onChange={(e) => this.OnCheckAllChange(e, indexo)}
@ -3424,7 +3522,7 @@ class PollNew extends Component {
<div className="df"> <div className="df">
{itemo.question.question_type === 1 ? ( {itemo.question.question_type === 1 ? (
<div> <div className="ml10">
<div style={{minWidth: "1100px"}}> <div style={{minWidth: "1100px"}}>
{polls_status === undefined || polls_status === 1 ? {polls_status === undefined || polls_status === 1 ?
<ActionBtn style="grey" className="mr20 mt5" <ActionBtn style="grey" className="mr20 mt5"
@ -3522,7 +3620,7 @@ class PollNew extends Component {
{itemo.question.question_type === 2 ? {itemo.question.question_type === 2 ?
( (
polls_status === undefined || polls_status === 1 ? polls_status === undefined || polls_status === 1 ?
<div className="clearfix mt30" > <div className="clearfix mt30 ml10" >
<div><ActionBtn style="grey" className="mr20 fl mt5" <div><ActionBtn style="grey" className="mr20 fl mt5"
onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项</ActionBtn> onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项</ActionBtn>

@ -1,7 +1,7 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin } from "antd"; import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin } from "antd";
import { WordsBtn,on, off, trigger } from 'educoder'; 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 axios from'axios';
import HomeworkModal from "../coursesPublic/HomeworkModal"; import HomeworkModal from "../coursesPublic/HomeworkModal";
import ShixunModal from "../coursesPublic/ShixunModal"; import ShixunModal from "../coursesPublic/ShixunModal";
@ -936,6 +936,7 @@ class ShixunHomework extends Component{
let main_id=this.props.match.params.main_id; let main_id=this.props.match.params.main_id;
let category_id=this.props.match.params.category_id; let category_id=this.props.match.params.category_id;
return( return(
<React.Fragment > <React.Fragment >
<div> <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">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>*/}
<span className="font-18 fl color-dark-21">实训作业</span> <span className="font-18 fl color-dark-21">实训作业</span>
<li className="fr"> <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? {this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span> <span>
<WordsBtn style="blue" onClick={()=>this.addDir()} className={"mr30 font-16"}>添加目录</WordsBtn> <WordsBtn style="blue" onClick={()=>this.addDir()} className={"mr30 font-16"}>添加目录</WordsBtn>

@ -553,7 +553,7 @@ class MemoNew extends Component {
return attachments; return attachments;
} }
handleChange = (info) => { handleChange = (info) => {
if (info.file.status === 'uploading' || info.file.status === 'done') { if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList; let fileList = info.fileList;
this.setState({ this.setState({
fileList: appendFileSizeToUploadFileAll(fileList) fileList: appendFileSizeToUploadFileAll(fileList)

@ -305,7 +305,7 @@ class Trialapplication extends Component {
return; return;
} }
// var telephone = $("#telephoneAdd.tianjia_phone").val(); // var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val(); // var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;

@ -323,7 +323,7 @@ class Trialapplicationysl extends Component {
return; return;
} }
// var telephone = $("#telephoneAdd.tianjia_phone").val(); // var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val(); // var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;

@ -92,7 +92,7 @@ class CaseNew extends Component{
} }
// 上传附件-change // 上传附件-change
handleContentUploadChange = (info) => { handleContentUploadChange = (info) => {
if (info.file.status === 'done' || info.file.status === 'uploading') { if (info.file.status === 'done' || info.file.status === 'uploading' || info.file.status === 'removed') {
let contentFileList = info.fileList; let contentFileList = info.fileList;
this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList)}); this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList)});
let list = appendFileSizeToUploadFileAll(contentFileList); let list = appendFileSizeToUploadFileAll(contentFileList);

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

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

@ -375,7 +375,7 @@ class LoginRegisterComponent extends Component {
return; return;
} }
// var telephone = $("#telephoneAdd.tianjia_phone").val(); // var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val(); // var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
@ -438,7 +438,7 @@ class LoginRegisterComponent extends Component {
// return; // return;
// } // }
// var telephone = $("#telephoneAdd.tianjia_phone").val(); // var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val(); // var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
@ -500,7 +500,7 @@ class LoginRegisterComponent extends Component {
return return
} }
// var telephone = $("#telephoneAdd.tianjia_phone").val(); // var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val(); // var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;

@ -233,7 +233,7 @@ class LoginRegisterComponent extends Component {
return; return;
} }
// var telephone = $("#telephoneAdd.tianjia_phone").val(); // var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val(); // var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
@ -700,7 +700,7 @@ class LoginRegisterComponent extends Component {
return; return;
} }
// var telephone = $("#telephoneAdd.tianjia_phone").val(); // var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val(); // var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
@ -1103,16 +1103,21 @@ class LoginRegisterComponent extends Component {
right: 12px; right: 12px;
height: 20px; height: 20px;
} }
.ant-input{ .mymimasysl {
border-right: none !important; border-right: none !important;
height: 40px !important; }
.ant-input-group-addon{
background-color: #fff;s
}
.ant-input-group .ant-input:hover {
z-index: 0 !important;
} }
` `
} }
</style> </style>
<Input placeholder="输入8~16位密码区分大小写" <Input placeholder="输入8~16位密码区分大小写"
type={classpassbool===false?"text":"password"} type={classpassbool===false?"text":"password"}
className={Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ?" font-14 color-grey-9 loginInputzhucheysl ":" font-14 color-grey-9 loginInputzhuche"} className={Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "mymimasysl" ?" font-14 color-grey-9 loginInputzhucheysl mymimasysl":" font-14 color-grey-9 loginInputzhuche mymimasysl"}
autoComplete="new-password" autoComplete="new-password"
onClick={this.changeType} onClick={this.changeType}
value={this.state.passwords} onChange={this.passwordonChanges} value={this.state.passwords} onChange={this.passwordonChanges}

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

Loading…
Cancel
Save