Merge branch 'dev_Ysl' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_admin
杨树林 6 years ago
commit fddbbe0c25

@ -1,2 +0,0 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

@ -1,3 +0,0 @@
// Place all the styles related to the forums controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

@ -9,8 +9,7 @@ class BiddingUsersController < ApplicationController
end
def win
package = current_user.project_packages.find(params[:project_package_id])
ProjectPackages::WinBiddingService.call(package, params)
ProjectPackages::WinBiddingService.call(current_package, current_user, params)
render_ok
rescue ProjectPackages::WinBiddingService::Error => ex
render_error(ex.message)

@ -17,8 +17,8 @@ class FilesController < ApplicationController
sort_type = params[:sort_type] || 'created_on' # created_on时间排序 downloads下载次数排序; quotes: 引用次数排序
course_second_category_id = params[:course_second_category_id] || 0 # 0: 为主目录, 其他为次目录id
@user = current_user
@attachments = @course.attachments.by_course_second_category_id(course_second_category_id)
.includes(attachment_group_settings: :course_group, author: [:user_extension, :course_members])
@attachments = course_second_category_id.to_i == 0 ? @course.attachments : @course.attachments.by_course_second_category_id(course_second_category_id)
@attachments = @attachments.includes(attachment_group_settings: :course_group, author: [:user_extension, :course_members])
.ordered(sort: sort.to_i, sort_type: sort_type.strip)
get_category(@course, course_second_category_id)

@ -1,2 +0,0 @@
class ForumsController < ApplicationController
end

@ -22,7 +22,7 @@ class LibrariesController < ApplicationController
end
@count = libraries.count
@libraries = paginate libraries.includes(:library_tags, :praise_tread_cache, user: :user_extension)
@libraries = paginate libraries.includes(:library_tags, user: :user_extension)
ids = @libraries.map(&:id)
@download_count_map = Attachment.where(container_type: 'Library', container_id: ids)

@ -1,8 +1,9 @@
class MemosController < ApplicationController
before_action :set_memo, only: [:show, :edit, :update, :destroy]
before_action :require_login, except: [:show, :index]
before_action :set_memo, only: [:show, :edit, :update, :destroy, :sticky_or_cancel, :hidden, :more_reply]
before_action :validate_memo_params, only: [:create, :update]
before_action :owner_or_admin, only: [:edit, :update, :destroy]
before_action :is_admin, only: []
before_action :is_admin, only: [:sticky_or_cancel, :hidden]
include ApplicationHelper
# GET /memos
@ -84,7 +85,7 @@ class MemosController < ApplicationController
params[:tags].each do |tag|
MemoTagRepertoire.create!(memo_id: @memo.id, tag_repertoire_id: tag)
end
normal_status("帖子创建成功")
render :json => {memo_id: @memo.id, status: 0, message: "帖子创建成功"}
rescue Exception => e
tip_exception("帖子创建失败,原因:#{e}")
raise ActiveRecord::Rollback
@ -117,6 +118,60 @@ class MemosController < ApplicationController
normal_status("删除成功")
end
def sticky_or_cancel
tip_exception("只能对主贴进行置顶操作") unless @memo.parent_id.nil?
begin
@memo.update_attributes!(sticky: !@memo.sticky)
normal_status("更新成功")
rescue Exception => e
tip_exception("更新失败,原因:#{e}")
raise ActiveRecord::Rollback
end
end
def hidden
tip_exception("不能对主贴进行隐藏操作") if @memo.parent_id.nil?
begin
@memo.update_attributes!(hidden: !@memo.hidden)
normal_status("更新成功")
rescue Exception => e
tip_exception("更新失败,原因:#{e}")
raise ActiveRecord::Rollback
end
end
def reply
tip_exception("parent_id不能为空") if params[:parent_id].blank?
tip_exception("content不能为空") if params[:content].blank?
ActiveRecord::Base.transaction do
begin
memo = Memo.find_by!(id: params[:parent_id])
@reply = Memo.new
@reply.content = params[:content]
@reply.author = current_user
@reply.forum_id = memo.forum_id
@reply.subject = memo.subject
@reply.root_id = memo.root_id || memo.id
memo.children << @reply
m = Memo.find_by!(id: @reply.root_id)
m.increment!(:all_replies_count)
rescue Exception => e
tip_exception("回复失败,原因:#{e}")
raise ActiveRecord::Rollback
end
end
end
def more_reply
@user = current_user
page = params[:page] || 2
limit = params[:limit] || 10
offset = (page.to_i - 1) * limit
@memos_count = Memo.where(parent_id: @memo.id).count
@memos = Memo.limit(limit).where(parent_id: @memo.id).includes(:author, :praise_treads).order("created_at desc").offset(offset)
end
private
# Use callbacks to share common setup or constraints between actions.
def set_memo

@ -408,18 +408,16 @@ class ShixunsController < ApplicationController
@shixun.update_attributes(shixun_params)
@shixun.shixun_info.update_attributes(shixun_info_params)
@shixun.shixun_schools.delete_all
if params[:scope_partment].present? && params[:user_scope].to_i == 1
logger.info("##########scope_partment:###{params[:scope_partment]}")
# scope_partment: 高校的名称
if params[:scope_partment].present?
arr = []
ids = School.where(:name => params[:scope_partment]).pluck(:id).uniq
ids.each do |id|
arr << { :school_id => id, :shixun_id => @shixun.id }
end
ShixunSchool.create!(arr)
use_scope = 1
else
use_scope = 0
end
@shixun.update_attributes!(:use_scope => use_scope)
# 超级管理员和运营人员才能保存 中间层服务器pod信息的配置
if current_user.admin? || current_user.business?
@shixun.shixun_service_configs.destroy_all

@ -222,7 +222,7 @@ class SubjectsController < ApplicationController
@subject.update_attributes(status: 1)
ApplyAction.create(container_type: "ApplySubject", container_id: @subject.id, user_id: current_user.id, status: 0)
begin
status = Trustie::Sms.send(mobile: '18711011226', send_type:'publish_subject' , name: '管理员')
status = Educoder::Sms.send(mobile: '18711011226', send_type:'publish_subject' , name: '管理员')
rescue => e
uid_logger_error("发送验证码出错: #{e}")
end

@ -3,11 +3,13 @@ class Users::PrivateMessageDetailsController < Users::BaseController
after_action :update_message_status, only: [:show]
helper_method :target_user
def show
messages = observed_user.private_messages.without_deleted.where(target: target_user)
@count = messages.count
@messages = messages.order(send_time: :asc).includes(sender: :user_extension)
@messages = paginate messages.order(send_time: :desc).includes(sender: :user_extension)
end
private

@ -194,7 +194,7 @@ module CoursesHelper
# 获取课堂的资源数
def get_attachment_count(course, category_id)
course.attachments.where(course_second_category_id: category_id).size
category_id.to_i == 0 ? course.attachments.size : course.attachments.where(course_second_category_id: category_id).size
end
# 获取课堂的作业数

@ -1,2 +0,0 @@
module ForumsHelper
end

@ -10,6 +10,8 @@ class Library < ApplicationRecord
has_many :attachments, as: :container
has_one :praise_tread_cache, foreign_key: :object_id
has_many :praise_treads, as: :praise_tread_object, dependent: :destroy
validates :uuid, presence: true, uniqueness: true

@ -15,6 +15,7 @@ class Memo < ApplicationRecord
has_many :descendants, foreign_key: :root_id, class_name: 'Memo'
has_many :children, foreign_key: :parent_id, class_name: 'Memo'
has_many :attachments, as: :container, dependent: :destroy
has_many :tidings, as: :container, dependent: :destroy
scope :field_for_list, lambda{
select([:id, :subject, :author_id, :sticky, :updated_at, :language, :reward, :all_replies_count, :viewed_count, :forum_id])

@ -58,7 +58,7 @@ class DiscussesService
praise_count: 0, position: params[:position], challenge_id: params[:challenge_id], hidden: !current_user.admin?
)
# 发送手机通知
Trustie::Sms.send(mobile:'18173242757', send_type:'discuss', name:'管理员')
Educoder::Sms.send(mobile:'18173242757', send_type:'discuss', name:'管理员')
rescue Exception => e
raise(e.message)
end

@ -54,7 +54,7 @@ class ProjectPackages::SaveService < ApplicationService
raise Error, '验证码不能为空' if params[:code].blank?
code = VerificationCode.where(phone: params[:contact_phone], code_type: 9, code: params[:code]).last
raise Error, '无效的验证码' if code.blank? || !code.valid_code?
raise Error, '无效的验证码' if code.blank? || !code.effective?
end
def deal_attachments

@ -1,14 +1,16 @@
class ProjectPackages::WinBiddingService < ApplicationService
Error = Class.new(StandardError)
attr_reader :package, :params
attr_reader :package, :user, :params
def initialize(package, params)
def initialize(package, user, params)
@package = package
@user = user
@params = params
end
def call
raise Error, '没有权限' unless package.creator_id == user.id || user.admin_or_business?
raise Error, '竞标报名还未结束' unless package.bidding_end?
raise Error, '该状态下不能选择中标者' unless package.may_finish_bidding?

@ -22,7 +22,7 @@ class Projects::ApplyJoinService < ApplicationService
apply.forge_activities.find_or_create_by!(user: user, project: project)
notify_project_manager!
notify_project_manager!(apply)
end
# notify_project_owner
@ -47,10 +47,13 @@ class Projects::ApplyJoinService < ApplicationService
end
end
def notify_project_manager!
def notify_project_manager!(apply)
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 }
base_attr = {
applied_id: apply.id, applied_type: 'AppliedProject', 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))

@ -1,96 +0,0 @@
class SearchShixunService < ApplicationService
include ElasticsearchAble
attr_reader :user, :params
def initialize(user, params)
@user = user
@params = params
end
def call
Shixun.search(keyword,
fields: search_fields,
where: where_clauses,
order: order_clauses,
includes: includes_clauses,
page: page,
per_page: per_page)
end
private
def tag_filter_shixun_ids
return [] if params[:tag_level].to_i == 0 || params[:tag_id].blank?
case params[:tag_level].to_i
when 1 then
Repertoire.find(params[:tag_id]).tag_repertoires.joins(:shixun_tag_repertoires)
.pluck('shixun_tag_repertoires.shixun_id')
when 2 then
SubRepertoire.find(params[:tag_id]).tag_repertoires.joins(:shixun_tag_repertoires)
.pluck('shixun_tag_repertoires.shixun_id')
when 3 then
TagRepertoire.find(params[:tag_id]).shixun_tag_repertoires.pluck(:shixun_id)
else
[]
end
end
def user_filter_shixun_ids
return [] if params[:order_by] != 'mine'
user.shixun_members.pluck(:shixun_id) + user.myshixuns.pluck(:shixun_id)
end
def keyword
params[:keyword].to_s.strip.presence || '*'
end
def search_fields
%w(name^10 author_name challenge_names description challenge_tag_names)
end
def where_clauses
hash = {}
ids = user_filter_shixun_ids + tag_filter_shixun_ids
hash[:id] = ids if ids.present?
if params[:order_by] == 'mine'
hash[:status] = { not: -1 }
else
hash.merge!(hidden: false, status: 2)
end
unless params[:status].to_i.zero?
params[:status] = [0, 1] if params[:status].to_i == 1
hash[:status] = params[:status]
end
hash[:trainee] = params[:diff].to_i unless params[:diff].to_i.zero?
hash
end
def includes_clauses
[]
end
def order_clauses
hash = { _score: :desc }
publish_order = { type: 'number', order: :desc, script: 'doc["status"].value=="2" ? 1 : 0' }
sort = params[:sort].to_s.strip == 'asc' ? 'asc' : 'desc'
clauses =
case params[:order_by].presence
when 'new' then { _script: publish_order, created_at: sort }
when 'hot' then { _script: publish_order, myshixuns_count: sort }
when 'mine' then { created_at: sort }
else { _script: publish_order, publish_time: sort }
end
hash.merge!(clauses)
hash
end
end

@ -51,6 +51,8 @@ class Users::UpdateAccountService < ApplicationService
if first_full_reward
RewardGradeService.call(user, container_id: user.id, container_type: 'Account', score: 500)
sms_notify_admin(user.lastname) if user.user_extension.teacher?
end
user
@ -65,4 +67,10 @@ class Users::UpdateAccountService < ApplicationService
def user_extension_attributes
params.slice(*%i[location location_city identity student_id technical_title school_id department_id])
end
def sms_notify_admin name
Educoder::Sms.send(mobile:'17680641960', send_type:'teacher_register', name: name, user_name:'管理员')
rescue => ex
Util.logger_error(ex)
end
end

@ -1 +1,2 @@
json.status 0
json.code @code

@ -34,7 +34,6 @@ elsif @type == "mp3" || @type == "mp4"
json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}]
json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}]
end
# json.orignal_file do
# json.array! @orignal_picture do |file|
# json.file_url attachment_show_users_path(:file_name => file, :path => @original_path)

@ -5,7 +5,7 @@ json.libraries do
json.cover_url library.cover_id.present? ? download_url(library.cover) : nil
json.praise_count library.praise_tread_cache&.praise_num || 0
json.praise_count library.praises_count
json.download_count @download_count_map.fetch(library.id, 0)
json.published_at library.display_published_at

@ -2,7 +2,7 @@ library = current_library
json.extract! library, :id, :uuid, :title, :content, :author_name, :author_school_name, :status, :visited_count
json.praise_count library.praise_tread_cache&.praise_num || 0
json.praise_count library.praises_count
json.published_at library.display_published_at
json.created_at library.display_created_at
@ -10,6 +10,7 @@ json.created_at library.display_created_at
# 创建者
json.creator do
json.partial! 'users/user_simple', user: library.user
json.school_name library.user.school_name
end
# 封面

@ -1,7 +1,14 @@
json.(memo, :id, :subject, :is_md, :content, :sticky, :reward, :viewed_count)
json.tag memo.tag_repertoires.map(&:name)
json.time memo.created_at
json.replies_count memo.all_replies_count
json.user_praise memo.praise_treads.user_liker(@user.try(:id)) ? true : false
json.memo_praise_count memo.praise_treads.liker.count
json.memo do
json.id memo.id
json.subject memo.subject
json.is_md memo.is_md
json.content memo.content
json.sticky memo.sticky
json.reward memo.reward
json.viewed_count memo.viewed_count
json.tag memo.tag_repertoires.map(&:name)
json.time memo.created_at
json.replies_count memo.all_replies_count
json.user_praise memo.praise_treads.user_liker(@user.try(:id)).count > 1 ? true : false
json.memo_praise_count memo.praise_treads.liker.count
end

@ -10,7 +10,7 @@ json.permission @user.manager_of_memo?(memo)
json.praise_count memo.praise_treads.select{|pt| pt.praise_or_tread == 1}.count
json.user_praise memo.praise_treads.select{|pt| pt.praise_or_tread == 1 && pt.user_id == @user.id}.length > 0
json.user_login memo.author.login
json.admin @user.admin
json.admin @user.admin? || @user.business?
json.children do
json.array! memo.children_of_reply do |child|

@ -0,0 +1,7 @@
json.memo_replies do
json.array! @memos do |memo|
json.partial! "memos/replies_list", memo: memo
end
end
json.memos_count @memos_count

@ -0,0 +1,2 @@
json.(@reply, :id, :subject, :content, :hidden, :forum_id, :author_id, :all_replies_count, :is_md, :parent_id, :root_id,
:reward, :sticky, :updated_at, :created_at, :viewed_count)

@ -1,9 +1,13 @@
json.count @count
json.target do
json.partial! 'users/user_simple', user: target_user
end
json.messages do
json.array! @messages.each do |message|
json.extract! message, :id, :user_id, :receiver_id, :sender_id, :content
json.send_time message.display_send_time
json.send_day message.send_time.strftime('%Y-%m-%d')
json.sender do
json.partial! 'users/user_simple', user: message.sender
end

@ -3,6 +3,7 @@ json.message 'success'
json.private_message do
json.extract! @message, :id, :user_id, :receiver_id, :sender_id, :content
json.send_day @message.send_time.strftime('%Y-%m-%d')
json.send_time @message.display_send_time
json.sender do
json.partial! 'users/user_simple', user: @message.sender

@ -16,5 +16,11 @@ json.project_packages do
json.deadline_at package.display_deadline_at
json.published_at package.display_published_at
json.operation do
can_manage = current_user&.id == observed_user.id || current_user&.admin_or_business?
json.can_edit can_manage && package.editable?
json.can_delete can_manage && package.deletable?
end
end
end

@ -5,6 +5,7 @@ Rails.application.routes.draw do
mount Sidekiq::Web => '/sidekiq', :constraints => AdminConstraint.new
get 'attachments/download/:id', to: 'attachments#show'
get 'attachments/download/:id/:filename', to: 'attachments#show'
resources :edu_settings
scope '/api' do
@ -22,11 +23,13 @@ Rails.application.routes.draw do
resources :memos do
member do
post :sticky_or_cancel
post :hidden
get :more_reply
end
collection do
post :reply
end
end
@ -713,7 +716,7 @@ Rails.application.routes.draw do
resources :libraries, only: [:index, :show, :create, :update, :destroy]
scope module: :projects do
resources :applied_projects, only: [:create]
resources :project_applies, only: [:create]
end
end

@ -0,0 +1,12 @@
class AddPraisesCountToMemos < ActiveRecord::Migration[5.2]
def change
add_column :memos, :praises_count, :integer, :default => 0
memos = Memo.includes(:praise_treads).all
memos.find_each do |m|
puts("####{m.id}")
praises_count = m.praise_treads.select{|pt| pt.praise_or_tread == 1}.count
m.update_column(:praises_count, praises_count)
end
end
end

@ -0,0 +1,10 @@
class AddPraisesCountToLibraries < ActiveRecord::Migration[5.2]
def change
add_column :libraries, :praises_count, :integer, :default => 0
Library.find_each do |library|
praises_count = library.praise_treads.count
library.update_column(:praises_count, praises_count)
end
end
end

@ -21,7 +21,7 @@ module Educoder
def self.notify_admin(opt)
opt[:name] = '管理员'
opt[:mobile] = ENV['NOTIFY_ADMIN_PHONE'] || EduSetting.get('notify_admin_phone') || '17680641960'
opt[:mobile] = ENV['NOTIFY_ADMIN_PHONE'] || EduSetting.get('notify_admin_phone') || '18711085785'
send(opt)
end
@ -39,25 +39,22 @@ module Educoder
params['text'] = "【Edu实训】" + code + "手机验证码有效期为10分钟。如非本人操作请忽略。"
elsif send_type == 'competition_start'
params['text'] = "【Edu实训】亲爱的#{user_name},你参与的#{name}将于#{result}开始,请及时参赛"
Rails.logger.info "#{params['text']}"
elsif send_type == "teacher_register"
params['mobile'] = EduSetting.get('teacher_register_phone') || '17680641960'
params['text'] = "【Edu实训】亲爱的#{user_name},有新的老师#{name}注册啦,请尽快处理"
elsif send_type == 'subject_authorization' || send_type == 'shixun_authorization'
params['text'] = "【Edu实训】亲爱的#{user_name},您提交的#{name}#{send_type=='subject_authorization'?'':''}发布申请#{result},请登录平台查看详情"
Rails.logger.info "#{params['text']}"
elsif send_type == 'authentication_pro' || send_type == 'authentication'|| send_type == 'trial_authorization' || send_type == 'project_info'
params['text'] = "【Edu实训】亲爱的#{user_name},您提交的#{send_type == 'authentication_pro'?'':(send_type == 'authentication'? '' : (send_type == 'project_info'?'':'' ))}#{result},请登录平台查看详情"
Rails.logger.info "#{params['text']}"
elsif send_type == "apply_pro_certification" || send_type == "apply_auth"
params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'apply_pro_certification'?'':''}认证申请,请尽快处理"
Rails.logger.info "#{params['text']}"
elsif send_type == "publish_subject" ||send_type == "publish_shixun"|| send_type == "user_apply_auth" || send_type == "discuss"
params['mobile'] = EduSetting.get('subject_shixun_notify_phone') || '18711011226' if send_type == "publish_subject" || send_type == "publish_shixun"
params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'publish_subject'?'':(send_type == 'publish_shixun' ? '' : (send_type == 'discuss' ? '':''))}申请发布,请尽快处理"
Rails.logger.info "#{params['text']}"
elsif send_type == 'join_course_multi_role'
params['text'] = "【Edu实训】亲爱的#{user_name},您的课堂#{name}有助教或者教师申请加入,请尽快审核"
Rails.logger.info "#{params['text']}"
elsif send_type == 'applied_project_info'
params['text'] = "【Edu实训】亲爱的#{user_name},您的项目#{name}有成员申请加入,请尽快审核"
Rails.logger.info "#{params['text']}"
end
http = Net::HTTP.new(send_tpl_sms_uri.host, send_tpl_sms_uri.port)

File diff suppressed because one or more lines are too long

@ -72,6 +72,7 @@
"react-infinite-scroller": "^1.2.4",
"react-loadable": "^5.3.1",
"react-monaco-editor": "^0.25.1",
"react-player": "^1.11.1",
"react-redux": "5.0.7",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",

@ -577,7 +577,7 @@ p .activity-item:first-child{border-top: 1px solid #eee;}
.recently_name{float: left;line-height: 48px;display: block}
.recently_item:hover{background-color: #F9F9F9;}
/*私信对话框*/
.private-list{min-height: 660px;max-height: 810px;overflow-y: auto}
.private-list{min-height: 660px;max-height: 831px;overflow-y: auto}
.private-list .private-part{padding-left:20px;cursor: pointer}
.private-part:hover{background-color: #F5F5F5;}
.private-part.active{background-color: #F5F5F5;}
@ -3065,3 +3065,358 @@ a.singlepublishtwo{
/*课程目标VS毕业要求指标点*/
.CourseTargetPoint thead th{vertical-align: baseline;}
.CourseTargetPoint tbody tr td{vertical-align: top;}
/*众包*/
.packinput .ant-input{
height: 50px;
width:749px;
border-color: #E1EDF8 !important;
}
.packinput{
width:749px;
}
.packinput .ant-input-group-addon .ant-btn{
width:140px !important;
font-size: 18px;
height: 50px;
background:rgba(76,172,255,1);
}
.setissues{
width:280px;
height:50px;
background:rgba(76,172,255,1);
border-radius:4px;
margin-left: 15px;
}
.pagetype li{
color:#8F8F8F !important;
}
.maxwidth700{
max-width: 700px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mbf10{
margin-bottom:-10px;
}
.PackageIndexNEIBanner{
width:1200px;
height:110px;
background:rgba(255,255,255,1);
box-shadow:0px 2px 6px 0px rgba(125,125,125,0.26);
border-radius:8px;
}
.padding110{
padding: 39px 110px 0px;
box-sizing: border-box;
}
.borderccc{
border: 1px solid #ccc;
}
.input-100-40s{
width: 100%;
padding: 5px;
box-sizing: border-box;
}
.fafafas{
background-color: #fafafa!important;
height: 40px;
}
.fafafas:focus{
background-color: #fff!important;
}
.fafas .ant-input{
background-color: #fafafa!important;
height: 40px;
}
.fafas .ant-input:focus{
background-color: #fff!important;
}
.fafas .ant-input-group-addon .ant-btn{
width:140px !important;
font-size: 14px;
height: 40px;
background:rgba(76,172,255,1);
}
.newFormbox .upload_filename{
line-height: 32px;
}
.newFormbox .attachment span{
line-height: 23px;
}
.newFormbox .attachment .remove-upload{
line-height: 28px;
}
.pd26a0{
padding: 26px 26px 16px 26px;
}
.newFormbox .attachment .icon-fujian{
font-size: 14px !important;
line-height: 14px;
margin-top: 9px;
}
.newFormbox{
height:20px
}
.ml24{
margin-left:24px;
}
.defalutCancelbtns{
display: block;
border: 1px solid #4CACFF !important;
background-color: #fff;
color: #4CACFF !important;
width:130px;
height:40px;
text-align: center;
line-height: 40px;
border-radius: 4px;
}
.defalutSubmitbtns{
background-color: #4CACFF;
height:40px;
}
.defalutSubmitbtnmodels{
width:127px;
height:30px;
background-color: #4CACFF;
}
.ant-steps-item-process .ant-steps-item-icon{
background-color: #4CACFF !important;
}
.ant-steps-item-process .ant-steps-item-icon{
background-color: #4CACFF !important;
}
.padding200{
padding: 115px 200px 215px 200px;
}
.fontcircle{
font-size: 80px;
display: inherit;
}
.sumbtongs{
font-size: 24px;
display: inherit;
text-align: center;
}
.terraces{
font-size: 16px;
display: inherit;
text-align: center;
color:#999;
}
.padding251{
padding: 0px 245px;
}
.ant-modal-title{
text-align: center;
}
.ml17{
margin-left: 17px;
}
.project-package-items{
display: -webkit-flex;
display: flex;
flex-direction: row;
margin:0px !important;
padding: 20px;
background: white;
margin-bottom:0px !important;
box-shadow: none !important;
}
.mtf7{
margin-top:-7px;
}
.publicpart.orangeGreen {
border-left: 80px solid #29BD8B;
}
.publicwords{
left: 3px;
top: 18px;
}
.project-packages-list .project-package-items .item-image{
width:100px !important;
}
.height185{
height: 185px;
}
.ContacttheTA{
width: 80px;
height: 26px;
font-size: 14px;
line-height: 26px;
display: block;
border: 1px solid #4CACFF !important;
background-color: #fff;
color: #4CACFF !important;
text-align: center;
border-radius: 4px;
}
.ContacttheTAs{
width: 80px;
height: 26px;
font-size: 14px;
line-height: 24px;
/*display: block;*/
border: 1px solid #fff !important;
background-color: #4CACFF;
color: #fff !important;
text-align: center;
border-radius: 4px;
}
.ml28{
margin-left: 28px;
}
.longboxs{
font-size: 16px;
font-family: MicrosoftYaHei-Bold;
font-weight: bold;
color: rgba(5,16,26,1);
border-left: 4px solid rgba(76,172,255,1);
padding-left: 10px;
margin-bottom: 20px;
}
.padding020{
padding: 0px 20px 20px;
}
.mtf3{
margin-top:-3px;
}
.task-btn-nebules{
background: #fff!important;
color: #4CACFF!important;
border: 1px solid #4CACFF!important;
margin-left: 20px;
cursor: pointer;
display: inline-block;
padding: 0 12px;
letter-spacing: 1px;
text-align: center;
font-size: 14px;
height: 30px;
line-height: 30px;
border-radius: 2px;
}
.packageabsolute{
position: absolute;
right: -16px;
top: -7px;
}
.relativef{
position: relative;
}
.homehove:hover .ptext{
color: #4CACFF!important;
}
.homehove:hover .ContacttheTAs{
display: block;
}
.topsj{
position: absolute;
top: -6px;
}
.bottomsj{
position: absolute;
bottom: -6px;
}
.touchSelect .ant-spin-dot-spin{
margin-top: 30% !important;
}
.pagenoedits{
margin-left: 20px;
color: #ccc;
}
.pagemancenter{
text-align: center;
}
.ml0{
margin-left: 0px;
}
.tabelcli{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 850px;
display: table-cell;
}
.mtf10{
margin-top:-10px;
}
.padding26{
padding: 26px;
box-sizing: border-box;
}
.pd26{
padding: 26px;
}
.pd30a0{
padding: 30px 30px 16px 30px;
}
.shaiContent li.shaiItem:hover span{
color: #fff !important;
}
.shaiContent li.shaiItem:hover i.iconfont{
color: #4CACFF!important
}
.detail_for_paragraph p{
white-space: pre-wrap;
}

@ -1,53 +1,57 @@
.App {
text-align: center;
}
.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 80px;
}
.App-header {
background-color: #222;
height: 150px;
padding: 20px;
color: white;
}
.App-title {
font-size: 1.5em;
}
.App-intro {
font-size: large;
}
@keyframes App-logo-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
/* md
codermirror maybeUpdateLineNumberWidth
*/
.editormd .CodeMirror-linenumbers {
padding: 0;
}
.editormd-html-preview hr, .editormd-preview-container hr {
/* 颜色加深 */
border-top: 1px solid #ccc;
}
/* 重置掉antd的一些样式 */
html, body {
-webkit-font-smoothing: auto !important;
}
.ant-progress-textyes {
color: #52c41a;
}
.ant-progress-textno{
color: #f5222d;
.App {
text-align: center;
}
.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 80px;
}
.App-header {
background-color: #222;
height: 150px;
padding: 20px;
color: white;
}
.App-title {
font-size: 1.5em;
}
.App-intro {
font-size: large;
}
@keyframes App-logo-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
/* md
codermirror maybeUpdateLineNumberWidth
*/
.editormd .CodeMirror-linenumbers {
padding: 0;
}
.editormd-html-preview hr, .editormd-preview-container hr {
/* 颜色加深 */
border-top: 1px solid #ccc;
}
/* 重置掉antd的一些样式 */
html, body {
-webkit-font-smoothing: auto !important;
}
.ant-progress-textyes {
color: #52c41a;
}
.ant-progress-textno{
color: #f5222d;
}
/* md多空格 */
.markdown-body p {
white-space: pre-wrap;
}

@ -18,9 +18,7 @@ import Notcompletedysl from './modules/user/Notcompletedysl';
import Trialapplicationysl from './modules/login/Trialapplicationysl';
import Trialapplicationreview from './modules/user/Trialapplicationreview';
import Addcourses from "./modules/courses/coursesPublic/Addcourses";
import AccountProfile from"./modules/user/AccountProfile";
import AccountProfile from "./modules/user/AccountProfile";
import Trialapplication from './modules/login/Trialapplication'
import NotFoundPage from './NotFoundPage'
@ -232,6 +230,10 @@ const ProjectPackages=Loadable({
loading: Loading,
})
const Messagerouting= Loadable({
loader: () => import('./modules/message/js/Messagerouting'),
loading: Loading,
})
class App extends Component {
constructor(props) {
super(props)
@ -293,7 +295,7 @@ class App extends Component {
<Switch>
{/*众包创新*/}
<Route path={"/crowdsourcings"} component={ProjectPackages}/>
<Route path={"/crowdsourcing"} component={ProjectPackages}/>
{/*认证*/}
<Route path="/account" component={AccountPage}/>
@ -351,17 +353,21 @@ class App extends Component {
{/* <Route path="/forums" component={ForumsIndexComponent}>
</Route> */}
<Route path="/comment" component={CommentComponent}/>
<Route path="/testMaterial" component={TestMaterialDesignComponent}/>
<Route path="/test" component={TestIndex}/>
<Route path="/testCodeMirror" component={TestCodeMirrorComponent}/>
<Route path="/testRCComponent" component={TestComponent}/>
<Route path="/testUrlQuery" component={TestUrlQueryComponent}/>
<Route path="/message"
render={
(props)=>(<Messagerouting {...this.props} {...props} {...this.state}></Messagerouting>)
}
></Route>
<Route exact path="/" component={ShixunsHome}/>
<Route component={Shixunnopage}/>
</Switch>
</Router>

@ -43,7 +43,6 @@ export function initAxiosInterceptors(props) {
// proxy = "https://testeduplus2.educoder.net"
proxy="http://47.96.87.25:48080"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制
const requestMap = {};

@ -9,7 +9,7 @@ export function markdownToHTML(oldContent, selector) {
window.$('#md_div').html('')
// markdown to html
if (selector && oldContent && oldContent.startsWith('<p')) { // 普通html处理
window.$(selector).html(oldContent)
window.$('#' + selector).html(oldContent)
} else {
try {
// selector ||

@ -1,5 +1,6 @@
import React,{ Component } from "react";
import { getUrl2 } from "educoder";
import ReactPlayer from 'react-player'
const $ = window.$
let _url_origin = getUrl2()
@ -10,33 +11,54 @@ class Clappr extends Component{
this.state={
}
}
componentWillUnmount() {
this['player'+this.props.id] && this['player'+this.props.id].destroy()
}
componentDidMount() {
return;
const source = this.props.source || "http://your.video/here.mp4"
const { id } = this.props
const { id, type } = this.props
const _id = `#_player${id}`
if (window['Clappr']) {
const player = new window.Clappr.Player({
if (!window['Clappr'] && window['ClapprLoading'] == true) {
setTimeout(() => {
this.componentDidMount()
}, 300)
return;
}
// && window['clappr-playback-rate-plugin']
if (window['Clappr'] ) {
// https://github.com/clappr/clappr/issues/1839
// http://clappr.github.io/classes/Player.html#method_mute
this['player'+id] = new window.Clappr.Player({
source: source, parentId: _id,
plugins: {
'core': [window.Clappr.MediaControl, window.Clappr.Playback]
}
height: type == 'mp3' ? 60 : 360,
hideMediaControl: type == 'mp3' ? false : true,
// plugins: {
// 'core': [window.Clappr.MediaControl, window['clappr-playback-rate-plugin'].default]
// }
});
} else {
window['ClapprLoading'] = true;
$.getScript(
`${_url_origin}/javascripts/media/clappr.min.js`,
(data, textStatus, jqxhr) => {
window.clappr = window.Clappr
$.getScript(
`${_url_origin}/javascripts/media/clappr-playback-rate-plugin.min.js`,
(data, textStatus, jqxhr) => {
const player = new window.Clappr.Player({
// $.getScript(
// `${_url_origin}/javascripts/media/clappr-playback-rate-plugin.min.js`,
// (data, textStatus, jqxhr) => {
this['player'+id] = new window.Clappr.Player({
source: source, parentId: _id,
plugins: {
'core': [window.Clappr.MediaControl, window['clappr-playback-rate-plugin'].default]
}
height: type == 'mp3' ? 60 : 360,
hideMediaControl: type == 'mp3' ? false : true,
// plugins: {
// 'core': [window.Clappr.MediaControl, window['clappr-playback-rate-plugin'].default]
// }
});
})
// })
});
@ -62,16 +84,18 @@ class Clappr extends Component{
render(){
let { source, id, className } = this.props;
let { source, id, className, type } = this.props;
const _id = `_player${id}`
return(
<React.Fragment>
<style>{`
{/* https://github.com/CookPete/react-player/issues/686 */}
<ReactPlayer url={source} playing={false} controls={true} width={400} height={ type == 'mp3' ? 55 : 290}/>
{/* <style>{`
.playback_rate {
margin-right: 16px;
}
`}</style>
<div id={_id} className={className}></div>
<div id={_id} className={className + ' ' + type}></div> */}
</React.Fragment>
)
}

@ -18,7 +18,7 @@ class EffectDisplayContent extends Component {
.effectDisplay .content>div {
flex: 1
}
.effectDisplay .clappr {
.effectDisplay .clappr, .effectDisplay .contentWrap {
display: flex;
justify-content: center;
}
@ -32,13 +32,13 @@ class EffectDisplayContent extends Component {
{content3 && <p className="content_title edu-txt-center fl font-18 mr03precent">预期输出{typeName}</p>}
</div>
<div className="clearfix df content" >
{content1 && <div className="fl mr03precent pt10 mb50">
{content1 && <div className="fl mr03precent pt10 mb50 contentWrap">
{content1}
</div>}
{content2 && <div className="fl mr03precent pt10 mb50">
{content2 && <div className="fl mr03precent pt10 mb50 contentWrap">
{content2}
</div>}
{content3 && <div className="fl mr03precent pt10 mb50">
{content3 && <div className="fl mr03precent pt10 mb50 contentWrap">
{content3}
</div>}
</div>

@ -1,4 +1,6 @@
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Redirect } from 'react-router';
import PropTypes from 'prop-types';
@ -29,7 +31,11 @@ class EvaluateSuccessEffectDisplay extends Component {
}
}
hidepicture = () => {
window.$('#picture_display').hide();
const dom = document.getElementById('picture_display');
ReactDOM.unmountComponentAtNode(dom)
// window.$('#picture_display').hide();
window.$('.data-tip-right').hide()
}
renderContent = () => {
// qrcode
@ -107,11 +113,11 @@ class EvaluateSuccessEffectDisplay extends Component {
<EffectDisplayContent
typeName="音频"
content1={ orignal_file[0] && orignal_file[0].file_url
? <Clappr source={orignal_file[0].file_url} id="1" className="clappr"></Clappr> : null }
? <Clappr source={orignal_file[0].file_url} id="1" className="clappr" type="mp3"></Clappr> : null }
content2={ user_file[0] && user_file[0].file_url
? <Clappr source={user_file[0].file_url} id="2" className="clappr"></Clappr> : null }
? <Clappr source={user_file[0].file_url} id="2" className="clappr" type="mp3"></Clappr> : null }
content3={ answer_file[0] && answer_file[0].file_url
? <Clappr source={answer_file[0].file_url} id="3" className="clappr"></Clappr> : null }
? <Clappr source={answer_file[0].file_url} id="3" className="clappr" type="mp3"></Clappr> : null }
></EffectDisplayContent>
)
} else if (type == 'mp4') {
@ -119,11 +125,11 @@ class EvaluateSuccessEffectDisplay extends Component {
<EffectDisplayContent
typeName="视频"
content1={ orignal_file[0] && orignal_file[0].file_url
? <Clappr source={orignal_file[0].file_url} id="1" className="clappr"></Clappr> : null }
? <Clappr source={orignal_file[0].file_url} id="1" className="clappr" type="mp4"></Clappr> : null }
content2={ user_file[0] && user_file[0].file_url
? <Clappr source={user_file[0].file_url} id="2" className="clappr"></Clappr> : null }
? <Clappr source={user_file[0].file_url} id="2" className="clappr" type="mp4"></Clappr> : null }
content3={ answer_file[0] && answer_file[0].file_url
? <Clappr source={answer_file[0].file_url} id="3" className="clappr"></Clappr> : null }
? <Clappr source={answer_file[0].file_url} id="3" className="clappr" type="mp4"></Clappr> : null }
></EffectDisplayContent>
)
}

@ -75,14 +75,15 @@ class CommonWorkDetailIndex extends Component{
})
}
goback = () => {
let workId=this.props.match.params.workId;
if ( window.location.pathname.indexOf('appraise') == -1) {
let category_id= this.state.category.category_id;
this.props.toListPage(this.props.match.params, category_id)
} else {
this.props.toWorkListPage(this.props.match.params, workId)
}
// let workId=this.props.match.params.workId;
//
// if ( window.location.pathname.indexOf('appraise') == -1) {
// let category_id= this.state.category.category_id;
// this.props.toListPage(this.props.match.params, category_id)
// } else {
// this.props.toWorkListPage(this.props.match.params, workId)
// }
this.props.history.goBack()
}
// 补交附件

@ -262,8 +262,9 @@ class CommonWorkPost extends Component{
}
goback=()=>{
this.props.toListPage(this.props.match.params, this.state.category ? this.state.category.category_id : '')
}
// this.props.toListPage(this.props.match.params, this.state.category ? this.state.category.category_id : '')
this.props.history.goBack()
}
// 输入title
@ -469,7 +470,7 @@ class CommonWorkPost extends Component{
}
gocannel=()=>{
window.history.go(-1)
this.props.history.goBack()
}
render(){

@ -31,14 +31,15 @@ class WorkDetailPageHeader extends Component{
}
goback = () => {
let workId=this.props.match.params.workId;
if ( window.location.pathname.indexOf('appraise') == -1) {
let category_id= this.props.category.category_id;
this.props.toListPage(this.props.match.params, category_id)
} else {
this.props.toWorkListPage(this.props.match.params, this.props.match.params.category_id)
}
// let workId=this.props.match.params.workId;
//
// if ( window.location.pathname.indexOf('appraise') == -1) {
// let category_id= this.props.category.category_id;
// this.props.toListPage(this.props.match.params, category_id)
// } else {
// this.props.toWorkListPage(this.props.match.params, this.props.match.params.category_id)
// }
this.props.history.goBack()
}
// 补交附件
Cancelvisible=()=>{

@ -1,247 +1,247 @@
import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,DatePicker} from "antd";
import locale from 'antd/lib/date-picker/locale/zh_CN';
import "../css/Courses.css";
import CoursesListType from '../coursesPublic/CoursesListType';
const { Option } = Select;
const CheckboxGroup = Checkbox.Group;
class Ecercisemount extends Component{
constructor(props){
super(props)
this.state={
}
}
componentDidMount(){
}
handleSubmit = (e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
console.log('Received values of form: ', values);
}
});
}
handleSelectChange = (value) => {
console.log(value);
this.props.form.setFieldsValue({
note: `Hi, ${value === 'male' ? 'man' : 'lady'}!`,
});
}
render(){
const { getFieldDecorator } = this.props.form;
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
return(
<React.Fragment>
<div>
<div className="newMain clearfix">
<div className={"educontent mb20"}>
<div style={{ width:'100%',height:'70px'}} >
<p className="ml15 fl color-black mt30 summaryname">Java语言之控制语句</p>
<CoursesListType
typelist={["已开启补交"]}
typesylename={"mt28"}
/>
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml20 mt18 mr20">返回</a>
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml30 mt18 " target={"_blank"}>实训详情</a>
</div>
<div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20">
<a className="active">答题列表</a>
<a>统计结果</a>
<a>问卷预览</a>
<a>配置</a>
<a className={"fr color-blue font-16"}>导出成绩</a>
<a className={"fr color-blue font-16"}>导出空白试卷</a>
</div>
</div>
<Form onSubmit={this.handleSubmit} className={"edu-back-white newcourses exercise"}>
{/*内容*/}
<div className="stud-class-set bor-bottom-greyE pd20 exerciselist">
<Form.Item label="发布设置" hasFeedback>
{getFieldDecorator("TestingProfile")(
<Checkbox id="TestingProfile" value={""} className="fl ml40">统一设置</Checkbox>
)}
<span className={"coursesselect"}>选中则所有分班使用相同的发布设置否则各个分班单独设置</span>
<div className={"clearfix"}>
<span className="color-grey-6 mt5 fl ml40" style={{minWidth: '70px'}}>发布时间</span>
<span className="fl mt5">
{getFieldDecorator("startTime")(
<DatePicker
showTime
showToday={false}
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
id={"startTime"}
width={"210px"}
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
)}
<span className={"exerciseselect"}>发布之前学生不会收到问卷</span>
</span>
</div>
<div className={"clearfix"}>
<span className="color-grey-6 mt5 fl ml40" style={{minWidth: '70px'}}>截止时间</span>
<span className="fl mt5">
{getFieldDecorator("endTime")(
<DatePicker
showTime
showToday={false}
locale={locale}
format={dateFormat}
placeholder="请选择截止时间"
id={"endTime"}
width={"210px"}
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
)}
<span className={"exerciseselect"}>截止时间点系统将自动提交所有学生的答题学生将不能继续答题</span>
</span>
</div>
</Form.Item>
</div>
<div className="stud-class-set bor-bottom-greyE pd20 exercisetime">
<Form.Item label="答题设置" hasFeedback>
<div className={"clearfix"}>
<span className="color-grey-6 mt5 fl ml40 font-16" style={{minWidth: '70px'}}>答题时长</span>
{getFieldDecorator("TestingProfile"
, {
rules: [{
pattern: /^[1-9]\d*$/,
message: '答题时长必须为正整数',
}],
})(
<Input id="TestingProfile" className={"greyInput mt10 mr10"} style={{width:'108px',marginLeft:'0px'}} />
)}
<span className={"mr10"}>分钟</span>
<span className={"coursesselect"}>选中则所有分班使用相同的发布设置否则各个分班单独设置</span>
</div>
</Form.Item>
<Form.Item hasFeedback>
<div className={"clearfix pd60"}>
{getFieldDecorator("subject", {
valuePropName: 'checked',
})(
<Checkbox id="subject" className="fl">题目顺序随机打乱</Checkbox>
)}
<span className={"coursesselect"}>选中则学生答题时题目顺序按照题型随机显示</span>
</div>
<div className={"clearfix pd60"}>
{getFieldDecorator("options", {
valuePropName: 'checked',
})(
<Checkbox id="options" className="fl">选项顺序随机打乱</Checkbox>
)}
<span className={"coursesselect"}>选中则学生答题时选项顺序随机显示</span>
</div>
</Form.Item>
</div>
<div className="stud-class-set pd20 coursenavbox">
<Form.Item
label="公开设置"
hasFeedback
>
<div className={"clearfix pd28"}>
{getFieldDecorator("opergrdee", {
valuePropName: 'checked',
})(
<Checkbox id="opergrdee" className="fl">公开成绩</Checkbox>
)}
<span className={"coursesselect"}>选中则在截止时间之后对提交答题的课堂成员公开所有成绩否则不公开</span>
</div>
<div className={"clearfix pd28"}>
{getFieldDecorator("openanswer", {
valuePropName: 'checked',
})(
<Checkbox id="openanswer" className="fl">公开答案</Checkbox>
)}
<span className={"coursesselect"}>选中则在截止时间之后对提交答题的课堂成员公开试卷题目的答案否则不公开</span>
</div>
<div className={"clearfix pd28"}>
{getFieldDecorator("openstatisticss", {
valuePropName: 'checked',
})(
<Checkbox id="openstatisticss" className="fl">公开统计</Checkbox>
)}
<span className={"coursesselect"}>选中则在截止时间之后对提交答题的课堂成员公开答题统计否则不公开</span>
</div>
</Form.Item>
</div>
<Form.Item wrapperCol={{ span: 12, offset: 5 }} >
<div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">
提交
</Button>
{/*<a className="defalutSubmitbtn fl mr20">提交</a>*/}
<a className="defalutCancelbtn fl">取消</a>
</div>
</Form.Item>
</Form>
</div>
</div>
</div>
</React.Fragment>
)
}
}
const EcercisemountApp = Form.create({ name: 'coursesNew' })(Ecercisemount);
import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,DatePicker} from "antd";
import locale from 'antd/lib/date-picker/locale/zh_CN';
import "../css/Courses.css";
import CoursesListType from '../coursesPublic/CoursesListType';
const { Option } = Select;
const CheckboxGroup = Checkbox.Group;
class Ecercisemount extends Component{
constructor(props){
super(props)
this.state={
}
}
componentDidMount(){
}
handleSubmit = (e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
console.log('Received values of form: ', values);
}
});
}
handleSelectChange = (value) => {
console.log(value);
this.props.form.setFieldsValue({
note: `Hi, ${value === 'male' ? 'man' : 'lady'}!`,
});
}
render(){
const { getFieldDecorator } = this.props.form;
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
return(
<React.Fragment>
<div>
<div className="newMain clearfix">
<div className={"educontent mb20"}>
<div style={{ width:'100%',height:'70px'}} >
<p className="ml15 fl color-black mt30 summaryname">Java语言之控制语句</p>
<CoursesListType
typelist={["已开启补交"]}
typesylename={"mt28"}
/>
<a onClick={()=>this.props.history.goBack()} className="color-grey-6 fr font-16 ml20 mt18 mr20">返回</a>
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml30 mt18 " target={"_blank"}>实训详情</a>
</div>
<div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20">
<a className="active">答题列表</a>
<a>统计结果</a>
<a>问卷预览</a>
<a>配置</a>
<a className={"fr color-blue font-16"}>导出成绩</a>
<a className={"fr color-blue font-16"}>导出空白试卷</a>
</div>
</div>
<Form onSubmit={this.handleSubmit} className={"edu-back-white newcourses exercise"}>
{/*内容*/}
<div className="stud-class-set bor-bottom-greyE pd20 exerciselist">
<Form.Item label="发布设置" hasFeedback>
{getFieldDecorator("TestingProfile")(
<Checkbox id="TestingProfile" value={""} className="fl ml40">统一设置</Checkbox>
)}
<span className={"coursesselect"}>选中则所有分班使用相同的发布设置否则各个分班单独设置</span>
<div className={"clearfix"}>
<span className="color-grey-6 mt5 fl ml40" style={{minWidth: '70px'}}>发布时间</span>
<span className="fl mt5">
{getFieldDecorator("startTime")(
<DatePicker
showTime
showToday={false}
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
id={"startTime"}
width={"210px"}
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
)}
<span className={"exerciseselect"}>发布之前学生不会收到问卷</span>
</span>
</div>
<div className={"clearfix"}>
<span className="color-grey-6 mt5 fl ml40" style={{minWidth: '70px'}}>截止时间</span>
<span className="fl mt5">
{getFieldDecorator("endTime")(
<DatePicker
showTime
showToday={false}
locale={locale}
format={dateFormat}
placeholder="请选择截止时间"
id={"endTime"}
width={"210px"}
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
)}
<span className={"exerciseselect"}>截止时间点系统将自动提交所有学生的答题学生将不能继续答题</span>
</span>
</div>
</Form.Item>
</div>
<div className="stud-class-set bor-bottom-greyE pd20 exercisetime">
<Form.Item label="答题设置" hasFeedback>
<div className={"clearfix"}>
<span className="color-grey-6 mt5 fl ml40 font-16" style={{minWidth: '70px'}}>答题时长</span>
{getFieldDecorator("TestingProfile"
, {
rules: [{
pattern: /^[1-9]\d*$/,
message: '答题时长必须为正整数',
}],
})(
<Input id="TestingProfile" className={"greyInput mt10 mr10"} style={{width:'108px',marginLeft:'0px'}} />
)}
<span className={"mr10"}>分钟</span>
<span className={"coursesselect"}>选中则所有分班使用相同的发布设置否则各个分班单独设置</span>
</div>
</Form.Item>
<Form.Item hasFeedback>
<div className={"clearfix pd60"}>
{getFieldDecorator("subject", {
valuePropName: 'checked',
})(
<Checkbox id="subject" className="fl">题目顺序随机打乱</Checkbox>
)}
<span className={"coursesselect"}>选中则学生答题时题目顺序按照题型随机显示</span>
</div>
<div className={"clearfix pd60"}>
{getFieldDecorator("options", {
valuePropName: 'checked',
})(
<Checkbox id="options" className="fl">选项顺序随机打乱</Checkbox>
)}
<span className={"coursesselect"}>选中则学生答题时选项顺序随机显示</span>
</div>
</Form.Item>
</div>
<div className="stud-class-set pd20 coursenavbox">
<Form.Item
label="公开设置"
hasFeedback
>
<div className={"clearfix pd28"}>
{getFieldDecorator("opergrdee", {
valuePropName: 'checked',
})(
<Checkbox id="opergrdee" className="fl">公开成绩</Checkbox>
)}
<span className={"coursesselect"}>选中则在截止时间之后对提交答题的课堂成员公开所有成绩否则不公开</span>
</div>
<div className={"clearfix pd28"}>
{getFieldDecorator("openanswer", {
valuePropName: 'checked',
})(
<Checkbox id="openanswer" className="fl">公开答案</Checkbox>
)}
<span className={"coursesselect"}>选中则在截止时间之后对提交答题的课堂成员公开试卷题目的答案否则不公开</span>
</div>
<div className={"clearfix pd28"}>
{getFieldDecorator("openstatisticss", {
valuePropName: 'checked',
})(
<Checkbox id="openstatisticss" className="fl">公开统计</Checkbox>
)}
<span className={"coursesselect"}>选中则在截止时间之后对提交答题的课堂成员公开答题统计否则不公开</span>
</div>
</Form.Item>
</div>
<Form.Item wrapperCol={{ span: 12, offset: 5 }} >
<div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">
提交
</Button>
{/*<a className="defalutSubmitbtn fl mr20">提交</a>*/}
<a className="defalutCancelbtn fl">取消</a>
</div>
</Form.Item>
</Form>
</div>
</div>
</div>
</React.Fragment>
)
}
}
const EcercisemountApp = Form.create({ name: 'coursesNew' })(Ecercisemount);
export default EcercisemountApp;

@ -249,13 +249,13 @@ class Testpapersettinghomepage extends Component{
// let category_id=this.props.match.params.category_id;
//
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+datalist.graduation_id;
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
// let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
}
render(){
let {tab,visible,Commonheadofthetestpaper}=this.state;

@ -97,13 +97,13 @@ class GraduationTasksSubmitedit extends Component{
goback=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
// let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
}
@ -362,7 +362,7 @@ class GraduationTasksSubmitedit extends Component{
}
gocannel=()=>{
window.history.go(-1)
this.props.history.goBack()
}
handleSubmit=(e) => {

@ -99,14 +99,14 @@ class GraduationTasksSubmitnew extends Component{
}
goback=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
// let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
}
// 输入title
@ -362,7 +362,7 @@ class GraduationTasksSubmitnew extends Component{
}
}
gocannel=()=>{
window.history.go(-1)
this.props.history.goBack()
}
//公用数据

@ -70,13 +70,13 @@ class GraduationTasksappraise extends Component{
// let category_id=this.props.match.params.category_id;
//
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+datalist.graduation_id;
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
// let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
}
Cancelvisible=()=>{

@ -82,13 +82,13 @@ class GraduationTasksedit extends Component{
goback=()=>{
let courseId = this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
// let courseId = this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
}

@ -107,12 +107,13 @@ class GraduationTasksnew extends Component {
goback = () => {
let courseId = this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
// let courseId = this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
}

@ -765,12 +765,13 @@ class GraduationTaskssettingapp extends Component{
}
goback=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
// let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
}
isgoback=()=>{

@ -60,13 +60,13 @@ class GraduationTaskssettinglist extends Component{
goback=()=>{
// window.history.back(-1)
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
// let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
}
seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{

@ -55,12 +55,14 @@ class GraduationTasksquestions extends Component{
// let courseId=this.props.match.params.coursesId;
// let category_id=this.props.match.params.category_id;
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
let courseId = this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
// let courseId = this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
}
end=()=>{

@ -265,7 +265,7 @@ class GraduateTopicPostWorksNew extends Component{
<div style={{ width:'100%',height:'70px'}} >
<p className="ml15 fl color-black mt30 summaryname">提交作品</p>
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a>
<a onClick={()=>this.props.history.goBack()} className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a>
</div>
<Form {...formItemLayout} onSubmit={this.handleSubmit}>

@ -257,12 +257,13 @@ class CoursesNew extends Component {
goback = () => {
if(this.props.match.params.coursesId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
// if(this.props.match.params.coursesId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
// window.history.go(-1)
this.props.history.goBack()
}
onCheckAllChange = (e) => {

@ -2337,11 +2337,11 @@ class PollNew extends Component {
}
gotohome=()=>{
const { current_user} = this.props
this.props.history.push(current_user && current_user.first_category_url);
// const { current_user} = this.props
// this.props.history.push(current_user && current_user.first_category_url);
//
this.props.history.goBack()
// let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");

@ -1,157 +1,157 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { Checkbox,Input,DatePicker } from 'antd';
import locale from 'antd/lib/date-picker/locale/zh_CN';
import "../css/Courses.css";
import CoursesListType from '../coursesPublic/CoursesListType';
//引入对应跳转的组件
class Polldepoly extends Component{
constructor(props) {
super(props)
this.state = {
contents: [{val:"",id:1}],
}
}
componentDidMount() {
}
submitCommitSummary=()=> {
const mdContnet = this.refs[`md${1}`].getValue().trim();;
console.log(mdContnet)
}
asdasdsad=()=>{
this.setState({
contents:""
})
}
render() {
let {contents}=this.state;
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
return (
<React.Fragment>
<div>
<div className="newMain clearfix">
<div className={"educontent mb20"}>
<div style={{
width:'100%',
height:'70px'
}} >
<p className="ml15 fl color-black mt30 summaryname" onClick={this.asdasdsad}>Java语言之控制语句</p>
<CoursesListType
typelist={["已开启补交"]}
typesylename={"mt28"}
/>
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a>
</div>
{/*<div className={"edu-con-bg01 user_bg_shadow bor-grey-e educontentbox"}>*/}
{/*<span className={"commitcontents"}>*/}
{/*<span className={"color-red"}>*</span>*/}
{/*内容</span>*/}
{/*<div className={"ml30 mr30 mt10"}>*/}
{/*</div>*/}
{/*</div>*/}
<div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20">
<a className="active">答题列表</a>
<a>统计结果</a>
<a>问卷预览</a>
<a>配置</a>
<a className={"fr color-blue font-16"}>导出统计</a>
</div>
</div>
<div className="stud-class-set edu-back-white pt30 pb30 pr10 pl20">
<div className="clearfix">
<p className="ml22 fl font-16 mt5 color-grey-6">发布设置</p>
{/*<a href="javascript:void(0);" className="white-btn orange-btn fr mr15 mt15" title="编辑"*/}
{/*onClick="show_poll_edit_setting();">编辑</a>*/}
</div>
<div className="clearfix pl60 pt20">
<Checkbox className={"color-grey-6"}>统一设置 </Checkbox> <span className={"color-grey-9"}>(使)</span>
</div>
<div className="clearfix pl60 pt20">
{/*<span className={"color-grey-6"}>发布时间:</span> <Input size="large" placeholder="请选择发布时间" /><span className={"color-grey-9"}>(发布之前,学生不会收到问卷)</span>*/}
<span className="color-grey-6 mt5 fl" style={{minWidth: '70px'}}>发布时间</span>
<span className="fl mt5">
<DatePicker
showTime
showToday={false}
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
<label style={{top:'6px'}} className="color-grey-9 ml10" >发布之前学生不会收到问卷</label>
</span>
</div>
<div className="clearfix pl60 pt20">
{/*<span className={"color-grey-6"}>发布时间:</span> <Input size="large" placeholder="请选择发布时间" /><span className={"color-grey-9"}>(发布之前,学生不会收到问卷)</span>*/}
<span className="color-grey-6 mt5 fl" style={{minWidth: '70px'}}>截止时间</span>
<span className="fl mt5">
<DatePicker
showToday={false}
showTime
locale={locale}
format={dateFormat}
placeholder="请选择截止时间"
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
<label style={{top:'6px'}} className="color-grey-9 ml10" >截止时间点系统将自动提交所有学生的答题学生将不能继续答题</label>
</span>
</div>
<div className="stud-class-set edu-back-white pt30 pb30 pr10 pl20">
<div className="clearfix">
<p className="ml22 fl font-16 mt5 color-grey-6">公开设置</p>
{/*<a href="javascript:void(0);" className="white-btn orange-btn fr mr15 mt15" title="编辑"*/}
{/*onClick="show_poll_edit_setting();">编辑</a>*/}
</div>
<div className="clearfix pl40 pt20">
<Checkbox className={"color-grey-6"}>公开统计 </Checkbox> <span className={"color-grey-9"}></span>
</div>
<div className="clearfix pl40 pt10">
<Checkbox className={"color-grey-6"}>实名问卷 </Checkbox> <span className={"color-grey-9"}></span>
</div>
</div>
</div>
<div className="clearfix mt30 mb30">
<a className="defalutSubmitbtn fl mr20"
onClick={this.submitCommitSummary}>提交</a>
<a className="defalutCancelbtn fl">取消</a>
</div>
</div>
</div>
</div>
</React.Fragment>
)
}
}
export default SnackbarHOC() ( TPMIndexHOC(Polldepoly) );
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { Checkbox,Input,DatePicker } from 'antd';
import locale from 'antd/lib/date-picker/locale/zh_CN';
import "../css/Courses.css";
import CoursesListType from '../coursesPublic/CoursesListType';
//引入对应跳转的组件
class Polldepoly extends Component{
constructor(props) {
super(props)
this.state = {
contents: [{val:"",id:1}],
}
}
componentDidMount() {
}
submitCommitSummary=()=> {
const mdContnet = this.refs[`md${1}`].getValue().trim();;
console.log(mdContnet)
}
asdasdsad=()=>{
this.setState({
contents:""
})
}
render() {
let {contents}=this.state;
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
return (
<React.Fragment>
<div>
<div className="newMain clearfix">
<div className={"educontent mb20"}>
<div style={{
width:'100%',
height:'70px'
}} >
<p className="ml15 fl color-black mt30 summaryname" onClick={this.asdasdsad}>Java语言之控制语句</p>
<CoursesListType
typelist={["已开启补交"]}
typesylename={"mt28"}
/>
<a onClick={()=>this.props.history.goBack()} className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a>
</div>
{/*<div className={"edu-con-bg01 user_bg_shadow bor-grey-e educontentbox"}>*/}
{/*<span className={"commitcontents"}>*/}
{/*<span className={"color-red"}>*</span>*/}
{/*内容</span>*/}
{/*<div className={"ml30 mr30 mt10"}>*/}
{/*</div>*/}
{/*</div>*/}
<div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20">
<a className="active">答题列表</a>
<a>统计结果</a>
<a>问卷预览</a>
<a>配置</a>
<a className={"fr color-blue font-16"}>导出统计</a>
</div>
</div>
<div className="stud-class-set edu-back-white pt30 pb30 pr10 pl20">
<div className="clearfix">
<p className="ml22 fl font-16 mt5 color-grey-6">发布设置</p>
{/*<a href="javascript:void(0);" className="white-btn orange-btn fr mr15 mt15" title="编辑"*/}
{/*onClick="show_poll_edit_setting();">编辑</a>*/}
</div>
<div className="clearfix pl60 pt20">
<Checkbox className={"color-grey-6"}>统一设置 </Checkbox> <span className={"color-grey-9"}>(使)</span>
</div>
<div className="clearfix pl60 pt20">
{/*<span className={"color-grey-6"}>发布时间:</span> <Input size="large" placeholder="请选择发布时间" /><span className={"color-grey-9"}>(发布之前,学生不会收到问卷)</span>*/}
<span className="color-grey-6 mt5 fl" style={{minWidth: '70px'}}>发布时间</span>
<span className="fl mt5">
<DatePicker
showTime
showToday={false}
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
<label style={{top:'6px'}} className="color-grey-9 ml10" >发布之前学生不会收到问卷</label>
</span>
</div>
<div className="clearfix pl60 pt20">
{/*<span className={"color-grey-6"}>发布时间:</span> <Input size="large" placeholder="请选择发布时间" /><span className={"color-grey-9"}>(发布之前,学生不会收到问卷)</span>*/}
<span className="color-grey-6 mt5 fl" style={{minWidth: '70px'}}>截止时间</span>
<span className="fl mt5">
<DatePicker
showToday={false}
showTime
locale={locale}
format={dateFormat}
placeholder="请选择截止时间"
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
<label style={{top:'6px'}} className="color-grey-9 ml10" >截止时间点系统将自动提交所有学生的答题学生将不能继续答题</label>
</span>
</div>
<div className="stud-class-set edu-back-white pt30 pb30 pr10 pl20">
<div className="clearfix">
<p className="ml22 fl font-16 mt5 color-grey-6">公开设置</p>
{/*<a href="javascript:void(0);" className="white-btn orange-btn fr mr15 mt15" title="编辑"*/}
{/*onClick="show_poll_edit_setting();">编辑</a>*/}
</div>
<div className="clearfix pl40 pt20">
<Checkbox className={"color-grey-6"}>公开统计 </Checkbox> <span className={"color-grey-9"}></span>
</div>
<div className="clearfix pl40 pt10">
<Checkbox className={"color-grey-6"}>实名问卷 </Checkbox> <span className={"color-grey-9"}></span>
</div>
</div>
</div>
<div className="clearfix mt30 mb30">
<a className="defalutSubmitbtn fl mr20"
onClick={this.submitCommitSummary}>提交</a>
<a className="defalutCancelbtn fl">取消</a>
</div>
</div>
</div>
</div>
</React.Fragment>
)
}
}
export default SnackbarHOC() ( TPMIndexHOC(Polldepoly) );

@ -71,13 +71,14 @@ class CommitSummary extends Component{
console.log(mdContnet)
}
gotohome=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
// let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
}
asdasdsad=()=>{
this.setState({
contents:""

@ -113,12 +113,13 @@ class ShixunHomeworkPage extends Component {
bindRef = ref => { this.child = ref }
///////////////教师截止
gotohome=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
// let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
}
render() {
let {tab, teacherdatapage, jobsettingsdatapage} = this.state;

@ -52,13 +52,13 @@ class ShixunWorkDetails extends Component {
}
goback=(sum)=>{
let{data}=this.state
if(sum===1){
window.location.href = "/courses/"+data.course_id+"/students";
}else{
window.history.go(-1)
}
// let{data}=this.state
// if(sum===1){
// window.location.href = "/courses/"+data.course_id+"/students";
// }else{
// window.history.go(-1)
// }
this.props.history.goBack()
}
render() {
let{data}=this.state;

@ -246,7 +246,7 @@ class TraineetraininginformationModal extends Component {
{this.props.boolgalist === false?
<div>
{
this.props.game_list === undefined?"" : this.props.game_list.length<4?
this.props.game_list === undefined?"" : this.props.game_list.length<5?
<div className="edu-table edu-back-white ">
<style>
{
@ -296,7 +296,7 @@ class TraineetraininginformationModal extends Component {
<div>
{
this.props.game_list === undefined?"" : this.props.game_list.length<4?
this.props.game_list === undefined?"" : this.props.game_list.length<5?
<div className="edu-table edu-back-white ">
<style>
{

@ -1,246 +1,246 @@
import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,DatePicker} from "antd";
import locale from 'antd/lib/date-picker/locale/zh_CN';
import "../css/Courses.css";
import CoursesListType from '../coursesPublic/CoursesListType';
const { Option } = Select;
const CheckboxGroup = Checkbox.Group;
class StudentHomework extends Component{
constructor(props){
super(props)
this.state={
}
}
componentDidMount(){
}
handleSubmit = (e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
console.log('Received values of form: ', values);
}
});
}
handleSelectChange = (value) => {
console.log(value);
this.props.form.setFieldsValue({
note: `Hi, ${value === 'male' ? 'man' : 'lady'}!`,
});
}
render(){
const { getFieldDecorator } = this.props.form;
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
return(
<React.Fragment>
<div>
<div className="newMain clearfix">
<div className={"educontent mb20"}>
<div style={{ width:'100%',height:'70px'}} >
<p className="ml15 fl color-black mt30 summaryname">Java语言之控制语句</p>
<CoursesListType
typelist={["已开启补交"]}
typesylename={"mt28"}
/>
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml20 mt18 mr20">返回</a>
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml30 mt18 " target={"_blank"}>实训详情</a>
</div>
<div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20">
<a className="active">作业列表</a>
<a>作业问答</a>
<a>配置</a>
<a className={"fr color-blue font-16"}>立即发布</a>
<a className={"fr color-blue font-16"}>导出成绩</a>
</div>
</div>
<Form onSubmit={this.handleSubmit} className={"edu-back-white newcourses exercise"}>
{/*内容*/}
<div className="stud-class-set bor-bottom-greyE pd20 exerciselist">
<Form.Item label="发布设置" hasFeedback>
{getFieldDecorator("TestingProfile")(
<Checkbox id="TestingProfile" value={""} className="fl ml40">统一设置</Checkbox>
)}
<span className={"coursesselect"}>选中则所有分班使用相同的发布设置否则各个分班单独设置</span>
<div className={"clearfix"}>
<span className="color-grey-6 mt5 fl ml40" style={{minWidth: '70px'}}>发布时间</span>
<span className="fl mt5">
{getFieldDecorator("startTime")(
<DatePicker
showToday={false}
showTime
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
id={"startTime"}
width={"210px"}
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
)}
<span className={"exerciseselect"}>发布之前学生不会收到问卷</span>
</span>
</div>
<div className={"clearfix"}>
<span className="color-grey-6 mt5 fl ml40" style={{minWidth: '70px'}}>截止时间</span>
<span className="fl mt5">
{getFieldDecorator("endTime")(
<DatePicker
showToday={false}
showTime
locale={locale}
format={dateFormat}
placeholder="请选择截止时间"
id={"endTime"}
width={"210px"}
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
)}
<span className={"exerciseselect"}>截止时间点系统将自动提交所有学生的答题学生将不能继续答题</span>
</span>
</div>
</Form.Item>
</div>
<div className="stud-class-set bor-bottom-greyE pd20 exercisetime">
<Form.Item label="补交设置" hasFeedback>
<div className={"clearfix"}>
<span className="color-grey-6 mt5 fl ml40 font-16" style={{minWidth: '70px'}}>答题时长</span>
{getFieldDecorator("TestingProfile"
, {
rules: [{
pattern: /^[1-9]\d*$/,
message: '答题时长必须为正整数',
}],
})(
<Input id="TestingProfile" className={"greyInput mt10 mr10"} style={{width:'108px',marginLeft:'0px'}} />
)}
<span className={"mr10"}>分钟</span>
<span className={"coursesselect"}>选中则所有分班使用相同的发布设置否则各个分班单独设置</span>
</div>
</Form.Item>
<Form.Item hasFeedback>
<div className={"clearfix pd60"}>
{getFieldDecorator("subject", {
valuePropName: 'checked',
})(
<Checkbox id="subject" className="fl">题目顺序随机打乱</Checkbox>
)}
<span className={"coursesselect"}>选中则学生答题时题目顺序按照题型随机显示</span>
</div>
<div className={"clearfix pd60"}>
{getFieldDecorator("options", {
valuePropName: 'checked',
})(
<Checkbox id="options" className="fl">选项顺序随机打乱</Checkbox>
)}
<span className={"coursesselect"}>选中则学生答题时选项顺序随机显示</span>
</div>
</Form.Item>
</div>
<div className="stud-class-set pd20 coursenavbox">
<Form.Item
label="公开设置"
hasFeedback
>
<div className={"clearfix pd28"}>
{getFieldDecorator("opergrdee", {
valuePropName: 'checked',
})(
<Checkbox id="opergrdee" className="fl">公开成绩</Checkbox>
)}
<span className={"coursesselect"}>选中则在截止时间之后对提交答题的课堂成员公开所有成绩否则不公开</span>
</div>
<div className={"clearfix pd28"}>
{getFieldDecorator("openanswer", {
valuePropName: 'checked',
})(
<Checkbox id="openanswer" className="fl">公开答案</Checkbox>
)}
<span className={"coursesselect"}>选中则在截止时间之后对提交答题的课堂成员公开试卷题目的答案否则不公开</span>
</div>
<div className={"clearfix pd28"}>
{getFieldDecorator("openstatisticss", {
valuePropName: 'checked',
})(
<Checkbox id="openstatisticss" className="fl">公开统计</Checkbox>
)}
<span className={"coursesselect"}>选中则在截止时间之后对提交答题的课堂成员公开答题统计否则不公开</span>
</div>
</Form.Item>
</div>
<Form.Item wrapperCol={{ span: 12, offset: 5 }} >
<div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">
提交
</Button>
{/*<a className="defalutSubmitbtn fl mr20">提交</a>*/}
<a className="defalutCancelbtn fl">取消</a>
</div>
</Form.Item>
</Form>
</div>
</div>
</div>
</React.Fragment>
)
}
}
const StudentHomeworkApp = Form.create({ name: 'coursesNew' })(StudentHomework);
import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,DatePicker} from "antd";
import locale from 'antd/lib/date-picker/locale/zh_CN';
import "../css/Courses.css";
import CoursesListType from '../coursesPublic/CoursesListType';
const { Option } = Select;
const CheckboxGroup = Checkbox.Group;
class StudentHomework extends Component{
constructor(props){
super(props)
this.state={
}
}
componentDidMount(){
}
handleSubmit = (e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
console.log('Received values of form: ', values);
}
});
}
handleSelectChange = (value) => {
console.log(value);
this.props.form.setFieldsValue({
note: `Hi, ${value === 'male' ? 'man' : 'lady'}!`,
});
}
render(){
const { getFieldDecorator } = this.props.form;
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
return(
<React.Fragment>
<div>
<div className="newMain clearfix">
<div className={"educontent mb20"}>
<div style={{ width:'100%',height:'70px'}} >
<p className="ml15 fl color-black mt30 summaryname">Java语言之控制语句</p>
<CoursesListType
typelist={["已开启补交"]}
typesylename={"mt28"}
/>
<a onClick={()=>this.props.history.goBack()} className="color-grey-6 fr font-16 ml20 mt18 mr20">返回</a>
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml30 mt18 " target={"_blank"}>实训详情</a>
</div>
<div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20">
<a className="active">作业列表</a>
<a>作业问答</a>
<a>配置</a>
<a className={"fr color-blue font-16"}>立即发布</a>
<a className={"fr color-blue font-16"}>导出成绩</a>
</div>
</div>
<Form onSubmit={this.handleSubmit} className={"edu-back-white newcourses exercise"}>
{/*内容*/}
<div className="stud-class-set bor-bottom-greyE pd20 exerciselist">
<Form.Item label="发布设置" hasFeedback>
{getFieldDecorator("TestingProfile")(
<Checkbox id="TestingProfile" value={""} className="fl ml40">统一设置</Checkbox>
)}
<span className={"coursesselect"}>选中则所有分班使用相同的发布设置否则各个分班单独设置</span>
<div className={"clearfix"}>
<span className="color-grey-6 mt5 fl ml40" style={{minWidth: '70px'}}>发布时间</span>
<span className="fl mt5">
{getFieldDecorator("startTime")(
<DatePicker
showToday={false}
showTime
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
id={"startTime"}
width={"210px"}
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
)}
<span className={"exerciseselect"}>发布之前学生不会收到问卷</span>
</span>
</div>
<div className={"clearfix"}>
<span className="color-grey-6 mt5 fl ml40" style={{minWidth: '70px'}}>截止时间</span>
<span className="fl mt5">
{getFieldDecorator("endTime")(
<DatePicker
showToday={false}
showTime
locale={locale}
format={dateFormat}
placeholder="请选择截止时间"
id={"endTime"}
width={"210px"}
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
)}
<span className={"exerciseselect"}>截止时间点系统将自动提交所有学生的答题学生将不能继续答题</span>
</span>
</div>
</Form.Item>
</div>
<div className="stud-class-set bor-bottom-greyE pd20 exercisetime">
<Form.Item label="补交设置" hasFeedback>
<div className={"clearfix"}>
<span className="color-grey-6 mt5 fl ml40 font-16" style={{minWidth: '70px'}}>答题时长</span>
{getFieldDecorator("TestingProfile"
, {
rules: [{
pattern: /^[1-9]\d*$/,
message: '答题时长必须为正整数',
}],
})(
<Input id="TestingProfile" className={"greyInput mt10 mr10"} style={{width:'108px',marginLeft:'0px'}} />
)}
<span className={"mr10"}>分钟</span>
<span className={"coursesselect"}>选中则所有分班使用相同的发布设置否则各个分班单独设置</span>
</div>
</Form.Item>
<Form.Item hasFeedback>
<div className={"clearfix pd60"}>
{getFieldDecorator("subject", {
valuePropName: 'checked',
})(
<Checkbox id="subject" className="fl">题目顺序随机打乱</Checkbox>
)}
<span className={"coursesselect"}>选中则学生答题时题目顺序按照题型随机显示</span>
</div>
<div className={"clearfix pd60"}>
{getFieldDecorator("options", {
valuePropName: 'checked',
})(
<Checkbox id="options" className="fl">选项顺序随机打乱</Checkbox>
)}
<span className={"coursesselect"}>选中则学生答题时选项顺序随机显示</span>
</div>
</Form.Item>
</div>
<div className="stud-class-set pd20 coursenavbox">
<Form.Item
label="公开设置"
hasFeedback
>
<div className={"clearfix pd28"}>
{getFieldDecorator("opergrdee", {
valuePropName: 'checked',
})(
<Checkbox id="opergrdee" className="fl">公开成绩</Checkbox>
)}
<span className={"coursesselect"}>选中则在截止时间之后对提交答题的课堂成员公开所有成绩否则不公开</span>
</div>
<div className={"clearfix pd28"}>
{getFieldDecorator("openanswer", {
valuePropName: 'checked',
})(
<Checkbox id="openanswer" className="fl">公开答案</Checkbox>
)}
<span className={"coursesselect"}>选中则在截止时间之后对提交答题的课堂成员公开试卷题目的答案否则不公开</span>
</div>
<div className={"clearfix pd28"}>
{getFieldDecorator("openstatisticss", {
valuePropName: 'checked',
})(
<Checkbox id="openstatisticss" className="fl">公开统计</Checkbox>
)}
<span className={"coursesselect"}>选中则在截止时间之后对提交答题的课堂成员公开答题统计否则不公开</span>
</div>
</Form.Item>
</div>
<Form.Item wrapperCol={{ span: 12, offset: 5 }} >
<div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">
提交
</Button>
{/*<a className="defalutSubmitbtn fl mr20">提交</a>*/}
<a className="defalutCancelbtn fl">取消</a>
</div>
</Form.Item>
</Form>
</div>
</div>
</div>
</React.Fragment>
)
}
}
const StudentHomeworkApp = Form.create({ name: 'coursesNew' })(StudentHomework);
export default StudentHomeworkApp;

@ -1,173 +1,173 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import { isDev } from 'educoder'
import './MemoDetailEditor.css'
require('codemirror/lib/codemirror.css');
const $ = window.$;
///作业回答 专用
class MemoDetailMDEditortwo extends Component {
constructor(props) {
super(props)
this.state = {
isInited: this.props.usingMockInput ? false : true,
isError: false,
errorMsg: ''
}
}
componentDidUpdate(prevProps, prevState, snapshot) {
if (this.props.memo && (!prevProps.memo || this.props.memo.id != prevProps.memo.id)) {
// this.keEditor = window.sd_create_editor_from_data(this.props.memo.id, null, "100%", "Memo");
// window._kk = this.keEditor
}
}
initMDEditor = () => {
// 因为props.memo不存在时本组件不会被加载这里直接在didMount里初始化即可
const placeholder = '我要回复...'
// const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`;
const imageUrl = `/api/attachments.json`;
// 执行太快了,样式不正常
window.__tt = 400;
setTimeout(() => {
var commentMDEditor = window.create_editorMD_4comment("memo_comment_editorMd", '', this.props.height || 240, placeholder, imageUrl, () => {
commentMDEditor.focus()
this.initDrag()
commentMDEditor.cm.on("change", (_cm, changeObj) => {
this.setState({
isError: false,
errorMsg: ''
})
})
}, {
watch: false,
dialogLockScreen: false,
});
this.commentMDEditor = commentMDEditor;
window.commentMDEditor = commentMDEditor;
}, window.__tt)
}
componentDidMount() {
!this.props.usingMockInput && this.initMDEditor()
}
initDrag = () => {
window.initMDEditorDragResize(".editor__resize", this.commentMDEditor)
}
onCommit = () => {
const content = this.commentMDEditor.getValue();
// this.props.showError ==
if (this.props.showError == true) {
if (!content || content.trim() == "") {
this.setState({
isError: true,
errorMsg: '不能为空'
})
return;
} else if (content.length > 2000) {
this.setState({
isError: true,
errorMsg: '不能超过2000个字符'
})
return;
}
this.setState({
isError: false,
errorMsg: ''
})
}
window.$(document).trigger("onReply", { commentContent: content
, id: this.props.memo.id, editor: this.commentMDEditor } );
}
showEditor() {
$("html, body").animate({ scrollTop: $('#commentInput').offset().top - 100 }, 1000, () => {
if (this.commentMDEditor) {
this.commentMDEditor.cm.focus()
} else {
$('#commentInput input')[0].click()
}
});
}
onMockInputClick = () => {
this.setState({isInited: true})
this.initMDEditor()
}
render() {
const { match, history, memo, placeholder } = this.props
const { isInited, errorMsg } = this.state
if (!memo) {
return <div></div>
}
return (
<React.Fragment>
<style>{`
.mockInputWrapper {
display: flex;
padding: 30px;
}
.mockInputWrapper input {
flex:1;
padding-left: 10px;
height: 40px;
background: rgb(246,246,246);
margin-right: 20px;
}
.mockInputWrapper a.commentsbtn {
height: 40px;
display: inline-block;
margin-top: 0px !important;
vertical-align: text-top;
padding-top: 6px;
width: 60px;
margin-right: 0px !important;
}
#commentInput .editormd{
width:100%!important;
}
`}</style>
<div style={{ display: isInited ? 'none' : ''}} className="mockInputWrapper" id="commentInput">
<input onClick={this.onMockInputClick} placeholder={placeholder || '我要回复'}></input>
<a href="javascript:void(0)"
onClick={this.onMockInputClick} className="commentsbtn task-btn task-btn-blue">
发送
</a>
</div>
<div nhname={`new_message_${memo.id}`} className=""
style={{ padding: '30px',boxSizing:"border-box", display: isInited ? '' : 'none' }} id="commentInput">
<div id="memo_comment_editorMd" className="editorMD" style={{ marginBottom: '0px'
, border: errorMsg ? '1px solid red' : '1px solid #ddd'}}>
<textarea style={{'display': 'none'}}>
</textarea>
</div>
<div className="editor__resize" href="javascript:void(0);">调整高度</div>
{ errorMsg && <input className="fl" style={{color: 'red', marginTop: '6px',
marginLeft: '4px'}}>{errorMsg}</input> }
<a id={`new_message_submit_btn_${memo.id}`} href="javascript:void(0)"
onClick={this.onCommit} className="commentsbtn task-btn-blue task-btn fr ">
发送
</a>
</div>
</React.Fragment>
);
}
}
export default ( MemoDetailMDEditortwo );
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import { isDev } from 'educoder'
import './MemoDetailEditor.css'
require('codemirror/lib/codemirror.css');
const $ = window.$;
///作业回答 专用
class MemoDetailMDEditortwo extends Component {
constructor(props) {
super(props)
this.state = {
isInited: this.props.usingMockInput ? false : true,
isError: false,
errorMsg: ''
}
}
componentDidUpdate(prevProps, prevState, snapshot) {
if (this.props.memo && (!prevProps.memo || this.props.memo.id != prevProps.memo.id)) {
// this.keEditor = window.sd_create_editor_from_data(this.props.memo.id, null, "100%", "Memo");
// window._kk = this.keEditor
}
}
initMDEditor = () => {
// 因为props.memo不存在时本组件不会被加载这里直接在didMount里初始化即可
const placeholder = '我要回复...'
// const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`;
const imageUrl = `/api/attachments.json`;
// 执行太快了,样式不正常
window.__tt = 400;
setTimeout(() => {
var commentMDEditor = window.create_editorMD_4comment("memo_comment_editorMd", '', this.props.height || 240, placeholder, imageUrl, () => {
commentMDEditor.focus();
this.initDrag();
commentMDEditor.cm.on("change", (_cm, changeObj) => {
this.setState({
isError: false,
errorMsg: ''
})
})
}, {
watch: false,
dialogLockScreen: false,
});
this.commentMDEditor = commentMDEditor;
window.commentMDEditor = commentMDEditor;
}, window.__tt)
};
componentDidMount() {
!this.props.usingMockInput && this.initMDEditor()
}
initDrag = () => {
window.initMDEditorDragResize(".editor__resize", this.commentMDEditor)
}
onCommit = () => {
const content = this.commentMDEditor.getValue();
// this.props.showError ==
if (this.props.showError == true) {
if (!content || content.trim() == "") {
this.setState({
isError: true,
errorMsg: '不能为空'
})
return;
} else if (content.length > 2000) {
this.setState({
isError: true,
errorMsg: '不能超过2000个字符'
})
return;
}
this.setState({
isError: false,
errorMsg: ''
})
}
window.$(document).trigger("onReply", { commentContent: content
, id: this.props.memo.id, editor: this.commentMDEditor } );
}
showEditor() {
$("html, body").animate({ scrollTop: $('#commentInput').offset().top - 100 }, 1000, () => {
if (this.commentMDEditor) {
this.commentMDEditor.cm.focus()
} else {
$('#commentInput input')[0].click()
}
});
}
onMockInputClick = () => {
this.setState({isInited: true})
this.initMDEditor()
}
render() {
const { match, history, memo, placeholder } = this.props
const { isInited, errorMsg } = this.state
if (!memo) {
return <div></div>
}
return (
<React.Fragment>
<style>{`
.mockInputWrapper {
display: flex;
padding: 30px;
}
.mockInputWrapper input {
flex:1;
padding-left: 10px;
height: 40px;
background: rgb(246,246,246);
margin-right: 20px;
}
.mockInputWrapper a.commentsbtn {
height: 40px;
display: inline-block;
margin-top: 0px !important;
vertical-align: text-top;
padding-top: 6px;
width: 60px;
margin-right: 0px !important;
}
#commentInput .editormd{
width:100%!important;
}
`}</style>
<div style={{ display: isInited ? 'none' : ''}} className="mockInputWrapper" id="commentInput">
<input onClick={this.onMockInputClick} placeholder={placeholder || '我要回复'}></input>
<a href="javascript:void(0)"
onClick={this.onMockInputClick} className="commentsbtn task-btn task-btn-blue">
发送
</a>
</div>
<div nhname={`new_message_${memo.id}`} className=""
style={{ padding: '30px',boxSizing:"border-box", display: isInited ? '' : 'none' }} id="commentInput">
<div id="memo_comment_editorMd" className="editorMD" style={{ marginBottom: '0px'
, border: errorMsg ? '1px solid red' : '1px solid #ddd'}}>
<textarea style={{'display': 'none'}}>
</textarea>
</div>
<div className="editor__resize" href="javascript:void(0);">调整高度</div>
{ errorMsg && <input className="fl" style={{color: 'red', marginTop: '6px',
marginLeft: '4px'}}>{errorMsg}</input> }
<a id={`new_message_submit_btn_${memo.id}`} href="javascript:void(0)"
onClick={this.onCommit} className="commentsbtn task-btn-blue task-btn fr ">
发送
</a>
</div>
</React.Fragment>
);
}
}
export default ( MemoDetailMDEditortwo );

@ -1,62 +1,62 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import axios from 'axios'
class UserSection extends Component {
constructor(props) {
super(props)
this.state = {
}
}
/*点击关注或者取消关注*/
AboutFocus(){
const { author_info } = this.props
/*http://localhost:3000/api/v1/users/155/watch?object_id=156&object_type=user*/
const focusUrl = `/api/v1/users/${author_info.user_id}/${this.props.author_info.watched ? 'unwatch' : 'watch'}?object_id=${author_info.user_id}&object_type=user`
axios.get(focusUrl,{
})
.then((response) => {
const status = response.data.status;
console.log(status);
if(status == 1){
const new_author_info = Object.assign({}, this.props.author_info)
new_author_info.watched = !new_author_info.watched
this.props.initForumState({author_info: new_author_info})
}
}).catch((error) => {
console.log(error)
})
}
render() {
const { match, history, author_info , current_user } = this.props
if (!author_info) {
return <div className="edu-back-white" id="forum_index_list"></div>
}
return (
<div className="edu-back-white padding40-20 edu-txt-center">
<a href={`/users/${author_info.login}`} target="_blank"><img src={`/images/${author_info.image_url}`} width="90" height="90" className="radius mb5"/></a>
<p className="font-20 userPrivateName">{author_info.username}</p>
<p className="color-grey-9 userPrivatePost">{author_info.identity}</p>
{ author_info.user_id !== current_user.user_id &&
<p className="clearfix mt30">
<a href="javascript:void(0)" className="fl font-16 mr10 user_default_btn edu-blueback-btn" onClick={()=>{this.AboutFocus()}}>{ author_info.watched == true ? "取消关注" : "关注" }</a>
<a href={`/users/${current_user.login}/message_detail?user_id=${author_info.user_id}`} className="fr font-16 user_default_btn user_private_btn" target="_blank">私信</a>
</p> }
</div>
);
}
}
export default UserSection;
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import axios from 'axios'
class UserSection extends Component {
constructor(props) {
super(props)
this.state = {
}
}
/*点击关注或者取消关注*/
AboutFocus(){
const { author_info } = this.props
/*http://localhost:3000/api/v1/users/155/watch?object_id=156&object_type=user*/
const focusUrl = `/api/v1/users/${author_info.user_id}/${this.props.author_info.watched ? 'unwatch' : 'watch'}?object_id=${author_info.user_id}&object_type=user`
axios.get(focusUrl,{
})
.then((response) => {
const status = response.data.status;
console.log(status);
if(status == 1){
const new_author_info = Object.assign({}, this.props.author_info)
new_author_info.watched = !new_author_info.watched
this.props.initForumState({author_info: new_author_info})
}
}).catch((error) => {
console.log(error)
})
}
render() {
const { match, history, author_info , current_user } = this.props
if (!author_info) {
return <div className="edu-back-white" id="forum_index_list"></div>
}
return (
<div className="edu-back-white padding40-20 edu-txt-center">
<a href={`/users/${author_info.login}`} target="_blank"><img src={`/images/${author_info.image_url}`} width="90" height="90" className="radius mb5"/></a>
<p className="font-20 userPrivateName">{author_info.username}</p>
<p className="color-grey-9 userPrivatePost">{author_info.identity}</p>
{ author_info.user_id !== current_user.user_id &&
<p className="clearfix mt30">
<a href="javascript:void(0)" className="fl font-16 mr10 user_default_btn edu-blueback-btn" onClick={()=>{this.AboutFocus()}}>{ author_info.watched == true ? "取消关注" : "关注" }</a>
<a href={`/message/${current_user.login}/message_detail?target_ids=${author_info.user_id}`} className="fr font-16 user_default_btn user_private_btn" target="_blank">私信</a>
</p> }
</div>
);
}
}
export default UserSection;

@ -11,10 +11,10 @@
}
.user_navlist{
margin-left: 40px;
/*margin-left: 40px;*/
}
.next-slick-list{
margin-left: 12px;
/*margin-left: 12px;*/
}
.black_nav_span{
@ -58,7 +58,7 @@
}
.educontentSlider{
width: 1282px !important;
/*width: 1282px !important;*/
}
.user_navlist_white{
max-height:350px !important;
@ -72,4 +72,8 @@
.iconfontshixundaibeijing{
font-size: 18px !important;
line-height: 24px;
}
.next-slick.next-slick-horizontal.next-slick-outer{
padding:0px !important;
}

@ -125,7 +125,16 @@ class ShixunsHome extends Component {
{/*<SiderBar/>*/}
<div className="clearfix">
<div className="clearfix edu-back-white pb40 pt30 mb20" id="index-top" onMouseMove={this.bannaronmousemove} onMouseOut={this.bannaronmouseout}>
<style>
{
`
.banners{
overflow: hidden;
}
`
}
</style>
<div className="clearfix edu-back-white pb40 pt30 mb20 banners" id="index-top" onMouseMove={this.bannaronmousemove} onMouseOut={this.bannaronmouseout}>
<div className="educontent pr educontentSlider">
{homedatalist===undefined?"":
<Slider

@ -0,0 +1,109 @@
.myw120{
width: 120px;
}
.myh120{
height: 120px;
}
.myimgw48{
width: 48px;
}
.myimgh48{
height: 48px;
}
.mycenter{
display: flex;
justify-content: center
}
.myw100baifenbi{
width: 100%;
}
.ant-modal-header{
border-radius: 0px !important;
}
.search-new{
width: 100% !important;
margin-bottom: 0px !important;
height: 32px;
position: relative;}
.search-span{
display: block;
position: absolute;
width: 100%;
height: 100%;
left: 0px;
top: 0px;
background-color: #F4F4F4;
border: 1px solid #EAEAEA;
border-radius: 4px;
z-index: 1;
}
.search-new-input{
width: 100% !important;
height: 32px;
padding-left: 5px;
border: none;
box-sizing: border-box;
background: none;
outline: none;
position: absolute;
left: 0px;
top: 1px;
z-index: 2;}
.search-new img,.search-new a,.search-new .searchicon{
cursor: pointer;
position: absolute;
right: 2px;
top: 2px;
z-index: 2;
}
.search-new a{top: 0px}
.search-new-input:focus + .search-span{background-color: #fff;}
.task-hide-2
{height: 40px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.msheight30{
height: 30px;
}
/*滚动条*/
.private-list::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.private-list::-webkit-scrollbar-thumb {
background-color: #E3EBF4;
box-shadow: 0px 0px black;
}
.private-list::-webkit-scrollbar-track {
border-radius:3px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
background-color: white;
}
/*滚动条*/
.dialogPanel::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.dialogPanel::-webkit-scrollbar-thumb {
background-color: #E3EBF4;
box-shadow: 0px 0px black;
}
.dialogPanel::-webkit-scrollbar-track {
border-radius:3px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
background-color: white;
}

@ -0,0 +1,65 @@
import React, { Component } from 'react';
import {
Spin,
Pagination,
} from "antd";
import axios from 'axios';
import moment from 'moment';
import {getImageUrl,markdownToHTML} from 'educoder';
import "../css/messagemy.css"
import WriteaprivateletterModal from '../messagemodal/WriteaprivateletterModal';
//私信页面
class Leftdialogue extends Component{
constructor(props) {
super(props);
this.state={
};
}
componentDidMount(){
console.log("Leftdialogue");
console.log(this.props);
};
componentDidUpdate(prevProps) {
// console.log("11111111111");
// console.log(prevProps);
// console.log("22222222222");
// console.log(this.props);
// console.log("33333333333");
// if(prevProps.current_user !== this.props.current_user){
// this.getdata(1);
// }
}
mydelete=(user_id,id)=>{
this.props.DELETEsetreplyfun(user_id,id);
}
myCome=(e)=>{
window.location.href="/users/"+e.login;
}
render() {
return (
<div className="OtherSide clearfix" id="message_content_25148">
<a onMouseDown={()=>this.myCome(this.props.objeysl.sender)}>
{
this.props.objeysl&&this.props.objeysl.sender.image_url ?
<img alt="头像" className="mr10 radius fl myimgw48 myimgh48"
src={getImageUrl("/images/" + this.props.objeysl.sender.image_url)} />:""
}
</a>
<div className="fl pr OtherSide-info">
<span className="trangle"></span>
<div className="sms break_word" id="message_content_show_25148" dangerouslySetInnerHTML={{__html: markdownToHTML(this.props.objeysl.content).replace(/▁/g, "▁▁▁")}}></div>
<div className="edu-txt-right mt5">
<a className="color-grey-c" onClick={()=>this.mydelete(this.props.objeysl.sender.id,this.props.objeysl.id)} >删除</a>
</div>
</div>
<span className="fl ml15 color-grey-c lineh-15 mt15">{moment(this.props.objeysl.send_time).hour()}:{moment(this.props.objeysl.send_time).minute()<10?"0"+moment(this.props.objeysl.send_time).minute():moment(this.props.objeysl.send_time).minute()}</span>
</div>
)
}
}
export default Leftdialogue;
// onClick="delete_confirm_box('/users/innov/delete_message?mess_id=25148', '确定要删除该条记录吗?')"

@ -0,0 +1,687 @@
import React, { Component } from 'react';
import "../css/messagemy.css"
import {getImageUrl} from 'educoder';
import { Modal,Input,Icon,Tooltip,Spin} from 'antd';
import axios from 'axios';
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import moment from 'moment';
import Rightdialogue from './Rightdialogue'
import Leftdialogue from './Leftdialogue'
//私信聊天页面
class MessagChat extends Component{
constructor(props) {
super(props);
this.messageRef = React.createRef();
this.state={
isSpin:false,
isSpins:false,
limit:20,
page:1,
datay:[],
limits:20,
mess:false,
myuserl:[],
pages:1,
mypagey:20,
messages:[],
objc:[],
datanull:1,
}
}
componentDidMount(){
this.getdata(1);
const query = this.props.location.search;
let target_ids = query.split('?target_ids=');
this.getChatList(1,this.state.limits,target_ids[1]);
// console.log("MessagChat111111");
// console.log(this.props.myysluser);
this.setState({
myyslusers:this.props.myysluser
})
try {
this.props.Mtab(3);
}catch (e) {
}
// console.log("MessagChat111111");
// console.log(this.props);
// console.log(this.props.match.params.userid);
this.scrollToBottom();
}
componentDidUpdate() {
// this.scrollToBottom();
}
scrollToBottom() {
const scrollHeight = this.messageList.scrollHeight;
const height = this.messageList.clientHeight;
const maxScrollTop = scrollHeight - height;
this.messageList.scrollTop = maxScrollTop > 0 ? maxScrollTop : 0;
}
contentViewScrolltop=(e)=>{
if(e.currentTarget.scrollTop===0){
if(this.state.datanull===0){
return
}
console.log("调用了方法1111111");
let {pages}=this.state;
let newpage=pages+1
const query = this.props.location.search;
let target_ids = query.split('?target_ids=');
this.shuaxingetChatList(newpage,this.state.limits,target_ids[1],true);
this.messageList.scrollTop=50;
}
}
// 滑动刷新
contentViewScrolledit=(e)=>{
//滑动到底判断
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
// console.log("滑动到底判断");
let {page}=this.state;
let newpage=page+1
this.getdata(newpage);
// let ls=newpage*20
// this.setState({
// limits:ls,
// })
}
//滑动到顶部
// console.log("滑动到顶部判断");
// console.log(e.currentTarget.clientHeight);
// console.log(e.currentTarget.scrollTop);
// console.log(e.currentTarget.scrollHeight);
// if(e.currentTarget.scrollHeight+e.currentTarget.scrollTop===e.currentTarget.clientHeight){
// console.log("滑动到顶部判断");
//
// // let ls=newpage*20
// // this.setState({
// // limits:ls,
// // })
// }
};
shuaxingetChatList=(page,listl,target_ids,bool)=>{
this.setState({
isSpin:true,
});
let url = `/users/${this.props.match.params.userid}/private_message_details.json`;
axios.get((url),{params:{
target_id:target_ids,
page: page,
per_page:listl,
}}).then((result) => {
this.setState({
isSpin: false,
});
if (result) {
// if (result.data.status === 0) {
if (result.data !== null) {
if(result.data.messages.length===0){
console.log("没有数据了");
this.setState({
datanull:0,
})
return
}
var laoshuju=this.state.messages;
var datas = [];
var datay = result.data.messages;
datay = datay.reverse();
datay=datay.concat(laoshuju);
var obj = {};
for (var i = 0; i < datay.length; i++) {
if (i === 0) {
var timetwoy=datay[i].send_time.slice(0,10);
datay[i].send_day = timetwoy;
obj = datay[i];
datas.push(datay[i]);
} else {
try {
var timeone=obj.send_time.slice(0,10);
var timetwo=datay[i].send_time.slice(0,10);
if (moment(timeone).isSame(timetwo)) {
datay[i].send_day = "";
} else {
datay[i].send_day = timetwo;
obj = datay[i];
}
}catch (e) {
}
datas.push(datay[i]);
}
}
console.log("新数组+++++++++++++++++++++++++++++++++++++");
console.log(datas)
//颠倒数组
this.setState({
messages: datas,
myuserl: result.data.target,
pages:page,
})
// }
}
}
}).catch((error) => {
console.log(error);
this.setState({
isSpin:false,
})
})
};
getChatList=(page,listl,target_ids)=>{
this.setState({
isSpin:true,
});
let url = `/users/${this.props.match.params.userid}/private_message_details.json`;
axios.get((url),{params:{
target_id:target_ids,
page: page,
per_page:listl,
}}).then((result) => {
if (result) {
// if (result.data.status === 0) {
if (result.data !== null) {
var datas = [];
var datay = result.data.messages;
datay = datay.reverse();
var obj = {};
for (var i = 0; i < datay.length; i++) {
if (i === 0) {
var timetwoy=datay[i].send_time.slice(0,10);
datay[i].send_day = timetwoy;
obj = datay[i];
datas.push(datay[i]);
} else {
try {
var timeone=obj.send_time.slice(0,10);
var timetwo=datay[i].send_time.slice(0,10);
if (moment(timeone).isSame(timetwo)) {
datay[i].send_day = "";
} else {
datay[i].send_day = timetwo;
obj = datay[i];
}
}catch (e) {
}
datas.push(datay[i]);
}
}
//颠倒数组
this.setState({
messages: datas,
myuserl: result.data.target,
pages:page,
})
// }
this.scrollToBottom();
}
}
this.setState({
isSpin: false,
});
}).catch((error) => {
console.log(error);
this.setState({
isSpin:false,
})
})
};
getChatListtwo=(pages,listls,target_ids)=>{
this.setState({
isSpin:true,
});
let url = `/users/${this.props.match.params.userid}/private_message_details.json`;
axios.get((url),{params:{
target_id:target_ids,
page: pages,
per_page:listls,
}}).then((result) => {
if (result) {
// if (result.data.status === 0) {
if (result) {
// if (result.data.status === 0) {
if (result.data !== null) {
var datas = [];
var datay = result.data.messages;
datay = datay.reverse();
var obj = {};
for (var i = 0; i < datay.length; i++) {
if (i === 0) {
var timetwoy=datay[i].send_time.slice(0,10);
datay[i].send_day = timetwoy;
obj = datay[i];
datas.push(datay[i]);
} else {
try {
var timeone=obj.send_time.slice(0,10);
var timetwo=datay[i].send_time.slice(0,10);
if (moment(timeone).isSame(timetwo)) {
datay[i].send_day = "";
} else {
datay[i].send_day = timetwo;
obj = datay[i];
}
}catch (e) {
console.log("271271271271");
console.log(e);
}
datas.push(datay[i]);
}
}
//颠倒数组
this.setState({
messages: datas,
myuserl: result.data.target,
pages:pages,
datanull:1
})
this.scrollToBottom();
// }
}
}
}
this.setState({
isSpin: false,
});
}).catch((error) => {
console.log(error);
this.setState({
isSpin:false,
});
// this.getdatatwo(this.state.page);
})
};
//获取数据地方
getdata=(page)=>{
let{limit}=this.state;
let url = `/users/${this.props.match&&this.props.match.params.userid}/private_messages.json`;
// let url = `/users/71519/private_messages.json`;
axios.get((url),{params:{
page:page,
per_page:limit,
}}).then((result) => {
if (result) {
// console.log(types);
// console.log(result);
// console.log("调用了消失的方法");
// console.log("5454545454");
// if(result.data.status===0) {
if (result.data !== null) {
if (result.data.private_messages !== null) {
if (result.data.private_messages.length > 0) {
for (var i = 0; i < result.data.private_messages.length; i++) {
this.state.datay.push(result.data.private_messages[i]);
}
}
}
}
this.setState({
page: page,
isSpins: false,
datay: this.state.datay,
data: result.data.private_messages === null ? undefined : result.data.private_messages === undefined ? undefined : result.data.private_messages === [] ? undefined : result.data.private_messages === "[]" ? undefined : result.data.private_messages.length === 0 ? undefined : result.data.private_messages,
});
}
// console.log(this.state.datay);
// }
}).catch((error) => {
console.log(error);
this.setState({
isSpins:false,
})
})
};
//获取数据地方
getdatatwo=(page)=>{
let{limits}=this.state;
let url = `/users/${this.props.match&&this.props.match.params.userid}/private_messages.json`;
// let url = `/users/71519/private_messages.json`;
axios.get((url),{params:{
page:page,
per_page:limits,
}}).then((result) => {
if (result) {
// if(result.data.status===0){
this.setState({
page:page,
isSpins:false,
datay:result.data.private_messages===null?undefined:result.data.private_messages===undefined?undefined:result.data.private_messages===[]?undefined:result.data.private_messages==="[]"?undefined:result.data.private_messages.length===0?undefined:result.data.private_messages,
});
// }
// console.log(this.state.datay);
}
}).catch((error) => {
console.log(error);
this.setState({
isSpins:false,
})
})
};
// 跳转页面
smyJump =(i)=>{
// console.log("跳转页面");
// console.log(i);
this.props.Modifyur(i);
};
// 点击了用户
Clickedontheuser=(user)=>{
// debugger
// console.log("点击了用户");
// console.log(user);
// this.setState({
// myyslusers:user,
// mess:true,
// })
this.setState({
myuserl:user,
})
this.props.history.replace(`/message/${this.props.current_user.user_id}/message_detail?target_ids=${user.id}`);
// this.getdatatwo(this.state.page);
this.getChatListtwo(1,this.state.mypagey,user.id);
}
//回复
setreplyfun=()=>{
this.setState({
isSpin:true,
});
let contents=this.messageRef.current.getValue().trim();
const query = this.props.location.search;
let target_ids = query.split('?target_ids=');
let url = `/users/${this.props.match.params.userid}/private_messages.json`;
axios.post(url, {
target_id: target_ids[1],
content: contents
})
.then((response) => {
this.setState({
isSpin:false,
});
if(response===undefined){
return
}
if(response.data.status===0){
// console.log("回复成功");
// console.log(response);
// var datas=[];
// var dataso=this.state.messages;
// var datays=response.data.private_message;
// var obj={};
// for (var i=0;i<dataso.length;i++){
// if(i===0){
// obj=dataso[i];
// datas.push(dataso[i]);
// }else{
// if( moment(obj.send_day).isSame(dataso[i].send_day)){
// dataso[i].send_day="";
// }else {
// obj=dataso[i];
// }
// datas.push(dataso[i]);
// }
// }
this.getChatListtwo(1,this.state.mypagey,target_ids[1]);
// try {
// var time =dataso[dataso.length-1].send_time.slice(0,10);
// console.log(time);
// var timetwo=datays.send_time.slice(0,10);
// console.log(timetwo);
// if( moment(time).isSame(timetwo)){
// datays.send_day="";
// dataso.push(datays);
// }else {
// datays.send_day=timetwo;
// dataso.push(datays);
// }
// }catch (e) {
// console.log("回去出现错误");
// console.log(e);
// }
//
// //颠倒数组
// this.setState({
// messages: dataso,
//
// });
this.scrollToBottom();
this.messageRef.current.setValue('')
}
})
.catch(function (error) {
console.log(error);
this.setState({
isSpin:false,
});
});
};
//删除
DELETEsetreplyfun=(user_id,id)=>{
//user_id不用
// console.log("311");
this.setState({
isSpin:true,
});
let url = `/users/${this.props.match.params.userid}/private_messages/${id}.json`;
axios.delete(url)
.then((response) => {
if(response){
if(response.data.status===0){
if(this.state.messages.length>0){
for(var i=0;i<this.state.messages.length;i++){
if(parseInt(this.state.messages[i].id)===id){
this.state.messages.splice(i,1);
}
}
// setTimeout(()=>{
//
// }, 200);
this.setState({
messages:this.state.messages,
isSpin:false,
// datanull:1
})
// this.scrollToBottom()
}
}
}
})
.catch(function (error) {
console.log(error);
this.setState({
isSpin:false,
})
});
}
render() {
let{isSpins,datay,myyslusers,mess,limits,myuserl,messages,isSpin,datanull}=this.state;
// console.log(mess);
// console.log(myyslusers);
// console.log("MessagChat");
// console.log(this.state);
// console.log("112");
// console.log(limits);
// console.log(myuserl);
// console.log(messages);
return (
<div className="edu-back-white ml20">
{/*私信对话框*/}
<div className="df clearfix">
{/*左边*/}
<div className="flex1">
<p className="clearfix pt30 pb30 edu-txt-center font-16 bor-bottom-greyE">
<a onClick={()=>this.smyJump(2)}><i className="iconfont icon-zuojiantou font-14 fl ml25 color-grey-9"
data-tip-down="返回到列表"></i></a>
{myuserl!==undefined?myuserl.name:""}与你的私信
</p>
{/*聊天页面*/}
<div className="dialogPanel"
onScroll={this.contentViewScrolltop}
ref={(div) => {
this.messageList = div;
}}>
<div >
<Spin size="large" className="myw100baifenbi" spinning={isSpin}>
{
datanull===0?
<p className="mt30 edu-txt-center"><span className="letter-time">没有信息了</span></p>
:""
}
<div id="yslysl" >
{
messages===undefined?
""
:messages.map((item,key)=>{
// console.log("-----------------================-=-==-==");
// console.log(item.sender_id);
// console.log(this.props.match.params.userid);
return(
<div key={key}>
{
item.send_day===undefined?"":item.send_day===null?"":item.send_day===""?"":
<p className="mt30 edu-txt-center"><span className="letter-time">{item.send_day}</span></p>
}
{
parseInt(item.sender_id)===parseInt(this.props.match.params.userid)?
<Rightdialogue objeysl={item} {...this.state} {...this.props} DELETEsetreplyfun={(user_id,id)=>this.DELETEsetreplyfun(user_id,id)}>
{/*自己的*/}
</Rightdialogue>
:<Leftdialogue objeysl={item} {...this.state} {...this.props} DELETEsetreplyfun={(user_id,id)=>this.DELETEsetreplyfun(user_id,id)}>
{/*他人的*/}
</Leftdialogue>
}
</div>
)
})
}
</div>
</Spin>
</div>
</div>
{/*回复*/}
<div className="bor-top-greyE padding20">
<style>
{`
.rememberTip{
display:none;
}
`}
</style>
<TPMMDEditor ref={this.messageRef}
placeholder={'请输入您的回复'}
watch={false}
initValue={''}
mdID={'courseMessageMD'}
className="courseMessageMD"
height={200}
></TPMMDEditor>
<div className={"msheight30"}>
<span className="fl ml5 color-orange font-12">在问题反馈时请同时发送问题发生页的网址链接以便我们高效的为您服务</span>
<a className="fr task-btn task-btn-orange" onClick={()=>this.setreplyfun()}>回复</a>
</div>
</div>
</div>
{/*右边*/}
<div className="bor-left-greyE" style={{width:"290px"}}>
{/*右边头部*/}
<p className="pt30 pb30 pl30 edu-txt-left font-16 bor-bottom-greyE">私信列表</p>
<Spin size="large" className="myw100baifenbi" spinning={isSpins}>
<div className="private-list" onScroll={this.contentViewScrolledit}>
{/*列表数据*/}
{
datay===undefined?
""
:datay.map((item,key)=>{
return(
<div className="private-part clearfix" key={key} onClick={(i)=>this.Clickedontheuser(item.target)}>
<div className="part-line df">
<img src={getImageUrl("/images/"+item.target.image_url)} className="radius mr10 myimgw48 myimgh48"/>
<div className="flex1">
<p className="clearfix mb15 lineh-17">
<span className="fl pr">
<span className="task-hide privatePartName">{item.target.name}</span>
{item.unread === true?
<span className="newLetter"></span>
:""}
</span>
<span className="color-grey-c fr">{moment(item.send_time).fromNow()}</span>
</p>
<p className="color-grey-6 lineh-20 justify break_word task-hide-2" style={{wordBreak:"break-word"}} dangerouslySetInnerHTML={{__html:item.content}}></p>
</div>
</div>
</div>
)
})}
</div>
</Spin>
</div>
</div>
</div>
)
}
}
export default MessagChat;
// onClick="delete_confirm_box('/users/innov/delete_message?mess_id=25137', '确定要删除该条记录吗?')"
//
// {/*左边*/}

@ -0,0 +1,176 @@
import React, { Component } from 'react';
import {
Spin,
Pagination,
} from "antd";
import axios from 'axios';
import {getImageUrl} from 'educoder';
import "../css/messagemy.css"
//消息页面
class MessagSub extends Component{
constructor(props) {
super(props);
this.state={
page:1,
limit:10,
typeysl:"",
count:0,
isSpin:false,
data:undefined,
}
}
// 初始化数据
componentDidMount(){
// console.log("初始化数据了MessagSub");
// console.log(this.props);
this.getdata("",this.state.page);
// this.Messageprivatemessageunreadmessage();
try {
this.props.Mtab(1);
}catch (e) {
}
}
//塞选页数
paginationonChanges=(pageNumber)=>{
this.setState({
page: pageNumber,
})
this.getdata(this.state.typeysl,pageNumber);
}
//获取数据源
getdata=(types,page)=>{
this.setState({
isSpin:true,
})
let{limit}=this.state;
let url = `/users/tidings.json`;
axios.get((url),{params:{
type:types,
page:page,
per_page:limit,
}}).then((result) => {
if (result) {
// if (result.data.status === 0) {
this.setState({
page: page,
count: result.data.count,
typeysl: types,
isSpin: false,
data: result.data.tidings === null ? undefined : result.data.tidings === undefined ? undefined : result.data.tidings === [] ? undefined : result.data.tidings === "[]" ? undefined : result.data.tidings.length === 0 ? undefined : result.data.tidings,
})
// }
}
}).catch((error) => {
console.log(error);
this.setState({
isSpin:false,
})
})
}
componentWillUnmount(){
// 卸载异步操作设置状态
this.setState = (state, callback) => {
return;
}
}
render() {
let{page,limit,typeysl,count,isSpin,data}=this.state;
// console.log("6868686868");
// console.log(data);
return (
<div className="clearfix ml20">
{/*头部筛选数据*/}
<ul className="pl10 ridingNav clearfix edu-back-white">
<li className={typeysl===""?"active":""}><a onClick={(s,i)=>this.getdata("",1)}>全部</a></li>
<li className={typeysl&&typeysl==="course"?"active":""} ><a onClick={(s,i)=>this.getdata("course",1)}>课堂提醒</a></li>
<li className={typeysl&&typeysl==="project"?"active":""} ><a onClick={(s,i)=>this.getdata("project",1)}>项目提醒</a></li>
<li className={typeysl&&typeysl==="project_package"?"active":""}><a onClick={(s,i)=>this.getdata("project_package",1)}>众包提醒</a></li>
<li className={typeysl&&typeysl==="interactive"?"active":""}><a onClick={(s,i)=>this.getdata("interactive",1)}>互动提醒</a></li>
<li className={typeysl&&typeysl==="apply"?"active":""}><a onClick={(s,i)=>this.getdata("apply",1)}>审核</a></li>
<li className={typeysl&&typeysl==="system"?"active":""}><a onClick={(s,i)=>this.getdata("system",1)}>通知</a></li>
</ul>
{/*下面内容页面*/}
<div className="bor-top-greyE mycenter">
{/*这里可以进行数据处理*/}
<div className="myw100baifenbi">
<Spin size="large" className="myw100baifenbi" spinning={isSpin}>
{
data===undefined?
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">暂无数据哦~</p>
</div>
:data.map((item,key)=>{
console.log(data)
return(
<div className="pl25 ridinglist edu-back-white" key={key}>
<div className="ridinglist-sub clearfix df tiding_item">
<img onMouseDown={()=>this.myCome(item)} src={getImageUrl("/images/"+item.trigger_user.image_url)} className="radius mr10 fl myimgw48 myimgh48"/>
<div className="fl flex1">
<p>
<a className="mr20 private_message_a" onMouseDown={()=>this.myCome(item)}>{item.trigger_user.name}</a>
<span className="color-grey-c">{item.time}</span>
{item.tiding_type==="Apply"?(
item.status===0?
<span className="edu-filter-btn ml20 edu-filter-btn-red">待处理</span>:""
):""}
{item.tiding_type==="Apply"?(
item.status===1?
<span className="edu-filter-btn ml20 edu-filter-btn-green">已处理</span>:""
):""}
</p>
<p className="color-grey-6 break_word_firefox" style={{wordBreak: "break-word"}}>
{
item.content
}
</p>
</div>
<span className={item.new_tiding===true?"new-point fr mr40 mt22":""}></span>
</div>
</div>
)
})}
</Spin>
{/*页数*/}
{ data===undefined?""
:
(count>10?
<div style={{textAlign: "center"}} className="new_expand mt10">
<div className="edu-txt-center mt30">
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit}
total={count}></Pagination>
</div>
</div>:""
)
}
</div>
</div>
</div>
)
}
}
export default MessagSub;

@ -0,0 +1,180 @@
import React, { Component } from 'react';
import {
Spin,
Pagination,
} from "antd";
import axios from 'axios';
import moment from 'moment';
import {getImageUrl} from 'educoder';
import "../css/messagemy.css"
import WriteaprivateletterModal from '../messagemodal/WriteaprivateletterModal';
//私信页面
class MessagePrivate extends Component{
constructor(props) {
super(props);
this.state={
page:1,
limit:10,
count:0,
data:undefined,
isSpin:false,
modalsType:false,
};
// console.log("MessagePrivate");
// console.log(this.props);
}
componentDidMount(){
this.getdata(1);
try {
this.props.Mtab(2);
}catch (e) {
}
// console.log("MessagePrivate");
// console.log(this.props);
// console.log(this.props.match.params.userid);
};
componentDidUpdate(prevProps) {
// console.log("11111111111");
// console.log(prevProps);
// console.log("22222222222");
// console.log(this.props);
// console.log("33333333333");
if(prevProps.current_user !== this.props.current_user){
this.getdata(1);
}
}
//获取数据地方
getdata=(page)=>{
this.setState({
isSpin:true,
});
let{limit}=this.state;
let url = `/users/${this.props.match&&this.props.match.params.userid}/private_messages.json`;
// let url = `/users/71519/private_messages.json`;
axios.get((url),{params:{
page:page,
per_page:limit,
}}).then((result) => {
if (result) {
// console.log(types);
// console.log(result);
// console.log("调用了消失的方法");
// console.log("5454545454");
// if (result.data.status === 0) {
this.setState({
page: page,
count: result.data.count,
isSpin: false,
data: result.data.private_messages === null ? undefined : result.data.private_messages === undefined ? undefined : result.data.private_messages === [] ? undefined : result.data.private_messages === "[]" ? undefined : result.data.private_messages.length === 0 ? undefined : result.data.private_messages,
})
// }
}
}).catch((error) => {
console.log(error);
this.setState({
isSpin:false,
})
})
};
paginationonChanges=(pageNumber)=>{
this.setState({
page: pageNumber,
})
this.getdata(pageNumber);
};
okmodalsType=()=>{
this.setState({
modalsType:true,
})
}
cancelmodalsType=()=>{
this.setState({
modalsType:false,
})
};
// 跳转页面
smyJump =(i,id)=>{
// console.log("跳转页面");
// console.log(i);
this.props.Modifyur(i,id);
};
myCome=(e)=>{
window.location.href="/users/"+e.target.login;
}
render() {
let{page,limit,typeysl,count,isSpin,data,modalsType}=this.state;
// console.log( this.props);
// console.log("37");
return (
<div>
{
modalsType===true?
<WriteaprivateletterModal {...this.state} {...this.props} modalsType={modalsType} cancelmodalsType={this.cancelmodalsType} smyJump={(is,item)=>this.smyJump(is,item)} ></WriteaprivateletterModal>
:""
}
<div className="edu-back-white ml25">
<p className="clearfix font-16 padding30-20 bor-bottom-greyE">
<span className="fl">全部私信</span>
<a className="color-blue fr" onClick={()=>this.okmodalsType()}>写私信</a>
</p>
<Spin size="large" className="myw100baifenbi" spinning={isSpin}>
{
data===undefined?
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">暂无数据哦~</p>
</div>
:data.map((item,key)=>{
return(
<div className="private-item clearfix df" key={key} onClick={()=>this.smyJump(3,item.target.id)}>
<a className="fl mr10 private_message_a" onMouseDown={()=>this.myCome(item)}>
<img onMouseDown={()=>this.myCome(item)} src={getImageUrl("/images/"+item.target.image_url)} className="radius myimgw48 myimgh48"/>
</a>
<div className="fl flex1">
<p>
<a onMouseDown={()=>this.myCome(item)} className="mr20 private_message_a">{item.target.name}</a>
<span>与你的私信</span>
<span className="color-grey-c mr20">[{item.message_count}{"条"}]</span>
<span className="color-grey-c">{moment(item.send_time).fromNow()}</span>
</p>
<span className="color-grey-6 break_word_firefox " dangerouslySetInnerHTML={{__html:item.content}}></span>
</div>
{item.unread === true ?<span className="new-point fr mt22"></span>:""}
</div>
)
})}
</Spin>
</div>
{/*页数*/}
{ data===undefined?""
:
(count>10?
<div style={{textAlign: "center"}} className="new_expand mt10">
<div className="edu-txt-center mt30">
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit}
total={count}></Pagination>
</div>
</div>
:""
)
}
</div>
)
}
}
export default MessagePrivate;

@ -0,0 +1,227 @@
import React, { Component } from 'react';
import {Input,Pagination,Tooltip} from 'antd';
import {TPMIndexHOC} from "../../../modules/tpm/TPMIndexHOC";
import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder';
import axios from 'axios';
import "../css/messagemy.css"
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import Loading from '../../../Loading'
import Loadable from 'react-loadable';
// MessagSub 消息自路由
// MessagePrivate 私信
const MessagSub = Loadable({
loader: () => import('./MessagSub'),
loading: Loading,
})
const MessagePrivate = Loadable({
loader: () => import('./MessagePrivate'),
loading: Loading,
})
const MessagChat = Loadable({
loader: () => import('./MessagChat'),
loading: Loading,
})
class Messagerouting extends Component{
constructor(props) {
super(props);
this.state={
routing:1,
unread_message_count:0,
unread_tiding_count:0,
}
}
componentDidMount(){
// console.log("Messagerouting");
// console.log(this.props);
// let courstype=this.props.location.search;
// // courstype=courstype.splice('/');
// // courstype=courstype[3];
// // console.log("45");
// console.log(courstype);
}
componentDidUpdate(prevProps) {
// console.log("11111111111");
// console.log(prevProps);
// console.log("22222222222");
// console.log(this.props);
// console.log("33333333333");
if(prevProps.current_user !== this.props.current_user){
this.Messageprivatemessageunreadmessage(this.props.current_user.user_id);
}
}
//消息未读
Messageprivatemessageunreadmessage=(user_id)=>{
const url=`/users/${user_id}/unread_message_info.json`
axios.get(url).then((result) => {
if(result===undefined){
return
}
// console.log("消息未读1");
// console.log(result);
this.setState({
unread_message_count:result.data.unread_message_count,
unread_tiding_count:result.data.unread_tiding_count,
})
}).catch((error) => {
console.log(error)
})
};
SwitchonClick=(value)=>{
this.setState({
routing:value,
});
this.Messageprivatemessageunreadmessage(this.props.current_user.user_id);
if(value===1){
this.props.history.replace(`/message/${this.props.current_user.user_id}/user_tidings`);
}
if(value===2){
this.props.history.replace(`/message/${this.props.current_user.user_id}/private_messages`);;
}
};
Message2=(data)=>{
// console.log("64");
// console.log(data);
this.setState({
unread_message_count:data.unread_message_count,
unread_tiding_count:data.unread_tiding_count,
})
};
//跳转到链接
Modifyur=(i,id)=>{
// console.log("跳转到链接1");
// console.log(i);
// console.log(item);
// console.log("跳转到链接2");
if(i<3){
this.setState({
routing:i,
});
if(i===1){
this.props.history.replace(`/message/${this.props.current_user.user_id}/user_tidings`);
}
if(i===2){
this.props.history.replace(`/message/${this.props.current_user.user_id}/private_messages`);
}
}else {
this.setState({
routing:i,
});
console.log("22222222222");
this.props.history.replace(`/message/${this.props.current_user.user_id}/message_detail?target_ids=${id}`);
}
};
myCome=(e)=>{
window.location.href="/users/"+e.target.login;
}
myxiaoxisixintab=(i)=>{
if(i===1){
this.setState({
routing:1,
});
}
if(i===2){
this.setState({
routing:2,
});
}
if(i===3){
this.setState({
routing:3,
});
}
}
render() {
let{routing,unread_message_count,unread_tiding_count} =this.state;
// console.log(this.props);
// console.log(routing);
return (
<div className="newMain clearfix">
<div className="educontent mt20 mb80 clearfix">
{/*左边*/}
<div className="leftPanel">
{/*头像*/}
<div className="mb20 edu-back-white pt40 pb40 edu-txt-center">
<a >
{
this.props.current_user!== undefined?
<img className="person radius myw120 myh120" src={getImageUrl("/images/"+this.props.current_user.image_url)}/>
:""
}
</a>
<p className="font-24 lineh-25 mt10" >{this.props.current_user&&this.props.current_user.username}</p>
<p className="color-grey-6 mt5" >{this.props.current_user&&this.props.current_user.user_identity}</p>
</div>
{/*路由跳转*/}
<ul className="edu-back-white">
<li className={routing ===1?"nav pr active":"nav pr"}>
<a onClick={(value)=>this.SwitchonClick(1)}>消息</a>
{parseInt(unread_tiding_count)>0?<span className="new-info">{unread_message_count}</span>:""}
</li>
<li className={routing ===2?"nav pr active":routing ===3?"nav pr active":"nav pr"}>
<a onClick={(value)=>this.SwitchonClick(2)}>私信</a>
{parseInt(unread_tiding_count)>0?<span className="new-info">{unread_tiding_count}</span>:""}
</li>
</ul>
</div>
{/*右边*/}
<div className="rightPanel">
<div className="clearfix">
{/*/!*消息自路由*!/*/}
{/*{routing===1?<MessagSub {...this.state} {...this.props} Message2={()=>this.Message2()}></MessagSub> :""}*/}
{/*/!*私信*!/*/}
{/*{routing===2?<MessagePrivate {...this.state} {...this.props} Message2={()=>this.Message2()} Modifyur={(i,item)=>this.Modifyur(i,item)}></MessagePrivate> :""}*/}
{/*/!*私信聊天页面*!/*/}
{/*{routing===3?<MessagChat {...this.state} {...this.props} Message2={()=>this.Message2()} Modifyur={(i)=>this.Modifyur(i)}></MessagChat>:""}*/}
<Switch>
{/*/!*消息自路由*! name 是 /message/info/:userid/*/}
<Route path="/message/:userid/user_tidings"
render={
(props) => (<MessagSub {...this.state} {...this.props} {...props} Message2={()=>this.Message2()} Mtab={(i)=>this.myxiaoxisixintab(i)}></MessagSub>)
}
></Route>
{/*/!*私信*! name 是letter/*/}
<Route path="/message/:userid/private_messages"
render={
(props) => (<MessagePrivate {...this.state} {...this.props} {...props} Message2={()=>this.Message2()} Modifyur={(i,item)=>this.Modifyur(i,item)} Mtab={(i)=>this.myxiaoxisixintab(i)}></MessagePrivate> )
}
></Route>
{/*/!*私信聊天页面*! letters/*/}
<Route path="/message/:userid/message_detail"
render={
(props) => (<MessagChat {...this.state} {...this.props} {...props} Message2={()=>this.Message2()} Modifyur={(i)=>this.Modifyur(i)} Mtab={(i)=>this.myxiaoxisixintab(i)}></MessagChat>)
}
></Route>
</Switch>
</div>
</div>
</div>
</div>
)
}
}
export default SnackbarHOC() (TPMIndexHOC ( Messagerouting ));

@ -0,0 +1,65 @@
import React, { Component } from 'react';
import {
Spin,
Pagination,
} from "antd";
import axios from 'axios';
import moment from 'moment';
import {getImageUrl,markdownToHTML} from 'educoder';
import "../css/messagemy.css"
import WriteaprivateletterModal from '../messagemodal/WriteaprivateletterModal';
//私信页面
class Rightdialogue extends Component{
constructor(props) {
super(props);
this.state={
};
}
componentDidMount(){
// console.log("Rightdialogue");
// console.log(this.props);
};
componentDidUpdate(prevProps) {
// console.log("11111111111");
// console.log(prevProps);
// console.log("22222222222");
// console.log(this.props);
// console.log("33333333333");
// if(prevProps.current_user !== this.props.current_user){
// this.getdata(1);
// }
}
mydelete=(user_id,id)=>{
this.props.DELETEsetreplyfun(user_id,id);
}
myCome=(e)=>{
window.location.href="/users/"+e.login;
}
render() {
return (
<div className="ThisSide clearfix" id="message_content_25137">
<a onMouseDown={()=>this.myCome(this.props.objeysl.sender)}>
{this.props.objeysl&&this.props.objeysl.sender.image_url ?
<img alt="头像" className="ml10 radius fr myimgw48 myimgh48"
src={getImageUrl("/images/" + this.props.objeysl.sender.image_url)}/>:""
}
</a>
<div className="fr pr ThisSide-info">
<span className="trangle"></span>
<div className="sms break_word" id="message_content_show_25137" dangerouslySetInnerHTML={{__html: markdownToHTML(this.props.objeysl.content).replace(/▁/g, "▁▁▁")}}></div>
<div className="edu-txt-left mt5">
<a className="color-grey-c" onClick={()=>this.mydelete(this.props.objeysl.sender.id,this.props.objeysl.id)}
>删除</a>
</div>
</div>
<span className="fr mr15 color-grey-c lineh-15 mt15">{moment(this.props.objeysl.send_time).hour()}:{moment(this.props.objeysl.send_time).minute()<10?"0"+moment(this.props.objeysl.send_time).minute():moment(this.props.objeysl.send_time).minute()}</span>
</div>
)
}
}
export default Rightdialogue;

@ -0,0 +1,356 @@
import React, { Component } from 'react';
import { Modal,Input,Icon,Tooltip,Spin} from 'antd';
import axios from 'axios';
// import '../../modules/user/common.css';
import {getImageUrl} from 'educoder';
//完善个人资料
class WriteaprivateletterModal extends Component {
constructor(props) {
super(props)
this.state ={
modalsType:false,
Pleaseselectthesender:false,
Pleaseselectthesenders:false,
inputvulue:"",
inputvulues:"",
floatingboxdisplay:false,
users:[],
Personalid:undefined,
isSpin:false,
Recentcontacts:false,
floatingboxdisplays:false,
}
}
componentDidMount() {
//用户id
//console.log(this.props.current_user.user_id);
this.Recentcontacts();
}
//获取最近联系人
Recentcontacts=()=>{
this.setState({
isSpin:true
});
const url =`/users/${this.props.current_user.user_id}/recent_contacts.json`
axios.get(url).then((result) => {
if(result===undefined){
return
}
//console.log(result);
this.setState({
users:result.data.users,
Recentcontacts:false,
floatingboxdisplay:false,
isSpin:false
})
}).catch((error) => {
//console.log(error)
this.setState({
isSpin:false
})
})
};
//发送私信
SendprivatemessageAPI=(idvalue,contentvalue)=>{
const url =`/users/${this.props.current_user.user_id}/private_messages.json`
let data={
target_id:idvalue,
content:contentvalue,
}
axios.post(url, data).then((result) => {
if(result===undefined){
return
}
this.setState({
floatingboxdisplays:false,
Pleaseselectthesender:false,
});
this.props.smyJump(3,result.data.private_message.receiver_id);
//console.log(result);
}).catch((error) => {
//console.log(error)
})
};
//搜索私信人
Retrieveprivatemessageusers=(value)=>{
this.setState({
isSpin:true
})
const url =`/users_for_private_messages.json`
axios.get((url),{params:{
keyword:value,
}}).then((result) => {
if(result===undefined){
return
}
this.setState({
users:result.data.users,
Recentcontacts:true,
floatingboxdisplay:true,
isSpin:false
})
//console.log(result);
}).catch((error) => {
//console.log(error)
this.setState({
isSpin:false
})
})
};
modalCancel=()=>{
// var weekArray = JSON.parse(window.sessionStorage.getItem('yslgeturls'));
// if(weekArray===undefined){
// weekArray="/";
// }
// if(weekArray===null){
// weekArray="/";
// }
// if(weekArray==="null"){
// weekArray="/";
// }
// window.location.href = weekArray;
}
setDownload=()=>{
// window.location.href ='/account/profile';
};
// 搜索
search_message_person=()=>{
//console.log("点击搜索按钮");
if(this.state.inputvulue.length===0){
this.Recentcontacts();
}else {
this.Retrieveprivatemessageusers(this.state.inputvulue);
}
};
//取消事件
HideModal=()=>{
this.props.cancelmodalsType();
};
//确认事件
OKModal=()=>{
let{inputvulue,Personalid,inputvulues}=this.state;
// console.log("发送私信了");
// console.log(inputvulue);
// console.log(Personalid);
// console.log(inputvulues);
if(inputvulue.length===0){
this.setState({
Pleaseselectthesender:true
});
return;
}
if(inputvulues.length===0){
this.setState({
floatingboxdisplays:true
})
return;
}
else {
if(Personalid===undefined){
this.setState({
Pleaseselectthesender:true
});
return
}
this.SendprivatemessageAPI(Personalid,inputvulues)
}
};
// 回车事件
Myοnkeydοwn=()=>{
//console.log("点击了回车事件");
if(this.state.inputvulue.length===0){
this.Recentcontacts();
}else {
this.Retrieveprivatemessageusers(this.state.inputvulue);
}
};
//判断点击的键盘的keyCode是否为13是就调用上面的搜索函数
handleEnterKey = (e) => {
//console.log("");
if(e.nativeEvent.keyCode === 13){ //e.nativeEvent获取原生的事件对像
this.Myοnkeydοwn()
}
};
// 查找联系人输入模式
setdatafunsval=(e)=>{
if(e.target.value.length===0){
this.setState({
inputvulue:e.target.value,
Pleaseselectthesender:false,
floatingboxdisplay:true,
Personalid:undefined
});
this.Recentcontacts();
}else {
this.setState({
inputvulue:e.target.value,
Pleaseselectthesender:false,
floatingboxdisplay:true,
});
}
//console.log(e.target.value);
};
// 输入内容
setdatafunsvals=(e)=>{
//console.log(e.target.value);
this.setState({
inputvulues:e.target.value,
Pleaseselectthesenders:false,
floatingboxdisplays:false,
floatingboxdisplay:false,
});
}
//失去焦点
myonBlur=(e)=>{
//console.log("失去焦点了");
e.preventDefault();
this.setState({
// floatingboxdisplay:false,
})
};
//获取焦点
myonFocus=(e)=>{
//console.log("获取到焦点了");
this.setState({
floatingboxdisplay:true,
})
};
//获取用户信息
Getuserinformation=(item)=>{
//console.log("获取到了用户信息");
//console.log(item.id);
this.setState({
Personalid:item.id===undefined?undefined:item.id===null?undefined:item.id,
inputvulue:item.name,
floatingboxdisplay:false,
})
}
render() {
let{Pleaseselectthesender,inputvulue,inputvulues,floatingboxdisplay,users,floatingboxdisplays,Recentcontacts,isSpin}=this.state;
//console.log(floatingboxdisplay);
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title={"写私信"}
centered={true}
visible={this.props.modalsType}
width="550px"
>
<div >
<div className="mb20 pr">
{/*搜索框*/}
{/*<div className="search-new myw100baifenbi" >*/}
{/* <input type="text" className="search-new-input fl " value={inputvulue} onKeyPress={this.handleEnterKey} onBlur={this.myonBlur} onFocus={this.myonFocus} onChange={this.setdatafunsval} utoComplete="off"*/}
{/* placeholder="发送给..." id="sendFor"/>*/}
{/* <span className="search-span"></span>*/}
{/* <img src={"/images/educoder/icon/search.svg"} className="fl mt5"*/}
{/* onClick={()=>this.search_message_person()}/>*/}
{/*</div>*/}
<div className="myw100baifenbi">
<Input
className=""
placeholder="发送给..."
value={inputvulue}
onKeyPress={this.handleEnterKey}
onBlur={this.myonBlur}
onFocus={this.myonFocus}
onChange={this.setdatafunsval}
suffix={
<img src={getImageUrl("/images/"+"educoder/icon/search.svg")} onClick={()=>this.search_message_person()}/>
}
/>
</div>
{/*搜索框下面悬浮框*/}
<div className="recently_person" style={floatingboxdisplay===false?{display: "none"}:{display: "block"}}>
<Spin size="large" className="myw100baifenbi" spinning={isSpin}>
<p className="padding10-20 color-grey-9 cdefault">{Recentcontacts===false?"最近联系人":"搜索结果"}</p>
{
users.map((item,key)=>{
return(
<p className="clearfix recently_item" key={key} onMouseDown={(c)=>this.Getuserinformation(item)}>
<img alt="1?1558048024" className="radius fl mr10 myimgw48 myimgh48" src={getImageUrl("/images/"+item.image_url)}
/>
<span className="recently_name">{item.name}</span>
</p>
)
})
}
</Spin>
{/*<p className="clearfix recently_item">*/}
{/* <img alt="1?1558048024" className="radius fl mr10 myimgw48 myimgh48" src={"/images/avatars/User/1?1558048024"}*/}
{/* />*/}
{/* <span className="recently_name" data-user="1">实践教学</span>*/}
{/*</p>*/}
{/*<p className="clearfix recently_item">*/}
{/* <img alt="B?1532489442" className="radius fl mr10 myimgw48 myimgh48" src={"/images/avatars/User/b?1532489442"}*/}
{/* />*/}
{/* <span className="recently_name" data-user="20523">innov</span>*/}
{/*</p>*/}
</div>
</div>
{/*私信内容*/}
<div className="writeLetter_Info">
<textarea className="writeLetter_text greyInput" value={inputvulues} onChange={this.setdatafunsvals} name="content" id="writeLetter_text"
maxLength="200"></textarea>
<span className="longchar">200</span>
</div>
</div>
{
Pleaseselectthesender === true ?
<p className="color-orange-tip " style={{height: "25px"}}><span id="notice_send_person">请选择发送对象</span></p>
:(floatingboxdisplays ===false?<p style={{height:"25px"}}></p>:"")
}
{
floatingboxdisplays===true?
<p className="color-orange-tip " style={{height: "25px"}}><span id="notice_send_person">请输入发送内容</span></p>
: ""
}
{/*确认事件*/}
<p className="clearfix edu-txt-center">
<a onClick={()=>this.HideModal()} className="pop_close task-btn mr30">取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.OKModal()} id="submit_send_letter">确定</a>
</p>
{/*<div className="educouddiv">*/}
{/* <div className={"tabeltext-alignleft"}><p style={{fontSize: "16px"}}>完善您的资料,将获得更多的使用权限</p></div>*/}
{/* <div className="clearfix mt30 edu-txt-center">*/}
{/* <a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a>*/}
{/* <a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>立即完善</a>*/}
{/* </div>*/}
{/*</div>*/}
</Modal>
)
}
}
export default WriteaprivateletterModal;

@ -18,7 +18,7 @@ class DownloadMessage extends Component {
setDownload=()=>{
this.modalCancel();
window.open(`/users/${this.props.user.login}/message_detail?user_id=1`)
window.open(`/message/${this.props.user.login}/message_detail?target_ids=1`)
}
modalCancel = () => {
this.setState({

@ -11,7 +11,7 @@ class DownloadMessageysl extends Component {
setDownload=()=>{
this.props.modalCancel();
window.open(`/users/${this.props.user.login}/message_detail?user_id=1`)
window.open(`/message/${this.props.user.login}/message_detail?target_ids=1`)
}
render() {

@ -368,17 +368,20 @@ class MainContentContainer extends Component {
}
componentDidMount() {
window.$(window.documents).bind("submitChoose",function(){
alert("hello world!");
});
// if (this.binded == true) {
// return;
// } else {
// this.binded = true
// window.$(window).unload( ()=>{
// alert(111)
// var fileUpdatePromise = this.doFileUpdateRequest(true)
// });
// }
}
componentWillUnmount() {
// window.$(window).off( "unload" )
}
doFileUpdateRequestOnCodeMirrorBlur = () => {
var fileUpdatePromise = this.doFileUpdateRequest(true)

@ -112,14 +112,14 @@ class PathDetailIndex extends Component{
this.setState({
Modalstype:false,
})
window.history.go(-1)
this.props.history.goBack()
}
cardsModalsave=()=>{
this.setState({
Modalstype:false,
})
window.history.go(-1)
this.props.history.goBack()
}
// 加载markdown
updatamakedown=(id)=>{

@ -222,7 +222,7 @@ export default class MDEditors extends Component {
const _placeholder = placeholder || "";
// amp;
// 编辑时要传memoId
const imageUrl = `/upload_with_markdown?container_id=&container_type=Memo`;
const imageUrl = `/api/attachments.json`;
// 创建editorMd
let react_id = `react_${_id}`;

@ -1,9 +1,12 @@
import React, {Component} from 'react';
import {Link} from "react-router-dom";
import axios from 'axios';
import { Input ,Icon,Button,Pagination} from 'antd';
import { Input ,Icon,Button,Pagination,Spin} from 'antd';
import moment from 'moment';
import '../packageconcnet.css';
import AccountProfile from"../../user/AccountProfile";
import LoginDialog from '../../login/LoginDialog';
const { Search } = Input;
let categorylist=[
@ -45,7 +48,10 @@ class PackageConcent extends Component {
sort_direction:"desc",
page:1,
per_page:20,
categories:[]
categories:[],
isRender:false,
AccountProfiletype:false,
isSpin:false
}
}
//desc, desc, asc
@ -69,7 +75,9 @@ class PackageConcent extends Component {
}
setdatas=(category,keyword,sort_by,sort_direction,page)=>{
this.setState({
isSpin:true
})
let Url = `/project_packages.json`;
axios.get(Url,{params:{
category_id:category,
@ -82,6 +90,7 @@ class PackageConcent extends Component {
).then((response) => {
this.setState({
data:response.data,
isSpin:false,
project_packages:response.data.project_packages
})
}).catch((error) => {
@ -134,12 +143,66 @@ class PackageConcent extends Component {
this.setdatas(category,keyword,value,sort_directionvalue,page)
}
onReleaseRequirements=(url)=>{
let{current_user} =this.props;
if(current_user===undefined){
this.setState({
isRender:true
})
return
}
if(current_user&&current_user.login===""){
this.setState({
isRender:true
})
return;
}
if(current_user&&current_user.profile_completed===false){
this.setState({
AccountProfiletype:true
})
return;
}
if(url !== undefined || url!==""){
window.location.href = url;
}
}
// 登录
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
}
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render() {
let {data,page,category,sort_by,sort_direction,project_packages}=this.state;
let {data,page,category,sort_by,sort_direction,project_packages,
isRender,AccountProfiletype
}=this.state;
return (
<div className="educontent clearfix mtf10" style={{flex: "1 0 auto"}}>
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.state}
{...this.props}
/>:""}
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
<div className="stud-class-set">
<div className="news">
<div className="edu-class-inner container clearfix">
@ -153,12 +216,12 @@ class PackageConcent extends Component {
<p className="clearfix" >
<p style={{height: '50px'}}>
<Search placeholder="输入标题名称进行检索"
style={{ width: 749}}
className="packinput"
enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>}
onSearch={ (value)=>this.setdatafuns(value)} />
<Button type="primary" className="setissues fr" size={"large"}>
<a href="/crowdsourcings/new" >发布需求</a>
<a onClick={()=>this.onReleaseRequirements("/crowdsourcing/new")}>发布需求</a>
</Button>
</p>
</p>
@ -207,7 +270,7 @@ class PackageConcent extends Component {
</p>
</div>
<Spin size="large" spinning={this.state.isSpin}>
{project_packages&&project_packages.map((item,key)=>{
return(
<div className="educontent project-packages-list mb30" key={key}>
@ -224,14 +287,14 @@ class PackageConcent extends Component {
<div className=" item-head-title">
<a className={"fl mt3 font-20 font-bd color-dark maxwidth700 "}
href={"/crowdsourcings/"+item.id}
onClick={()=>this.onReleaseRequirements("/crowdsourcing/"+item.id)}
title={item.title}
>{item.title}</a>
</div>
<div className=" item-head-blank"></div>
<div className=" item-head-price">
<div className=" item-head-price mtf12">
{item.min_price===null?"":<span>{item.min_price}</span>}
{item.max_price===null||item.min_price===null?"":<span>~</span>}
{item.max_price===null?"":<span>{item.max_price}</span>}
@ -252,16 +315,16 @@ class PackageConcent extends Component {
<div className=" item-group item-other-deadline">
<span className=" item-group-icon mr10"><i className="fa fa-clock-o"></i></span>
<span className=" item-group-text">{moment(item.deadline_at).endOf('day').fromNow()}竞标截止</span>
<span className=" item-group-text">{moment(item.deadline_at).format("YYYY-MM-DD HH:mm")}竞标截止</span>
</div>
<div className=" item-group item-other-bidding ml0">
<div className=" item-group item-other-bidding ml0 pagemancenter">
<span className=" item-group-icon mr10"><i className="fa fa-user" ></i></span>
<span className=" item-group-text">{item.bidding_users_count}人竞标</span>
</div>
<div className=" item-other-blank"></div>
{/*<div className=" item-other-blank"></div>*/}
<div className=" item-group item-other-publish-at">
{item.published_at===null?<span className="item-group-text">更新于{moment(item.updated_at).format("YYYY-MM-DD HH:mm")} </span>:
<span className=" item-group-text">发布于{moment(item.published_at).format("YYYY-MM-DD HH:mm")} </span>}
@ -274,6 +337,7 @@ class PackageConcent extends Component {
</div>
)
})}
</Spin>
{project_packages&&project_packages.length===0?<div className="edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src="https://www.educoder.net/images/educoder/nodata.png" />

@ -230,7 +230,8 @@ class PackageIndexNEITaskDetails extends Component {
}
goback = () => {
// window.history.go(-1)
window.location.href="/crowdsourcings";
// window.location.href="/crowdsourcing";
this.props.history.goBack()
}
render() {
@ -252,7 +253,7 @@ class PackageIndexNEITaskDetails extends Component {
<Breadcrumb separator={'>'} className={"fl"}>
{/*<Breadcrumb.Item>{this.props.current_user.username}</Breadcrumb.Item>*/}
<Breadcrumb.Item>
<a href="/crowdsourcings">众包创新</a>
<a href="/crowdsourcing">众包创新</a>
</Breadcrumb.Item>
<Breadcrumb.Item><span className={"tabelcli"} title={data&&data.title}>{data&&data.title}</span></Breadcrumb.Item>
@ -292,8 +293,8 @@ class PackageIndexNEITaskDetails extends Component {
onMouseOver={this.setover}
onMouseOut={this.setout}
>
{overtype===false?<a className="ContacttheTA fl" target="_blank" href={`/users/${data&&data.creator.login}/message_detail?user_id=${data&&data.creator.id}`}> <img alt="头像" class="mr5" src={require('./newsone.png')} />联系TA</a>:
<a className="ContacttheTAs fl" target="_blank" href={`/users/${data&&data.creator.login}/message_detail?user_id=${data&&data.creator.id}`}> <img alt="头像" className="mr5"
{overtype===false?<a className="ContacttheTA fl" target="_blank" href={`/message/${data&&data.creator.login}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" class="mr5" src={require('./newsone.png')} />联系TA</a>:
<a className="ContacttheTAs fl" target="_blank" href={`/message/${data&&data.creator.login}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" className="mr5"
src={require('./newstwo.png')}/>联系TA</a>}
</div>}
</div>
@ -312,7 +313,7 @@ class PackageIndexNEITaskDetails extends Component {
</span>
</div>
<div className=" item-head-price mtf7">
<div className=" item-head-price mt2">
{data&&data.min_price===null?"":<span><span className={"font-24"}>{data&&data.min_price}</span></span>}
{data&&data.max_price===null||data&&data.min_price===null?"":<span>~</span>}
{data&&data.max_price===null?"":<span><span className={"font-24"}>{data&&data.max_price}</span></span>}
@ -353,7 +354,7 @@ class PackageIndexNEITaskDetails extends Component {
需求详情
{data&&data.status==="pending"&&data&&data.operation.can_select_bidding_user===true?<div className="fr">
<a className="task-btn-nebules fr" href={`/crowdsourcings/${this.props.match.params.id}/edit`}>编辑</a>
<a className="task-btn-nebules fr" href={`/crowdsourcing/${this.props.match.params.id}/edit`}>编辑</a>
<a className="task-btn-nebules fr" onClick={this.deletePackages}>删除</a>
</div>:""}
@ -406,7 +407,7 @@ class PackageIndexNEITaskDetails extends Component {
{item.status==="bidding_won"?<img src={gouxuan} className="yslgouxuanimg"/>:""}
<a href={`/users/${item.login}`}><img className="div1imgs" src={getImageUrl("images/"+item.image_url)}/></a>
<div className="textall mt10" title={item.name}> <p className="ptext">{item.name}</p></div>
{this.props.current_user&&this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" target="_blank" href={`/users/${item.login}/message_detail?user_id=${item.id}`}>
{this.props.current_user&&this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" target="_blank" href={`/message/${item.login}/message_detail?target_ids=${item.id}`}>
<img alt="头像" className="mr5" src={require('./newstwo.png')}/>联系TA
</a>:""}
</div>

@ -43,6 +43,12 @@ function disabledDateTime() {
disabledMinutes: () => range(1, 30).concat(range(31, 60)),
};
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
class PackageIndexNEIBannerConcent extends Component {
constructor(props) {
super(props)
@ -50,7 +56,7 @@ class PackageIndexNEIBannerConcent extends Component {
this.state = {
modalCancel:false,
getverificationcodes:true,
seconds:35,
seconds:60,
springtype:false,
category:undefined,
title:undefined,
@ -83,7 +89,7 @@ class PackageIndexNEIBannerConcent extends Component {
deadline_at:moment(data.deadline_at),
min_price:data.min_price,
max_price:data.max_price,
contact_name:data.contact_name==null||data.contact_name==undefined?this.props.current_user.username:data.contact_name,
contact_name:data.contact_name==null||data.contact_name==undefined?this.props.current_user.real_name:data.contact_name,
phones:data.contact_phone,
attachments:data.attachments,
@ -93,7 +99,7 @@ class PackageIndexNEIBannerConcent extends Component {
})
}else{
console.log(this.props.current_user&&this.props.current_user.username)
console.log(this.props.current_user&&this.props.current_user.real_name)
}
let Url = `/project_package_categories.json`;
@ -112,7 +118,7 @@ class PackageIndexNEIBannerConcent extends Component {
})
this.setState({
contact_name:this.props.current_user&&this.props.current_user.username
contact_name:this.props.current_user&&this.props.current_user.real_name
})
// this.contentMdRef.current.setValue("测试赋值")
@ -123,7 +129,7 @@ class PackageIndexNEIBannerConcent extends Component {
if(prevProps.current_user!=this.props.current_user){
if(this.props.current_user!=undefined){
this.setState({
contact_name:this.props.current_user.username
contact_name:this.props.current_user.real_name
})
}
}
@ -151,7 +157,7 @@ class PackageIndexNEIBannerConcent extends Component {
clearInterval(timer);
this.setState({
getverificationcodes: false,
seconds: 35,
seconds: 60,
})
}
});
@ -170,7 +176,7 @@ class PackageIndexNEIBannerConcent extends Component {
clearInterval(timer);
this.setState({
getverificationcodes: false,
seconds: 35,
seconds: 60,
})
}
@ -183,11 +189,11 @@ class PackageIndexNEIBannerConcent extends Component {
//短信验证
SMSverification = () => {
let {contact_phone,code}=this.state;
var url = `/account/get_verification_code.json`;
var url = `/accounts/get_verification_code.json`;
axios.get((url), {
params: {
value: contact_phone,
type: 9,
login: contact_phone,
type: 5,
}
}).then((result) => {
//验证有问题{"status":1,"message":"success"}
@ -452,7 +458,7 @@ class PackageIndexNEIBannerConcent extends Component {
deadline_at:deadline_at._i,
min_price:parseInt(min_price),
max_price:parseInt(max_price),
contact_name: contact_name===null||contact_name===undefined?this.props.current_user.username:contact_name,
contact_name: contact_name===null||contact_name===undefined?this.props.current_user.real_name:contact_name,
contact_phone: contact_phone===undefined?this.props.current_user&&this.props.current_user.phone:contact_phone,
code:code,
publish:types
@ -462,7 +468,7 @@ class PackageIndexNEIBannerConcent extends Component {
if(type===true){
this.props.setPublicationfun(response.data.id)
}else{
window.location.href="/crowdsourcings/"+response.data.id
window.location.href="/crowdsourcing/"+response.data.id
}
this.setState({
springtype:false
@ -500,7 +506,7 @@ class PackageIndexNEIBannerConcent extends Component {
deadline_at:deadline_at._i,
min_price:parseInt(min_price),
max_price:parseInt(max_price),
contact_name: contact_name===null||contact_name===undefined?this.props.current_user.username:contact_name,
contact_name: contact_name===null||contact_name===undefined?this.props.current_user.real_name:contact_name,
contact_phone: contact_phone===undefined?this.props.current_user&&this.props.current_user.phone:contact_phone,
code:code,
publish:types
@ -510,7 +516,7 @@ class PackageIndexNEIBannerConcent extends Component {
if(type===true){
this.props.setPublicationfun(response.data.id)
}else{
window.location.href="/crowdsourcings/"+response.data.id
window.location.href="/crowdsourcing/"+response.data.id
}
this.setState({
springtype:false
@ -714,9 +720,9 @@ class PackageIndexNEIBannerConcent extends Component {
<Spin size="large" spinning={this.state.springtype} >
<p className="clearfix" id={"publishtimestart"}>
<div className={"stud-class-set pd30a0 coursenavbox edu-back-white pb20"}>
<div className={"stud-class-set pd30a0 edu-back-white pb20"}>
<div className={"ant-row contentbox mdInForm mb20"}>
<div className="ant-form-item-label mb10">
<div className="ant-form-item-label mb20">
<label htmlFor="coursesNew_description" className="ant-form-item-requireds font-16">请选择需求类型</label>
</div>
@ -729,9 +735,10 @@ class PackageIndexNEIBannerConcent extends Component {
})}
</div>
</p>
{this.state.categorytypes===true?<div className={"color-red"}>请选择类型</div>:""}
<div className="ant-form-item-label mb10">
{this.state.categorytypes===true?<div className={"color-red mb10"}>请选择类型</div>:""}
<div className="ant-form-item-label mb15">
<label htmlFor="coursesNew_description" className="ant-form-item-requireds font-16" >需求标题和详情</label>
</div>
@ -805,6 +812,8 @@ class PackageIndexNEIBannerConcent extends Component {
placeholder="请选择任务的竞标截止日期"
className={"fafas"}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
dropdownClassName="hideDisable"
value={this.state.deadline_at}
onChange={this.onChangeTimePicker}
/>
@ -848,7 +857,7 @@ class PackageIndexNEIBannerConcent extends Component {
<Input
className={"fafafas"}
style={{"width": "260px"}}
value={this.state.contact_name===null||this.state.contact_name===undefined?this.props.current_user&&this.props.current_user.username:this.state.contact_name}
value={this.state.contact_name===null||this.state.contact_name===undefined?this.props.current_user&&this.props.current_user.real_name:this.state.contact_name}
placeholder="请输入姓名"
onInput={(e)=>this.onChangeContact_name(e)}
/>

@ -14,10 +14,10 @@ class PackageIndexNEISubmit extends Component {
}
setageload=(sum)=>{
if(sum===undefined){
window.location.href="/crowdsourcings/new"
window.location.href="/crowdsourcing/new"
}else{
// this.props.history.push("/project_packages/"+sum)
window.location.href="/crowdsourcings/"+sum
window.location.href="/crowdsourcing/"+sum
}
}

@ -30,7 +30,8 @@ class PackageIndexNewandEditIndex extends Component{
goback = () => {
// window.history.go(-1)
window.location.href="/crowdsourcings";
// window.location.href="/crowdsourcing";
this.props.history.goBack()
}
render() {

@ -43,25 +43,25 @@ class ProjectPackageIndex extends Component {
<Switch>
{/*众包首页*/}
<Route path="/crowdsourcings/:id/edit"
<Route path="/crowdsourcing/:id/edit"
render={
(props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/crowdsourcings/new"
<Route path="/crowdsourcing/new"
render={
(props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/crowdsourcings/:id"
<Route path="/crowdsourcing/:id"
render={
(props) => (<PackageIndexNEITaskDetails {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/crowdsourcings"
<Route path="/crowdsourcing"
render={
(props) => (<PackageIndex {...this.props} {...props} {...this.state} />)
}

@ -7,6 +7,11 @@
border-color: #E1EDF8 !important;
}
.packinput{
width:749px;
}
.packinput .ant-input-group-addon .ant-btn{
width:140px !important;
font-size: 18px;
@ -357,4 +362,8 @@
*, *::before, *::after {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.mtf12{
margin-top: -12px;
}

@ -114,16 +114,15 @@ class NewHeader extends Component {
//
// }
}
openNotification = (messge) => {
notification.open({
message: "提示",
description:
messge,
onClick: () => {
console.log('Notification Clicked!');
},
});
};
componentWillReceiveProps(newProps, oldProps) {
this.setState({
user:newProps.user
@ -408,59 +407,62 @@ submittojoinclass=(value)=>{
return
}
if(value===0){
let url="/courses/join_course_multi_role.json"
const form = new FormData();
form.append('invite_code', tojoinclasstitle);
form.append('role', pamst);
form.append('type', 1);
axios.post(url,form,[true]
).then((response) => {
if( response.data.state===0){
this.submitstatevalue(0,"加入成功",response.data.course_id)
}else if( response.data.state===1){
}else if( response.data.state===2){
this.submitstatevalue( 0,"课堂已过期! 请联系课堂管理员重启课堂。(在配置课堂处)")
}else if( response.data.state===3){
this.submitstatevalue( 0,"您已是课堂成员)",response.data.course_id)
}else if( response.data.state===4){
this.submitstatevalue( 0,"您输入的邀请码错误)")
}else if( response.data.state===5){
this.submitstatevalue( 0,"您还未登录")
}else if( response.data.state===6){
this.submitstatevalue( 0,"申请已提交,请等待审核")
}else if( response.data.state===7){
this.submitstatevalue( 0," 您已经发送过申请了,请耐心等待")
}else if( response.data.state===8){
this.submitstatevalue( 0,"您已经是该课堂的教师了",response.data.course_id)
}else if( response.data.state==9){
this.submitstatevalue( 0,"您已经是该课堂的教辅了",response.data.course_id)
}else if( response.data.state==10){
this.submitstatevalue(0,"您已经是该课堂的管理员了",response.data.course_id)
}else if( response.data.state==11){
this.submitstatevalue(0," 该课堂已归档,请联系老师")
}else if( response.data.state==12){
this.submitstatevalue(0,"您已经发送过申请了,请耐心等待师")
}else if( response.data.state==13){
this.submitstatevalue(0,"您申请已提交,请等待审核")
}else if( response.data.state==14){
this.submitstatevalue("此邀请码已停用,请与老师联系")
}else if( response.data.state==15){
this.submitstatevalue(0,"您已是课堂成员! 加入分班请在课堂具体分班页面进行")
}else {
this.submitstatevalue(0," 未知错误,请稍后再试")
}
})
}
// if(value===0){
// let url="/courses/join_course_multi_role.json"
// const form = new FormData();
// form.append('invite_code', tojoinclasstitle);
// form.append('role', pamst);
// form.append('type', 1);
// axios.post(url,form,[true]
// ).then((response) => {
// if( response.data.state===0){
// this.submitstatevalue(0,"加入成功",response.data.course_id)
// }else if( response.data.state===1){
// }else if( response.data.state===2){
// this.submitstatevalue( 0,"课堂已过期! 请联系课堂管理员重启课堂。(在配置课堂处)")
// }else if( response.data.state===3){
// this.submitstatevalue( 0,"您已是课堂成员)",response.data.course_id)
// }else if( response.data.state===4){
// this.submitstatevalue( 0,"您输入的邀请码错误)")
// }else if( response.data.state===5){
// this.submitstatevalue( 0,"您还未登录")
// }else if( response.data.state===6){
// this.submitstatevalue( 0,"申请已提交,请等待审核")
// }else if( response.data.state===7){
// this.submitstatevalue( 0," 您已经发送过申请了,请耐心等待")
// }else if( response.data.state===8){
// this.submitstatevalue( 0,"您已经是该课堂的教师了",response.data.course_id)
// }else if( response.data.state==9){
// this.submitstatevalue( 0,"您已经是该课堂的教辅了",response.data.course_id)
// }else if( response.data.state==10){
// this.submitstatevalue(0,"您已经是该课堂的管理员了",response.data.course_id)
// }else if( response.data.state==11){
// this.submitstatevalue(0," 该课堂已归档,请联系老师")
// }else if( response.data.state==12){
// this.submitstatevalue(0,"您已经发送过申请了,请耐心等待师")
// }else if( response.data.state==13){
// this.submitstatevalue(0,"您申请已提交,请等待审核")
// }else if( response.data.state==14){
// this.submitstatevalue("此邀请码已停用,请与老师联系")
// }else if( response.data.state==15){
// this.submitstatevalue(0,"您已是课堂成员! 加入分班请在课堂具体分班页面进行")
// }else {
// this.submitstatevalue(0," 未知错误,请稍后再试")
// }
// })
//
// }
if(value===1){
let url="/api/applied_project/applied_project_info.json"
const form = new FormData();
form.append('invite_code', tojoinclasstitle);
form.append('member', RadioGroupvalue);
form.append('type', 1);
axios.post(url,form,[true]
let url="/project_applies.json"
// const form = new FormData();
// form.append('code', tojoinclasstitle);
// form.append('role', RadioGroupvalue);
// form.append('type', 1);
axios.post(url,{
code:tojoinclasstitle,
role:RadioGroupvalue
}
).then((response) => {
if( response.data.status===1){
this.submitstatevalue(1,"您输入的邀请码错误")
@ -474,9 +476,17 @@ submittojoinclass=(value)=>{
this.submitstatevalue( 1,"您已经申请加入该项目了,请耐心等待")
}else if( response.data.status===6){
this.submitstatevalue( 1,"您已成功加入项目",response.data.project)
}
}else if( response.data.status===0){
if(RadioGroupvalue==="reporter"){
this.openNotification("您加入项目成功!");
window.location.href=`/projects/${response.data.project_id}`;
}else{
this.openNotification("您的申请已提交,请等待项目管理员审批!");
}
}
})
}
this.hidetojoinclass()
}
// trialapplications =()=>{
@ -617,8 +627,10 @@ submittojoinclass=(value)=>{
let activeShixuns = false;
let activePaths = false;
let coursestype=false;
let activePackages=false;
if (match.path === '/forums') {
if (match.path === '/forums') {
activeForums = true;
} else if (match.path.startsWith('/shixuns')) {
activeShixuns = true;
@ -626,14 +638,12 @@ submittojoinclass=(value)=>{
activePaths = true;
} else if (match.path.startsWith('/courses')) {
coursestype = true;
}else {
}else if (match.path.startsWith('/crowdsourcing')) {
activePackages = true;
}else {
activeIndex = true;
}
// join_course_url: "https://www.educoder.net/courses/join_course_multi_role"
// join_project_url: "https://www.educoder.net/applied_project/applied_project_info"
// rolearr:["",""],
// console.log("618");
// console.log(user_phone_binded);
return (
<div className="newHeader" id="nHeader" >
@ -716,10 +726,9 @@ submittojoinclass=(value)=>{
/>
</li>
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.moop_cases_url}>教学案例</a></li>
<li className=""><a
// href={this.props.Headertop===undefined?"":this.props.Headertop.crowdsourcing_url}
href={'/crowdsourcings'}
>众包创新</a></li>
<li className={`${activePackages === true ? 'pr active' : 'pr'}`}>
<a href={'/crowdsourcing'}>众包创新</a>
</li>
<li className={`${activeForums === true ? 'active' : ''}`}><a href={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</a></li>
<li
style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}}
@ -816,7 +825,7 @@ submittojoinclass=(value)=>{
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>我的实践课程</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的项目</Link></li>
{/*<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li>*/}
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li>
<li><a href={`/account/profile`}>账号管理</a></li>
{/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/}
{/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/}
@ -870,9 +879,9 @@ submittojoinclass=(value)=>{
{/* /courses/join_course_multi_role */}
{/*<li>*/}
<a onClick={this.tojoinitem}>加入项目</a>
<a onClick={this.tojoinitem}>加入项目</a>
{/*</li>*/}
<Modal
{tojoinitemtype===true?<Modal
keyboard={false}
title="加入项目"
visible={tojoinitemtype}
@ -897,15 +906,15 @@ submittojoinclass=(value)=>{
<label className="panel-form-label fl">身份</label>
<RadioGroup className="mt10" onChange={this.onChangeRadioGroup}>
<Radio value={1}>管理人员</Radio>
<Radio value={2}>开发人员</Radio>
<Radio value={3}>报告人员</Radio>
<Radio value={"manager"}>管理人员</Radio>
<Radio value={"developer"}>开发人员</Radio>
<Radio value={"reporter"}>报告人员</Radio>
</RadioGroup>
</li>
<p id="none_checked_notice" className="color-orange none f12"
style={{marginLeft: '90px',display:checked_notice===true?'block':"none"}}>至少选择一个身份</p>
style={{marginLeft: '90px',display:checked_notice===true?'block':"none"}}>选择一个身份</p>
<li className="clearfix mt10 edu-txt-center">
<a className="task-btn mr10"
@ -918,14 +927,14 @@ submittojoinclass=(value)=>{
</ul>
</div>
</div>
</Modal>
</Modal>:""}
</ul>
</div>
</div>
<div className="fl mr30 edu-menu-panel headIcon">
{ user===undefined?"":user.login===""?"": <a
href={this.props.Headertop===undefined?"":this.props.Headertop.message_url}
href={`/message/${user.user_id}/user_tidings`}
style={{position:'relative'}}
>
<i className="iconfont icon-xiaoxilingdang color-white"></i>

@ -32,14 +32,14 @@ if (!window['indexHOCLoaded']) {
// $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?15254409771`));
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?7`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?15254409781`));
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?7`));
// index.html有加载
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?15254409781`));
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?7`));
// $('head').append($('<link rel="stylesheet" type="text/css" />')
@ -264,7 +264,10 @@ export function TPMIndexHOC(WrappedComponent) {
"is_teacher": false,
"tidding_count": 0
}
*/
*/
if(response=== undefined){
return
}
if (response.data) {
this.initCommonState(response.data)
this.setState({
@ -306,13 +309,11 @@ export function TPMIndexHOC(WrappedComponent) {
<style>{
`
.newContainers{
width: 100%;
/*min-width: 1440px;*/
max-width: unset;
min-width: 1200px;
max-width: unset;
overflow: hidden;
}
// .-task-sidebar{
// right: 270px !important;
// }
`
}</style>
<NewHeader {...this.state} {...this.props}></NewHeader>

@ -339,9 +339,6 @@ export default class TPMevaluation extends Component {
goblakepath=(path,key)=>{
let {main,selectpath,pathtype} =this.state;
let newmain=[]
for(var i=0;i<=key;i++){
newmain.push(main[i])
@ -366,16 +363,20 @@ export default class TPMevaluation extends Component {
});
if(pathtype===2){
// var str=path;
// str.slice(0,str.length-1)
// debugger
// console.log(str)
let paths = path.substring(0,path.length-1);
console.log(paths)
this.setState({
selectpath: path,
selectpath: paths,
})
}
}
// delesavegetfilepath=(value)=>{
// let {selectpatharr} = this.state
// let newarr =selectpatharr;
@ -674,6 +675,7 @@ export default class TPMevaluation extends Component {
this.setState({
selectpath:e.target.value
})
}
updatepath=(e,name,type)=>{
this.setState({
@ -949,6 +951,8 @@ export default class TPMevaluation extends Component {
<Option value={2}>apk/exe</Option>
<Option value={3}>txt</Option>
<Option value={4}>html</Option>
<Option value={5}>mp3</Option>
<Option value={6}>mp4</Option>
</Select>
<a className="ml10" onClick={()=>this.showrepositoryurltip(1)}><img src={getImageUrl("images/educoder/problem.png")}/></a>
<div className="invite-tip clearfix repository_url_tippostion" style={{display:showrepositoryurltiptype===true?"block":"none"}} id="repository_url_tip"
@ -975,20 +979,20 @@ export default class TPMevaluation extends Component {
</div>
{pathoptionvalue===1?<div className="edu-back-white mb10 clearfix">
{pathoptionvalue===1||pathoptionvalue===5||pathoptionvalue===6?<div className="edu-back-white mb10 clearfix">
<div className="padding40-20">
<p className="color-grey-6 font-16 mb20">待处理图片路径</p>
<p className="color-grey-6 font-16 mb20">待处理文件路径</p>
<div className="df">
<div className="flex1 mr20">
<input type="text" className="input-100-45" autoComplete="off"
id="shixun_file_expect_picture_path" name="challenge[original_picture_path]"
placeholder="请选择版本库中存储了待处理图片的路径。例src/step1/expectedimages"
placeholder="请选择版本库中存储了待处理文件(图片/MP3等)的路径。例src/step1/sourcefiles"
value={shixunfileexpectpicturepath}
onInput={(e)=>this.updatepath(e,"shixunfileexpectpicturepath",2)}
onClick={(e)=>this.getfilepath(e,"shixunfileexpectpicturepath",2)}
/>
<p className="color-grey-9 mt15">
该路径下的文件将在学员评测本关任务时作为原始图片显示在查看效果页供学员参考,任务为图片处理时请指定该路径并注意与程序文件所在文件夹分开
该路径下的文件将在学员评测本关任务时作为原始文件显示在查看效果页供学员参考任务为文件处理时请指定该路径并注意与程序文件所在文件夹分开
</p>
</div>
<div></div>
@ -997,20 +1001,20 @@ export default class TPMevaluation extends Component {
</div>:""}
{pathoptionvalue===1? <div className="edu-back-white mb10 clearfix">
{pathoptionvalue===1||pathoptionvalue===5||pathoptionvalue===6? <div className="edu-back-white mb10 clearfix">
<div className="padding40-20">
<p className="color-grey-6 font-16 mb20">标准答案图片路径</p>
<p className="color-grey-6 font-16 mb20">标准答案文件路径</p>
<div className="df">
<div className="flex1 mr20">
<input type="text" className="input-100-45" autoComplete="off"
id="shixun_file_standard_picture_path" name="challenge[expect_picture_path]"
placeholder="请选择版本库中存储了标准答案代码输出文件的路径。例src/step1/expectedimages"
placeholder="请选择版本库中存储了标准答案文件(图片/MP3等)的路径。例src/step1/expectedfiles"
value={shixunfilestandardpicturepath}
onInput={(e)=>this.updatepath(e,"shixunfilestandardpicturepath",2)}
onClick={(e)=>this.getfilepath(e,"shixunfilestandardpicturepath",2)}
/>
<p className="color-grey-9 mt15">
该路径下的文件将在学员评测本关任务时作为参考答案显示在查看效果页供学员参考任务输出结果为文件时请指定该路径并注意与程序文件所在文件夹分开
该路径下的文件将在学员评测本关任务时作为参考答案显示在查看效果页供学员参考任务输出结果为文件时请指定该路径并注意与程序文件所在文件夹分开
</p>
</div>
<div></div>
@ -1029,9 +1033,9 @@ export default class TPMevaluation extends Component {
value={shixunfilepicturepath}
onInput={(e)=>this.updatepath(e,"shixunfilepicturepath",2)}
onClick={(e)=>this.getfilepath(e,"shixunfilepicturepath",2)}
placeholder="请在版本库中指定用来保存学员代码实际输出结果的路径。例src/step1/outputimages"/>
placeholder="请在版本库中指定用来保存学员代码实际输出结果的路径。例src/step1/outputfiles"/>
<p className="color-grey-9 mt15">
学员评测本关任务时生成的文件将保存在该路径下并作为实际输出显示在查看效果页供学员确认任务输出结果为文件时请指定该路径并注意与程序文件所在文件夹分开
学员评测本关任务时生成的文件将保存在该路径下并作为实际输出显示在查看效果页供学员确认任务输出结果为文件时请指定该路径并注意与程序文件所在文件夹分开
</p>
</div>
<div></div>
@ -1066,16 +1070,16 @@ export default class TPMevaluation extends Component {
<p className="color-grey-9 mb20"
style={{width:'100%',height:'20px',display:scorevalue===true?'block':'none'}}
>
<span className={"headdfgf color979797"} style={{width:'500px'}} >
系统评分占比
<RadioGroup
value={markvalue}
onChange={this.onChangemarkvalue}
>
<Radio value={true}>均分比例</Radio>
<Radio value={false}>自定义比例</Radio>
</RadioGroup>
</span>
<span className={"headdfgf color979797"} style={{width:'500px'}} >
系统评分占比
<RadioGroup
value={markvalue}
onChange={this.onChangemarkvalue}
>
<Radio value={true}>均分比例</Radio>
<Radio value={false}>自定义比例</Radio>
</RadioGroup>
</span>
</p>

@ -264,5 +264,5 @@
margin: 0 auto;
}
.ant-input-affix-wrapper .ant-input-prefix, .ant-input-affix-wrapper .ant-input-suffix {
background: #ffffff!important;
background: transparent !important;
}

@ -357,7 +357,7 @@ class Infos extends Component{
:
<div className="inline">
<a href="javascript:void(0);" onClick={this.followPerson} className="user_default_btn user_watch_btn user_private_btn fl mr20">{followed ? "取消关注":"关注"}</a>
<a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${login}/message_detail?user_id=${id}`} className="user_default_btn user_private_btn fl">私信</a>
<a href={`${this.props.Headertop && this.props.Headertop.old_url}/message/${login}/message_detail?target_ids=${id}`} className="user_default_btn user_private_btn fl">私信</a>
</div>
}
</div>
@ -404,11 +404,11 @@ class Infos extends Component{
{/* 众包 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */}
<Route exact path="/users/:username/package"
render={
(props) => (<InfosPackage {...this.props} {...props} {...this.state} />)
}
></Route>
{/*<Route exact path="/users/:username/package"*/}
{/*render={*/}
{/*(props) => (<InfosPackage {...this.props} {...props} {...this.state} />)*/}
{/*}*/}
{/*></Route>*/}
{/* 课堂 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */}

@ -2,16 +2,35 @@ import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination,Spin} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import axios from 'axios';
import NoneData from '../../courses/coursesPublic/NoneData'
import {getImageUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import NoneData from '../../courses/coursesPublic/NoneData'
import "./usersInfo.css"
import Create from './publicCreatNew'
import moment from 'moment';
let categorylist=[
{name:"全部",value:undefined},
{name:"前端开发",value:"front"},
{name:"后端开发",value:"backend"},
{name:"移动开发",value:"mobile"},
{name:"数据库",value:"database"},
{name:"云计算和大数据",value:"cloud_compute_and_big_data"},
{name:"人工智能",value:"ai"},
{name:"运维与测试",value:"devops_and_test"},
{name:"其他",value:"other"},
]
//
function setcategorylist(val){
let vals=""
categorylist.some((item,key)=> {
if (item.name === val) {
vals=item.value
return true
}
}
)
return vals
}
class InfosPackage extends Component{
constructor(props){
super(props);
@ -19,8 +38,8 @@ class InfosPackage extends Component{
category:undefined,
status:undefined,
page:1,
per_page:16,
per_page:20,
sort_direction:'desc',
totalCount:undefined,
data:undefined,
isSpin:false
@ -36,12 +55,14 @@ class InfosPackage extends Component{
}
getCourses=(category,status,page)=>{
let url=`/users/${this.props.match.params.username}/courses.json`;
let url=`/users/${this.props.match.params.username}/project_packages.json`;
axios.get((url),{params:{
category,
status,
page,
per_page: this.props.is_current && category && page ==1?17:16
sort_by:"published_at",
sort_direction:'desc',
per_page:20
}}).then((result)=>{
if(result){
this.setState({
@ -103,21 +124,98 @@ class InfosPackage extends Component{
} = this.state;
let is_current=this.props.is_current;
console.log(this.props.current_user&&this.props.current_user.user_identity==="学生")
// console.log(data)
return(
<div className="educontent">
<div className="educontent mb50">
<Spin size="large" spinning={isSpin}>
<div className="white-panel edu-back-white pt25 pb25 clearfix ">
<li className={category ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeCategory()}>全部</a></li>
<li className={category=="manage" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的</a></li>
<li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}参与的</a></li>
<li className={category ? "" : "active"}><a onClick={()=>this.changeCategory()}>全部</a></li>
<li className={category=="manage" ? "active" : ""}><a onClick={()=>this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的</a></li>
<li className={category=="bidden" ? "active" : ""}><a onClick={()=>this.changeCategory("bidden")}>{is_current ? "我":"TA"}参与的</a></li>
</div>
{
category=="manage"?
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="unpublished" ? "active" : ""}><a onClick={()=>this.changeStatus("unpublished")}>未发布</a></li>
<li className={status=="bidding" ? "active" : ""}><a onClick={()=>this.changeStatus("bidding")}>竞标中</a></li>
<li className={status=="finished" ? "active" : ""}><a onClick={()=>this.changeStatus("finished")}>已完成</a></li>
</div>: category=="bidden"?
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="bidding_lost" ? "active" : ""}><a onClick={()=>this.changeStatus("bidding_lost")}>未中标</a></li>
<li className={status=="bidding_won" ? "active" : ""}><a onClick={()=>this.changeStatus("bidding_won")}>已中标</a></li>
</div>:""
}
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
<span className="fl color-grey-9">{0}</span>
<span className="fl color-grey-9">{totalCount}</span>
<span className="fr color-grey-9">发布时间</span>
</p>
{/*bidden_status: "pending"*/}
{/*category_id: 2*/}
{/*status: "published"*/}
{/*type: "bidden"*/}
{data===undefined?<NoneData></NoneData>:data.project_packages.length===0?<NoneData></NoneData>:data.project_packages.map((item,key)=>{
return(
<div className="educontent project-packages-list" key={key}>
<div className="project-package-item project-package-11">
<div className="item-image">
<img alt="图片" src={`/images/educoder/project_packages/${setcategorylist(item.category_name)}.png`} />
</div>
<div className="item-body">
<div className="item-head">
<div className="item-head-title" title={item.title}>
<a href={`/crowdsourcing/${item.id}`}>{item.title}</a>
</div>
<div className="item-head-tags">
</div>
<div className="item-head-blank"></div>
<div className="item-head-price mtf15">
{item.min_price===null?"":<span>{item.min_price}</span>}
{item.max_price===null||item.min_price===null?"":<span>~</span>}
{item.max_price===null?"":<span>{item.max_price}</span>}
{item.min_price===null&&item.max_price===null?<span>可议价</span>:""}
</div>
</div>
<div className="item-category">
<div className="item-category-item">{item.category_name}</div>
</div>
<div className="item-other">
<div className="item-group item-other-visit">
<span className="item-group-icon"><i className="fa fa-eye"></i></span>
<span className="item-group-text">{item.visit_count}人浏览</span>
</div>
<div className="item-group item-other-deadline">
<span className="item-group-icon"><i className="fa fa-clock-o"></i></span>
<span className="item-group-text">{moment(item.deadline_at).format("YYYY-MM-DD HH:mm")}竞标截止</span>
</div>
<div className="item-group item-other-bidding pagemancenter">
<span className="item-group-icon"><i className="fa fa-user"></i></span>
<span className="item-group-text">{item.bidding_users_count}人竞标</span>
</div>
<div className="item-group item-other-publish-at">
{item.published_at===null?<span className="item-group-text">更新于{moment(item.updated_at).format("YYYY-MM-DD HH:mm")} </span>:
<span className=" item-group-text">发布于{moment(item.published_at).format("YYYY-MM-DD HH:mm")} </span>}
</div>
</div>
</div>
</div>
</div>
)})}
{
totalCount >20 &&
<div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={20} current={page}/>
</div>
}
</Spin>
</div>
)

@ -1,93 +1,97 @@
.navInfo{
border:none!important;
position: absolute;
width: 100%;
bottom: -8px;
}
.navInfo li {
float: left;
margin: 0px 40px;
padding:0px;
height: 45px;
line-height: 40px;
font-size: 16px;
position: relative;
}
.navInfo li.active::after{
position: absolute;
left: 0px;
height: 2px;
width: 100%;
content: '';
bottom: 0px;
background: #05101A!important;
color: #666!important;
}
.navInfo li,.navInfo li.ant-menu-item-active{
border-bottom: none!important;
color: #666!important;
}
.navInfo li.ant-menu-item-selected{
border-bottom: 2px solid #05101A!important;
color: #05101A!important;
}
.navInfo ul.ant-menu{float: left!important;border:none!important;}
.substancenenew{
width: 236px;
height: 206px;
background: rgba(248,248,248,1);
border: 2px dotted rgba(225,225,225,1);
opacity: 1;
border-radius: 4px;
padding-top: 50px;
position: inherit;
}
.substancepad{
padding: 20px 20px 0px 20px;
border-bottom: 1px solid transparent;
}
.substancefont{
height:24px;
font-size:18px;
font-family:Microsoft YaHei;
font-weight:400;
line-height:21px;
color:rgba(153,153,153,1);
opacity:1;
margin-top: -8px;
}
.topten{
width: 1px;
height: 100px;
border: 2px soild rgba(225,225,225,1);
background: rgba(225,225,225,1);
border: 1px solid rgba(225,225,225,1);
margin: 0 auto;
}
.leftten{
width: 100px;
height: 1px;
background: rgba(225,225,225,1);
border: 1px solid rgba(225,225,225,1);
margin: 0px auto;
position: absolute;
top: 120px;
left: 88px;
}
.squarebox{
position: absolute;
top: 0px;
left: 0px;
}
/*题库的标签--和资源标签样式相似*/
.bankTag{max-height: 82px;overflow-y: auto}
.bankTag #sourceTag li{margin-left: 0px;margin-right: 5px;}
.bank_list_Tag{cursor: default}
/*资源标签*/
#sourceTag li,.bank_list_Tag{font-size: 12px;color: #4E7A9B;background-color: #E5F3FF;padding: 0px 4px;height: 20px;line-height: 20px; margin-left: 5px;display: inline-block;cursor: pointer;margin-bottom: 5px;}
#sourceTag li a{color: #4e7a9b!important;}
#sourceTag li.active{background-color: #4CACFF;color: #fff;}
#sourceTag li.active a{background-color: #4CACFF;color: #fff!important;}
.navInfo{
border:none!important;
position: absolute;
width: 100%;
bottom: -8px;
}
.navInfo li {
float: left;
margin: 0px 40px;
padding:0px;
height: 45px;
line-height: 40px;
font-size: 16px;
position: relative;
}
.navInfo li.active::after{
position: absolute;
left: 0px;
height: 2px;
width: 100%;
content: '';
bottom: 0px;
background: #05101A!important;
color: #666!important;
}
.navInfo li,.navInfo li.ant-menu-item-active{
border-bottom: none!important;
color: #666!important;
}
.navInfo li.ant-menu-item-selected{
border-bottom: 2px solid #05101A!important;
color: #05101A!important;
}
.navInfo ul.ant-menu{float: left!important;border:none!important;}
.substancenenew{
width: 236px;
height: 206px;
background: rgba(248,248,248,1);
border: 2px dotted rgba(225,225,225,1);
opacity: 1;
border-radius: 4px;
padding-top: 50px;
position: inherit;
}
.substancepad{
padding: 20px 20px 0px 20px;
border-bottom: 1px solid transparent;
}
.substancefont{
height:24px;
font-size:18px;
font-family:Microsoft YaHei;
font-weight:400;
line-height:21px;
color:rgba(153,153,153,1);
opacity:1;
margin-top: -8px;
}
.topten{
width: 1px;
height: 100px;
border: 2px soild rgba(225,225,225,1);
background: rgba(225,225,225,1);
border: 1px solid rgba(225,225,225,1);
margin: 0 auto;
}
.leftten{
width: 100px;
height: 1px;
background: rgba(225,225,225,1);
border: 1px solid rgba(225,225,225,1);
margin: 0px auto;
position: absolute;
top: 120px;
left: 88px;
}
.squarebox{
position: absolute;
top: 0px;
left: 0px;
}
/*题库的标签--和资源标签样式相似*/
.bankTag{max-height: 82px;overflow-y: auto}
.bankTag #sourceTag li{margin-left: 0px;margin-right: 5px;}
.bank_list_Tag{cursor: default}
/*资源标签*/
#sourceTag li,.bank_list_Tag{font-size: 12px;color: #4E7A9B;background-color: #E5F3FF;padding: 0px 4px;height: 20px;line-height: 20px; margin-left: 5px;display: inline-block;cursor: pointer;margin-bottom: 5px;}
#sourceTag li a{color: #4e7a9b!important;}
#sourceTag li.active{background-color: #4CACFF;color: #fff;}
#sourceTag li.active a{background-color: #4CACFF;color: #fff!important;}
.mtf15{
margin-top:-15px;
}

@ -580,7 +580,7 @@ p .activity-item:first-child{border-top: 1px solid #eee;}
.recently_name{float: left;line-height: 48px;display: block}
.recently_item:hover{background-color: #F9F9F9;}
/*私信对话框*/
.private-list{min-height: 660px;max-height: 810px;overflow-y: auto}
.private-list{min-height: 660px;max-height: 831px;overflow-y: auto}
.private-list .private-part{padding-left:20px;cursor: pointer}
.private-part:hover{background-color: #F5F5F5;}
.private-part.active{background-color: #F5F5F5;}
@ -3361,4 +3361,358 @@ a.singlepublishtwo{
#trophyreturn i{
font-size: 16px!important;
color: #AAAAAA;
}
/*众包*/
.packinput .ant-input{
height: 50px;
width:749px;
border-color: #E1EDF8 !important;
}
.packinput{
width:749px;
}
.packinput .ant-input-group-addon .ant-btn{
width:140px !important;
font-size: 18px;
height: 50px;
background:rgba(76,172,255,1);
}
.setissues{
width:280px;
height:50px;
background:rgba(76,172,255,1);
border-radius:4px;
margin-left: 15px;
}
.pagetype li{
color:#8F8F8F !important;
}
.maxwidth700{
max-width: 700px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mbf10{
margin-bottom:-10px;
}
.PackageIndexNEIBanner{
width:1200px;
height:110px;
background:rgba(255,255,255,1);
box-shadow:0px 2px 6px 0px rgba(125,125,125,0.26);
border-radius:8px;
}
.padding110{
padding: 39px 110px 0px;
box-sizing: border-box;
}
.borderccc{
border: 1px solid #ccc;
}
.input-100-40s{
width: 100%;
padding: 5px;
box-sizing: border-box;
}
.fafafas{
background-color: #fafafa!important;
height: 40px;
}
.fafafas:focus{
background-color: #fff!important;
}
.fafas .ant-input{
background-color: #fafafa!important;
height: 40px;
}
.fafas .ant-input:focus{
background-color: #fff!important;
}
.fafas .ant-input-group-addon .ant-btn{
width:140px !important;
font-size: 14px;
height: 40px;
background:rgba(76,172,255,1);
}
.newFormbox .upload_filename{
line-height: 32px;
}
.newFormbox .attachment span{
line-height: 23px;
}
.newFormbox .attachment .remove-upload{
line-height: 28px;
}
.pd26a0{
padding: 26px 26px 16px 26px;
}
.newFormbox .attachment .icon-fujian{
font-size: 14px !important;
line-height: 14px;
margin-top: 9px;
}
.newFormbox{
height:20px
}
.ml24{
margin-left:24px;
}
.defalutCancelbtns{
display: block;
border: 1px solid #4CACFF !important;
background-color: #fff;
color: #4CACFF !important;
width:130px;
height:40px;
text-align: center;
line-height: 40px;
border-radius: 4px;
}
.defalutSubmitbtns{
background-color: #4CACFF;
height:40px;
}
.defalutSubmitbtnmodels{
width:127px;
height:30px;
background-color: #4CACFF;
}
.ant-steps-item-process .ant-steps-item-icon{
background-color: #4CACFF !important;
}
.ant-steps-item-process .ant-steps-item-icon{
background-color: #4CACFF !important;
}
.padding200{
padding: 115px 200px 215px 200px;
}
.fontcircle{
font-size: 80px;
display: inherit;
}
.sumbtongs{
font-size: 24px;
display: inherit;
text-align: center;
}
.terraces{
font-size: 16px;
display: inherit;
text-align: center;
color:#999;
}
.padding251{
padding: 0px 245px;
}
.ant-modal-title{
text-align: center;
}
.ml17{
margin-left: 17px;
}
.project-package-items{
display: -webkit-flex;
display: flex;
flex-direction: row;
margin:0px !important;
padding: 20px;
background: white;
margin-bottom:0px !important;
box-shadow: none !important;
}
.mtf7{
margin-top:-7px;
}
.publicpart.orangeGreen {
border-left: 80px solid #29BD8B;
}
.publicwords{
left: 3px;
top: 18px;
}
.project-packages-list .project-package-items .item-image{
width:100px !important;
}
.height185{
height: 185px;
}
.ContacttheTA{
width: 80px;
height: 26px;
font-size: 14px;
line-height: 26px;
display: block;
border: 1px solid #4CACFF !important;
background-color: #fff;
color: #4CACFF !important;
text-align: center;
border-radius: 4px;
}
.ContacttheTAs{
width: 80px;
height: 26px;
font-size: 14px;
line-height: 24px;
/*display: block;*/
border: 1px solid #fff !important;
background-color: #4CACFF;
color: #fff !important;
text-align: center;
border-radius: 4px;
}
.ml28{
margin-left: 28px;
}
.longboxs{
font-size: 16px;
font-family: MicrosoftYaHei-Bold;
font-weight: bold;
color: rgba(5,16,26,1);
border-left: 4px solid rgba(76,172,255,1);
padding-left: 10px;
margin-bottom: 20px;
}
.padding020{
padding: 0px 20px 20px;
}
.mtf3{
margin-top:-3px;
}
.task-btn-nebules{
background: #fff!important;
color: #4CACFF!important;
border: 1px solid #4CACFF!important;
margin-left: 20px;
cursor: pointer;
display: inline-block;
padding: 0 12px;
letter-spacing: 1px;
text-align: center;
font-size: 14px;
height: 30px;
line-height: 30px;
border-radius: 2px;
}
.packageabsolute{
position: absolute;
right: -16px;
top: -7px;
}
.relativef{
position: relative;
}
.homehove:hover .ptext{
color: #4CACFF!important;
}
.homehove:hover .ContacttheTAs{
display: block;
}
.topsj{
position: absolute;
top: -6px;
}
.bottomsj{
position: absolute;
bottom: -6px;
}
.touchSelect .ant-spin-dot-spin{
margin-top: 30% !important;
}
.pagenoedits{
margin-left: 20px;
color: #ccc;
}
.pagemancenter{
text-align: center;
}
.ml0{
margin-left: 0px;
}
.tabelcli{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 850px;
display: table-cell;
}
.mtf10{
margin-top:-10px;
}
.padding26{
padding: 26px;
box-sizing: border-box;
}
.pd26{
padding: 26px;
}
.pd30a0{
padding: 30px 30px 16px 30px;
}
.shaiContent li.shaiItem:hover span{
color: #fff !important;
}
.shaiContent li.shaiItem:hover i.iconfont{
color: #4CACFF!important
}
.detail_for_paragraph p{
white-space: pre-wrap;
}

@ -1,5 +0,0 @@
require 'rails_helper'
RSpec.describe ForumsController, type: :controller do
end

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save