diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 8cbc503f7..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 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/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..9a3eec9ca 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -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/libs/custom_regexp.rb b/app/libs/custom_regexp.rb index dd2ebb0b8..2980f2ed2 100644 --- a/app/libs/custom_regexp.rb +++ b/app/libs/custom_regexp.rb @@ -3,5 +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/ + 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_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/models/user.rb b/app/models/user.rb index 388959aca..eb3ece0a4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -23,8 +23,6 @@ class User < ApplicationRecord # 身份证 VALID_NUMBER_REGEX = /(^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^([A-Z]\d{6,10}(\(\w{1}\))?)$)/ - VALID_PASSWORD_REGEX = /\A[a-z_A-Z0-9-\.!@#\$%\\\^&\*\)\(\+=\{\}\[\]\/",'<>~\·`\?:;|]{8,16}\z/ - LOGIN_LENGTH_LIMIT = 30 MAIL_LENGTH_LMIT = 60 @@ -183,7 +181,6 @@ class User < ApplicationRecord #validates_format_of :ID_number, with: VALID_NUMBER_REGEX, multiline: true, message: "身份证号格式不对" # validates :nickname, presence: true, length: { maximum: 10 } # validates :lastname, presence: true - validates_format_of :password, with: VALID_PASSWORD_REGEX, multiline: true, message: "8~16位密码,支持字母数字和符号" # 删除自动登录的token,一旦退出下次会提示需要登录 def delete_autologin_token(value) 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/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/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 @@ - + + - - - + + + 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/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/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/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..7915e6674 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?"":} -
    - ) - }) - } -
    :""} +