diff --git a/app/controllers/concerns/git_helper.rb b/app/controllers/concerns/git_helper.rb index 65ebd4074..d77e1c3f6 100644 --- a/app/controllers/concerns/git_helper.rb +++ b/app/controllers/concerns/git_helper.rb @@ -48,7 +48,7 @@ module GitHelper def project_fork(container, original_rep_path, username) raise Educoder::TipException.new("fork源路径为空,fork失败!") if original_rep_path.blank? # 将要生成的仓库名字 - new_repo_name = "#{username}/#{container.try(:identifier)}#{ Time.now.strftime("%Y%m%d%H%M%S")}" + new_repo_name = "#{username.try(:strip)}/#{container.try(:identifier)}#{ Time.now.strftime("%Y%m%d%H%M%S")}" uid_logger("start fork container: repo_name is #{new_repo_name}") GitService.fork_repository(repo_path: original_rep_path, fork_repository_path: (new_repo_name + ".git")) container.update_attributes!(:repo_name => new_repo_name) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 29f270a34..5cccb3ee7 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -212,7 +212,7 @@ class HomeworkCommonsController < ApplicationController format.xlsx{ student_work_to_xlsx(@work_excel,@homework) exercise_export_name = "#{current_user.real_name}_#{@course.name}_#{@homework.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}" - render xlsx: "#{exercise_export_name.strip.first(30)}",template: "homework_commons/works_list.xlsx.axlsx",locals: + render xlsx: "#{exercise_export_name.strip}",template: "homework_commons/works_list.xlsx.axlsx",locals: {table_columns: @work_head_cells,task_users: @work_cells_column} } end diff --git a/app/controllers/projects/base_controller.rb b/app/controllers/projects/base_controller.rb new file mode 100644 index 000000000..d874b4759 --- /dev/null +++ b/app/controllers/projects/base_controller.rb @@ -0,0 +1,5 @@ +class Projects::BaseController < ApplicationController + include PaginateHelper + + before_action :require_login, :check_auth +end diff --git a/app/controllers/projects/project_applies_controller.rb b/app/controllers/projects/project_applies_controller.rb new file mode 100644 index 000000000..37d9d615e --- /dev/null +++ b/app/controllers/projects/project_applies_controller.rb @@ -0,0 +1,14 @@ +class Projects::ProjectAppliesController < Projects::BaseController + def create + project = Projects::ApplyJoinService.call(current_user, create_params) + render_ok(project_id: project.id) + rescue Projects::ApplyJoinService::Error => ex + render_error(ex.message) + end + + private + + def create_params + params.permit(:code, :role) + end +end \ No newline at end of file diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 1c272e02d..6c3f34a60 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -716,7 +716,7 @@ class ShixunsController < ApplicationController rescue Exception => e if e.message != "ActiveRecord::RecordInvalid" logger.error("##########project_fork error #{e.message}") - @current_task.destroy! + @myshixun.destroy! end raise "实训云平台繁忙(繁忙等级:81)" end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 23f6870c8..a1f6a5495 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -73,8 +73,7 @@ class UsersController < ApplicationController @user_url = "/users/#{@user.login}" @career = Career.where(status: true).order("created_at asc").pluck(:id, :name) - ec_user = EcSchoolUser.where(:user_id => current_user.id).first - @auth = ec_user ? "#{@old_domain}/ecs/department?school_id=#{ec_user.school_id}" : nil + @auth = User.current.ec_school.present? ? "#{@old_domain}/ecs/department?school_id=#{User.current.ec_school}" : nil end # 用户回复功能 diff --git a/app/decorators/tiding_decorator.rb b/app/decorators/tiding_decorator.rb index 8d383dadf..c9ad806ee 100644 --- a/app/decorators/tiding_decorator.rb +++ b/app/decorators/tiding_decorator.rb @@ -98,7 +98,7 @@ module TidingDecorator end def apply_add_schools_content - name = container.name + name = ApplyAddSchool.find_by(id: container_id)&.name if tiding_type == 'Apply' I18n.t(locale_format(tiding_type)) % name elsif status == 2 @@ -201,7 +201,7 @@ module TidingDecorator when 'Issue' then I18n.t(locale_format(parent_container_type)) % parent_container.subject when 'Journal' then - message = object.notes.present? ? ':' + message_content_helper(parent_container.notes) : '' + message = parent_container&.notes.present? ? ':' + message_content_helper(parent_container.notes) : '' I18n.t(locale_format(parent_container_type)) % message end end @@ -331,13 +331,17 @@ module TidingDecorator end def challenge_work_score_content + I18n.t(locale_format) % container&.comment + end + + def student_works_scores_appeal_content work = StudentWork.find_by(id: parent_container_id) - return if work.blank? + name = work&.homework_common&.name if parent_container_type == 'StudentWork' - I18n.t(locale_format(parent_container_type, tiding_type)) % work.homework_common.try(:name) - elsif parent_container_type == 'UserAppealResult' || parent_container_type == 'AppealResult' - I18n.t(locale_format(parent_container_type, status)) % work.homework_common.try(:name) + I18n.t(locale_format(parent_container_type, tiding_type)) % name + else + I18n.t(locale_format(parent_container_type, status)) % name end end @@ -349,7 +353,7 @@ module TidingDecorator if tiding_type == 'System' I18n.t(locale_format(tiding_type, status), reason: extra) % container.try(:title) else - I18n.t(locale_format) % container.try(:title) + I18n.t(locale_format(tiding_type)) % container.try(:title) end end diff --git a/app/jobs/apply_join_project_notify_job.rb b/app/jobs/apply_join_project_notify_job.rb new file mode 100644 index 000000000..fe46bf0e0 --- /dev/null +++ b/app/jobs/apply_join_project_notify_job.rb @@ -0,0 +1,31 @@ +# 申请成为 管理员、开发者 加入项目 消息通知 +class ApplyJoinProjectNotifyJob < ApplicationJob + queue_as :notify + + def perform(user_id, project_id, role) + user = User.find_by(id: user_id) + project = Project.find_by(id: project_id) + return if user.blank? || project.blank? + + attrs = %i[user_id trigger_user_id container_id container_type status + belong_container_id belong_container_type tiding_type extra created_at updated_at] + + same_attrs = { + trigger_user_id: user.id, status: 0, tiding_type: 'Apply', extra: role, + container_id: project.id, container_type: 'JoinProject', + belong_container_id: project.id, belong_container_type: 'Project' + } + + # 报告人员加入时消息为系统通知消息 + if role == 5 + same_attrs[:container_type] = 'ReporterJoinProject' + same_attrs[:tiding_type] = 'System' + end + + Tiding.bulk_insert(*attrs) do |worker| + project.manager_members.each do |manager| + worker.add(same_attrs.merge(user_id: manager.user_id)) + end + end + end +end diff --git a/app/models/applied_project.rb b/app/models/applied_project.rb new file mode 100644 index 000000000..901443e81 --- /dev/null +++ b/app/models/applied_project.rb @@ -0,0 +1,9 @@ +class AppliedProject < ApplicationRecord + belongs_to :user + belongs_to :project + + has_many :applied_messages, as: :applied, dependent: :destroy + has_many :forge_activities, as: :forge_act, dependent: :destroy + + scope :pending, -> { where(status: 0) } +end diff --git a/app/models/forge_activity.rb b/app/models/forge_activity.rb new file mode 100644 index 000000000..77103d0ff --- /dev/null +++ b/app/models/forge_activity.rb @@ -0,0 +1,5 @@ +class ForgeActivity < ApplicationRecord + belongs_to :user + belongs_to :project + belongs_to :forge_act, polymorphic: true +end \ No newline at end of file diff --git a/app/models/journal.rb b/app/models/journal.rb new file mode 100644 index 000000000..25c1e2498 --- /dev/null +++ b/app/models/journal.rb @@ -0,0 +1,4 @@ +class Journal < ApplicationRecord + belongs_to :user + belongs_to :issue, foreign_key: :journalized_id +end \ No newline at end of file diff --git a/app/models/member.rb b/app/models/member.rb index d1feb8a37..70b7fe305 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -1,6 +1,8 @@ class Member < ApplicationRecord - has_many :member_roles, dependent: :destroy + belongs_to :user belongs_to :course, optional: true belongs_to :project, optional: true - belongs_to :user + + has_many :member_roles, dependent: :destroy + has_many :roles, through: :member_roles end diff --git a/app/models/member_role.rb b/app/models/member_role.rb index 900efc732..2461c52f1 100644 --- a/app/models/member_role.rb +++ b/app/models/member_role.rb @@ -1,3 +1,4 @@ class MemberRole < ApplicationRecord + belongs_to :role belongs_to :member end diff --git a/app/models/project.rb b/app/models/project.rb index ddc6f6e5f..c3c626cb0 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1,9 +1,12 @@ class Project < ApplicationRecord belongs_to :owner, class_name: 'User', foreign_key: :user_id + has_many :members + has_many :manager_members, -> { joins(:roles).where(roles: { name: 'Manager' }) }, class_name: 'Member' has_one :project_score, dependent: :destroy has_many :issues + has_many :user_grades, dependent: :destroy # 创建者 def creator diff --git a/app/models/role.rb b/app/models/role.rb new file mode 100644 index 000000000..e60606ffa --- /dev/null +++ b/app/models/role.rb @@ -0,0 +1,3 @@ +class Role < ApplicationRecord + has_many :member_roles, dependent: :destroy +end \ No newline at end of file diff --git a/app/models/searchable/dependents/user.rb b/app/models/searchable/dependents/user.rb index f6dcaa430..bb55d0530 100644 --- a/app/models/searchable/dependents/user.rb +++ b/app/models/searchable/dependents/user.rb @@ -8,7 +8,7 @@ module Searchable::Dependents::User private def check_searchable_dependents - if firstname_previously_changed? || lastname_previously_changed? || user_extension.school_id_previously_changed? + if firstname_previously_changed? || lastname_previously_changed? || user_extension&.school_id_previously_changed? # reindex shixun created_shixuns.each(&:reindex) diff --git a/app/models/tiding.rb b/app/models/tiding.rb index 66b1f85be..3ef625c57 100644 --- a/app/models/tiding.rb +++ b/app/models/tiding.rb @@ -6,4 +6,16 @@ class Tiding < ApplicationRecord belongs_to :belong_container, polymorphic: true, optional: true has_many :attachments, as: :container + + def identifier + value = nil + if Object.const_defined?(container_type) + value = container.try(:identifier) + end + + if value.blank? && belong_container_type && Object.const_defined?(belong_container_type) + value = belong_container.try(:identifier) + end + value + end end \ No newline at end of file diff --git a/app/models/user.rb b/app/models/user.rb index f2d9c7fb1..14d7b2697 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -128,6 +128,9 @@ class User < ApplicationRecord has_many :bidding_users, dependent: :destroy has_many :bidden_project_packages, through: :bidding_users, source: :project_package + # 项目 + has_many :applied_projects, dependent: :destroy + # Groups and active users scope :active, lambda { where(status: STATUS_ACTIVE) } @@ -497,6 +500,13 @@ class User < ApplicationRecord ) end + # 工程认证的学校 + def ec_school + school_id = self.ec_school_users.pluck(:school_id).first || + self.ec_major_schools.pluck(:school_id).first || + (self.ec_course_users.first && self.ec_course_users.first.try(:ec_course).try(:ec_year).try(:ec_major_school).try(:school_id)) + end + # 登录,返回用户名与密码匹配的用户 def self.try_to_login(login, password) login = login.to_s.strip diff --git a/app/models/user_grade.rb b/app/models/user_grade.rb new file mode 100644 index 000000000..dffbb4743 --- /dev/null +++ b/app/models/user_grade.rb @@ -0,0 +1,4 @@ +class UserGrade < ApplicationRecord + belongs_to :project + belongs_to :user +end diff --git a/app/services/concerns/elasticsearch_able.rb b/app/services/concerns/elasticsearch_able.rb index c1640470c..e93f9c537 100644 --- a/app/services/concerns/elasticsearch_able.rb +++ b/app/services/concerns/elasticsearch_able.rb @@ -22,6 +22,7 @@ module ElasticsearchAble fragment_size: EduSetting.get('es_highlight_fragment_size') || 30, tag: '', fields: { + name: { type: 'plain' }, challenge_names: { type: 'plain' }, challenge_tag_names: { type: 'plain' }, description: { type: 'plain' }, diff --git a/app/services/projects/apply_join_service.rb b/app/services/projects/apply_join_service.rb new file mode 100644 index 000000000..a177de930 --- /dev/null +++ b/app/services/projects/apply_join_service.rb @@ -0,0 +1,82 @@ +class Projects::ApplyJoinService < ApplicationService + Error = Class.new(StandardError) + + attr_reader :user, :params + + def initialize(user, params) + @user = user + @params = params + end + + def call + validate! + + # 项目报告人员直接加入项目 + if params[:role] == 'reporter' + Projects::JoinService.call(project, user, role: 'reporter') + return project + end + + ActiveRecord::Base.transaction do + apply = user.applied_projects.create!(project: project, role: role_value) + + apply.forge_activities.find_or_create_by!(user: user, project: project) + + notify_project_manager! + end + + # notify_project_owner + ApplyJoinProjectNotifyJob.perform_later(user.id, project.id, role_value) + + project + end + + private + + def project + @_project ||= Project.find_by(invite_code: params[:code].to_s.strip) + end + + def role_value + @_role ||= + case params[:role] + when 'manager' then 3 + when 'developer' then 4 + when 'reporter' then 5 + else raise Error, '角色无效' + end + end + + def notify_project_manager! + columns = %i[user_id applied_id applied_type status viewed applied_user_id role project_id created_at updated_at] + AppliedMessage.bulk_insert(*columns) do |worker| + base_attr = { status: false, viewed: false, applied_user_id: user.id, role: role_value, project_id: project.id } + + project.manager_members.each do |manager| + worker.add(base_attr.merge(user_id: manager.user_id)) + end + end + end + + def notify_project_owner + owner = project.user + return if owner.phone.blank? + + Educoder::Sms.send(mobile: owner.phone, send_type:'applied_project_info', + user_name: owner.show_name, name: project.name) + rescue Exception => ex + Rails.logger.error("发送短信失败 => #{ex.message}") + end + + def validate! + # params check + raise Error, '邀请码不能为空' if params[:code].blank? + raise Error, '角色不能为空' if params[:role].blank? + raise Error, '角色无效' unless %w(manager developer reporter).include?(params[:role]) + + # logical check + raise Error, '邀请码无效' if project.blank? + raise Error, '您已在该项目中' if project.member?(user) + raise Error, '您已经提交过申请' if user.applied_projects.pending.exists?(project: project) + end +end \ No newline at end of file diff --git a/app/services/projects/join_service.rb b/app/services/projects/join_service.rb new file mode 100644 index 000000000..b434e48cd --- /dev/null +++ b/app/services/projects/join_service.rb @@ -0,0 +1,35 @@ +class Projects::JoinService < ApplicationService + attr_reader :project, :user, :opts + + def initialize(project, user, **opts) + @project = project + @user = user + @opts = opts + end + + def call + ActiveRecord::Base.transaction do + member = project.members.create!(user: user) + + member.member_roles.create!(role_id: role_value) + + project.user_grades.find_or_create_by!(user: user) + end + + ApplyJoinProjectNotifyJob.perform_later(user, project, role_value) + + project + end + + private + + def role_value + @_role ||= + case opts[:role] + when 'manager' then 3 + when 'developer' then 4 + when 'reporter' then 5 + else raise ArgumentError + end + end +end \ No newline at end of file diff --git a/app/views/tidings/_tiding.json.jbuilder b/app/views/tidings/_tiding.json.jbuilder index d26d37b7b..34b06320d 100644 --- a/app/views/tidings/_tiding.json.jbuilder +++ b/app/views/tidings/_tiding.json.jbuilder @@ -1,6 +1,6 @@ json.extract! tiding, :id, :status, :viewed, :user_id, :tiding_type, :container_id, :container_type, :parent_container_id, :parent_container_type json.content tiding.content -json.identifier tiding.try(:container).try(:identifier) rescue nil +json.identifier tiding.identifier json.time tiding.how_long_time json.new_tiding tiding.unread?(@onclick_time) diff --git a/config/routes.rb b/config/routes.rb index 6024201a4..6623edd99 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -695,6 +695,10 @@ Rails.application.routes.draw do end resources :libraries, only: [:index, :show, :create, :update, :destroy] + + scope module: :projects do + resources :applied_projects, only: [:create] + end end #git 认证回调 diff --git a/db/migrate/20190729080935_modify_login_for_users.rb b/db/migrate/20190729080935_modify_login_for_users.rb new file mode 100644 index 000000000..60e5e0964 --- /dev/null +++ b/db/migrate/20190729080935_modify_login_for_users.rb @@ -0,0 +1,9 @@ +class ModifyLoginForUsers < ActiveRecord::Migration[5.2] + def change + users = User.where("created_on > '2019-07-26 19:00:00'") + users.find_each do |use| + use.update_attributes(login: use.login&.strip, phone: use.phone&.strip) + use.user_extension.update_column(:student_id, use.user_extension&.student_id&.strip) if use.user_extension + end + end +end diff --git a/db/migrate/20190729095722_delete_error_myshixun_from_myshxiuns.rb b/db/migrate/20190729095722_delete_error_myshixun_from_myshxiuns.rb new file mode 100644 index 000000000..ef5b86975 --- /dev/null +++ b/db/migrate/20190729095722_delete_error_myshixun_from_myshxiuns.rb @@ -0,0 +1,11 @@ +class DeleteErrorMyshixunFromMyshxiuns < ActiveRecord::Migration[5.2] + def change + myshixuns = Myshixun.where("created_at > '2019-07-26 00:00:00' and repo_name is null") + myshixuns.find_each do |myshixun| + if myshixun.games.blank? + puts("###########user_login: #{User.find(myshixun.user_id).login}") + myshixun.destroy! + end + end + end +end diff --git a/db/migrate/20190729122213_delete_myshixun_games_for_users.rb b/db/migrate/20190729122213_delete_myshixun_games_for_users.rb new file mode 100644 index 000000000..d52369828 --- /dev/null +++ b/db/migrate/20190729122213_delete_myshixun_games_for_users.rb @@ -0,0 +1,11 @@ +class DeleteMyshixunGamesForUsers < ActiveRecord::Migration[5.2] + def change + myshixuns = Myshixun.where("created_at > '2019-07-26 19:00:00' and repo_name is null") + myshixuns.find_each do |m| + if m.games.count == m.games.select{|g| g.status == 3}.count + puts("#######login: #{User.find(m.user_id).login}") + m.destroy! + end + end + end +end diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index a9e24da3d..8b7c727a9 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -1,11 +1,25 @@ /*--------------------------首页*/ /*头部导航条样式---2018-03-19--by-cs*/ -.newHeader{background: #24292D !important; width:100%; height: 60px !important; min-width: 1200px;position: fixed;top: 0px;left: 0px;z-index:1000;-moz-box-shadow: 0px 0px 12px rgba(0,0,0,0.1); /* 老的 Firefox */box-shadow: 0px 0px 12px rgba(0,0,0,0.1);} +.newHeader{ + /*overflow:hidden;*/ + /*text-overflow:ellipsis;*/ + /*white-space:nowrap;*/ + background: #24292D !important; width:100%; height: 60px !important; min-width: 1200px;position: fixed;top: 0px;left: 0px;z-index:1000;-moz-box-shadow: 0px 0px 12px rgba(0,0,0,0.1); /* 老的 Firefox */box-shadow: 0px 0px 12px rgba(0,0,0,0.1); +} .newHeader .logoimg{ margin-top: 16px; float: left; width: 97px;} -.head-nav{float: left;width: 830px;text-align: center;height: 60px;box-sizing: border-box; min-width: 400px;} +.head-nav{ + float: left; + text-align: center; + height: 60px; + box-sizing: border-box; + min-width: 785px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .head-nav ul#header-nav{position: absolute;top: 0px;z-index: 3;height: 60px;box-sizing: border-box;} .head-nav ul#header-nav li{float: left;height: 60px;line-height: 60px;margin-right: 30px;cursor: pointer;position: relative;font-size: 16px} .head-nav ul#header-nav li a{display: block;height: 100%;width: 100%;color: #fff} diff --git a/public/react/public/index.html b/public/react/public/index.html index a4a795941..801189edb 100755 --- a/public/react/public/index.html +++ b/public/react/public/index.html @@ -87,7 +87,7 @@ -
+
diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 363ff495d..2ad7df0d5 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -41,7 +41,7 @@ export function initAxiosInterceptors(props) { // proxy = "http://testbdweb.trustie.net" // proxy = "http://testbdweb.educoder.net" // proxy = "https://testeduplus2.educoder.net" - proxy="http://47.96.87.25:48080" + proxy="http://47.96.87.25:48080/" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; diff --git a/public/react/src/common/TextUtil.js b/public/react/src/common/TextUtil.js index 82a848cac..8aef0adbd 100644 --- a/public/react/src/common/TextUtil.js +++ b/public/react/src/common/TextUtil.js @@ -10,7 +10,8 @@ export function markdownToHTML(oldContent, selector) { window.$(selector).html(oldContent) } else { try { - var markdwonParser = window.editormd.markdownToHTML("md_div", { + // selector || + var markdwonParser = window.editormd.markdownToHTML(selector || "md_div", { markdown: oldContent, // .replace(/▁/g,"▁▁▁"), emoji: true, htmlDecode: "style,script,iframe", // you can filter tags decode @@ -23,6 +24,10 @@ export function markdownToHTML(oldContent, selector) { } catch(e) { console.error(e) } + // selector = '.' + selector + if (selector) { + return; + } const content = window.$('#md_div').html() if (selector) { diff --git a/public/react/src/common/components/markdown/MarkdownToHtml.css b/public/react/src/common/components/markdown/MarkdownToHtml.css new file mode 100644 index 000000000..affba12cd --- /dev/null +++ b/public/react/src/common/components/markdown/MarkdownToHtml.css @@ -0,0 +1,6 @@ +.markdownToHtml.editormd-html-preview, .markdownToHtml.editormd-preview-container { + overflow: hidden; +} +.markdownToHtml.editormd-html-preview p.editormd-tex, .markdownToHtml.editormd-preview-container p.editormd-tex { + text-align: left; +} \ No newline at end of file diff --git a/public/react/src/common/components/markdown/MarkdownToHtml.js b/public/react/src/common/components/markdown/MarkdownToHtml.js index 0780fc789..63733165e 100644 --- a/public/react/src/common/components/markdown/MarkdownToHtml.js +++ b/public/react/src/common/components/markdown/MarkdownToHtml.js @@ -1,8 +1,8 @@ import React,{ Component } from "react"; import { markdownToHTML } from 'educoder' +import './MarkdownToHtml.css' /** selector 需要传入唯一的selector作为id,不然会引起冲突 - delay 如果有公式,需要传入delay={true} */ class MarkdownToHtml extends Component{ constructor(props){ @@ -10,33 +10,26 @@ class MarkdownToHtml extends Component{ this.state={ } } - _markdownToHTML = (content, selector) => { - if (this.props.delay == true) { - (function(content, selector) { - // console.log('selector: ', selector) - setTimeout(() => { - markdownToHTML(content, selector) - }, 600) - })(content, selector) - } else { - markdownToHTML(content, selector) - } + _markdownToHTML = (content, selector) => { + markdownToHTML(content, selector) } componentDidUpdate = (prevProps) => { if (this.props.content) { if ( prevProps.content != this.props.content ) { - this._markdownToHTML(this.props.content, `.markdown_to_html_${this.props.selector || ''}`) + this._markdownToHTML(this.props.content, `markdown_to_html_${this.props.selector || ''}`) } } } componentDidMount () { - this.props.content && this._markdownToHTML(this.props.content, `.markdown_to_html_${this.props.selector || ''}`) + this.props.content && this._markdownToHTML(this.props.content, `markdown_to_html_${this.props.selector || ''}`) } render(){ const { style, className } = this.props + let _selector = `markdown_to_html_${this.props.selector || ''}` + return( -
diff --git a/public/react/src/modules/courses/ListPageIndex.js b/public/react/src/modules/courses/ListPageIndex.js index 95342bb13..9f12f6434 100644 --- a/public/react/src/modules/courses/ListPageIndex.js +++ b/public/react/src/modules/courses/ListPageIndex.js @@ -103,7 +103,7 @@ class ListPageIndex extends Component{
{/*头部banner*/} - + {/*{yslGuideone===null||yslGuideone===undefined||yslGuideone===false?*/} {/* (*/} {/* this.props.isAdmin()===true?*/} diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index ff8e3e3a2..f1b9faab7 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -136,7 +136,7 @@ class CommonWorkDetailIndex extends Component{ DownloadMessageval:undefined }) } - + bindRef = ref => { this.child = ref }; render() { @@ -171,8 +171,10 @@ class CommonWorkDetailIndex extends Component{ let params = {} if (isListModule) { // TODO - // params = this.refs.commonWorkList._getRequestParams() + params =this.child._getRequestParams()!==undefined?this.child._getRequestParams():{}; } + // console.log("普通作业176176176"); + // console.log(params); let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}` let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}` return ( @@ -356,7 +358,7 @@ class CommonWorkDetailIndex extends Component{ {/* 作品列表 */} () + (props) => () } > @@ -382,7 +384,7 @@ class CommonWorkDetailIndex extends Component{ {/* 作品列表 */} () + (props) => () } > diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 5938d037a..8bc029cec 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -400,7 +400,12 @@ class CommonWorkList extends Component{ componentDidMount() { this.fetchList() on('commonwork_fetch_all', this.fetchAllListener) - $("html").animate({ scrollTop: $('html').scrollTop() - 100 }) + $("html").animate({ scrollTop: $('html').scrollTop() - 100 }); + try { + this.props.triggerRef(this); + }catch (e) { + + } } componentWillUnmount() { @@ -767,7 +772,7 @@ class CommonWorkList extends Component{
-

没有数据可以显示!

+

暂时还没有相关数据哦!

diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index cd3355082..778829d72 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -7,7 +7,7 @@ import '../poll/pollStyle.css' import '../css/Courses.css' import moment from 'moment' -import { WordsBtn,markdownToHTML,ActionBtn,getImageUrl } from 'educoder' +import { WordsBtn,markdownToHTML,ActionBtn,getImageUrl, MarkdownToHtml } from 'educoder' import Modals from '../../modals/Modals' import CoursesListType from '../coursesPublic/CoursesListType'; @@ -537,7 +537,7 @@ class ExerciseReviewAndAnswer extends Component{ />

- {courseName} + {courseName} > {data && data.left_banner_name} > @@ -712,7 +712,10 @@ class ExerciseReviewAndAnswer extends Component{

  • -

    + {/*

    */} +
  • { // 选择题和判断题共用 @@ -724,6 +727,7 @@ class ExerciseReviewAndAnswer extends Component{ questionType={item} user_exercise_status={user_exercise_status} changeQuestionStatus={(No,flag)=>this.changeQuestionStatus(No,flag)} + index={key} > } { @@ -736,6 +740,8 @@ class ExerciseReviewAndAnswer extends Component{ questionType={item} user_exercise_status={user_exercise_status} changeQuestionStatus={(No,flag)=>this.changeQuestionStatus(No,flag)} + index={key} + > } { @@ -748,6 +754,8 @@ class ExerciseReviewAndAnswer extends Component{ questionType={item} user_exercise_status={user_exercise_status} changeQuestionStatus={(No,flag)=>this.changeQuestionStatus(No,flag)} + index={key} + > } { @@ -774,6 +782,8 @@ class ExerciseReviewAndAnswer extends Component{ questionType={item} user_exercise_status={user_exercise_status} id={this.state.Id} + index={key} + > } diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js index 6e7b52715..1771d87b3 100644 --- a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js +++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js @@ -1,5 +1,5 @@ import React, {Component} from "react"; -import {WordsBtn,markdownToHTML} from 'educoder'; +import {WordsBtn,markdownToHTML, MarkdownToHtml} from 'educoder'; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Pagination} from "antd"; import {Link,Switch,Route,Redirect} from 'react-router-dom'; import axios from 'axios'; @@ -194,8 +194,10 @@ class Exercisestatisticalresult extends Component { {item.ques_position+"."}{item.ques_type===0?"单选":item.ques_type===1?"多选":item.ques_type===2?"判断":item.ques_type===3?"填空":item.ques_type===4?"主观":item.ques_type===5?"实训":""}题
    {/*Q{item.ques_position}:*/} -
    - + {/*
    */} + {/**/}
    diff --git a/public/react/src/modules/courses/exercise/Exercisetablesmubu.js b/public/react/src/modules/courses/exercise/Exercisetablesmubu.js index 60c29ffbc..92cfa30b7 100644 --- a/public/react/src/modules/courses/exercise/Exercisetablesmubu.js +++ b/public/react/src/modules/courses/exercise/Exercisetablesmubu.js @@ -52,7 +52,7 @@ class Exercisetablesmubus extends Component { dataIndex: 'commit_percent', key: 'commit_percent', render: (text, record, index) => { - const _content = + const _content = {text.value!="有效填写量"&&text.value!="wrong" && } diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 6f4cec877..fffadccf6 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -2565,7 +2565,7 @@ class Studentshavecompletedthelist extends Component {
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    @@ -2630,7 +2630,7 @@ class Studentshavecompletedthelist extends Component {
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    @@ -2692,7 +2692,7 @@ class Studentshavecompletedthelist extends Component {
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    diff --git a/public/react/src/modules/courses/exercise/new/JudgeDisplay.js b/public/react/src/modules/courses/exercise/new/JudgeDisplay.js index 7beaa50e5..60fbd5ac2 100644 --- a/public/react/src/modules/courses/exercise/new/JudgeDisplay.js +++ b/public/react/src/modules/courses/exercise/new/JudgeDisplay.js @@ -7,7 +7,7 @@ import { } from 'antd'; import axios from 'axios' import { qNameArray } from './common' -import {getUrl, ActionBtn, markdownToHTML} from 'educoder'; +import {getUrl, ActionBtn, markdownToHTML, MarkdownToHtml } from 'educoder'; import QestionDisplayHeader from './QestionDisplayHeader' const { TextArea } = Input; const confirm = Modal.confirm; @@ -87,9 +87,12 @@ class JudgeDisplay extends Component{ return (
    - {item.choice_text} + {/* {item.choice_text} */} + {/* */} + dangerouslySetInnerHTML={{__html: markdownToHTML1(item.choice_text)}}> */}
    ) })} diff --git a/public/react/src/modules/courses/exercise/new/MainDisplay.js b/public/react/src/modules/courses/exercise/new/MainDisplay.js index 0581865d7..44a795374 100644 --- a/public/react/src/modules/courses/exercise/new/MainDisplay.js +++ b/public/react/src/modules/courses/exercise/new/MainDisplay.js @@ -70,10 +70,10 @@ class MainDisplay extends Component{
    参考答案:
    {/*
    */} diff --git a/public/react/src/modules/courses/exercise/new/NullDisplay.js b/public/react/src/modules/courses/exercise/new/NullDisplay.js index eade97474..079b1194f 100644 --- a/public/react/src/modules/courses/exercise/new/NullDisplay.js +++ b/public/react/src/modules/courses/exercise/new/NullDisplay.js @@ -109,7 +109,7 @@ class NullDisplay extends Component{
    { answers.answer_text.map((item, itemIndex) => { return })} diff --git a/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js b/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js index 7b82b14b6..c90d87dac 100644 --- a/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js +++ b/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js @@ -82,9 +82,9 @@ class QestionDisplayHeader extends Component{
    { question_title && - //
    } diff --git a/public/react/src/modules/courses/exercise/new/SingleDisplay.js b/public/react/src/modules/courses/exercise/new/SingleDisplay.js index cbb6da827..bce4dc4c1 100644 --- a/public/react/src/modules/courses/exercise/new/SingleDisplay.js +++ b/public/react/src/modules/courses/exercise/new/SingleDisplay.js @@ -101,10 +101,10 @@ class SingleDisplay extends Component{
    {prefix} {/* */} + dangerouslySetInnerHTML={{__html: markdownToHTML1(item.choice_text)}}> */}
    ) } else { @@ -112,10 +112,10 @@ class SingleDisplay extends Component{
    {prefix} {/* */} + dangerouslySetInnerHTML={{__html: markdownToHTML1(item.choice_text)}}> */}
    ) } })} diff --git a/public/react/src/modules/courses/exercise/question/fillEmpty.js b/public/react/src/modules/courses/exercise/question/fillEmpty.js index 79bc164d8..5179432a2 100644 --- a/public/react/src/modules/courses/exercise/question/fillEmpty.js +++ b/public/react/src/modules/courses/exercise/question/fillEmpty.js @@ -1,6 +1,6 @@ import React,{ Component } from "react"; import {Checkbox,Radio, Input} from "antd"; -import {DMDEditor,markdownToHTML } from 'educoder' +import {DMDEditor,markdownToHTML, MarkdownToHtml } from 'educoder' import axios from 'axios' @@ -140,7 +140,10 @@ class fillEmpty extends Component{ { item.answer_text && item.answer_text.map((i,index)=>{ return( -
    + + //
    ) }) } diff --git a/public/react/src/modules/courses/exercise/question/multiple.js b/public/react/src/modules/courses/exercise/question/multiple.js index 3ef3d960f..7e96f8550 100644 --- a/public/react/src/modules/courses/exercise/question/multiple.js +++ b/public/react/src/modules/courses/exercise/question/multiple.js @@ -1,6 +1,6 @@ import React,{ Component } from "react"; import {Checkbox,Radio, Input} from "antd"; -import {markdownToHTML} from 'educoder' +import {markdownToHTML, MarkdownToHtml} from 'educoder' import axios from 'axios' const tagArray = [ @@ -51,7 +51,10 @@ class Multiple extends Component{

    {prefix} {/* */} - + {/* */} +

    ) }) diff --git a/public/react/src/modules/courses/exercise/question/simpleAnswer.js b/public/react/src/modules/courses/exercise/question/simpleAnswer.js index 240f775c2..527044968 100644 --- a/public/react/src/modules/courses/exercise/question/simpleAnswer.js +++ b/public/react/src/modules/courses/exercise/question/simpleAnswer.js @@ -1,6 +1,6 @@ import React,{ Component } from "react"; import {Checkbox,Radio, Input} from "antd"; -import {markdownToHTML} from 'educoder' +import {markdownToHTML, MarkdownToHtml} from 'educoder' import TPMMDEditor from '../../../../modules/tpm/challengesnew/TPMMDEditor' import axios from 'axios' @@ -54,7 +54,10 @@ class simpleAnswer extends Component{
  • { user_exercise_status == 1 ? -
    0 ? questionType.user_answer[0]:"")}}>
    + //
    0 ? questionType.user_answer[0]:"")}}>
    + 0 ? questionType.user_answer[0]:""} selector={'simgle_' + (this.props.index + 1)} + className="answerStyle" + > :
    0 ? questionType.user_answer[0]:''} mdID={'simpleEditor'+questionType.question_id} placeholder="请输入你的答案" @@ -70,7 +73,10 @@ class simpleAnswer extends Component{ exercise.answer_status == 1 || questionType.a_flag ?

    参考答案:

    -
  • + {/*
  • */} +

    this.showAndHide(false)}>隐藏参考答案

    : @@ -82,7 +88,10 @@ class simpleAnswer extends Component{ isStudent && exercise.answer_open==true && exercise.exercise_status == 3 ?

    参考答案:

    -
  • + {/*
  • */} +
    :"" } diff --git a/public/react/src/modules/courses/exercise/question/single.js b/public/react/src/modules/courses/exercise/question/single.js index 4ff4bf12b..510c28b48 100644 --- a/public/react/src/modules/courses/exercise/question/single.js +++ b/public/react/src/modules/courses/exercise/question/single.js @@ -1,7 +1,7 @@ import React,{ Component } from "react"; import {Checkbox,Radio, Input} from "antd"; -import {markdownToHTML} from 'educoder' +import {markdownToHTML, MarkdownToHtml} from 'educoder' import axios from 'axios' const tagArray = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', @@ -46,7 +46,10 @@ class single extends Component{

    {prefix} {/* */} - + {/* */} +

    ) }) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js index 1e0fb3071..6c7085ca2 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js @@ -190,7 +190,7 @@ export default ImageLayerOfCommentHOC() (GraduationTasksappraiseReply); {/*className="edu-tab-con-box clearfix edu-txt-center">*/} {/**/} - {/*

    没有数据可以显示!

    */} + {/*

    暂时还没有相关数据哦!

    */} {/**/} {/**/} {/**/} \ No newline at end of file diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index d773d8411..7d421da4b 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -1307,7 +1307,7 @@ class GraduationTaskssettinglist extends Component{
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    @@ -1573,7 +1573,7 @@ class GraduationTaskssettinglist extends Component{ className="edu-tab-con-box clearfix edu-txt-center"> -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index 363d06c54..6780948ef 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -36,8 +36,10 @@ const buildColumns = (that) => { key: 'login', align:'center', className:"color-grey-6", - render: (name, record) => { - return {name} + render: (login, record) => { + return 10 ? login : ''} + >{login} } }, { title: '姓名', @@ -57,8 +59,8 @@ const buildColumns = (that) => { align:'center', className:"color-grey-6", render: (student_id, record) => { - return {student_id} + return 10 ? student_id : ''} + style={{maxWidth: '160px'}} >{student_id} } }]; if (course_groups && course_groups.length) { diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 8ec2ffcbc..4dc41fcf7 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2528,7 +2528,7 @@ class Listofworksstudentone extends Component {
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    @@ -2747,7 +2747,7 @@ class Listofworksstudentone extends Component {
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    @@ -2945,7 +2945,7 @@ class Listofworksstudentone extends Component {
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index f1d1c43f3..cc9586577 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -258,7 +258,7 @@ class ShixunWorkModal extends Component{
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    diff --git a/public/react/src/modules/forums/MemoList.js b/public/react/src/modules/forums/MemoList.js index fae728542..26cad1448 100644 --- a/public/react/src/modules/forums/MemoList.js +++ b/public/react/src/modules/forums/MemoList.js @@ -31,7 +31,7 @@ class MemoList extends Component { {!memo_list || memo_list.length === 0 ?
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    : renderMemoList() } diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js index 003724ede..65284d0f8 100644 --- a/public/react/src/modules/home/shixunsHome.js +++ b/public/react/src/modules/home/shixunsHome.js @@ -123,7 +123,7 @@ class ShixunsHome extends Component { {/*懒加载*/} - + {/**/}
    diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 2db1929b9..58cd9b7fb 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -102,6 +102,8 @@ class LoginDialog extends Component { authCodeclass:'log-botton mt5', isRender: false, MyEduCoderModals:false, + Phonenumberisnotco:undefined, + Phonenumberisnotcobool:false, }; } @@ -112,26 +114,103 @@ class LoginDialog extends Component { register=(num) =>{ this.setState({login:1,speedy:num,dialogBox:'dialogBox2'}); } - - loginChange = () =>{ - let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/; - let reg1 = /^1\d{10}$/; - let reg2=/^[a-zA-z]\w{3,14}$/; - // let reg3=/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/; - let value=this.refs.loginPassText.value; - let valuenum= value.length; - if(valuenum>0){ - if(!reg.test(value)&&!reg1.test(value)&&!reg2.test(value)){ - this.setState({regular:1}) - return - }else{ - this.setState({loginValue:value}) - this.setState({regular:0}) + inputOnBlur = (e, id) => { + this.Emailphonenumberverification(e.target.value, 1); + }; + // 输入页面 + loginChange = (e) =>{ + var stirngt=""; + if(e.target.value.length>0){ + var str= e.target.value.replace(/\s*/g,"") + stirngt=str; + }else{ + stirngt= e.target.value; + } + + if (e.target.value.length === 0) { + this.setState({ + loginValue: stirngt, + Phonenumberisnotco:undefined, + }) + }else{ + this.setState({ + loginValue: stirngt, + Phonenumberisnotco:undefined, + }) + } + // let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/; + // let reg1 = /^1\d{10}$/; + // let reg2=/^[a-zA-z]\w{3,14}$/; + // // let reg3=/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/; + // let value=this.refs.loginPassText.value; + // let valuenum= value.length; + // if(valuenum>0){ + // if(!reg.test(value)&&!reg1.test(value)&&!reg2.test(value)){ + // this.setState({regular:1}) + // return + // }else{ + // // this.setState({loginValue:value}); + // this.setState({regular:0}); + // var stirngt; + // if(value.length>0){ + // var str= value.replace(/\s*/g,"") + // stirngt=str; + // }else{ + // stirngt= value; + // } + // this.setState({ + // loginValue:stirngt, + // }); + // } + // }else{ + // this.setState({loginValue:value}); + // var stirngt; + // if(value.length>0){ + // var str= value.replace(/\s*/g,"") + // stirngt=str; + // }else{ + // stirngt= value; + // } + // this.setState({ + // loginValue:stirngt, + // }); + // } + }; + //邮箱手机号验证 + Emailphonenumberverification = (value, id) => { + var url = `/accounts/valid_email_and_phone.json`; + axios.get((url), { + params: { + login: value, + type: 1, + } + }).then((result) => { + if(result){ + if(result.data.status===-2){ + if(result.data.message==="该手机号码或邮箱已被注册"){ + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + }) + }else { + this.setState({ + Phonenumberisnotco: result.data.message, + Phonenumberisnotcobool: true, + }) + } + return; + }else { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + }) + return; } - }else{ - this.setState({loginValue:value}) } - } + }).catch((error) => { + + }) + }; passwordChange = () =>{ let value =this.refs.passwordText.value; @@ -411,7 +490,7 @@ class LoginDialog extends Component { window.location.href = url; }; render() { - let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass, + let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass,Phonenumberisnotco, dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state; if (isRender === undefined) { @@ -457,11 +536,13 @@ class LoginDialog extends Component { id="name_loggin_input" ref="loginPassText" onInput={this.loginChange} + onBlur={(e) => this.inputOnBlur(e, 1)} + value={this.state.loginValue} name="username" placeholder="请输入有效的手机号/邮箱号" >

    请输入有效的手机号/邮箱号

    + style={{display: Phonenumberisnotco===undefined?'none':'block'}}>{Phonenumberisnotco}

    +
    + {/*newContainers*/}
    {/*
    diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index d197bc9c4..3d1136371 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -649,10 +649,22 @@ submittojoinclass=(value)=>{ {...this.state} {...this.props} />:""} - + 高校智能化教学与实训平台 -
    + + +
    {/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
    @@ -711,65 +723,67 @@ submittojoinclass=(value)=>{ >工程认证 - -
    -
    - {/**/} -
    - - 实训 - - -
    - {/**/} - {/*搜索框*/} - {showSearchOpentype===true?
    this.hideshowSearchOpen(e)} onMouseLeave={()=>this.setevaluatinghides()}> - this.onKeywordSearchKeyDowns()} - onSearch={(value) => this.onKeywordSearchKeyDown(value)} - // onPressEnter={this.onKeywordSearchKeyDown} - style={{ width: 300,height:32}} - autoFocus={true} - /> -
    :""} - - {/**/} - {/*/!**!/*/} - {/**/} - - {/**/} - {/* TODO 需要服务端接口提供最近搜索 + } + +
    +
    + {/**/} +
    + + 实训 + + +
    + {/**/} + {/*搜索框*/} + {showSearchOpentype===true?
    this.hideshowSearchOpen(e)} onMouseLeave={()=>this.setevaluatinghides()}> + this.onKeywordSearchKeyDowns()} + onSearch={(value) => this.onKeywordSearchKeyDown(value)} + // onPressEnter={this.onKeywordSearchKeyDown} + style={{ width: 300,height:32}} + autoFocus={true} + /> +
    :""} + + {/**/} + {/*/!**!/*/} + {/**/} + + {/**/} + {/* TODO 需要服务端接口提供最近搜索
    最近搜索
    */} -
    -
    - -
    +
    +
    {/* <%= link_to '登录', signin_path, :className => "mr5" %> @@ -777,16 +791,16 @@ submittojoinclass=(value)=>{ <%= link_to '注册', user_join_path, :className => "ml5" %> */} { user===undefined? - + this.educoderlogin()} className="mr5 color-white">登录 注册 - :user.login===""? + :user.login===""? this.educoderlogin()} className="mr5 color-white">登录 注册 : - ); diff --git a/public/react/src/modules/tpm/TPMIndex.css b/public/react/src/modules/tpm/TPMIndex.css index 1eb60bee8..2f6eccfd6 100644 --- a/public/react/src/modules/tpm/TPMIndex.css +++ b/public/react/src/modules/tpm/TPMIndex.css @@ -200,4 +200,12 @@ body>.-task-title { .HeaderSearch{ width: 325px; +} +.mainheighs{ + height: 100%; + display: block; +} + +.ml18a{ + margin-left:18%; } \ No newline at end of file diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index 2e40d006a..e539d1d70 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -20,7 +20,7 @@ const versionNum = '0001'; // let _url_origin = getUrl() let _url_origin=''; if(window.location.port === "3007"){ - _url_origin="https://newweb.educoder.net"; + _url_origin="http://47.96.87.25:48080/"; } // let _url_origin=`https://www.educoder.net`; diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 9199aa51d..48e1af926 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -556,7 +556,7 @@ class LoginRegisterComponent extends Component { }).catch((error) => { }) - } + }; //短信验证 SMSverification = () => { var url = `/accounts/get_verification_code.json`; @@ -689,60 +689,6 @@ class LoginRegisterComponent extends Component { } //失去焦点判断 inputOnBlur = (e, id) => { - // this.isCorrectname(e.target.value, id); - // this.Emailphonenumberverification(e.target.value, id); - if (e.target.value.length === 0) { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - }) - return; - } - // var telephone = $("#telephoneAdd.tianjia_phone").val(); - var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; - // var email = $("#add_email.tianjia_email").val(); - var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; - - // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 - var stringdata = undefined; - if (!regph.test(e.target.value)) { - stringdata = "手机号格式不正确"; - this.setState({ - Phonenumberisnotco: stringdata, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - } else { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - }) - return - } - - if (!regemail.test(e.target.value)) { - if ((e.target.value.indexOf("@") != -1) === true) { - stringdata = "邮箱格式不正确"; - } else { - stringdata = "手机号格式不正确"; - - } - this.setState({ - Phonenumberisnotco: stringdata, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - return - } else { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - }) - this.Emailphonenumberverification(e.target.value, 1); - return - } this.Emailphonenumberverification(e.target.value, 1); } inputOnBlurzhuche = (e, id) => { diff --git a/public/react/src/modules/user/Notcompletedysl.js b/public/react/src/modules/user/Notcompletedysl.js index 8f147957a..53d9b3509 100644 --- a/public/react/src/modules/user/Notcompletedysl.js +++ b/public/react/src/modules/user/Notcompletedysl.js @@ -37,6 +37,12 @@ class Notcompletedysl extends Component { if(weekArray===undefined){ weekArray="/"; } + if(weekArray===null){ + weekArray="/"; + } + if(weekArray==="null"){ + weekArray="/"; + } window.location.href = weekArray; } @@ -46,7 +52,7 @@ class Notcompletedysl extends Component { render() { - console.log(this.props) + // console.log(this.props) return( : "" } { - (!data || data.courses.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && + (!data || data.courses.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && } { data && data.courses && data.courses.map((item,key)=>{ @@ -147,7 +147,7 @@ class InfosCourse extends Component{ { item.can_visited ==false?
    - +

    非成员不能访问

    :"" } diff --git a/public/react/src/modules/user/usersInfo/InfosPath.js b/public/react/src/modules/user/usersInfo/InfosPath.js index 759527a6e..d23739280 100644 --- a/public/react/src/modules/user/usersInfo/InfosPath.js +++ b/public/react/src/modules/user/usersInfo/InfosPath.js @@ -152,7 +152,7 @@ class InfosPath extends Component{ this.props.current_user && this.props.current_user.user_identity != "学生" ? :"" } { - (!data || data.subjects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && + (!data || data.subjects.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && } { data && data.subjects && data.subjects.map((item,key)=>{ diff --git a/public/react/src/modules/user/usersInfo/InfosProject.js b/public/react/src/modules/user/usersInfo/InfosProject.js index 6c1f4a666..195e98b73 100644 --- a/public/react/src/modules/user/usersInfo/InfosProject.js +++ b/public/react/src/modules/user/usersInfo/InfosProject.js @@ -125,7 +125,7 @@ class InfosProject extends Component{ :"" } { - (!data || data.projects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && + (!data || data.projects.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && } { data && data.projects && data.projects.map((item,key)=>{ @@ -142,7 +142,7 @@ class InfosProject extends Component{ { item.can_visited ==false?
    - +

    非成员不能访问

    :"" } diff --git a/public/react/src/modules/user/usersInfo/InfosShixun.js b/public/react/src/modules/user/usersInfo/InfosShixun.js index bac60fe6f..1550230ab 100644 --- a/public/react/src/modules/user/usersInfo/InfosShixun.js +++ b/public/react/src/modules/user/usersInfo/InfosShixun.js @@ -161,7 +161,7 @@ class InfosShixun extends Component{ :"" } { - (!data || data.shixuns.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && + (!data || data.shixuns.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && } { data && data.shixuns && data.shixuns.map((item,key)=>{ diff --git a/public/react/src/search/SearchPage.js b/public/react/src/search/SearchPage.js index 32d88b392..ccdb9e12a 100644 --- a/public/react/src/search/SearchPage.js +++ b/public/react/src/search/SearchPage.js @@ -164,7 +164,7 @@ class SearchPage extends Component{
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index c5831dad4..4fdd8c400 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -1,11 +1,25 @@ /*--------------------------首页*/ /*头部导航条样式---2018-03-19--by-cs*/ -.newHeader{background: #24292D !important; width:100%; height: 60px !important; min-width: 1200px;position: fixed;top: 0px;left: 0px;z-index:1000;-moz-box-shadow: 0px 0px 12px rgba(0,0,0,0.1); /* 老的 Firefox */box-shadow: 0px 0px 12px rgba(0,0,0,0.1);} +.newHeader{ + /*overflow:hidden;*/ + /*text-overflow:ellipsis;*/ + /*white-space:nowrap;*/ + background: #24292D !important; width:100%; height: 60px !important; min-width: 1200px;position: fixed;top: 0px;left: 0px;z-index:1000;-moz-box-shadow: 0px 0px 12px rgba(0,0,0,0.1); /* 老的 Firefox */box-shadow: 0px 0px 12px rgba(0,0,0,0.1); +} .newHeader .logoimg{ margin-top: 16px; float: left; width: 97px;} -.head-nav{float: left;width:830px;text-align: center;height: 60px;box-sizing: border-box; min-width: 400px;} +.head-nav{ + float: left; + text-align: center; + height: 60px; + box-sizing: border-box; + min-width: 785px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .head-nav ul#header-nav{position: absolute;top: 0px;z-index: 3;height: 60px;box-sizing: border-box;} .head-nav ul#header-nav li{float: left;height: 60px;line-height: 60px;margin-right: 30px;cursor: pointer;position: relative;font-size: 16px} .head-nav ul#header-nav li a{display: block;height: 100%;width: 100%;color: #fff}