diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index f03cbdef8..23240fa75 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -38,6 +38,8 @@ class AccountsController < ApplicationController return normal_status(-2, "验证码已失效") if !verifi_code&.effective? end + return normal_status(-1, "8~16位密码,支持字母数字和符号") unless params[:password] =~ CustomRegexp::PASSWORD + code = generate_identifier User, 8, pre login = pre + code @user = User.new(admin: false, login: login, mail: email, phone: phone, type: "User") @@ -114,6 +116,7 @@ class AccountsController < ApplicationController end return normal_status(-2, "验证码不正确") if verifi_code.try(:code) != code.strip return normal_status(-2, "验证码已失效") if !verifi_code&.effective? + return normal_status(-1, "8~16位密码,支持字母数字和符号") unless params[:new_password] =~ CustomRegexp::PASSWORD user.password, user.password_confirmation = params[:new_password], params[:new_password_confirmation] ActiveRecord::Base.transaction do @@ -123,7 +126,7 @@ class AccountsController < ApplicationController sucess_status rescue Exception => e uid_logger_error(e.message) - tip_exception("密码重置失败") + tip_exception(e.message) end end diff --git a/app/controllers/admins/daily_school_statistics_controller.rb b/app/controllers/admins/daily_school_statistics_controller.rb index eb9c75fbc..f0911f239 100644 --- a/app/controllers/admins/daily_school_statistics_controller.rb +++ b/app/controllers/admins/daily_school_statistics_controller.rb @@ -6,6 +6,7 @@ class Admins::DailySchoolStatisticsController < Admins::BaseController total_count, statistics = Admins::SchoolDailyStatisticService.call(params) @statistics = paginate statistics, total_count: total_count + @params_page = params[:page] || 1 respond_to do |format| format.html { load_statistic_total } diff --git a/app/controllers/admins/myshixuns_controller.rb b/app/controllers/admins/myshixuns_controller.rb index f70a64554..adc34e95e 100644 --- a/app/controllers/admins/myshixuns_controller.rb +++ b/app/controllers/admins/myshixuns_controller.rb @@ -6,6 +6,7 @@ class Admins::MyshixunsController < Admins::BaseController myshixuns = Admins::MyshixunQuery.call(params) @myshixuns = paginate myshixuns.includes(:last_executable_task, :last_task, shixun: :user, user: { user_extension: :school }) + @params_page = params[:page] || 1 myshixun_ids = @myshixuns.map(&:id) @finish_game_count = Game.where(myshixun_id: myshixun_ids, status: 2).group(:myshixun_id).count diff --git a/app/controllers/admins/school_statistics_controller.rb b/app/controllers/admins/school_statistics_controller.rb index fdd10c70f..5133cc997 100644 --- a/app/controllers/admins/school_statistics_controller.rb +++ b/app/controllers/admins/school_statistics_controller.rb @@ -10,6 +10,7 @@ class Admins::SchoolStatisticsController < Admins::BaseController @grow_summary = service.grow_summary total_count, statistics = service.call + @params_page = params[:page] || 1 @statistics = paginate statistics, total_count: total_count end diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index de24f7a8e..b08ba2dbd 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1299,8 +1299,10 @@ class CoursesController < ApplicationController begin @all_members = @course.students search = params[:search] ? "#{params[:search].strip}" : "" #用户名或学生学号id搜索 - group_id = params[:group_id] #分班的班级id - @all_members = @all_members.where(course_group_id: group_id.map(&:to_i)) unless group_id.blank? + if params[:group_id].present? + group_ids = params[:group_id].is_a?(String) ? [params[:group_id].to_i] : params[:group_id].map(&:to_i) + @all_members = @all_members.where(course_group_id: group_ids) + end unless search.blank? @all_members = @all_members.joins(user: [:user_extension]).where('concat(users.lastname, users.firstname) like ? or user_extensions.student_id like ?',"%#{search}%","%#{search}%") end diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 0299fdf7d..25e0de44a 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -47,26 +47,26 @@ class FilesController < ApplicationController def bulk_publish return normal_status(403, "您没有权限进行操作") if current_user.course_identity(@course) >= 5 - tip_exception("请至少选择一个分班") if params[:group_ids].blank? && @course.course_groups.size != 0 + # tip_exception("请至少选择一个分班") if params[:group_ids].blank? && @course.course_groups.size != 0 attachments = @course.attachments.by_ids(@attachment_ids) ActiveRecord::Base.transaction do # 有分班设置时 - if @course.course_group_module? && @course.course_groups_count != 0 && params[:group_ids] - group_ids = params[:group_ids]&.reject(&:blank?) - charge_group_ids = @course.charge_group_ids(current_user) - publish_groups = charge_group_ids & group_ids if group_ids - - attachments.each do |atta| - if atta.published? && !atta.unified_setting || !atta.published? - create_atta_group_settings atta - atta.update_all(unified_setting: 0) if atta.unified_setting - none_publish_settings = atta.attachment_group_settings.where(course_group_id: publish_groups).none_published - none_publish_settings.update_all(publish_time: Time.now) - end - end - end + # if @course.course_group_module? && @course.course_groups_count != 0 && params[:group_ids] + # group_ids = params[:group_ids]&.reject(&:blank?) + # charge_group_ids = @course.charge_group_ids(current_user) + # publish_groups = charge_group_ids & group_ids if group_ids + # + # attachments.each do |atta| + # if atta.published? && !atta.unified_setting || !atta.published? + # create_atta_group_settings atta + # atta.update_attributes!(unified_setting: 0) if atta.unified_setting + # none_publish_settings = atta.attachment_group_settings.where(course_group_id: publish_groups).none_published + # none_publish_settings.update_all(publish_time: Time.now) + # end + # end + # end # 未发布的资源更新状态 attachments.where(is_publish: 0).update_all(is_publish: 1, publish_time: Time.now) @@ -140,7 +140,7 @@ class FilesController < ApplicationController def public_with_course_and_project @attachments = Attachment.publiced.simple_columns .contains_course_and_project - .includes(:author => :user_extension) + .includes(:container, author: :user_extension) .by_filename_or_user_name(params[:search]) .ordered(sort: 0, sort_type: 'created_on') @@ -361,15 +361,16 @@ class FilesController < ApplicationController def publish_params tip_exception("缺少发布参数") if params[:delay_publish].blank? @unified_setting = 1 - if params[:delay_publish].to_i == 1 && @course.course_group_module? && @course.course_groups_count != 0 - tip_exception("分班发布设置不能为空") if params[:group_settings].blank? - min_publish_time = params[:group_settings].pluck(:publish_time).reject(&:blank?).min - max_publish_time = params[:group_settings].pluck(:publish_time).reject(&:blank?).max - tip_exception("分班发布设置不能为空") if min_publish_time.blank? - - # 分班设置中的时间一样且包含所有分班 则按统一设置处理,否则是非统一设置 - @unified_setting = 0 unless min_publish_time == max_publish_time && params[:group_settings].pluck(:group_id).flatten.sort == @course.course_groups.pluck(:id).sort - elsif params[:delay_publish].to_i == 1 + # if params[:delay_publish].to_i == 1 && @course.course_group_module? && @course.course_groups_count != 0 + # tip_exception("分班发布设置不能为空") if params[:group_settings].blank? + # min_publish_time = params[:group_settings].pluck(:publish_time).reject(&:blank?).min + # max_publish_time = params[:group_settings].pluck(:publish_time).reject(&:blank?).max + # tip_exception("分班发布设置不能为空") if min_publish_time.blank? + # + # # 分班设置中的时间一样且包含所有分班 则按统一设置处理,否则是非统一设置 + # @unified_setting = 0 unless min_publish_time == max_publish_time && params[:group_settings].pluck(:group_id).flatten.sort == @course.course_groups.pluck(:id).sort + # els + if params[:delay_publish].to_i == 1 tip_exception("缺少延期发布的时间参数") if params[:publish_time].blank? min_publish_time = params[:publish_time] end diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index 442e9ca3b..b7ec6fb8e 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -68,6 +68,7 @@ class HackUserLastestCodesController < ApplicationController # 提交记录详情 def record_detail @hack_user = HackUserCode.find params[:id] + @my_hack = @hack_user.hack_user_lastest_code end # 接收中间件返回结果接口 diff --git a/app/controllers/hacks_controller.rb b/app/controllers/hacks_controller.rb index 4465d515d..c9e9097f8 100644 --- a/app/controllers/hacks_controller.rb +++ b/app/controllers/hacks_controller.rb @@ -48,7 +48,9 @@ class HacksController < ApplicationController hack.save! # 创建测试集与代码 hack.hack_sets.create!(hack_sets_params) - hack.hack_codes.create!(hack_code_params.merge(modify_time: Time.now)) + hack_codes = hack.hack_codes.new(hack_code_params) + hack_codes.modify_time = Time.now + hack_codes.save! end render_ok({identifier: hack.identifier}) rescue Exception => e @@ -67,10 +69,8 @@ class HacksController < ApplicationController # 新建 @hack.hack_sets.create!(hack_sets_params) # 更新代码 - if params[:hack_codes][:code] != @hack.code - hack_code_params = hack_code_params.merge(modify_time: Time.now) - end - @hack.hack_codes.create!(hack_code_params) + code_params = params[:hack_codes][:code] != @hack.code ? hack_code_params.merge(modify_time: Time.now) : hack_code_params + @hack.hack_codes.first.update_attributes!(code_params) end render_ok rescue Exception => e diff --git a/app/forms/users/update_password_form.rb b/app/forms/users/update_password_form.rb index 4da341839..db674384c 100644 --- a/app/forms/users/update_password_form.rb +++ b/app/forms/users/update_password_form.rb @@ -3,5 +3,5 @@ class Users::UpdatePasswordForm attr_accessor :password, :old_password - validates :password, presence: true + validates :password, presence: true, length: { minimum: 8, maximum: 16 }, format: { with: CustomRegexp::PASSWORD, message: "8~16位密码,支持字母数字和符号" } end \ No newline at end of file diff --git a/app/libs/custom_regexp.rb b/app/libs/custom_regexp.rb index 2a2a99384..2980f2ed2 100644 --- a/app/libs/custom_regexp.rb +++ b/app/libs/custom_regexp.rb @@ -3,4 +3,5 @@ module CustomRegexp EMAIL = /\A[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+\z/ LASTNAME = /\A[a-zA-Z0-9\u4e00-\u9fa5]+\z/ NICKNAME = /\A[\u4e00-\u9fa5_a-zA-Z0-9]+\z/ + PASSWORD = /\A[a-z_A-Z0-9\-\.!@#\$%\\\^&\*\)\(\+=\{\}\[\]\/",'_<>~\·`\?:;|]{8,16}\z/ end \ No newline at end of file diff --git a/app/models/attachment.rb b/app/models/attachment.rb index a918f4e0a..f18d9cd2a 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -21,7 +21,7 @@ class Attachment < ApplicationRecord scope :contains_only_project, -> { where(container_type: 'Project') } scope :contains_course_and_project, -> { contains_only_course.or(contains_only_project) } scope :mine, -> (author_id) { where(author_id: author_id) } - scope :simple_columns, -> { select(:id, :filename, :filesize, :created_on, :cloud_url, :author_id, :content_type) } + scope :simple_columns, -> { select(:id, :filename, :filesize, :created_on, :cloud_url, :author_id, :content_type, :container_type, :container_id) } scope :search_by_container, -> (ids) {where(container_id: ids)} scope :unified_setting, -> {where("unified_setting = ? ", 1)} @@ -35,7 +35,7 @@ class Attachment < ApplicationRecord def title title = filename - if container.is_a?(StudentWork) && author_id != User.current.id + if container && container.is_a?(StudentWork) && author_id != User.current.id course = container&.homework_common&.course unless User.current.teacher_of_course?(course) title = "#{Time.now.strftime('%Y%m%d%H%M%S')}_#{DCODES.sample(8).join}" + File.extname(filename) diff --git a/app/models/hack.rb b/app/models/hack.rb index a32e91325..506cd4942 100644 --- a/app/models/hack.rb +++ b/app/models/hack.rb @@ -42,8 +42,8 @@ class Hack < ApplicationRecord end # 管理员 - def manager? - user_id == current_user.id || current_user.admin_or_business? + def manager?(user) + user_id == user.id || user.admin_or_business? end end diff --git a/app/models/hack_user_code.rb b/app/models/hack_user_code.rb index 072fd4e31..eee394e39 100644 --- a/app/models/hack_user_code.rb +++ b/app/models/hack_user_code.rb @@ -1,6 +1,7 @@ class HackUserCode < ApplicationRecord # 用户编程题的信息 belongs_to :hack + belongs_to :hack_user_lastest_code scope :created_order, ->{ order("created_at desc")} end diff --git a/app/views/admins/courses/shared/_list.html.erb b/app/views/admins/courses/shared/_list.html.erb index 633616462..4105c8153 100644 --- a/app/views/admins/courses/shared/_list.html.erb +++ b/app/views/admins/courses/shared/_list.html.erb @@ -1,30 +1,31 @@ + - + - + - - + + <% if courses.present? %> - <% courses.each do |course| %> + <% courses.each_with_index do |course, index| %> - <%= render 'admins/courses/shared/td', course: course %> + <%= render partial: 'admins/courses/shared/td', locals: {course: course, no: index} %> <% end %> <% else %> diff --git a/app/views/admins/courses/shared/_td.html.erb b/app/views/admins/courses/shared/_td.html.erb index 1d2da2a33..51cc4b199 100644 --- a/app/views/admins/courses/shared/_td.html.erb +++ b/app/views/admins/courses/shared/_td.html.erb @@ -1,3 +1,4 @@ +
序号 ID 课堂名称成员成员 资源 普通作业 分组作业 实训作业 试卷评测次数评测次数 私有 状态 单位 创建者 <%= sort_tag('创建时间', name: 'created_at', path: admins_courses_path) %> 首页邮件通知操作邮件通知操作
<%= list_index_no((params[:page] || 1).to_i, no) %> <%= course.id %> <%= link_to(course.name, "/courses/#{course.id}", target: '_blank') %> diff --git a/app/views/admins/courses/update.js.erb b/app/views/admins/courses/update.js.erb index 1278a2e1f..983ac22f0 100644 --- a/app/views/admins/courses/update.js.erb +++ b/app/views/admins/courses/update.js.erb @@ -1 +1,3 @@ -$("#course-item-<%= @course.id %>").html("<%= j render partial: "admins/courses/shared/td",locals: {course: @course} %>") \ No newline at end of file +var index = $("#course-item-<%= @course.id %>").children(":first").html(); +$("#course-item-<%= @course.id %>").html("<%= j render partial: "admins/courses/shared/td",locals: {course: @course, no: 1} %>"); +$("#course-item-<%= @course.id %>").children(":first").html(index); \ No newline at end of file diff --git a/app/views/admins/customers/shared/_list.html.erb b/app/views/admins/customers/shared/_list.html.erb index 0ba5638cb..6f84db4e5 100644 --- a/app/views/admins/customers/shared/_list.html.erb +++ b/app/views/admins/customers/shared/_list.html.erb @@ -1,15 +1,17 @@ - + + <% if customers.present? %> - <% customers.each do |customer| %> + <% customers.each_with_index do |customer, index| %> +
客户名称序号客户名称 <%= sort_tag('添加时间', name: 'created_at', path: admins_partner_customers_path(current_partner)) %> 操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= customer.school&.name %> <%= customer.created_at&.strftime('%Y-%m-%d %H:%M') %> diff --git a/app/views/admins/daily_school_statistics/shared/_list.html.erb b/app/views/admins/daily_school_statistics/shared/_list.html.erb index 611acdd2a..6982891ee 100644 --- a/app/views/admins/daily_school_statistics/shared/_list.html.erb +++ b/app/views/admins/daily_school_statistics/shared/_list.html.erb @@ -1,8 +1,8 @@ + - @@ -16,13 +16,14 @@ - + <% if statistics.present? %> - <% statistics.each do |statistic| %> + <% statistics.each_with_index do |statistic, index| %> +
序号 单位名称<%= sort_tag('教师总数', name: 'teacher_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('学生总数', name: 'student_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('课堂总数', name: 'course_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('实训作业总数', name: 'homework_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('其它作业总数', name: 'other_homework_count', path: admins_daily_school_statistics_path) %><%= sort_tag('动态时间', name: 'nearly_course_time', path: admins_daily_school_statistics_path) %><%= sort_tag('动态时间', name: 'nearly_course_time', path: admins_daily_school_statistics_path) %>
<%= list_index_no(@params_page.to_i, index) %> <%= link_to statistic[:name], "/colleges/#{statistic[:id]}/statistics", target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %> diff --git a/app/views/admins/department_applies/shared/_list.html.erb b/app/views/admins/department_applies/shared/_list.html.erb index 0a1d803be..87d5ab66f 100644 --- a/app/views/admins/department_applies/shared/_list.html.erb +++ b/app/views/admins/department_applies/shared/_list.html.erb @@ -1,18 +1,20 @@ + - + <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> + diff --git a/app/views/admins/department_members/create.js.erb b/app/views/admins/department_members/create.js.erb index 4355c7432..6bf0a6ac3 100644 --- a/app/views/admins/department_members/create.js.erb +++ b/app/views/admins/department_members/create.js.erb @@ -1,4 +1,6 @@ $('.modal.admin-add-department-member-modal').modal('hide'); $.notify({ message: '操作成功' }); -$('.department-list-table .department-item-<%= current_department.id %>').html("<%= j(render partial: 'admins/departments/shared/department_item', locals: { department: current_department }) %>") \ No newline at end of file +var index = $(".department-item-<%= current_department.id %>").children(":first").html(); +$('.department-list-table .department-item-<%= current_department.id %>').html("<%= j(render partial: 'admins/departments/shared/department_item', locals: { department: current_department, index: 1 }) %>"); +$(".department-item-<%= current_department.id %>").children(":first").html(index); \ No newline at end of file diff --git a/app/views/admins/departments/shared/_department_item.html.erb b/app/views/admins/departments/shared/_department_item.html.erb index 64b4ee70b..62f3a81ac 100644 --- a/app/views/admins/departments/shared/_department_item.html.erb +++ b/app/views/admins/departments/shared/_department_item.html.erb @@ -1,3 +1,4 @@ + <% not_list = defined?(:users_count) %> diff --git a/app/views/admins/departments/shared/_list.html.erb b/app/views/admins/departments/shared/_list.html.erb index 6af63d6f4..09ba2a65f 100644 --- a/app/views/admins/departments/shared/_list.html.erb +++ b/app/views/admins/departments/shared/_list.html.erb @@ -1,10 +1,11 @@
序号 ID 部门名称 单位名称创建者创建者 <%= sort_tag('创建于', name: 'created_at', path: admins_department_applies_path) %> 操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= apply.id %> <%= apply.name %> <%= apply.school.try(:name) %><%= list_index_no((params[:page] || 1).to_i, index) %><%= overflow_hidden_span department.name, width: 150 %>
+ - + @@ -14,9 +15,9 @@ <% if departments.present? %> - <% departments.each do |department| %> + <% departments.each_with_index do |department, index| %> - <%= render 'admins/departments/shared/department_item', department: department %> + <%= render partial: 'admins/departments/shared/department_item', locals: {department: department, index: index} %> <% end %> <% else %> diff --git a/app/views/admins/departments/update.js.erb b/app/views/admins/departments/update.js.erb index 359bac59c..d20ca9524 100644 --- a/app/views/admins/departments/update.js.erb +++ b/app/views/admins/departments/update.js.erb @@ -1,4 +1,6 @@ $('.modal.admin-edit-department-modal').modal('hide'); $.notify({ message: '操作成功' }); -$('.department-list-table .department-item-<%= current_department.id %>').html("<%= j(render partial: 'admins/departments/shared/department_item', locals: { department: current_department }) %>") \ No newline at end of file +var index = $(".department-item-<%= current_department.id %>").children(":first").html(); +$('.department-list-table .department-item-<%= current_department.id %>').html("<%= j(render partial: 'admins/departments/shared/department_item', locals: {department: current_department, index: 1}) %>"); +$(".department-item-<%= current_department.id %>").children(":first").html(index); \ No newline at end of file diff --git a/app/views/admins/identity_authentications/shared/_list.html.erb b/app/views/admins/identity_authentications/shared/_list.html.erb index 607feb93a..6e12d1c54 100644 --- a/app/views/admins/identity_authentications/shared/_list.html.erb +++ b/app/views/admins/identity_authentications/shared/_list.html.erb @@ -3,6 +3,7 @@
序号 部门名称 单位名称 用户数已职业认证已职业认证 部门管理员 统计链接 云主机数
+ <% unless is_processed %> - + <% unless is_processed %> <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> <% user = apply.user %> + <% unless is_processed %> <% end %> diff --git a/app/views/admins/laboratories/shared/_laboratory_item.html.erb b/app/views/admins/laboratories/shared/_laboratory_item.html.erb index 81a45ca71..765616926 100644 --- a/app/views/admins/laboratories/shared/_laboratory_item.html.erb +++ b/app/views/admins/laboratories/shared/_laboratory_item.html.erb @@ -1,4 +1,5 @@ <% school = laboratory.school %> +
序号 <%= check_box_tag('all-check', 1, false, id: nil, class: 'batch-all-check-box', @@ -13,7 +14,7 @@ 姓名 身份证号 学校/单位职称职称 照片 @@ -33,9 +34,10 @@
<%= list_index_no((params[:page] || 1).to_i, index) %><%= check_box_tag('ids[]', apply.id, false, id: nil, class: 'batch-check-box') %><%= list_index_no((params[:page] || 1).to_i, index) %> <%= school&.name || 'EduCoder主站' %> <% if laboratory.identifier %> diff --git a/app/views/admins/laboratories/shared/_list.html.erb b/app/views/admins/laboratories/shared/_list.html.erb index 2520b3276..a731be44a 100644 --- a/app/views/admins/laboratories/shared/_list.html.erb +++ b/app/views/admins/laboratories/shared/_list.html.erb @@ -1,6 +1,7 @@ + @@ -9,14 +10,14 @@ - + <% if laboratories.present? %> - <% laboratories.each do |laboratory| %> + <% laboratories.each_with_index do |laboratory, index| %> - <%= render 'admins/laboratories/shared/laboratory_item', laboratory: laboratory %> + <%= render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: laboratory, index: index} %> <% end %> <% else %> diff --git a/app/views/admins/laboratories/update.js.erb b/app/views/admins/laboratories/update.js.erb index 1b9f307a6..149539ad6 100644 --- a/app/views/admins/laboratories/update.js.erb +++ b/app/views/admins/laboratories/update.js.erb @@ -1 +1,3 @@ -$(".laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: "admins/laboratories/shared/laboratory_item",locals: {laboratory: @laboratory} %>") \ No newline at end of file +var index = $(".laboratory-item-<%= @laboratory.id %>").children(":first").html(); +$(".laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: "admins/laboratories/shared/laboratory_item",locals: {laboratory: @laboratory, index: 1} %>"); +$(".laboratory-item-<%= @laboratory.id %>").children(":first").html(index); \ No newline at end of file diff --git a/app/views/admins/laboratories/update_sync_course.js.erb b/app/views/admins/laboratories/update_sync_course.js.erb index 5ae68f673..663f56ee1 100644 --- a/app/views/admins/laboratories/update_sync_course.js.erb +++ b/app/views/admins/laboratories/update_sync_course.js.erb @@ -1 +1,3 @@ -$("#laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: @laboratory} %>") \ No newline at end of file +var index = $(".laboratory-item-<%= @laboratory.id %>").children(":first").html(); +$("#laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: @laboratory, index: 1} %>"); +$(".laboratory-item-<%= @laboratory.id %>").children(":first").html(index); \ No newline at end of file diff --git a/app/views/admins/laboratory_shixuns/shared/_list.html.erb b/app/views/admins/laboratory_shixuns/shared/_list.html.erb index e1244c472..462486f4b 100644 --- a/app/views/admins/laboratory_shixuns/shared/_list.html.erb +++ b/app/views/admins/laboratory_shixuns/shared/_list.html.erb @@ -1,21 +1,22 @@
序号 单位名称 域名 统计链接同步课堂 同步实践课程 同步实训操作操作
- + + - + <% if laboratory_shixuns.present? %> - <% laboratory_shixuns.each do |laboratory_shixun| %> + <% laboratory_shixuns.each_with_index do |laboratory_shixun, index| %> - <%= render partial: 'admins/laboratory_shixuns/shared/td', locals: { laboratory_shixun: laboratory_shixun } %> + <%= render partial: 'admins/laboratory_shixuns/shared/td', locals: { laboratory_shixun: laboratory_shixun, index: index } %> <% end %> <% else %> diff --git a/app/views/admins/laboratory_shixuns/shared/_td.html.erb b/app/views/admins/laboratory_shixuns/shared/_td.html.erb index dbdf0df75..d987b53b4 100644 --- a/app/views/admins/laboratory_shixuns/shared/_td.html.erb +++ b/app/views/admins/laboratory_shixuns/shared/_td.html.erb @@ -1,5 +1,6 @@ <%- shixun = laboratory_shixun.shixun -%> +
实训名称序号实训名称 技术平台 技术体系 封面 创建者状态状态 执行时间 操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/shixuns/#{shixun.identifier}", target: '_blank' do %> <%= shixun.name %> diff --git a/app/views/admins/laboratory_subjects/shared/_list.html.erb b/app/views/admins/laboratory_subjects/shared/_list.html.erb index 55f67dea8..c40d02260 100644 --- a/app/views/admins/laboratory_subjects/shared/_list.html.erb +++ b/app/views/admins/laboratory_subjects/shared/_list.html.erb @@ -1,7 +1,8 @@ - + + @@ -13,10 +14,11 @@ <% if laboratory_subjects.present? %> - <% laboratory_subjects.each do |laboratory_subject| %> + <% laboratory_subjects.each_with_index do |laboratory_subject, index| %> <%- subject = laboratory_subject.subject -%> +
课程名称序号课程名称 技术体系 等级体系 封面
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to(subject.name, "/paths/#{subject.id}", target: '_blank') %> 首页 diff --git a/app/views/admins/laboratory_users/create.js.erb b/app/views/admins/laboratory_users/create.js.erb index f43fd7887..604e62943 100644 --- a/app/views/admins/laboratory_users/create.js.erb +++ b/app/views/admins/laboratory_users/create.js.erb @@ -1,4 +1,6 @@ $('.modal.admin-add-laboratory-user-modal').modal('hide'); $.notify({ message: '操作成功' }); -$('.laboratory-list-table .laboratory-item-<%= current_laboratory.id %>').html("<%= j(render partial: 'admins/laboratories/shared/laboratory_item', locals: { laboratory: current_laboratory }) %>") \ No newline at end of file +var index = $(".laboratory-item-<%= current_laboratory.id %>").children(":first").html(); +$('.laboratory-list-table .laboratory-item-<%= current_laboratory.id %>').html("<%= j(render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: current_laboratory, index: 1}) %>"); +$(".laboratory-item-<%= current_laboratory.id %>").children(":first").html(index); \ No newline at end of file diff --git a/app/views/admins/library_applies/shared/_list.html.erb b/app/views/admins/library_applies/shared/_list.html.erb index 783d0db30..fde3d1d1a 100644 --- a/app/views/admins/library_applies/shared/_list.html.erb +++ b/app/views/admins/library_applies/shared/_list.html.erb @@ -3,11 +3,12 @@ + - + <% if is_processed %> @@ -18,10 +19,11 @@ <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> <% user = apply.library.user %> <% library = apply.library %> +
序号 头像 姓名 教学案例 案例描述时间时间拒绝原因 状态
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> diff --git a/app/views/admins/myshixuns/shared/_list.html.erb b/app/views/admins/myshixuns/shared/_list.html.erb index 440437320..a80a4ef23 100644 --- a/app/views/admins/myshixuns/shared/_list.html.erb +++ b/app/views/admins/myshixuns/shared/_list.html.erb @@ -1,9 +1,10 @@ + - + @@ -14,8 +15,9 @@ <% if myshixuns.present? %> - <% myshixuns.each do |myshixun| %> + <% myshixuns.each_with_index do |myshixun, index| %> +
序号 ID 标识实训名称实训名称 实训老师 完成 经验值
<%= list_index_no(@params_page.to_i, index) %> <%= myshixun.id %> <%= myshixun.identifier %> diff --git a/app/views/admins/partners/shared/_list.html.erb b/app/views/admins/partners/shared/_list.html.erb index 0bebc2a4b..71153c175 100644 --- a/app/views/admins/partners/shared/_list.html.erb +++ b/app/views/admins/partners/shared/_list.html.erb @@ -1,15 +1,17 @@ - + + <% if partners.present? %> - <% partners.each do |partner| %> + <% partners.each_with_index do |partner, index| %> + diff --git a/app/views/admins/professional_authentications/shared/_list.html.erb b/app/views/admins/professional_authentications/shared/_list.html.erb index 6ec6355ba..7ffa5837e 100644 --- a/app/views/admins/professional_authentications/shared/_list.html.erb +++ b/app/views/admins/professional_authentications/shared/_list.html.erb @@ -3,6 +3,7 @@
名称序号名称 <%= sort_tag('添加时间', name: 'created_at', path: admins_partners_path) %> 操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to partner.school&.name || partner.name, customers_partner_path(partner), target: '_blank' %>
+ <% unless is_processed %> - + <% unless is_processed %> <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> <% user = apply.user %> + <% unless is_processed %> <% end %> diff --git a/app/views/admins/project_package_applies/shared/_list.html.erb b/app/views/admins/project_package_applies/shared/_list.html.erb index d94c96184..bec0912ca 100644 --- a/app/views/admins/project_package_applies/shared/_list.html.erb +++ b/app/views/admins/project_package_applies/shared/_list.html.erb @@ -3,11 +3,12 @@
序号 <%= check_box_tag('all-check', 1, false, id: nil, class: 'batch-all-check-box', @@ -12,7 +13,7 @@ 头像 姓名 学校/单位职称职称 照片 @@ -31,9 +32,10 @@
<%= list_index_no((params[:page] || 1).to_i, index) %><%= check_box_tag('ids[]', apply.id, false, id: nil, class: 'batch-check-box') %>
+ - + <% if is_processed %> @@ -18,10 +19,11 @@ <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> <% package = apply.project_package %> <% user = package.creator %> +
序号 头像 姓名 众包需求 需求描述时间时间拒绝原因 状态
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> diff --git a/app/views/admins/projects/shared/_list.html.erb b/app/views/admins/projects/shared/_list.html.erb index 8a84a72d0..e2a6307ad 100644 --- a/app/views/admins/projects/shared/_list.html.erb +++ b/app/views/admins/projects/shared/_list.html.erb @@ -1,6 +1,7 @@ + @@ -11,14 +12,15 @@ - + <% if projects.present? %> - <% projects.each do |project| %> + <% projects.each_with_index do |project, index| %> +
序号 ID 项目名称 公开里程碑 成员 管理员<%= sort_tag('创建时间', name: 'created_at', path: admins_projects_path) %><%= sort_tag('创建时间', name: 'created_at', path: admins_projects_path) %> 操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= project.id %> <%= link_to(project.name, "/projects/#{project.id}", target: '_blank') %> diff --git a/app/views/admins/school_statistics/shared/_list.html.erb b/app/views/admins/school_statistics/shared/_list.html.erb index aa043f097..9d2a1c209 100644 --- a/app/views/admins/school_statistics/shared/_list.html.erb +++ b/app/views/admins/school_statistics/shared/_list.html.erb @@ -20,7 +20,8 @@ - + + @@ -32,8 +33,9 @@ <% if statistics.present? %> - <% statistics.each do |statistic| %> + <% statistics.each_with_index do |statistic, index| %> +
单位名称序号单位名称 <%= sort_tag('新增教师', name: 'teacher_increase_count', path: admins_school_statistics_path) %> <%= sort_tag('新增学生', name: 'student_increase_count', path: admins_school_statistics_path) %> <%= sort_tag('新增课堂', name: 'course_increase_count', path: admins_school_statistics_path) %>
<%= list_index_no(@params_page.to_i, index) %> <%= link_to statistic.school_name, "/colleges/#{statistic.school_id}/statistics", target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %> diff --git a/app/views/admins/schools/index.html.erb b/app/views/admins/schools/index.html.erb index 9c41067ee..56cbadd9d 100644 --- a/app/views/admins/schools/index.html.erb +++ b/app/views/admins/schools/index.html.erb @@ -4,7 +4,7 @@
<%= form_tag(admins_schools_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %> - <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '部门名称检索') %> + <%= 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': '搜索中...') %> <% end %> diff --git a/app/views/admins/schools/shared/_list.html.erb b/app/views/admins/schools/shared/_list.html.erb index ec7475028..ff0b17992 100644 --- a/app/views/admins/schools/shared/_list.html.erb +++ b/app/views/admins/schools/shared/_list.html.erb @@ -1,6 +1,7 @@ + @@ -11,13 +12,14 @@ - + <% if schools.present? %> - <% schools.each do |school| %> + <% schools.each_with_index do |school, index| %> +
序号 ID LOGO 标识码<%= sort_tag('用户数', name: 'users_count', path: admins_schools_path) %> 部门数 <%= sort_tag('创建时间', name: 'created_at', path: admins_schools_path) %>操作操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= school.id %> <% if Util::FileManage.exists?(school) %> diff --git a/app/views/admins/shixun_authorizations/shared/_list.html.erb b/app/views/admins/shixun_authorizations/shared/_list.html.erb index c1dec5f45..c3828ec86 100644 --- a/app/views/admins/shixun_authorizations/shared/_list.html.erb +++ b/app/views/admins/shixun_authorizations/shared/_list.html.erb @@ -3,11 +3,12 @@ + - + <% if is_processed %> @@ -19,12 +20,13 @@ <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> <% user = apply.user %> <% shixun = shixun_map[apply.container_id] %> <% content_review = shixun.shixun_reviews.select{|sr| sr.review_type == 'Content'}.first %> <% perference_review = shixun.shixun_reviews.select{|sr| sr.review_type == 'Performance'}.first %> +
序号 头像 创建者 实训名称 审核情况任务数任务数 时间拒绝原因
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", class: 'shixun-authorization-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> diff --git a/app/views/admins/shixun_recycles/shared/_list.html.erb b/app/views/admins/shixun_recycles/shared/_list.html.erb index 60d2742e9..5518fc753 100644 --- a/app/views/admins/shixun_recycles/shared/_list.html.erb +++ b/app/views/admins/shixun_recycles/shared/_list.html.erb @@ -1,16 +1,18 @@ + - + <% if shixuns.present? %> - <% shixuns.each do |shixun| %> + <% shixuns.each_with_index do |shixun, index| %> + diff --git a/app/views/admins/shixun_settings/shared/_list.html.erb b/app/views/admins/shixun_settings/shared/_list.html.erb index 7591fe323..aee4307b1 100644 --- a/app/views/admins/shixun_settings/shared/_list.html.erb +++ b/app/views/admins/shixun_settings/shared/_list.html.erb @@ -1,12 +1,13 @@
序号 ID 实训名称子站源子站源 创建者 <%= sort_tag('创建于', name: 'created_at', path: admins_shixun_recycles_path) %> 操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= shixun.identifier %> <%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %> <%= shixun.laboratory&.school&.name %>
- + + - - - + + + diff --git a/app/views/admins/shixun_settings/shared/_td.html.erb b/app/views/admins/shixun_settings/shared/_td.html.erb index f4a05f178..905183873 100644 --- a/app/views/admins/shixun_settings/shared/_td.html.erb +++ b/app/views/admins/shixun_settings/shared/_td.html.erb @@ -1,3 +1,4 @@ +
ID序号ID 实训名称 技术平台 权限技术体系上传图片小程序封面技术体系上传图片小程序封面 创建者 关闭 复制<%= page_no %> <%= shixun.identifier %> diff --git a/app/views/admins/subject_authorizations/shared/_list.html.erb b/app/views/admins/subject_authorizations/shared/_list.html.erb index 28a699e22..94503dad7 100644 --- a/app/views/admins/subject_authorizations/shared/_list.html.erb +++ b/app/views/admins/subject_authorizations/shared/_list.html.erb @@ -3,9 +3,10 @@ + - + @@ -20,10 +21,11 @@ <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> <% user = apply.user %> <% subject = subject_map[apply.container_id] %> +
序号 头像 创建者实践课程名称实践课程名称 阶段数 实训数 关卡数
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", class: 'subject-authorization-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> diff --git a/app/views/admins/subjects/shared/_list.html.erb b/app/views/admins/subjects/shared/_list.html.erb index 5a37b64e7..33d37f21d 100644 --- a/app/views/admins/subjects/shared/_list.html.erb +++ b/app/views/admins/subjects/shared/_list.html.erb @@ -1,11 +1,12 @@ + - - - - + + + + @@ -17,8 +18,9 @@ <% if subjects.present? %> - <% subjects.each do |subject| %> + <% subjects.each_with_index do |subject, index| %> +
序号 名称阶段数实训数技术体系等级体系阶段数实训数技术体系等级体系 封面 创建者 单位
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to(subject.name, "/paths/#{subject.id}", target: '_blank') %> 首页 diff --git a/app/views/admins/unit_applies/shared/_apply_item.html.erb b/app/views/admins/unit_applies/shared/_apply_item.html.erb index 084826d72..b7d38b776 100644 --- a/app/views/admins/unit_applies/shared/_apply_item.html.erb +++ b/app/views/admins/unit_applies/shared/_apply_item.html.erb @@ -1,3 +1,4 @@ +<%= list_index_no((params[:page] || 1).to_i, index) %> <%= apply.id %> <%= overflow_hidden_span apply.name %> diff --git a/app/views/admins/unit_applies/shared/_list.html.erb b/app/views/admins/unit_applies/shared/_list.html.erb index c28ce7967..75b9c720b 100644 --- a/app/views/admins/unit_applies/shared/_list.html.erb +++ b/app/views/admins/unit_applies/shared/_list.html.erb @@ -1,9 +1,10 @@ + - + @@ -12,9 +13,9 @@ <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> - <%= render partial: "admins/unit_applies/shared/apply_item", locals: {apply: apply} %> + <%= render partial: "admins/unit_applies/shared/apply_item", locals: {apply: apply, index: index} %> <% end %> <% else %> diff --git a/app/views/admins/user_statistics/shared/_list.html.erb b/app/views/admins/user_statistics/shared/_list.html.erb index 5759d2f38..1e63fd0ac 100644 --- a/app/views/admins/user_statistics/shared/_list.html.erb +++ b/app/views/admins/user_statistics/shared/_list.html.erb @@ -1,20 +1,22 @@
序号 ID 单位名称地区地区 详细地址 申请者 <%= sort_tag('创建于', name: 'created_at', path: admins_unit_applies_path) %>
+ - - - - + + + + <% if users.present? %> - <% users.each do |user| %> + <% users.each_with_index do |user, index| %> +
序号 姓名 单位部门 学习关卡数<%#= sort_tag('学习关卡数', name: 'study_challenge_count', path: admins_user_statistics_path) %>完成关卡数<%#= sort_tag('完成关卡数', name: 'finish_challenge_count', path: admins_user_statistics_path) %><%= sort_tag('学习实训数', name: 'study_shixun_count', path: admins_user_statistics_path) %><%= sort_tag('完成实训数', name: 'finish_shixun_count', path: admins_user_statistics_path) %>评测次数完成关卡数<%#= sort_tag('完成关卡数', name: 'finish_challenge_count', path: admins_user_statistics_path) %><%= sort_tag('学习实训数', name: 'study_shixun_count', path: admins_user_statistics_path) %><%= sort_tag('完成实训数', name: 'finish_shixun_count', path: admins_user_statistics_path) %>评测次数 实战时间
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", target: '_blank' do %> <%= overflow_hidden_span user.real_name, width: 100 %> diff --git a/app/views/admins/users/shared/_user_list.html.erb b/app/views/admins/users/shared/_user_list.html.erb index 0a21baafe..36243e547 100644 --- a/app/views/admins/users/shared/_user_list.html.erb +++ b/app/views/admins/users/shared/_user_list.html.erb @@ -1,8 +1,9 @@ - - + + + @@ -15,8 +16,9 @@ <% if users.present? %> - <% users.each do |user| %> + <% users.each_with_index do |user, index| %> +
真实姓名邮件地址序号真实姓名邮件地址 手机号码 单位 角色
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", target: '_blank' do %> <%= overflow_hidden_span user.real_name, width: 100 %> diff --git a/app/views/admins/video_applies/shared/_list.html.erb b/app/views/admins/video_applies/shared/_list.html.erb index 5e472bd4b..3466d21ba 100644 --- a/app/views/admins/video_applies/shared/_list.html.erb +++ b/app/views/admins/video_applies/shared/_list.html.erb @@ -3,12 +3,13 @@ + - + <% if is_processed %> @@ -19,10 +20,11 @@ <% if applies.present? %> - <% applies.each do |v| %> + <% applies.each_with_index do |v, index| %> <% video = v.video %> <% user = video.user %> +
序号 头像 姓名 视频名称 视频大小 播放链接时间时间拒绝原因 状态
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> diff --git a/app/views/hack_user_lastest_codes/record_detail.json.jbuilder b/app/views/hack_user_lastest_codes/record_detail.json.jbuilder index 4b77c2e00..8f72014fe 100644 --- a/app/views/hack_user_lastest_codes/record_detail.json.jbuilder +++ b/app/views/hack_user_lastest_codes/record_detail.json.jbuilder @@ -1,4 +1,8 @@ json.(@hack_user, :id, :status, :error_line, :error_msg, :expected_output, :input, :output, :execute_time, :execute_memory, :created_at, :code) json.language @hack_user.hack.language -json.name @hack_user.hack.name \ No newline at end of file +json.name @hack_user.hack.name +json.myproblem_identifier @my_hack.identifier +json.user do + json.partial! 'users/user', user: current_user +end \ No newline at end of file diff --git a/app/views/hack_user_lastest_codes/show.json.jbuilder b/app/views/hack_user_lastest_codes/show.json.jbuilder index f6fde6261..2d7ffd2bf 100644 --- a/app/views/hack_user_lastest_codes/show.json.jbuilder +++ b/app/views/hack_user_lastest_codes/show.json.jbuilder @@ -14,8 +14,6 @@ end json.user do json.partial! 'users/user', user: current_user -end + json.hack_manager @hack.manager?(current_user) -json.user_auth do - json.manager @hack.manager? end \ No newline at end of file diff --git a/db/migrate/20191209111347_add_index_for_hack_codes.rb b/db/migrate/20191209111347_add_index_for_hack_codes.rb new file mode 100644 index 000000000..f1e655e21 --- /dev/null +++ b/db/migrate/20191209111347_add_index_for_hack_codes.rb @@ -0,0 +1,6 @@ +class AddIndexForHackCodes < ActiveRecord::Migration[5.2] + def change + HackCode.destroy_all + add_index :hack_codes, [:hack_id, :language], unique: true + end +end diff --git a/public/images/educoder/index/shixun/shixun24.jpg b/public/images/educoder/index/shixun/shixun24.jpg deleted file mode 100644 index 51d97e719..000000000 Binary files a/public/images/educoder/index/shixun/shixun24.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun25.jpg b/public/images/educoder/index/shixun/shixun25.jpg deleted file mode 100644 index ceb1ff60a..000000000 Binary files a/public/images/educoder/index/shixun/shixun25.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun26.jpg b/public/images/educoder/index/shixun/shixun26.jpg deleted file mode 100644 index 6180626a4..000000000 Binary files a/public/images/educoder/index/shixun/shixun26.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun27.jpg b/public/images/educoder/index/shixun/shixun27.jpg deleted file mode 100644 index a998669c6..000000000 Binary files a/public/images/educoder/index/shixun/shixun27.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun28.jpg b/public/images/educoder/index/shixun/shixun28.jpg deleted file mode 100644 index 8b9422b87..000000000 Binary files a/public/images/educoder/index/shixun/shixun28.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun29.jpg b/public/images/educoder/index/shixun/shixun29.jpg deleted file mode 100644 index e9cda9129..000000000 Binary files a/public/images/educoder/index/shixun/shixun29.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun30.jpg b/public/images/educoder/index/shixun/shixun30.jpg deleted file mode 100644 index df4df88a0..000000000 Binary files a/public/images/educoder/index/shixun/shixun30.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun31.jpg b/public/images/educoder/index/shixun/shixun31.jpg deleted file mode 100644 index 131afcac2..000000000 Binary files a/public/images/educoder/index/shixun/shixun31.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun31.jpg~HEAD b/public/images/educoder/index/shixun/shixun31.jpg~HEAD deleted file mode 100644 index 5d4218a45..000000000 Binary files a/public/images/educoder/index/shixun/shixun31.jpg~HEAD and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun32.jpg b/public/images/educoder/index/shixun/shixun32.jpg deleted file mode 100644 index bb4fb7d31..000000000 Binary files a/public/images/educoder/index/shixun/shixun32.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun33.jpg b/public/images/educoder/index/shixun/shixun33.jpg deleted file mode 100644 index b851ac0fc..000000000 Binary files a/public/images/educoder/index/shixun/shixun33.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun34.jpg b/public/images/educoder/index/shixun/shixun34.jpg deleted file mode 100644 index 6eadbbe35..000000000 Binary files a/public/images/educoder/index/shixun/shixun34.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun35.jpg b/public/images/educoder/index/shixun/shixun35.jpg deleted file mode 100644 index 87f8276ca..000000000 Binary files a/public/images/educoder/index/shixun/shixun35.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun36.jpg b/public/images/educoder/index/shixun/shixun36.jpg deleted file mode 100644 index 149841c9a..000000000 Binary files a/public/images/educoder/index/shixun/shixun36.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun37.jpg b/public/images/educoder/index/shixun/shixun37.jpg deleted file mode 100644 index 0ad960534..000000000 Binary files a/public/images/educoder/index/shixun/shixun37.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun38.jpg b/public/images/educoder/index/shixun/shixun38.jpg deleted file mode 100644 index e1e64007e..000000000 Binary files a/public/images/educoder/index/shixun/shixun38.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun39.jpg b/public/images/educoder/index/shixun/shixun39.jpg deleted file mode 100644 index 07a00b3a6..000000000 Binary files a/public/images/educoder/index/shixun/shixun39.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun40.jpg b/public/images/educoder/index/shixun/shixun40.jpg deleted file mode 100644 index d4bf2fadf..000000000 Binary files a/public/images/educoder/index/shixun/shixun40.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun41.jpg b/public/images/educoder/index/shixun/shixun41.jpg deleted file mode 100644 index c7a03198a..000000000 Binary files a/public/images/educoder/index/shixun/shixun41.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun42.jpg b/public/images/educoder/index/shixun/shixun42.jpg deleted file mode 100644 index cbccb88c6..000000000 Binary files a/public/images/educoder/index/shixun/shixun42.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun43.jpg b/public/images/educoder/index/shixun/shixun43.jpg deleted file mode 100644 index e3e3a41e2..000000000 Binary files a/public/images/educoder/index/shixun/shixun43.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun44.jpg b/public/images/educoder/index/shixun/shixun44.jpg deleted file mode 100644 index 80e8b193a..000000000 Binary files a/public/images/educoder/index/shixun/shixun44.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun45.jpg b/public/images/educoder/index/shixun/shixun45.jpg deleted file mode 100644 index d032aed71..000000000 Binary files a/public/images/educoder/index/shixun/shixun45.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun46.jpg b/public/images/educoder/index/shixun/shixun46.jpg deleted file mode 100644 index 84b7cf6e0..000000000 Binary files a/public/images/educoder/index/shixun/shixun46.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun47.jpg b/public/images/educoder/index/shixun/shixun47.jpg deleted file mode 100644 index cb99dc95d..000000000 Binary files a/public/images/educoder/index/shixun/shixun47.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun48.jpg b/public/images/educoder/index/shixun/shixun48.jpg deleted file mode 100644 index c619abfa6..000000000 Binary files a/public/images/educoder/index/shixun/shixun48.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun49.jpg b/public/images/educoder/index/shixun/shixun49.jpg deleted file mode 100644 index 398dfa1e1..000000000 Binary files a/public/images/educoder/index/shixun/shixun49.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun50.jpg b/public/images/educoder/index/shixun/shixun50.jpg deleted file mode 100644 index 6a3a61dfd..000000000 Binary files a/public/images/educoder/index/shixun/shixun50.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun51.jpg b/public/images/educoder/index/shixun/shixun51.jpg deleted file mode 100644 index 29262fba7..000000000 Binary files a/public/images/educoder/index/shixun/shixun51.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun52.jpg b/public/images/educoder/index/shixun/shixun52.jpg deleted file mode 100644 index 766d7afd8..000000000 Binary files a/public/images/educoder/index/shixun/shixun52.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun53.jpg b/public/images/educoder/index/shixun/shixun53.jpg deleted file mode 100644 index db81f7cff..000000000 Binary files a/public/images/educoder/index/shixun/shixun53.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun54.jpg b/public/images/educoder/index/shixun/shixun54.jpg deleted file mode 100644 index e47fb239c..000000000 Binary files a/public/images/educoder/index/shixun/shixun54.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun55.jpg b/public/images/educoder/index/shixun/shixun55.jpg deleted file mode 100644 index 556e59b33..000000000 Binary files a/public/images/educoder/index/shixun/shixun55.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun56.jpg b/public/images/educoder/index/shixun/shixun56.jpg deleted file mode 100644 index 0048c81a5..000000000 Binary files a/public/images/educoder/index/shixun/shixun56.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun57.jpg b/public/images/educoder/index/shixun/shixun57.jpg deleted file mode 100644 index caf3ad104..000000000 Binary files a/public/images/educoder/index/shixun/shixun57.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun58.jpg b/public/images/educoder/index/shixun/shixun58.jpg deleted file mode 100644 index 610199dc5..000000000 Binary files a/public/images/educoder/index/shixun/shixun58.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun59.jpg b/public/images/educoder/index/shixun/shixun59.jpg deleted file mode 100644 index 973cba886..000000000 Binary files a/public/images/educoder/index/shixun/shixun59.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun60.jpg b/public/images/educoder/index/shixun/shixun60.jpg deleted file mode 100644 index 9d13e9c61..000000000 Binary files a/public/images/educoder/index/shixun/shixun60.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun61.jpg b/public/images/educoder/index/shixun/shixun61.jpg deleted file mode 100644 index 54e283cd9..000000000 Binary files a/public/images/educoder/index/shixun/shixun61.jpg and /dev/null differ diff --git a/public/images/educoder/index/shixun/shixun62.jpg b/public/images/educoder/index/shixun/shixun62.jpg deleted file mode 100644 index 079c83926..000000000 Binary files a/public/images/educoder/index/shixun/shixun62.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject18.jpg b/public/images/educoder/index/subject/subject18.jpg deleted file mode 100644 index 5bcdd8e21..000000000 Binary files a/public/images/educoder/index/subject/subject18.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject19.jpg b/public/images/educoder/index/subject/subject19.jpg deleted file mode 100644 index 0c82077d2..000000000 Binary files a/public/images/educoder/index/subject/subject19.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject20.jpg b/public/images/educoder/index/subject/subject20.jpg deleted file mode 100644 index 25c3896e0..000000000 Binary files a/public/images/educoder/index/subject/subject20.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject21.jpg b/public/images/educoder/index/subject/subject21.jpg deleted file mode 100644 index ebe3df86d..000000000 Binary files a/public/images/educoder/index/subject/subject21.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject22.jpg b/public/images/educoder/index/subject/subject22.jpg deleted file mode 100644 index b06cca4ab..000000000 Binary files a/public/images/educoder/index/subject/subject22.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject23.jpg b/public/images/educoder/index/subject/subject23.jpg deleted file mode 100644 index bd6ea450c..000000000 Binary files a/public/images/educoder/index/subject/subject23.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject24.jpg b/public/images/educoder/index/subject/subject24.jpg deleted file mode 100644 index e6fbb0ab0..000000000 Binary files a/public/images/educoder/index/subject/subject24.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject25.jpg b/public/images/educoder/index/subject/subject25.jpg deleted file mode 100644 index bedeea999..000000000 Binary files a/public/images/educoder/index/subject/subject25.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject26.jpg b/public/images/educoder/index/subject/subject26.jpg deleted file mode 100644 index 3c8040901..000000000 Binary files a/public/images/educoder/index/subject/subject26.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject27.jpg b/public/images/educoder/index/subject/subject27.jpg deleted file mode 100644 index 59410bd62..000000000 Binary files a/public/images/educoder/index/subject/subject27.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject28.jpg b/public/images/educoder/index/subject/subject28.jpg deleted file mode 100644 index 4799d28d8..000000000 Binary files a/public/images/educoder/index/subject/subject28.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject29.jpg b/public/images/educoder/index/subject/subject29.jpg deleted file mode 100644 index 451053cf7..000000000 Binary files a/public/images/educoder/index/subject/subject29.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject30.jpg b/public/images/educoder/index/subject/subject30.jpg deleted file mode 100644 index 2abd5a860..000000000 Binary files a/public/images/educoder/index/subject/subject30.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject31.jpg b/public/images/educoder/index/subject/subject31.jpg deleted file mode 100644 index f84e0587a..000000000 Binary files a/public/images/educoder/index/subject/subject31.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject32.jpg b/public/images/educoder/index/subject/subject32.jpg deleted file mode 100644 index 7ab3f038e..000000000 Binary files a/public/images/educoder/index/subject/subject32.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject33.jpg b/public/images/educoder/index/subject/subject33.jpg deleted file mode 100644 index c3f1e57db..000000000 Binary files a/public/images/educoder/index/subject/subject33.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject34.jpg b/public/images/educoder/index/subject/subject34.jpg deleted file mode 100644 index b5f4cb5f7..000000000 Binary files a/public/images/educoder/index/subject/subject34.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject35.jpg b/public/images/educoder/index/subject/subject35.jpg deleted file mode 100644 index 6a9156340..000000000 Binary files a/public/images/educoder/index/subject/subject35.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject36.jpg b/public/images/educoder/index/subject/subject36.jpg deleted file mode 100644 index f7c8757cc..000000000 Binary files a/public/images/educoder/index/subject/subject36.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject37.jpg b/public/images/educoder/index/subject/subject37.jpg deleted file mode 100644 index b8b815f8b..000000000 Binary files a/public/images/educoder/index/subject/subject37.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject38.jpg b/public/images/educoder/index/subject/subject38.jpg deleted file mode 100644 index 286a1e356..000000000 Binary files a/public/images/educoder/index/subject/subject38.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject39.jpg b/public/images/educoder/index/subject/subject39.jpg deleted file mode 100644 index e901842c4..000000000 Binary files a/public/images/educoder/index/subject/subject39.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject4-o.jpg b/public/images/educoder/index/subject/subject4-o.jpg deleted file mode 100644 index 7c6784cf1..000000000 Binary files a/public/images/educoder/index/subject/subject4-o.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject40.jpg b/public/images/educoder/index/subject/subject40.jpg deleted file mode 100644 index ac5f581fd..000000000 Binary files a/public/images/educoder/index/subject/subject40.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject41.jpg b/public/images/educoder/index/subject/subject41.jpg deleted file mode 100644 index f968870f0..000000000 Binary files a/public/images/educoder/index/subject/subject41.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject42.jpg b/public/images/educoder/index/subject/subject42.jpg deleted file mode 100644 index b3251b7e4..000000000 Binary files a/public/images/educoder/index/subject/subject42.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject43.jpg b/public/images/educoder/index/subject/subject43.jpg deleted file mode 100644 index 0dd42efaa..000000000 Binary files a/public/images/educoder/index/subject/subject43.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject44.jpg b/public/images/educoder/index/subject/subject44.jpg deleted file mode 100644 index 21214a7d1..000000000 Binary files a/public/images/educoder/index/subject/subject44.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject45.jpg b/public/images/educoder/index/subject/subject45.jpg deleted file mode 100644 index bd27e6ba0..000000000 Binary files a/public/images/educoder/index/subject/subject45.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject46.jpg b/public/images/educoder/index/subject/subject46.jpg deleted file mode 100644 index 3d621652b..000000000 Binary files a/public/images/educoder/index/subject/subject46.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject47.jpg b/public/images/educoder/index/subject/subject47.jpg deleted file mode 100644 index fcd318623..000000000 Binary files a/public/images/educoder/index/subject/subject47.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject48.jpg b/public/images/educoder/index/subject/subject48.jpg deleted file mode 100644 index e7ee65970..000000000 Binary files a/public/images/educoder/index/subject/subject48.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject49.jpg b/public/images/educoder/index/subject/subject49.jpg deleted file mode 100644 index 5adf9e274..000000000 Binary files a/public/images/educoder/index/subject/subject49.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject50.jpg b/public/images/educoder/index/subject/subject50.jpg deleted file mode 100644 index 46ee0208c..000000000 Binary files a/public/images/educoder/index/subject/subject50.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject51.jpg b/public/images/educoder/index/subject/subject51.jpg deleted file mode 100644 index 4c52ae48e..000000000 Binary files a/public/images/educoder/index/subject/subject51.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject52.jpg b/public/images/educoder/index/subject/subject52.jpg deleted file mode 100644 index f959d9ed7..000000000 Binary files a/public/images/educoder/index/subject/subject52.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject53.jpg b/public/images/educoder/index/subject/subject53.jpg deleted file mode 100644 index 3516fad82..000000000 Binary files a/public/images/educoder/index/subject/subject53.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject54.jpg b/public/images/educoder/index/subject/subject54.jpg deleted file mode 100644 index d717562e7..000000000 Binary files a/public/images/educoder/index/subject/subject54.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject55.jpg b/public/images/educoder/index/subject/subject55.jpg deleted file mode 100644 index 2cc6c0173..000000000 Binary files a/public/images/educoder/index/subject/subject55.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject56.jpg b/public/images/educoder/index/subject/subject56.jpg deleted file mode 100644 index 2125dc132..000000000 Binary files a/public/images/educoder/index/subject/subject56.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject57.jpg b/public/images/educoder/index/subject/subject57.jpg deleted file mode 100644 index eecf5b1c2..000000000 Binary files a/public/images/educoder/index/subject/subject57.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject58.jpg b/public/images/educoder/index/subject/subject58.jpg deleted file mode 100644 index 89d26b0b0..000000000 Binary files a/public/images/educoder/index/subject/subject58.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject6-o.jpg b/public/images/educoder/index/subject/subject6-o.jpg deleted file mode 100644 index f7cda83f2..000000000 Binary files a/public/images/educoder/index/subject/subject6-o.jpg and /dev/null differ diff --git a/public/images/educoder/index/subject/subject8-o.jpg b/public/images/educoder/index/subject/subject8-o.jpg deleted file mode 100644 index fbeebe4ee..000000000 Binary files a/public/images/educoder/index/subject/subject8-o.jpg and /dev/null differ diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 064c64db1..7283eafb9 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -13,7 +13,7 @@ function locationurl(list){ if (window.location.port === "3007") { } else { - window.location.replace(list) + window.location.href(list) } } let hashTimeout diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index c4ec4df02..ce4fb8dc2 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -756,7 +756,7 @@ class Fileslists extends Component{ Savesname={this.state.Savesname} Cancel={this.state.Cancel} Saves={this.state.Saves} - course_groups={this.state.course_groups} + // course_groups={this.state.course_groups} />:""} {/*发送*/} diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index f5dfc089a..315f5ff99 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -428,6 +428,9 @@ class NewShixunModel extends Component{ .ant-drawer-body { padding:15px 24px 24px 0px; } + .ant-dropdown { + z-index:11000 + } ` } diff --git a/public/react/src/modules/courses/coursesPublic/SelectResource.js b/public/react/src/modules/courses/coursesPublic/SelectResource.js index 31c6d2f52..e2454652b 100644 --- a/public/react/src/modules/courses/coursesPublic/SelectResource.js +++ b/public/react/src/modules/courses/coursesPublic/SelectResource.js @@ -42,12 +42,7 @@ class Selectresource extends Component{ getallfiles:false, searchtype:'getallfiles', Radiovalue:0, - datatime:undefined, - course_group_publish_times:[ - { - group_id : [], - publish_time :undefined, - }], + datatime:undefined } } componentDidMount() { @@ -79,7 +74,7 @@ class Selectresource extends Component{ } SenttotheSearch=(value)=>{ - let {searchtype}=this.state; + let {searchtype}=this.state; if(searchtype==="getallfiles"){ this.getallfiles(value,1) }else if(searchtype==="getmyfiles"){ @@ -91,32 +86,32 @@ class Selectresource extends Component{ setupdatalist=(url,newpage)=>{ let {Resourcelist,Searchvalue}=this.state; if(Resourcelist!=undefined){ - let newResourcelist=Resourcelist.files; - axios.get(url,{ - params:{ - page:newpage, - page_size:15, - search:Searchvalue, - } - }).then((result)=>{ + let newResourcelist=Resourcelist.files; + axios.get(url,{ + params:{ + page:newpage, + page_size:15, + search:Searchvalue, + } + }).then((result)=>{ - var list=result.data.data.files; + var list=result.data.data.files; for(var i=0;i{ - console.log(error) - }) + }).catch((error)=>{ + console.log(error) + }) } } contentViewScroll=(e)=>{ @@ -152,7 +147,7 @@ class Selectresource extends Component{ // this.props.funshixunmodallist(Searchvalue,types,true,1) // this.props.funpatheditarry([]) if(types==="all"){ - this.getallfiles(undefined,1) + this.getallfiles(undefined,1) }else if(types==="my"){ this.getmyfiles(undefined,1) } @@ -168,12 +163,12 @@ class Selectresource extends Component{ search:value, } }).then((result)=>{ - this.setState({ - Resourcelist:result.data.data, - hometypepvisible:false, - getallfiles:true, - searchtype:'getallfiles' - }) + this.setState({ + Resourcelist:result.data.data, + hometypepvisible:false, + getallfiles:true, + searchtype:'getallfiles' + }) }).catch((error)=>{ console.log(error) }) @@ -189,11 +184,11 @@ class Selectresource extends Component{ search:value, } }).then((result)=>{ - this.setState({ - Resourcelist: result.data.data, - hometypepvisible:false, - searchtype:'getmyfiles' - }) + this.setState({ + Resourcelist: result.data.data, + hometypepvisible:false, + searchtype:'getmyfiles' + }) }).catch((error)=>{ console.log(error) }) @@ -201,7 +196,7 @@ class Selectresource extends Component{ hidecouseShixunModal=()=>{ - this.props.hidecouseShixunModal() + this.props.hidecouseShixunModal() } ModalCancelModalCancel=()=>{ @@ -217,22 +212,22 @@ class Selectresource extends Component{ savecouseShixunModal=()=>{ - let {patheditarry,datatime,Radiovalue,course_group_publish_times}=this.state; + let {patheditarry,datatime,Radiovalue}=this.state; let {coursesId,attachmentId}=this.props; - let url="/files/import.json"; - - if(patheditarry===undefined||patheditarry.length===0){ - this.setState({ - patheditarrytype:true - }) - return - }else{ - this.setState({ - patheditarrytype:false - }) - } - - if(this.state.Radiovalue===1&&this.props.course_groups.length===0){ + let url="/files/import.json"; + + if(patheditarry===undefined||patheditarry.length===0){ + this.setState({ + patheditarrytype:true + }) + return + }else{ + this.setState({ + patheditarrytype:false + }) + } + + if(this.state.Radiovalue===1){ if(datatime===undefined||datatime===null||datatime=== ""){ this.setState({ Radiovaluetype:true @@ -249,17 +244,16 @@ class Selectresource extends Component{ course_id:coursesId, attachment_ids:patheditarry, course_second_category_id:this.props.coursesidtype===undefined||this.props.coursesidtype==="node"?0:attachmentId, - delay_publish:Radiovalue, - publish_time:this.props.course_groups.length===0?Radiovalue===1?datatime===undefined? undefined:datatime:undefined:undefined, - group_settings:this.props.course_groups.length===0?undefined:course_group_publish_times + delay_publish:Radiovalue, + publish_time:Radiovalue===1?datatime:undefined } ).then((response) => { - if(response.data.status===0){ - this.ModalCancelModalCancel(); - this.props.updataleftNavfun(); - this.props.showNotification("选用资源成功"); - this.props.setupdate(attachmentId) - } + if(response.data.status===0){ + this.ModalCancelModalCancel(); + this.props.updataleftNavfun(); + this.props.showNotification("选用资源成功"); + this.props.setupdate(attachmentId) + } }).catch((error) => { console.log(error) }) @@ -277,58 +271,15 @@ class Selectresource extends Component{ }); } - onChangeTimepublish= (date, dateString,key,type) => { - if(type===1){ - this.setState({ - datatime:handleDateString(dateString), - }) - }else if(type===2){ - let {course_group_publish_times}=this.state; - let newgroup_publish=course_group_publish_times; - for(var i=0; i { - addgrouppublish=()=>{ - let newlist=this.state.course_group_publish_times; - newlist.push( { - group_id : undefined, - publish_time :undefined, - }) - this.setState({ - course_group_publish_times:newlist - }) - } - deletegrouppublish=(key)=>{ - let newlist=this.state.course_group_publish_times; - newlist.splice(key,1); this.setState({ - course_group_publish_times:newlist + datatime:handleDateString(dateString), }) - } - selectassigngroups=(e,index,key)=>{ - debugger - let {course_group_publish_times}=this.state; - let newgroup_publish=course_group_publish_times; - for(var i=0; i; const radioStyle = { @@ -336,8 +287,6 @@ class Selectresource extends Component{ height: '30px', lineHeight: '30px', }; - - console.log(course_group_publish_times) return(
{/*提示*/} @@ -350,73 +299,73 @@ class Selectresource extends Component{ /> {visible===true? - - + } + - -
-
- -
  • this.changeTag("all")} className={ type==="all" ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部
  • -
  • this.changeTag("my")} className={ type==="my" ? " active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>我的资源
  • -
    - this.SenttotheSearch(value)} - style={{width: '100%'}} - /> + - -
      -
    • 资源名称
    • -
    • 大小
    • -
    • 发布人
    • -
    • 时间
    • -
    +
      +
    • 资源名称
    • +
    • 大小
    • +
    • 发布人
    • +
    • 时间
    • +
    - -
    - - { - Resourcelist === undefined ?"":Resourcelist.files.length===0?: - - - { - Resourcelist.files.map((item,key)=>{ - return( -
    -
  • - - - -
  • -
  • {item.filesize}
  • -
  • {item.author.name}
  • -
  • {formatDate(item.created_on)}
  • -
    - ) - }) - } -
    - - } -
    +
    -
    - 发布设置: - - - 立即发布 - - - - 延期发布 - {this.props.course_groups.length>0?"":this.onChangeTimepublish(e,index,undefined,1)} - disabledTime={disabledDateTime} - disabledDate={disabledDate} - disabled={this.state.Radiovalue===1?false:true} - />} - - - (按照设置的时间定时发布) - - - - {this.props.course_groups.length>0?this.props.isStudent()===true?"":
    - {this.state.Radiovalue===1?:""} { - course_group_publish_times.map((item,key)=>{ - return( -
    - - - this.onChangeTimepublish(e,index,key,2)} - // onChange={ this.onChangeTimepublish } - disabledTime={disabledDateTime} - disabledDate={disabledDate} - /> - {key!=0?this.deletegrouppublish(key)}>:""} - {key+1===this.props.course_groups.length?"":} -
    - ) - }) + Resourcelist === undefined ?"":Resourcelist.files.length===0?: + + + { + Resourcelist.files.map((item,key)=>{ + return( +
    +
  • + + + +
  • +
  • {item.filesize}
  • +
  • {item.author.name}
  • +
  • {formatDate(item.created_on)}
  • +
    + ) + }) + } +
    } -
    :""} -
    +
    + +
    + 发布设置: + + + 立即发布 + + + + 延期发布 + this.onChangeTimepublish(e,index,undefined,1)} + disabledTime={disabledDateTime} + disabledDate={disabledDate} + disabled={this.state.Radiovalue===1?false:true} + /> + + + (按照设置的时间定时发布) + +
    - {this.state.patheditarrytype===true?

    请选择资源

    :""} - {this.state.Radiovaluetype===true?

    发布时间不能为空

    :""} -
    + {this.state.patheditarrytype===true?

    请选择资源

    :""} + {this.state.Radiovaluetype===true?

    发布时间不能为空

    :""} +
    -
    - - :""} + + :""}
    ) } diff --git a/public/react/src/modules/courses/coursesPublic/sendResource.js b/public/react/src/modules/courses/coursesPublic/sendResource.js index b0f4b1b69..73a0f6630 100644 --- a/public/react/src/modules/courses/coursesPublic/sendResource.js +++ b/public/react/src/modules/courses/coursesPublic/sendResource.js @@ -14,12 +14,12 @@ function range(start, end) { } return result; } - function disabledDateTime() { return { + // disabledHours: () => range(0, 24).splice(4, 20), disabledMinutes: () => range(1, 30).concat(range(31, 60)), - // disabledSeconds: () => range(0,60) - } + // disabledSeconds: () => [0, 60], + }; } function disabledDate(current) { @@ -45,8 +45,8 @@ class Sendresource extends Component{ // moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), course_group_publish_times:[ { - group_id : undefined, - publish_time :undefined, + course_group_id : undefined, + publish_time :"" }], course_groups:undefined, course_groups_count:undefined, @@ -86,34 +86,34 @@ class Sendresource extends Component{ } onAttachmentRemove = (file) => { - if(!file.percent || file.percent == 100){ - const url = `/attachments/${file.response ? file.response.id : file.uid}.json` - axios.delete(url, { - }) - .then((response) => { - if (response.data) { - const { status } = response.data; - if (status == 0) { - this.setState({ - fileListtype:false, - fileList:[] - }) - } - - } - }) - .catch(function (error) { - console.log(error); - }); - this.setState({ - fileListtype:false, - }) - }else{ - this.setState({ - fileListtype:false, - fileList:[] - }) - } + if(!file.percent || file.percent == 100){ + const url = `/attachments/${file.response ? file.response.id : file.uid}.json` + axios.delete(url, { + }) + .then((response) => { + if (response.data) { + const { status } = response.data; + if (status == 0) { + this.setState({ + fileListtype:false, + fileList:[] + }) + } + + } + }) + .catch(function (error) { + console.log(error); + }); + this.setState({ + fileListtype:false, + }) + }else{ + this.setState({ + fileListtype:false, + fileList:[] + }) + } } ModalCancelModalCancel=()=>{ @@ -127,7 +127,7 @@ class Sendresource extends Component{ } Saves=()=>{ - let {fileList,description,is_public,datatime,Radiovalue,course_group_publish_times} =this.state; + let {fileList,description,is_public,datatime,Radiovalue} =this.state; let newfileList=[]; for(var list of fileList){ @@ -141,7 +141,7 @@ class Sendresource extends Component{ return } - if(this.state.Radiovalue===1&&this.props.course_groups.length===0){ + if(this.state.Radiovalue===1){ if(datatime===undefined||datatime===null||datatime=== ""){ this.setState({ Radiovaluetype:true @@ -156,7 +156,6 @@ class Sendresource extends Component{ - if(description===undefined){ }else if(description.length>100){ @@ -177,10 +176,9 @@ class Sendresource extends Component{ course_second_category_id:this.props.coursesidtype===undefined||this.props.coursesidtype==="node"?0:attachmentId, attachment_ids:newfileList, is_public:is_public, - publish_time:this.props.course_groups.length===0?Radiovalue===1?datatime===undefined? undefined:datatime:undefined:"", + publish_time:Radiovalue===1?datatime===undefined? undefined:datatime:undefined, description:description, delay_publish:Radiovalue, - group_settings:this.props.course_groups.length===0?"":course_group_publish_times }).then((result)=>{ if(result.data.status===0){ @@ -239,42 +237,10 @@ class Sendresource extends Component{ Radiovalue: e.target.value, }); } - - addgrouppublish=()=>{ - let newlist=this.state.course_group_publish_times; - newlist.push( { - group_id : undefined, - publish_time :undefined, - }) - this.setState({ - course_group_publish_times:newlist - }) - } - deletegrouppublish=(key)=>{ - let newlist=this.state.course_group_publish_times; - newlist.splice(key,1); - this.setState({ - course_group_publish_times:newlist - }) - } - selectassigngroups=(e,index,key)=>{ - let {course_group_publish_times}=this.state; - let newgroup_publish=course_group_publish_times; - for(var i=0; i {/*提示*/} @@ -406,8 +372,8 @@ class Sendresource extends Component{ {this.props.course_is_public===true?
    公开: - 选中,所有用户可见,否则课堂成员可见 - + 选中,所有用户可见,否则课堂成员可见 +
    :""} - {this.props.course_groups.length>0?this.props.isStudent()===true?"":
    - {this.state.Radiovalue===1?:""} - { - course_group_publish_times.map((item,key)=>{ - return( -
    - - - this.onChangeTimepublish(e,index,key,2)} - // onChange={ this.onChangeTimepublish } - disabledTime={disabledDateTime} - disabledDate={disabledDate} - /> - {key!=0?this.deletegrouppublish(key)}>:""} - {key+1===this.props.course_groups.length?"":} -
    - ) - }) - - } -
    :""}
    diff --git a/public/react/src/modules/courses/elearning/YslDetailCards.js b/public/react/src/modules/courses/elearning/YslDetailCards.js index e705894e6..55bed2b5e 100644 --- a/public/react/src/modules/courses/elearning/YslDetailCards.js +++ b/public/react/src/modules/courses/elearning/YslDetailCards.js @@ -492,13 +492,13 @@ class YslDetailCards extends Component{ : } - + {key+1}-{index+1}  {line.shixun_name} { - this.props.current_user&&this.props.current_user.admin===false&&line.shixun_status==="暂未公开"? + this.props.current_user&&this.props.current_user.admin===false&&this.props.current_user&&this.props.current_user.business===false&&line.shixun_status==="暂未公开"?
  • 暂未公开
  • :
  • @@ -512,7 +512,7 @@ class YslDetailCards extends Component{
  • } - {this.props.current_user&&this.props.current_user.admin===false&&line.shixun_status==="暂未公开"?"":
  • + {this.props.current_user&&this.props.current_user.admin===false&&this.props.current_user&&this.props.current_user.business===false&&line.shixun_status==="暂未公开"?"":
  • { showparagraphkey === key && showparagraphindex === index ? "" : 实验任务
    -
    +
    {homedatalist===undefined?"": } @@ -240,7 +240,7 @@ class ShixunsHome extends Component {

    实践课程

    TRAINING COURSE

    - 更多 + 更多
    @@ -319,7 +319,7 @@ class ShixunsHome extends Component {

    实训项目

    DEVELOPMENT COMMUNITY

    - 更多 + 更多
    +
    +
    + +
    + +
    + 新建实训项目 + {this.props.user && this.props.user.main_site === true ? + 实训制作指南 : ""} +
    +
    +
    + + {getFieldDecorator('radiogroup')( + + 普通实训 + Jupyter实训 + , + )} + + + {getFieldDecorator('name', { + rules: [{ + required: true, message: '请输入选题名称', + }, { + max: 60, message: '请输入名称,最大限制60个字符', + },{ + whitespace:true,message:'请勿输入空格' + }], + })( + + )} + + + + + + + + {getFieldDecorator('select', { + rules: [{required: true, message: '请选择难易度'}], + })( +
    + + +
    + )} + (实训的难易程度) +
    + + + + +
    + + {getFieldDecorator('selectleft', { + rules: [{required: true, message: '请选择主类别'}], + })( +
    + + + + 没有实验环境? + 申请新建 +
    - -
    -

    技术平台

    -
    - * -
    - -

    - 列表中没有? - 申请新建 -

    - - - {/**/} -
    -
  • - - -
  • -
    {this.state.languagewritetype===true?"请填写该镜像语言":""}
    -
  • - - -
  • -
    {this.state.systemenvironmenttype===true?"请填写该镜像语言系统环境":""}
    -
  • - - - -
  • -
    {this.state.testcoderunmodetype===true?"请填写该镜像测试代码运行方式":""}
    -
  • - -
    - - - 上传附件 - (单个文件50M以内) - - -
    - -
  • -
    - {this.state.attachmentidstype===true?"请上传附件":""} -
    -
  • - this.sendhideModaly()} - >取消 - -
  • -
    -
    - {/**/} -
    - - - - -
    -

    新建申请已提交,请等待管理员的审核

    -
  • 我们将在1-2个工作日内与您联系 -
  • -
    -
    - 知道啦 -
    - - - -
    - -
    -

    请在配置页面完成后续的评测脚本设置操作

    -
    - 必填项 -
    - + )} + + + + +
    + {getFieldDecorator('selectright', { + rules: [{required: true, message: '请选择小类别'}], + })( +
    +
    + )} + +
    +
    + 已安装软件:hadoop3.1.0、jdk1.8; +
    +
    + 说明:添加了hadoop3.1.0、jdk1.8的源码包,添加了hadoop3.1.0、jdk1.8的源码包 +
    +
    +
    +
    +
    -
    -

    命令行

    -
    - - 无命令行窗口 (选中则不给学员的实践任务提供命令窗口) - 命令行练习窗口 (选中则给学员提供用于练习操作的命令行窗口) - 命令行评测窗口 (选中则给学员提供用于关卡评测的命令行窗口) - - 多个命令行窗口(选中则允许学员同时开启多个命令行窗口) - - -
    -
    -
    -

    公开程度

    -
    - - 对所有公开 (选中则所有已被试用授权的用户可以学习) - 对指定单位公开 (选中则下方指定单位的已被试用授权的用户可以学习) - - -
    -
    -
    -
    -
    - -
    - (搜索选中添加单位名称) - {this.state.datalisttype===true?请勿选择重复单位:""} - {/*+ 添加*/} -
    -
    - -
    -
    - { - scope_partment === undefined ? "" : scope_partment.map((item, key) => { - return ( -
  • {item} - this.deleteScopeInput(key)}>× -
  • - ) - }) - } -
    - {/*{*/} - {/*scope_partment===undefined?"":scope_partment.map((item,key)=>{*/} - {/*return(*/} - {/*
    */} - {/*this.deleteScopeInput(key)} style={{ color: 'rgba(0,0,0,.25)' }} />}*/} - {/*value={item}*/} - {/*/>*/} - {/*
    */} - - {/*)*/} - {/*})*/} - {/*}*/} -
    - - - - 请选择需要公开的单位 - -
    -
    -
    -
    + + {postapplyvisible===true?:""} + + +
    +
  • + + +
  • +
    {this.state.languagewritetype===true?"请填写该镜像语言":""}
    +
  • + + +
  • +
    {this.state.systemenvironmenttype===true?"请填写该镜像语言系统环境":""}
    +
  • + + + +
  • +
    {this.state.testcoderunmodetype===true?"请填写该镜像测试代码运行方式":""}
    +
  • + +
    + + + 上传附件 + (单个文件50M以内) + + +
    + +
  • +
    + {this.state.attachmentidstype===true?"请上传附件":""} +
    +
  • + this.sendhideModaly()} + >取消 + +
  • +
    +
    + {/**/} +
    + + + + +
    +

    新建申请已提交,请等待管理员的审核

    +
  • 我们将在1-2个工作日内与您联系 +
  • +
    +
    + 知道啦 +
    +
    +
    + -
    -

    发布信息

    -
    -
    - *面向学员: -
    - -
    - 实训难易度定位,不限定用户群体 -
    - 必填项 -
    -
    -
    -
  • - 复制: - - -
  • -
    - 开启时间: -
  • - - -
  • -
    -
    - {/*
    */} - {/*

    VNC图形化

    */} - {/*
  • */} - {/**/} - {/**/} - {/*
  • */} - {/*
    */} - - -
    - - 取消 -
    + + + - - - +
    +
    + + +
    +
    + - ); - } + ); + } } -const NewshixunsNew = Form.create({ name: 'newshixunsnew' })(Newshixuns); + +const NewshixunsNew = Form.create({name: 'newshixun'})(Newshixuns); + export default SnackbarHOC()(TPMIndexHOC(NewshixunsNew)); diff --git a/public/react/src/modules/tpm/newshixuns/Shixunmd.js b/public/react/src/modules/tpm/newshixuns/Shixunmd.js new file mode 100644 index 000000000..608c7ea63 --- /dev/null +++ b/public/react/src/modules/tpm/newshixuns/Shixunmd.js @@ -0,0 +1,111 @@ +import React, { Component } from 'react'; +import {Button,Form,Input} from 'antd'; +import axios from 'axios'; +import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; +class Osshackathonmd extends Component{ + constructor(props) { + super(props) + this.contentMdRef = React.createRef(); + this.state={ + title_num: 0, + title_value: undefined + } + } + componentDidUpdate =(prevState)=>{ + // if(prevState!=this.props){ + // let url=`/osshackathon/edit_hackathon.json`; + // axios.get(url).then((result)=>{ + // if(result.status==200){ + // this.setState({ + // title_value:result.data.name + // }) + // this.contentMdRef.current.setValue(result.data.description); + // } + // }) + // } + } + componentDidMount(){ + let url=`/osshackathon/edit_hackathon.json`; + axios.get(url).then((result)=>{ + if(result.status==200){ + this.setState({ + title_value:result.data.name + }) + this.contentMdRef.current.setValue(result.data.description === null ? "" : result.data.description); + } + }) + } + + + // 输入title + changeTitle = (e) => { + // title_num: 60 - parseInt(e.target.value.length), + this.setState({ + title_num: e.target.value.length, + title_value: e.target.value + }) + + } + handleSubmit = () => { + let {title_value}=this.state; + const mdContnet = this.contentMdRef.current.getValue().trim(); + // if(mdContnet.length>10000){ + // this.props.showNotification("内容超过10000个字"); + // return + // } + + let url=`/osshackathon/update_hackathon.json`; + axios.post(url,{ + name:title_value, + description:mdContnet, + } + ).then((response) => { + if(response.data.status===0){ + this.props.getosshackathon() + this.props.hidehackathonedit() + this.props.showNotification(`提交成功`); + } + }).catch((error) => { + console.log(error) + }) + + } + render() { + + + // console.log(this.props.tabkey) + // console.log(chart_rules) + + return ( +
    +
    + + + + + + + +
    + + + + +
    + + ) + } +} +export default Osshackathonmd; diff --git a/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css b/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css index e241dcf0d..5dadbfa6d 100644 --- a/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css +++ b/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css @@ -394,4 +394,432 @@ a.white-btn.use_scope-btn:hover{ .ant-btn:hover, .ant-btn:focus, .ant-btn:active, .ant-btn.active{ background-color: #4CACFF; +} + +.newViewAfter .ant-input{ + line-height: 40px !important; + height: 40px !important; + box-shadow: none!important; +} + +.width30{ + width: 30%; +} + +.newshixunheadersear{ + display: -ms-flexbox; + display: flex; + -ms-flex-pack: center; + justify-content: center; + margin: 0 auto; +} +.packinput .ant-input{ + height: 55px; + width:663px !important; + font-size: 14px; + /*color: #681616 !important;*/ + border-color: #E1EDF8 !important; + padding-left: 20px; +} + +.packinput .ant-input-group-addon .ant-btn{ + width:137px !important; + font-size: 18px; + height: 53px; + background:rgba(76,172,255,1); + +} +.tabtitle{ + height: 62px !important; + -webkit-box-shadow: 3px 10px 21px 0px rgba(76, 76, 76, 0.15); + box-shadow: 3px 10px 21px 0px rgba(76, 76, 76, 0.15); + border-radius: 6px; + background: #fff; + display: -ms-flexbox; + display: flex; + -ms-flex-pack: center; + justify-content: center; +} +.tabtitles2{ + background: #fff; + height: 62px !important; + width: 1200px; +} + +.tabtitless{ + height: 62px !important; + line-height: 62px !important; + +} +.tabtitle1{ + +} +.tabtitle2{ + margin-left: 30px !important; + +} + + +.counttit{ + display: -ms-flexbox; + display: flex; + -ms-flex-pack: center; + justify-content: center; +} + +.counttittext{ + text-align: left; + width: 1200px; + height: 18px; + color: #888888; + font-size: 13px; + margin-top: 24px; + + +} +.counttittexts{ + color: #4CACFF !important; + font-size: 13px; +} + +.mainx{ + display: -ms-flexbox; + display: flex; + -ms-flex-pack: center; + justify-content: center; + margin-top: 17px; +} +.project-packages-list{ + +} +.project-package-item{ + display: -ms-flexbox; + display: flex; + -ms-flex-direction:column; + flex-direction:column; + margin-bottom: 20px; + padding: 20px; + background: white; + /* box-shadow: 1px 3px 3px 1px rgba(156,156,156,0.16); */ + +} +.xuxianpro{ + height: 20px; + border-bottom: 1px dashed; + border-color: #EAEAEA; + margin-bottom: 18px; +} +.magr11{ + margin-top: 11px; +} +.highlight{ + color: #4CACFF; +} +.fonttext{ + font-size: 20px; + font-weight:bold; +} + +.fontextcolor{ + color: #777777; +} +.tzbq{ + margin-left: 68px; +} +.tzbqx{ + /* margin-left: 24px; */ +} +.bjyss{ + background: #F8F8F8; +} +.zj{ + overflow:hidden; + -o-text-overflow:ellipsis; + text-overflow:ellipsis; + white-space:nowrap +} +.ziticor{ + color: #777777; + font-size: 13px; +} +.foohter{ + margin-top: 20px; + display: -ms-flexbox; + display: flex; + -ms-flex-direction:row; + flex-direction:row; +} + +.maxwidth1100{ + max-width: 1100px; + overflow:hidden; + -o-text-overflow:ellipsis; + text-overflow:ellipsis; + white-space:nowrap; + font-size: 18px !important; + font-weight: 500; + color: rgba(51,51,51,1) !important; +} + + +.newshixunmodelmidfont{ + font-size: 14px; + font-weight: 400; + color: #999999; + margin-top: 15px; + margin-left: 30px; + max-width: 1100px; + overflow: hidden; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; +} + +.newshixunmodelbotfont{ + font-size:12px; + font-weight:400; + color:rgba(102,102,102,1); + margin-top: 15px; + margin-left: 30px; +} + +.newshixunlist{ + max-height:227px; + width: 1200px; +} + +.xuxianpro { + height: 20px; + border-bottom: 1px dashed; + border-color: #eaeaea; + margin-bottom: 18px; +} + +.newshixunpd030{ + padding: 0px 30px; +} + +.pd303010{ + padding: 30px 30px 10px; +} + +.newshixunfont12{ + font-size: 12px; + color: rgba(76,172,255,1); + line-height: 21px; +} + +.newshixunmode{ + width: 100px; + height: 38px; + border-radius: 3px; + /*border: 1px solid rgba(191,191,191,1);*/ +} + +.ntopsj { + position: absolute; + top: -4px; +} + +.nyslbottomsj { + position: absolute; + bottom: -6px; +} + +.inherits .ant-dropdown-menu-item{ + cursor: inherit !important; +} + +.menus{ + width: 91px; + text-align: center; +} + +.newshixunmodelbotfont span{ + display: inline-block; + margin-right: 34px; +} + +.minhegiht300{ + min-height: 300px; +} + +.newshixunlist:hover{ + -webkit-box-shadow: 1px 6px 16px rgba(156,156,156,0.16); + box-shadow: 1px 6px 16px rgba(156,156,156,0.16); + opacity: 1; + border-radius: 2px; +} + +.newshixun500{ + max-width: 500px; + overflow: hidden; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + white-space: nowrap; +} + +.mt3 { + margin-top: 3px !important; +} + +.highlight{ + color: #4CACFF; +} + +.newshixunbottombtn{ + position: fixed; + z-index: 1000; + bottom: 0px; + width: 100%; + height: 63px; + background: rgba(255,255,255,1); + -webkit-box-shadow: 0px -4px 4px 0px rgba(0,0,0,0.05); + box-shadow: 0px -4px 4px 0px rgba(0,0,0,0.05); +} + + +.mb60shixun{ + margin-bottom: 60px !important; +} + +.padding13-30 { + padding: 13px 30px; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.displaymodulat { + display: -ms-flexbox; + display: flex; + display: -webkit-flex; + -ms-flex-direction: column; + flex-direction: column; + -ms-flex-align: center; + align-items: center; +} + +.WordNumberTextarea { + outline: none; /* 去掉输入字符时的默认样式 */ + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + background-color: white; + text-shadow: none; + -webkit-writing-mode: horizontal-tb !important; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + resize: none; /*禁止拉伸*/ + border: none; /*去掉默认边框*/ + width: 100%; + height: 130px; + border: none; + display: block; +} + +.WordNumbernote { + padding: 0; + margin: 0; + list-style: none; + text-decoration: none; + -webkit-box-sizing: border-box; + box-sizing: border-box; + overflow: hidden; + height: auto; + border: 1px solid rgba(234, 234, 234, 1); + border-radius: 0.125rem; + margin: 10px 10px 0px 10px; + padding: 10px 10px 5px 10px; + backgroud: rgba(234, 234, 234, 1); + width: 530px; + margin-left: 10px; + margin-top: 25px; + height: 214px !important; +} + +.WordNumbernote .WordNumberTextarea { + outline: none; + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + background-color: white; + text-shadow: none; + -webkit-writing-mode: horizontal-tb !important; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + resize: none; + border: none; + width: 100%; + height: 169px !important; + border: none; + display: block; +} + +.WordNumberTextarea-count { + display: inline-block; + float: right; + font-size: 16px; + color: #adadad; + padding-right: 0.25rem; +} + +.borerinput { + border: 1px solid #DD1717 !important; +} + +.borerinputs { + border: 1px solid #eee !important; +} + + +.mexertwo { + display: -ms-flexbox; + display: flex; + -ms-flex-direction: initial; + flex-direction: initial; +} + +.mexeheigth { + line-height: 40px; +} + +.mexeheigth2 { + line-height: 40px; + width: 74px; +} + +.minbuttionte { + /* display: flex; */ + margin-top: 20px; + width: 100%; + /* align-items: center; */ + margin-bottom: 17px; + display: -ms-flexbox; + display: flex; + -ms-flex-direction: column; + flex-direction: column; + -ms-flex-align: center; + align-items: center; + -ms-flex-pack: center; + justify-content: center; + -ms-flex-direction: initial; + flex-direction: initial; +} + +.initialflex{ + display: -ms-flexbox; + display: flex; + -ms-flex-direction:initial; + flex-direction:initial; +} + +.newshixunheadersear{ + margin: 0 auto; +} + +.newshixunmodels{ + margin: 0 auto; +} + +.backgroundFFF{ + background: #FFF !important; } \ No newline at end of file diff --git a/public/react/src/modules/tpm/newshixuns/oldNewshixuns.js b/public/react/src/modules/tpm/newshixuns/oldNewshixuns.js new file mode 100644 index 000000000..1eaee9ad6 --- /dev/null +++ b/public/react/src/modules/tpm/newshixuns/oldNewshixuns.js @@ -0,0 +1,1356 @@ +import React, {Component} from 'react'; + +import {TPMIndexHOC} from '../TPMIndexHOC'; + +import {SnackbarHOC,appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder'; + +import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification,Tooltip} from 'antd'; + +// import "antd/dist/antd.css"; + +import locale from 'antd/lib/date-picker/locale/zh_CN'; + +import axios from 'axios'; + +import './css/Newshixuns.css'; + +import {getUrl} from 'educoder' + +import moment from 'moment'; + +let path = getUrl("/editormd/lib/") + +const $ = window.$; + +let timeout; + +let currentValue; + +const Option = Select.Option; + +const RadioGroup = Radio.Group; +const confirm = Modal.confirm; + + +// 处理整点 半点 +// 取传入时间往后的第一个半点 +export function handleDateStrings(dateString) { + if (!dateString) return dateString; + const ar = dateString.split(':') + if (ar[1] == '00' || ar[1] == '30') { + return dateString + } + const miniute = parseInt(ar[1]); + if (miniute < 30 || miniute == 60) { + return [ar[0], '30'].join(':') + } + if (miniute < 60) { + // 加一个小时 + const tempStr = [ar[0], '00'].join(':'); + const format = "YYYY-MM-DD HH:mm"; + const _moment = moment(tempStr, format) + _moment.add(1, 'hours') + return _moment.format(format) + } + + return dateString +} + + + +// 恢复数据 +function md_rec_data(k, mdu, id, editor) { + if (window.sessionStorage.getItem(k + mdu) !== null) { + editor.setValue(window.sessionStorage.getItem(k + mdu)); + md_clear_data(k, mdu, id); + } +} + +// 保存数据 +function md_add_data(k, mdu, d) { + window.sessionStorage.setItem(k + mdu, d); +} + +// 清空保存的数据 +function md_clear_data(k, mdu, id) { + window.sessionStorage.removeItem(k + mdu); + var id1 = "#e_tip_" + id; + var id2 = "#e_tips_" + id; + if (k == 'content') { + $(id2).html(""); + } else { + $(id1).html(""); + } +} + +function md_elocalStorage(editor, mdu, id) { + if (window.sessionStorage) { + var oc = window.sessionStorage.getItem('content' + mdu); + if (oc !== null) { + $("#e_tips_" + id).data('editor', editor); + var h = '您上次有已保存的数据,是否恢复 ? / 不恢复'; + $("#e_tips_" + id).html(h); + } + setInterval(function () { + var d = new Date(); + var h = d.getHours(); + var m = d.getMinutes(); + var s = d.getSeconds(); + h = h < 10 ? '0' + h : h; + m = m < 10 ? '0' + m : m; + s = s < 10 ? '0' + s : s; + if (editor.getValue().trim() != "") { + md_add_data("content", mdu, editor.getValue()); + var id1 = "#e_tip_" + id; + var id2 = "#e_tips_" + id; + + $(id1).html(" 数据已于 " + h + ':' + m + ':' + s + " 保存 "); + $(id2).html(""); + } + }, 10000); + + } else { + $("#e_tip_" + id).after('您的浏览器不支持localStorage.无法开启自动保存草稿服务,请升级浏览器!'); + } +} + + +function create_editorMD(id, width, high, placeholder, imageUrl, callback) { + var editorName = window.editormd(id, { + width: width, + height: high, + path: path, // "/editormd/lib/" + + syncScrolling: "single", + tex: true, + tocm: true, + emoji: true, + taskList: true, + codeFold: true, + searchReplace: true, + htmlDecode: "style,script,iframe", + sequenceDiagram: true, + autoFocus: false, + toolbarIcons: function () { + // Or return editormd.toolbarModes[name]; // full, simple, mini + // Using "||" set icons align right. + return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"] + }, + toolbarCustomIcons: { + testIcon: "
    ", + testIcon1: "
    " + }, + //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。 + saveHTMLToTextarea: true, + // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标 + dialogMaskOpacity: 0.6, + placeholder: placeholder, + imageUpload: true, + imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], + imageUploadURL: imageUrl,//url + onload: function () { + // this.previewing(); + $("#" + id + " [type=\"latex\"]").bind("click", function () { + editorName.cm.replaceSelection("```latex"); + editorName.cm.replaceSelection("\n"); + editorName.cm.replaceSelection("\n"); + editorName.cm.replaceSelection("```"); + var __Cursor = editorName.cm.getDoc().getCursor(); + editorName.cm.setCursor(__Cursor.line - 1, 0); + }); + + $("#" + id + " [type=\"inline\"]").bind("click", function () { + editorName.cm.replaceSelection("`$$$$`"); + var __Cursor = editorName.cm.getDoc().getCursor(); + editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 3); + editorName.cm.focus(); + }); + $("[type=\"inline\"]").attr("title", "行内公式"); + $("[type=\"latex\"]").attr("title", "多行公式"); + + md_elocalStorage(editorName, `memoNew_${id}`, "memoNew"); + + callback && callback() + } + }); + return editorName; +} + +function range(start, end) { + const result = []; + for (let i = start; i < end; i++) { + result.push(i); + } + return result; +} +function disabledDateTime() { + return { + // disabledHours: () => range(0, 24).splice(4, 20), + disabledMinutes: () => range(1, 30).concat(range(31, 60)), + // disabledSeconds: () => [0, 60], + }; +} + +function disabledDate(current) { + return current && current < moment().endOf('day').subtract(1, 'days'); +} +class Newshixuns extends Component { + constructor(props) { + super(props) + this.state = { + fileList: [], + newshixunlist: undefined, + departmentslist: undefined, + name: "", + main_type: "", + small_type: "", + trainee: "", + webssh: 0, + use_scope: 0, + can_copy: "", + scope_partment: undefined, + vnc: "", + scopetype: false, + postapplyvisible: false, + sendsure_applyvalue: undefined, + postapplytitle: false, + shixun_nametype: false, + main_types: false, + trainee_types: false, + SelectTheCommandtype: false, + opers: false, + operss: false, + TimePickervalue: "", + opensmail: false, + onSearchvalue: "", + scope_partmenttype: false, + languagewrite: undefined, + systemenvironment:undefined, + testcoderunmode:undefined, + file:undefined, + deleteisnot:true, + languagewritetype:false, + systemenvironmenttype:false, + testcoderunmodetype:false, + attachmentidstype:false, + datalisttype:false, + bottonloading:false + } + } + + initMD(initValue) { + this.contentChanged = false; + const placeholder = ""; + // amp; + // 编辑时要传memoId + const imageUrl = `/api/attachments.json`; + // 创建editorMd + + const taskpass_editormd = create_editorMD("memoMD", '100%', 400, placeholder, imageUrl, () => { + setTimeout(() => { + taskpass_editormd.resize() + taskpass_editormd.cm && taskpass_editormd.cm.refresh() + }, 500) + + if (initValue) { + taskpass_editormd.setValue(initValue) + } + taskpass_editormd.cm.on("change", (_cm, changeObj) => { + // console.log('....contentChanged') + this.contentChanged = true; + }) + }); + this.taskpass_editormd = taskpass_editormd; + window.taskpass_editormd = taskpass_editormd; + + } + + componentDidMount() { + let newshixunUrl = `/shixuns/new.json`; + axios.get(newshixunUrl).then((response) => { + if (response.status === 200) { + if (response.data.message===undefined) { + this.setState({ + newshixunlist: response.data + }); + this.initMD(response.data.sample[0][1]); + } + + } + }).catch((error) => { + console.log(error) + }); + + let departmentsUrl = `/shixuns/departments.json`; + axios.get(departmentsUrl).then((response) => { + if (response.status === 200) { + if (response.data.message===undefined) { + this.setState({ + departmentslist: response.data.shools_name + }); + } + } + }).catch((error) => { + console.log(error) + }); + } + + setlanguagewrite = (e)=>{ + this.setState({ + languagewrite: e.target.value + }) + } + + setsystemenvironment = (e) => { + this.setState({ + systemenvironment: e.target.value + }) + } + settestcoderunmode = (e) => { + this.setState({ + testcoderunmode: e.target.value + }) + + } + shixunname = (e) => { + this.setState({ + name: e.target.value, + shixun_nametype: false + }); + } + + bigClass = (value) => { + this.setState({ + main_type: value + }) + } + + littleClass = (value) => { + this.setState({ + small_type: value + }) + } + + Selectthestudent = (value) => { + this.setState({ + trainee: value + }) + } + + SelectTheCommand = (e) => { + this.setState({ + webssh: e.target.value, + }); + + if (e.target.value === 2) { + this.setState({ + SelectTheCommandtype: true, + multi_webssh: false + }); + } else { + this.setState({ + SelectTheCommandtype: false, + multi_webssh: false + }); + } + } + + Selectpublic = (e) => { + this.setState({ + scopetype: false, + use_scope: e.target.value, + }); + if (e.target.value === 1) { + this.setState({ + scopetype: true + }); + } + + } + + Teacherscopy = (e) => { + let sum = "" + if (e.target.checked === false) { + sum = 0 + } else if (e.target.checked === true) { + sum = 1 + } + this.setState({ + can_copy: sum, + }); + } + + TeachersUbuntu = (e) => { + let sum = "" + if (e.target.checked === false) { + sum = 0 + } else if (e.target.checked === true) { + sum = 1 + } + this.setState({ + vnc: sum, + }); + } + + adduse_scopeinput = () => { + let {scope_partment} = this.state; + let array = scope_partment; + let newarray = "" + array.push(newarray) + this.setState({ + scope_partment: array, + }); + } + + shixunScopeInput = (e, id) => { + let types=false + let {scope_partment} = this.state; + let datalist = scope_partment; + if (datalist === undefined) { + datalist = [] + } + + datalist.map((item,key)=>{ + if(e===item){ + types=true + this.setState({ + datalisttype:true + }) + return + } + }) + + if(types===false){ + datalist.push(e) + this.setState({ + scope_partment: datalist, + onSearchvalue: "" + }); + } + + + } + + deleteScopeInput = (key) => { + let {scope_partment} = this.state; + let datalist = scope_partment; + datalist.splice(key, 1); + this.setState({ + scope_partment: datalist + }); + } + + //提交数据 + submit_new_shixun = () => { + const mdVal = this.taskpass_editormd.getValue(); + let {can_copy, main_type, name, scope_partment, small_type, trainee, use_scope, vnc, webssh, multi_webssh, TimePickervalue} = this.state; + let Url = `/shixuns.json` + if (name === "") { + this.setState({ + shixun_nametype: true + }) + this.props.showSnackbar("实训名称为空"); + $('html').animate({ + scrollTop: 10 + }, 1000); + return + } + if (main_type === "") { + this.setState({ + main_types: true + }) + $('html').animate({ + scrollTop: 700 + }, 1000); + this.props.showSnackbar("请选择技术平台大类别"); + + return + } + + if (use_scope === 1) { + if (scope_partment === undefined || scope_partment.length === 0) { + this.setState({ + scope_partmenttype: true + }) + $('html').animate({ + scrollTop: 900 + }, 1000); + this.props.showSnackbar("公开程度,指定单位为空"); + return + } + } + if (trainee === "") { + this.setState({ + trainee_types: true + }) + // $('html').animate({ + // scrollTop: 700 + // }, 1000); + this.props.showSnackbar("请选择发布信息"); + return + } + let newmulti_webssh = multi_webssh; + if (newmulti_webssh === true) { + newmulti_webssh = 1 + } else { + newmulti_webssh = "" + } + this.setState({ + bottonloading:true + }) + axios.post(Url, { + name: name, + can_copy: can_copy, + description: mdVal, + main_type: main_type, + scope_partment: scope_partment, + small_type: small_type, + trainee: trainee, + use_scope: use_scope, + vnc: vnc, + webssh: webssh, + multi_webssh: newmulti_webssh, + task_pass: 1, + opening_time: TimePickervalue + } + ).then((response) => { + if (response.status === 200) { + window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges"; + // window.open("/shixuns/"+response.data.shixun_identifier+"/challenges"); + }else{ + this.setState({ + bottonloading:false + }) + } + }).catch((error) => { + console.log(error) + this.setState({ + bottonloading:false + }) + }) + } + + + shixunsfetch = (value, callback) => { + if (timeout) { + clearTimeout(timeout); + timeout = null; + } + currentValue = value; + + function fake() { + let departmentsUrl = `/shixuns/departments.json?q=` + currentValue; + axios.get(departmentsUrl).then((response) => { + if (response.data.message===undefined) { + callback(response.data.shools_name); + } + }).catch((error) => { + console.log(error) + }); + } + + timeout = setTimeout(fake, 300); + } + + shixunHandleSearch = (value) => { + + this.shixunsfetch(value, departmentslist => this.setState({departmentslist})); + + this.setState({ + onSearchvalue: "" + }) + } + + post_apply = () => { + this.setState({ + postapplyvisible: true + }) + } + sendsure_apply = () => { + let {languagewrite,systemenvironment,testcoderunmode} = this.state; + // console.log("点击确定") + // console.log("languagewrite"+languagewrite); + // console.log("systemenvironment"+systemenvironment); + // console.log("testcoderunmode"+testcoderunmode); + + // let attachment_ids = undefined + // if (this.state.fileList) { + // attachment_ids = this.state.fileList.map(item => { + // return item.response ? item.response.id : item.id + // }) + // } + if(languagewrite === undefined || languagewrite === "" ){ + // this.props.showNotification(`请填写该镜像是基于什么语言`); + this.setState({ + languagewritetype:true + }) + return + } + if(systemenvironment === undefined || systemenvironment === ""){ + // this.props.showNotification(`请填写该镜像是基于什么语言系统环境`); + this.setState({ + systemenvironmenttype:true + }) + return; + + } + if(testcoderunmode === undefined || testcoderunmode === "") { + // this.props.showNotification(`请填写该镜像中测试代码运行方式`); + this.setState({ + testcoderunmodetype:true + }) + return; + } + var attachment_ids=undefined; + if (this.state.fileList) { + attachment_ids = this.state.fileList.map(item => { + return item.response ? item.response.id : item.id + }) + } + + if( attachment_ids === undefined || attachment_ids.length===0){ + + // notification.open( + // { + // message: '提示', + // description: + // '请上传附件!', + // + // } + // ) + this.setState({ + attachmentidstype:true + }) + return; + } + // console.log("attachment_ids"+attachment_ids); + + // alert(languagewrite +" "+systemenvironment +" "+testcoderunmode + " "+attachment_ids); + + var data={ + language:languagewrite, + runtime:systemenvironment, + run_method:testcoderunmode, + attachment_id:attachment_ids[0], + } + var url =`/shixuns/apply_shixun_mirror.json`; + axios.post(url,data + ).then((response) => { + + try { + if (response.data) { + // const { id } = response.data; + // if (id) { + if(this.state.file !== undefined){ + console.log("549"); + // this.deleteAttachment(this.state.file); + this.setState({ + file:undefined, + deleteisnot:true, + languagewrite:"", + systemenvironment:"", + testcoderunmode:"", + fileList:[] + }) + }else { + this.setState({ + file:undefined, + deleteisnot:true, + languagewrite:"", + systemenvironment:"", + testcoderunmode:"", + fileList:[] + }) + } + // this.props.showNotification('提交成功!'); + notification.open( + { + message: '提示', + description: + '提交成功!', + + } + ) + this.sendhideModaly() + // this.props.history.push(`/courses/${cid}/graduation_topics`); + // } + } + }catch (e) { + + } + + }) + + } + sendhideModaly = () => { + this.setState({ + postapplyvisible: false, + }) + if(this.state.file !== undefined){ + console.log("580"); + // this.deleteAttachment(this.state.file); + this.setState({ + file:undefined, + deleteisnot:true, + languagewrite:"", + systemenvironment:"", + testcoderunmode:"", + fileList:[] + }) + }else { + this.setState({ + file:undefined, + deleteisnot:true, + languagewrite:"", + systemenvironment:"", + testcoderunmode:"", + fileList:[] + }) + } + } + sendsure_applyvalues = (e) => { + this.setState({ + sendsure_applyvalue: e.target.value + }) + } + yeshidemodel = () => { + this.setState({ + postapplytitle: false + }) + } + + SelectTheCommandonChange = (e) => { + this.setState({ + multi_webssh: e.target.checked + }) + } + + + bigopen = (e) => { + this.setState({ + opers: true + }) + + } + + bigopens = (e) => { + this.setState({ + opers: false, + operss: false, + opensmail: false + }) + + } + + bigopensmal = (e) => { + this.setState({ + opensmail: true + }) + + } + + sbigopen = (e) => { + this.setState({ + operss: true + }) + + } + + // sbigopens=()=>{ + // this.setState({ + // operss:false + // }) + // } + + onChangeTimePicker = (value, dateString) => { + this.setState({ + TimePickervalue: dateString=== ""?"":moment(handleDateStrings(dateString)) + }) + } + + // 附件相关 START + handleChange = (info) => { + if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { + let {fileList} = this.state; + + if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { + console.log("handleChange1"); + // if(fileList.length===0){ + let fileLists = info.fileList; + this.setState({ + // fileList:appendFileSizeToUploadFileAll(fileList), + fileList: fileLists, + deleteisnot: false + }); + // } + } + } + } + onAttachmentRemove = (file) => { + if(!file.percent || file.percent == 100){ + confirm({ + title: '确定要删除这个附件吗?', + okText: '确定', + cancelText: '取消', + // content: 'Some descriptions', + onOk: () => { + console.log("665") + this.deleteAttachment(file) + }, + onCancel() { + console.log('Cancel'); + }, + }); + return false; + } + + } + deleteAttachment = (file) => { + console.log(file); + 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 (status == 0) { + // console.log('--- success') + + this.setState((state) => { + + const index = state.fileList.indexOf(file); + const newFileList = state.fileList.slice(); + newFileList.splice(index, 1); + return { + fileList: newFileList, + deleteisnot:true + }; + }); + } + } + }) + .catch(function (error) { + console.log(error); + }); + } + + + handleSubmit=()=>{ + // console.log(this.state.languagewrite) + // console.log(this.state.systemenvironment) + // console.log(this.state.testcoderunmode) + var attachment_ids; + if (this.state.fileList) { + attachment_ids = this.state.fileList.map(item => { + return item.response ? item.response.id : item.id + }) + } + // console.log(attachment_ids); + // var data={ + // language:"", + // runtime:"", + // run_method:"", + // attachment_id:"", + // } + // axios.post(url,data + // ).then((response) => { + // if (response.data) { + // // const { id } = response.data; + // // if (id) { + // this.props.showNotification('提交成功!'); + // // this.props.history.push(`/courses/${cid}/graduation_topics`); + // // } + // } + // }) + + + + } + render() { + const { getFieldDecorator } = this.props.form; + let {testcoderunmode ,systemenvironment,languagewrite,deleteisnot, fileList,TimePickervalue, scope_partmenttype, opensmail, newshixunlist, name, scope_partment, departmentslist, postapplyvisible, sendsure_applyvalue, postapplytitle, shixun_nametype, main_types, trainee_types, SelectTheCommandtype, opers, datalisttype, onSearchvalue} = this.state; + let options + if (departmentslist != undefined) { + options = this.state.departmentslist.map((d, k) => { + return ( + + ) + }) + } + const uploadProps = { + width: 600, + fileList, + multiple: true, + // https://github.com/ant-design/ant-design/issues/15505 + // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 + // showUploadList: false, + action: `${getUploadActionUrl()}`, + onChange: this.handleChange, + onRemove: this.onAttachmentRemove, + beforeUpload: (file, fileList) => { + + if (this.state.fileList.length >= 1) { + return false + } + // console.log('beforeUpload', file.name); + const isLt150M = file.size / 1024 / 1024 < 50; + if (!isLt150M) { + // this.props.showNotification(`文件大小必须小于50MB`); + notification.open( + { + message: '提示', + description: + '文件大小必须小于50MB', + + } + ) + } + if(this.state.file !== undefined){ + console.log("763") + this.setState({ + file:file + }) + }else { + this.setState({ + file:file + }) + } + + console.log("handleChange2"); + return isLt150M; + }, + } + // const uploadProps = { + // width: 600, + // fileList, + // multiple: true, + // // https://github.com/ant-design/ant-design/issues/15505 + // // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 + // // showUploadList: false, + // action: `${getUrl()}/api/attachments.json`, + // onChange: this.handleChange, + // onRemove: this.onAttachmentRemove, + // beforeUpload: (file) => { + // // console.log('beforeUpload', file.name); + // const isLt50M = file.size / 1024 / 1024 < 50; + // if (!isLt50M) { + // this.props.showNotification('文件大小必须小于150MB!'); + // } + // return isLt50M; + // }, + // }; + + return ( + +
    +
    +
    + +
    +

    + 创建实训 + {this.props.user&&this.props.user.main_site===true?实训制作指南:""} +

    + +
    +

    实训名称

    +
    + * +
    + + + 必填项 + +
    + +
    +
    + +
    + + +
    + +

    简介

    + +
    +
    + +
    +
    +

    +

    +
    + +
    +

    技术平台

    +
    + * +
    + +

    + 列表中没有? + 申请新建 +

    + + + {/*
    */} +
    +
  • + + +
  • +
    {this.state.languagewritetype===true?"请填写该镜像语言":""}
    +
  • + + +
  • +
    {this.state.systemenvironmenttype===true?"请填写该镜像语言系统环境":""}
    +
  • + + + +
  • +
    {this.state.testcoderunmodetype===true?"请填写该镜像测试代码运行方式":""}
    +
  • + +
    + + + 上传附件 + (单个文件50M以内) + + +
    + +
  • +
    + {this.state.attachmentidstype===true?"请上传附件":""} +
    +
  • + this.sendhideModaly()} + >取消 + +
  • +
    +
    + {/*
    */} +
    + + + + +
    +

    新建申请已提交,请等待管理员的审核

    +
  • 我们将在1-2个工作日内与您联系 +
  • +
    +
    + 知道啦 +
    +
    +
    +
    +
    + +
    +

    请在配置页面完成后续的评测脚本设置操作

    +
    + 必填项 +
    +
    +
    + + +
    +

    命令行

    +
    + + 无命令行窗口 (选中则不给学员的实践任务提供命令窗口) + 命令行练习窗口 (选中则给学员提供用于练习操作的命令行窗口) + 命令行评测窗口 (选中则给学员提供用于关卡评测的命令行窗口) + + 多个命令行窗口(选中则允许学员同时开启多个命令行窗口) + + +
    +
    + + +
    +

    公开程度

    +
    + + 对所有公开 (选中则所有已被试用授权的用户可以学习) + 对指定单位公开 (选中则下方指定单位的已被试用授权的用户可以学习) + + +
    +
    +
    +
    +
    + +
    + (搜索选中添加单位名称) + {this.state.datalisttype===true?请勿选择重复单位:""} + {/*+ 添加*/} +
    +
    + +
    +
    + { + scope_partment === undefined ? "" : scope_partment.map((item, key) => { + return ( +
  • {item} + this.deleteScopeInput(key)}>× +
  • + ) + }) + } +
    + {/*{*/} + {/*scope_partment===undefined?"":scope_partment.map((item,key)=>{*/} + {/*return(*/} + {/*
    */} + {/*this.deleteScopeInput(key)} style={{ color: 'rgba(0,0,0,.25)' }} />}*/} + {/*value={item}*/} + {/*/>*/} + {/*
    */} + + {/*)*/} + {/*})*/} + {/*}*/} +
    + + + + 请选择需要公开的单位 + +
    +
    +
    +
    + + +
    +

    发布信息

    +
    +
    + *面向学员: +
    + +
    + 实训难易度定位,不限定用户群体 +
    + 必填项 +
    +
    +
    +
  • + 复制: + + +
  • +
    + 开启时间: +
  • + + +
  • +
    +
    + {/*
    */} + {/*

    VNC图形化

    */} + {/*
  • */} + {/**/} + {/**/} + {/*
  • */} + {/*
    */} + + +
    + + 取消 +
    + + +
    +
    +
    + + ); + } +} +const NewshixunsNew = Form.create({ name: 'newshixunsnew' })(Newshixuns); +export default SnackbarHOC()(TPMIndexHOC(NewshixunsNew)); + + + + + + diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css index 89b62856d..8e479aa9b 100644 --- a/public/stylesheets/educoder/edu-main.css +++ b/public/stylesheets/educoder/edu-main.css @@ -674,7 +674,7 @@ input.radio-width90{ width: 90px; } .ringauto{width: 20px;height: 20px;line-height: 20px;text-align: center;border-radius: 50%;background-color: #F4FAFF;margin-right:5px;} /*-------------------个人主页:右侧提示区域--------------------------*/ -.-task-sidebar{position:fixed;width:40px;height:180px;right:0;bottom:30px;z-index: 10;} +.-task-sidebar{position:fixed;width:40px;height:180px;right:0;bottom:80px;z-index: 10;} .-task-sidebar div{height: 40px;line-height: 40px;box-sizing: border-box;width:40px;background:#4CACFF;color:#fff;font-size:20px;text-align:center;margin-bottom:5px;border-radius: 4px;} .-task-sidebar div i{ color:#fff;} .-task-sidebar div i:hover{color: #fff!important;}