dev_aliyun_beta
commit
adee752481
@ -0,0 +1,54 @@
|
|||||||
|
$(document).on('turbolinks:load', function() {
|
||||||
|
var $refuseModal = $('.admin-common-refuse-modal');
|
||||||
|
if ($refuseModal.length > 0) {
|
||||||
|
var $form = $refuseModal.find('form.admin-common-refuse-form');
|
||||||
|
var $applyIdInput = $refuseModal.find('.modal-body input[name="apply_id"]');
|
||||||
|
|
||||||
|
$form.validate({
|
||||||
|
errorElement: 'span',
|
||||||
|
errorClass: 'danger text-danger',
|
||||||
|
rules: {
|
||||||
|
reason: {
|
||||||
|
required: true,
|
||||||
|
maxlength: 200
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// modal ready fire
|
||||||
|
$refuseModal.on('show.bs.modal', function (event) {
|
||||||
|
var $link = $(event.relatedTarget);
|
||||||
|
|
||||||
|
var applyId = $link.data('id');
|
||||||
|
var url = $link.data('url');
|
||||||
|
|
||||||
|
$applyIdInput.val(applyId);
|
||||||
|
$form.data('url', url);
|
||||||
|
});
|
||||||
|
// modal visited fire
|
||||||
|
$refuseModal.on('shown.bs.modal', function(){
|
||||||
|
$refuseModal.find('.modal-body input[name="reason"]').focus();
|
||||||
|
});
|
||||||
|
$refuseModal.on('hide.bs.modal', function () {
|
||||||
|
$applyIdInput.val('');
|
||||||
|
$form.data('url', '');
|
||||||
|
})
|
||||||
|
|
||||||
|
$refuseModal.on('click', '.submit-btn', function(){
|
||||||
|
$form.find('.error').html('');
|
||||||
|
|
||||||
|
if ($form.valid()) {
|
||||||
|
var url = $form.data('url');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
method: 'POST',
|
||||||
|
dataType: 'script',
|
||||||
|
url: url,
|
||||||
|
data: $form.serialize(),
|
||||||
|
}).done(function(){
|
||||||
|
$refuseModal.modal('hide');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,18 @@
|
|||||||
|
$(document).on('turbolinks:load', function() {
|
||||||
|
if ($('body.admins-identity-authentications-index-page').length > 0) {
|
||||||
|
var $searchFrom = $('.identity-authentication-list-form');
|
||||||
|
|
||||||
|
$searchFrom.on('click', '.search-form-tab', function(){
|
||||||
|
var $link = $(this);
|
||||||
|
|
||||||
|
$searchFrom.find('input[name="keyword"]').val('');
|
||||||
|
$searchFrom.find('select[name="status"]').val('processed');
|
||||||
|
|
||||||
|
if($link.data('value') === 'processed'){
|
||||||
|
$searchFrom.find('.status-filter').show();
|
||||||
|
} else {
|
||||||
|
$searchFrom.find('.status-filter').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
@ -0,0 +1,18 @@
|
|||||||
|
$(document).on('turbolinks:load', function() {
|
||||||
|
if ($('body.admins-professional-authentications-index-page').length > 0) {
|
||||||
|
var $searchFrom = $('.professional-authentication-list-form');
|
||||||
|
|
||||||
|
$searchFrom.on('click', '.search-form-tab', function(){
|
||||||
|
var $link = $(this);
|
||||||
|
|
||||||
|
$searchFrom.find('input[name="keyword"]').val('');
|
||||||
|
$searchFrom.find('select[name="status"]').val('processed');
|
||||||
|
|
||||||
|
if($link.data('value') === 'processed'){
|
||||||
|
$searchFrom.find('.status-filter').show();
|
||||||
|
} else {
|
||||||
|
$searchFrom.find('.status-filter').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
@ -0,0 +1,10 @@
|
|||||||
|
$(document).on('turbolinks:load', function() {
|
||||||
|
var $tabs = $('.search-form-container .search-form-tabs');
|
||||||
|
if ($tabs.length > 0) {
|
||||||
|
$tabs.on('click', '.search-form-tab', function(){
|
||||||
|
var $activeTab = $(this);
|
||||||
|
$tabs.find('.search-form-tab').removeClass('active');
|
||||||
|
$activeTab.addClass('active');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
|||||||
|
.admins-identity-authentications-index-page {
|
||||||
|
.identity-authentication-list-container {
|
||||||
|
span {
|
||||||
|
&.apply-status-1 { color: #28a745; }
|
||||||
|
&.apply-status-2 { color: #dc3545; }
|
||||||
|
&.apply-status-3 { color: #6c757d; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
.admins-professional-authentications-index-page {
|
||||||
|
.professional-authentication-list-container {
|
||||||
|
span {
|
||||||
|
&.apply-status-1 { color: #28a745; }
|
||||||
|
&.apply-status-2 { color: #dc3545; }
|
||||||
|
&.apply-status-3 { color: #6c757d; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
class Admins::IdentityAuthenticationsController < Admins::BaseController
|
||||||
|
def index
|
||||||
|
params[:status] ||= 'pending'
|
||||||
|
|
||||||
|
applies = Admins::ApplyUserAuthenticationQuery.call(params.merge(type: 1))
|
||||||
|
|
||||||
|
@applies = paginate applies.preload(user: { user_extension: [:school, :department] })
|
||||||
|
end
|
||||||
|
|
||||||
|
def agree
|
||||||
|
Admins::IdentityAuths::AgreeApplyService.call(current_apply)
|
||||||
|
render_success_js
|
||||||
|
end
|
||||||
|
|
||||||
|
def refuse
|
||||||
|
Admins::IdentityAuths::RefuseApplyService.call(current_apply, params)
|
||||||
|
|
||||||
|
render_success_js
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def current_apply
|
||||||
|
@_current_apply ||= ApplyUserAuthentication.real_name_auth.find(params[:id])
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,26 @@
|
|||||||
|
class Admins::ProfessionalAuthenticationsController < Admins::BaseController
|
||||||
|
def index
|
||||||
|
params[:status] ||= 'pending'
|
||||||
|
|
||||||
|
applies = Admins::ApplyUserAuthenticationQuery.call(params.merge(type: 2))
|
||||||
|
|
||||||
|
@applies = paginate applies.preload(user: { user_extension: [:school, :department] })
|
||||||
|
end
|
||||||
|
|
||||||
|
def agree
|
||||||
|
Admins::ProfessionalAuths::AgreeApplyService.call(current_apply)
|
||||||
|
render_success_js
|
||||||
|
end
|
||||||
|
|
||||||
|
def refuse
|
||||||
|
Admins::ProfessionalAuths::RefuseApplyService.call(current_apply, params)
|
||||||
|
|
||||||
|
render_success_js
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def current_apply
|
||||||
|
@_current_apply ||= ApplyUserAuthentication.professional_auth.find(params[:id])
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,102 @@
|
|||||||
|
module Admins::BaseHelper
|
||||||
|
def sidebar_item_group(url, text, **opts)
|
||||||
|
link_opts = url.start_with?('/') ? {} : { 'data-toggle': 'collapse', 'aria-expanded': false }
|
||||||
|
content =
|
||||||
|
link_to url, link_opts do
|
||||||
|
content_tag(:i, '', class: "fa fa-#{opts[:icon]}", 'data-toggle': 'tooltip', 'data-placement': 'right', 'data-boundary': 'window', title: text) +
|
||||||
|
content_tag(:span, text)
|
||||||
|
end
|
||||||
|
|
||||||
|
content +=
|
||||||
|
content_tag(:ul, id: url[1..-1], class: 'collapse list-unstyled', "data-parent": '#sidebar') do
|
||||||
|
yield
|
||||||
|
end
|
||||||
|
|
||||||
|
raw content
|
||||||
|
end
|
||||||
|
|
||||||
|
def sidebar_item(url, text, **opts)
|
||||||
|
content =
|
||||||
|
link_to url, 'data-controller': opts[:controller] do
|
||||||
|
content_tag(:i, '', class: "fa fa-#{opts[:icon]}", 'data-toggle': 'tooltip', 'data-placement': 'right', 'data-boundary': 'window', title: text) +
|
||||||
|
content_tag(:span, text)
|
||||||
|
end
|
||||||
|
|
||||||
|
raw content
|
||||||
|
end
|
||||||
|
|
||||||
|
def admin_sidebar_controller
|
||||||
|
key = params[:controller].to_s.gsub(/\//, '-')
|
||||||
|
SidebarUtil.controller_name(key) || key
|
||||||
|
end
|
||||||
|
|
||||||
|
def define_admin_breadcrumbs(&block)
|
||||||
|
content_for(:setup_admin_breadcrumb, &block)
|
||||||
|
end
|
||||||
|
|
||||||
|
def add_admin_breadcrumb(text, url = nil)
|
||||||
|
@_admin_breadcrumbs ||= []
|
||||||
|
@_admin_breadcrumbs << OpenStruct.new(text: text, url: url)
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_text(str, default = '--')
|
||||||
|
str.presence || default
|
||||||
|
end
|
||||||
|
|
||||||
|
def overflow_hidden_span(text, width: 300)
|
||||||
|
opts = { class: 'd-inline-block text-truncate', style: "max-width: #{width}px" }
|
||||||
|
opts.merge!('data-toggle': 'tooltip', title: text) if text != '--'
|
||||||
|
|
||||||
|
content_tag(:span, text, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
def sort_tag(content = '', **opts)
|
||||||
|
options = {}
|
||||||
|
options[:sort_by] = opts.delete(:name)
|
||||||
|
is_current_sort = params[:sort_by].to_s == options[:sort_by]
|
||||||
|
options[:sort_direction] = is_current_sort && params[:sort_direction].to_s == 'desc' ? 'asc' : 'desc'
|
||||||
|
|
||||||
|
path = opts.delete(:path) + "?" + unsafe_params.merge(options).to_query
|
||||||
|
arrow_class = case params[:sort_direction].to_s
|
||||||
|
when 'desc' then 'fa-sort-amount-desc'
|
||||||
|
when 'asc' then 'fa-sort-amount-asc'
|
||||||
|
else ''
|
||||||
|
end
|
||||||
|
opts[:style] = "#{opts[:style]} ;position: relative;"
|
||||||
|
|
||||||
|
content_tag(:span, opts) do
|
||||||
|
link_to path, remote: true do
|
||||||
|
content = content_tag(:span) { yield } if block_given?
|
||||||
|
|
||||||
|
content += content_tag(:i, '', class: "fa color-light-green ml-1 #{arrow_class}", style: 'position: absolute;top:0;') if is_current_sort
|
||||||
|
raw content
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def javascript_void_link(name, **opts)
|
||||||
|
raw link_to(name, 'javascript:void(0)', opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
def agree_link(name, url, **opts)
|
||||||
|
klass = ['action agree-action', opts.delete(:class)].compact.join(' ')
|
||||||
|
|
||||||
|
refresh_url_data = "refresh_url=#{CGI::escape(request.fullpath)}"
|
||||||
|
url = url + (url.index('?') ? '&' : '?') + refresh_url_data
|
||||||
|
|
||||||
|
raw link_to(name, url, { method: :post, remote: true, class: klass, 'data-confirm': '确认审核通过?'}.merge(opts))
|
||||||
|
end
|
||||||
|
|
||||||
|
def delete_link(name, url, **opts)
|
||||||
|
klass = ['action delete-action', opts.delete(:class)].compact.join(' ')
|
||||||
|
|
||||||
|
refresh_url_data = "refresh_url=#{CGI::escape(request.fullpath)}"
|
||||||
|
url = url + (url.index('?') ? '&' : '?') + refresh_url_data
|
||||||
|
|
||||||
|
raw link_to(name, url, { method: :delete, remote: true, class: klass, 'data-confirm': '确认删除?'}.merge(opts))
|
||||||
|
end
|
||||||
|
|
||||||
|
def unsafe_params
|
||||||
|
params.except(:controller, :action).to_unsafe_h
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,40 @@
|
|||||||
|
module Util::FileManage
|
||||||
|
module_function
|
||||||
|
|
||||||
|
# 不同的类型扩展不同的目录
|
||||||
|
def relative_path
|
||||||
|
"avatars"
|
||||||
|
end
|
||||||
|
|
||||||
|
def storage_path
|
||||||
|
File.join(Rails.root, "public", "images", relative_path)
|
||||||
|
end
|
||||||
|
|
||||||
|
def disk_filename(source_type,source_id,image_file=nil)
|
||||||
|
File.join(storage_path, "#{source_type}", "#{source_id}")
|
||||||
|
end
|
||||||
|
|
||||||
|
def disk_auth_filename(source_type, source_id, type)
|
||||||
|
File.join(storage_path, "#{source_type}", "#{source_id}#{type}")
|
||||||
|
end
|
||||||
|
|
||||||
|
def disk_real_name_auth_filename(source_id)
|
||||||
|
disk_auth_filename('UserAuthentication', source_id, 'ID')
|
||||||
|
end
|
||||||
|
|
||||||
|
def auth_file_url(source_type, source_id, type)
|
||||||
|
File.join('/images', relative_path, source_type, "#{source_id}#{type}")
|
||||||
|
end
|
||||||
|
|
||||||
|
def real_name_auth_file_url(source_id)
|
||||||
|
auth_file_url('UserAuthentication', source_id, 'ID')
|
||||||
|
end
|
||||||
|
|
||||||
|
def disk_professional_auth_filename(source_id)
|
||||||
|
disk_auth_filename('UserAuthentication', source_id, 'PRO')
|
||||||
|
end
|
||||||
|
|
||||||
|
def professional_auth_file_url(source_id)
|
||||||
|
auth_file_url('UserAuthentication', source_id, 'PRO')
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,34 @@
|
|||||||
|
class Admins::ApplyUserAuthenticationQuery < ApplicationQuery
|
||||||
|
include CustomSortable
|
||||||
|
|
||||||
|
attr_reader :params
|
||||||
|
|
||||||
|
sort_columns :updated_at, default_by: :updated_at, default_direction: :desc
|
||||||
|
|
||||||
|
def initialize(params)
|
||||||
|
@params = params
|
||||||
|
end
|
||||||
|
|
||||||
|
def call
|
||||||
|
applies = ApplyUserAuthentication.where(auth_type: params[:type].presence || 1)
|
||||||
|
|
||||||
|
status =
|
||||||
|
case params[:status]
|
||||||
|
when 'pending' then 0
|
||||||
|
when 'processed' then [1, 2]
|
||||||
|
when 'agreed' then 1
|
||||||
|
when 'refused' then 2
|
||||||
|
else 0
|
||||||
|
end
|
||||||
|
applies = applies.where(status: status) if status.present?
|
||||||
|
|
||||||
|
# 关键字模糊查询
|
||||||
|
keyword = params[:keyword].to_s.strip
|
||||||
|
if keyword.present?
|
||||||
|
applies = applies.joins(user: { user_extension: :school })
|
||||||
|
.where('CONCAT(lastname,firstname) LIKE :keyword OR schools.name LIKE :keyword', keyword: "%#{keyword}%")
|
||||||
|
end
|
||||||
|
|
||||||
|
custom_sort(applies, params[:sort_by], params[:sort_direction])
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,38 @@
|
|||||||
|
class Admins::IdentityAuths::AgreeApplyService < ApplicationService
|
||||||
|
attr_reader :apply, :user
|
||||||
|
|
||||||
|
def initialize(apply)
|
||||||
|
@apply = apply
|
||||||
|
@user = apply.user
|
||||||
|
end
|
||||||
|
|
||||||
|
def call
|
||||||
|
ActiveRecord::Base.transaction do
|
||||||
|
apply.update!(status: 1)
|
||||||
|
user.update!(authentication: true)
|
||||||
|
|
||||||
|
RewardGradeService.call(user, container_id: user.id, container_type: 'Authentication', score: 500)
|
||||||
|
|
||||||
|
deal_tiding!
|
||||||
|
delete_auth_file!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def deal_tiding!
|
||||||
|
apply.tidings.where(tiding_type: 'Apply').update_all(status: 1)
|
||||||
|
|
||||||
|
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
|
||||||
|
container_id: apply.id, container_type: 'ApplyUserAuthentication',
|
||||||
|
belong_container_id: apply.user_id, belong_container_type: 'User',
|
||||||
|
status: 1, tiding_type: 'System')
|
||||||
|
end
|
||||||
|
|
||||||
|
def delete_auth_file!
|
||||||
|
path = Util::FileManage.disk_real_name_auth_filename(user.id)
|
||||||
|
File.delete(path) if File.exists?(path)
|
||||||
|
|
||||||
|
apply.update!(is_delete: true)
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,40 @@
|
|||||||
|
class Admins::IdentityAuths::RefuseApplyService < ApplicationService
|
||||||
|
attr_reader :apply, :user, :params
|
||||||
|
|
||||||
|
def initialize(apply, params)
|
||||||
|
@apply = apply
|
||||||
|
@user = apply.user
|
||||||
|
@params = params
|
||||||
|
end
|
||||||
|
|
||||||
|
def call
|
||||||
|
ActiveRecord::Base.transaction do
|
||||||
|
apply.update!(status: 2, remarks: reason)
|
||||||
|
|
||||||
|
deal_tiding!
|
||||||
|
delete_auth_file!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def reason
|
||||||
|
params[:reason].to_s.strip
|
||||||
|
end
|
||||||
|
|
||||||
|
def deal_tiding!
|
||||||
|
apply.tidings.where(tiding_type: 'Apply').update_all(status: 1)
|
||||||
|
|
||||||
|
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
|
||||||
|
container_id: apply.id, container_type: 'ApplyUserAuthentication',
|
||||||
|
belong_container_id: apply.user_id, belong_container_type: 'User',
|
||||||
|
status: 2, tiding_type: 'System')
|
||||||
|
end
|
||||||
|
|
||||||
|
def delete_auth_file!
|
||||||
|
path = Util::FileManage.disk_real_name_auth_filename(user.id)
|
||||||
|
File.delete(path) if File.exists?(path)
|
||||||
|
|
||||||
|
apply.update!(is_delete: true)
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,38 @@
|
|||||||
|
class Admins::ProfessionalAuths::AgreeApplyService < ApplicationService
|
||||||
|
attr_reader :apply, :user
|
||||||
|
|
||||||
|
def initialize(apply)
|
||||||
|
@apply = apply
|
||||||
|
@user = apply.user
|
||||||
|
end
|
||||||
|
|
||||||
|
def call
|
||||||
|
ActiveRecord::Base.transaction do
|
||||||
|
apply.update!(status: 1)
|
||||||
|
user.update!(professional_certification: true)
|
||||||
|
|
||||||
|
RewardGradeService.call(user, container_id: user.id, container_type: 'Professional', score: 500)
|
||||||
|
|
||||||
|
deal_tiding!
|
||||||
|
delete_auth_file!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def deal_tiding!
|
||||||
|
apply.tidings.where(tiding_type: 'Apply').update_all(status: 1)
|
||||||
|
|
||||||
|
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
|
||||||
|
container_id: apply.id, container_type: 'ApplyUserAuthentication',
|
||||||
|
belong_container_id: apply.user_id, belong_container_type: 'User',
|
||||||
|
status: 1, tiding_type: 'System')
|
||||||
|
end
|
||||||
|
|
||||||
|
def delete_auth_file!
|
||||||
|
path = Util::FileManage.disk_professional_auth_filename(user.id)
|
||||||
|
File.delete(path) if File.exists?(path)
|
||||||
|
|
||||||
|
apply.update!(is_delete: true)
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,40 @@
|
|||||||
|
class Admins::ProfessionalAuths::RefuseApplyService < ApplicationService
|
||||||
|
attr_reader :apply, :user, :params
|
||||||
|
|
||||||
|
def initialize(apply, params)
|
||||||
|
@apply = apply
|
||||||
|
@user = apply.user
|
||||||
|
@params = params
|
||||||
|
end
|
||||||
|
|
||||||
|
def call
|
||||||
|
ActiveRecord::Base.transaction do
|
||||||
|
apply.update!(status: 2, remarks: reason)
|
||||||
|
|
||||||
|
deal_tiding!
|
||||||
|
delete_auth_file!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def reason
|
||||||
|
params[:reason].to_s.strip
|
||||||
|
end
|
||||||
|
|
||||||
|
def deal_tiding!
|
||||||
|
apply.tidings.where(tiding_type: 'Apply').update_all(status: 1)
|
||||||
|
|
||||||
|
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
|
||||||
|
container_id: apply.id, container_type: 'ApplyUserAuthentication',
|
||||||
|
belong_container_id: apply.user_id, belong_container_type: 'User',
|
||||||
|
status: 2, tiding_type: 'System')
|
||||||
|
end
|
||||||
|
|
||||||
|
def delete_auth_file!
|
||||||
|
path = Util::FileManage.disk_professional_auth_filename(user.id)
|
||||||
|
File.delete(path) if File.exists?(path)
|
||||||
|
|
||||||
|
apply.update!(is_delete: true)
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,32 @@
|
|||||||
|
<% define_admin_breadcrumbs do %>
|
||||||
|
<% add_admin_breadcrumb('实名认证') %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<div class="box search-form-container flex-column mb-0 pb-0 identity-authentication-list-form">
|
||||||
|
<ul class="nav nav-tabs w-100 search-form-tabs">
|
||||||
|
<li class="nav-item">
|
||||||
|
<%= link_to '待审批', admins_identity_authentications_path(status: :pending), remote: true, 'data-value': 'pending',
|
||||||
|
class: "nav-link search-form-tab #{params[:status] == 'pending' ? 'active' : ''}" %>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<%= link_to '已审批', admins_identity_authentications_path(status: :processed), remote: true, 'data-value': 'processed',
|
||||||
|
class: "nav-link search-form-tab #{params[:status] != 'pending' ? 'active' : ''}" %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<%= form_tag(admins_identity_authentications_path(unsafe_params), method: :get, class: 'form-inline search-form justify-content-end mt-3', remote: true) do %>
|
||||||
|
<div class="form-group status-filter" style="<%= params[:status] != 'pending' ? '' : 'display: none;' %>">
|
||||||
|
<label for="status">审核状态:</label>
|
||||||
|
<% status_options = [['全部', 'processed'], ['已同意', 'agreed'], ['已拒绝', 'refused']] %>
|
||||||
|
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
|
||||||
|
</div>
|
||||||
|
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '姓名/学校/单位检索') %>
|
||||||
|
<%= submit_tag('搜索', class: 'btn btn-primary ml-3') %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="box identity-authentication-list-container">
|
||||||
|
<%= render(partial: 'admins/identity_authentications/shared/list', locals: { applies: @applies }) %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= render(partial: 'admins/shared/admin_common_refuse_modal') %>
|
@ -0,0 +1 @@
|
|||||||
|
$('.identity-authentication-list-container').html("<%= j( render partial: 'admins/identity_authentications/shared/list', locals: { applies: @applies } ) %>");
|
@ -0,0 +1,74 @@
|
|||||||
|
<% is_processed = params[:status].to_s != 'pending' %>
|
||||||
|
|
||||||
|
<table class="table table-hover text-center identity-authentication-list-table">
|
||||||
|
<thead class="thead-light">
|
||||||
|
<tr>
|
||||||
|
<th width="8%">头像</th>
|
||||||
|
<th width="10%">姓名</th>
|
||||||
|
<th width="14%">身份证号</th>
|
||||||
|
<th width="20%">学校/单位</th>
|
||||||
|
<th width="12%">职称</th>
|
||||||
|
<% unless is_processed %>
|
||||||
|
<th width="8%">
|
||||||
|
照片
|
||||||
|
<i class="fa fa-question-circle" data-toggle="tooltip" data-html="true" data-placement="top" title="审核完成后自动删除图片"></i>
|
||||||
|
</th>
|
||||||
|
<% end %>
|
||||||
|
<th width="16%">时间</th>
|
||||||
|
<% if is_processed %>
|
||||||
|
<th width="14%">拒绝原因</th>
|
||||||
|
<th width="8%">状态</th>
|
||||||
|
<% else %>
|
||||||
|
<th width="20%">操作</th>
|
||||||
|
<% end %>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% if applies.present? %>
|
||||||
|
<% applies.each do |apply| %>
|
||||||
|
<% user = apply.user %>
|
||||||
|
<tr class="identity-authentication-item identity-authentication-<%= apply.id %>">
|
||||||
|
<td>
|
||||||
|
<%= link_to "/users/#{user.login}", class: 'identity-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
|
||||||
|
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
<td><%= user.real_name %></td>
|
||||||
|
<td><%= user.ID_number %></td>
|
||||||
|
<td><%= raw [user.school_name.presence, user.department_name.presence].compact.join('<br/>') %></td>
|
||||||
|
<td><%= user.identity %> <%= raw user.user_extension.student? && user.student_id ? "<br/>#{user.student_id}" : '' %></td>
|
||||||
|
|
||||||
|
<% unless is_processed %>
|
||||||
|
<td>
|
||||||
|
<% if File.exists?(disk_real_name_auth_filename(user.id)) %>
|
||||||
|
<%= image_tag(real_name_auth_file_url(user.id).to_s + "?#{Time.now.to_i}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
|
||||||
|
<% else %>
|
||||||
|
<%= content_tag(:span, '图片已删除', class: 'text-secondary') %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<td><%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %></td>
|
||||||
|
|
||||||
|
<% if is_processed %>
|
||||||
|
<td class="text-secondary"><%= overflow_hidden_span apply.remarks, width: 140 %></td>
|
||||||
|
<td><span class="apply-status-<%= apply.status %>"><%= apply.status_text %></span></td>
|
||||||
|
<% else %>
|
||||||
|
<td class="action-container">
|
||||||
|
<%= agree_link '同意', agree_admins_identity_authentication_path(apply, element: ".identity-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?' %>
|
||||||
|
<%= javascript_void_link('拒绝', class: 'action refuse-action',
|
||||||
|
data: {
|
||||||
|
toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id,
|
||||||
|
url: refuse_admins_identity_authentication_path(apply, element: ".identity-authentication-#{apply.id}")
|
||||||
|
}) %>
|
||||||
|
</td>
|
||||||
|
<% end %>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<%= render 'admins/shared/no_data_for_table' %>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>
|
@ -0,0 +1,32 @@
|
|||||||
|
<% define_admin_breadcrumbs do %>
|
||||||
|
<% add_admin_breadcrumb('职业认证') %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<div class="box search-form-container flex-column mb-0 pb-0 professional-authentication-list-form">
|
||||||
|
<ul class="nav nav-tabs w-100 search-form-tabs">
|
||||||
|
<li class="nav-item">
|
||||||
|
<%= link_to '待审批', admins_professional_authentications_path(status: :pending), remote: true, 'data-value': 'pending',
|
||||||
|
class: "nav-link search-form-tab #{params[:status] == 'pending' ? 'active' : ''}" %>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<%= link_to '已审批', admins_professional_authentications_path(status: :processed), remote: true, 'data-value': 'processed',
|
||||||
|
class: "nav-link search-form-tab #{params[:status] != 'pending' ? 'active' : ''}" %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<%= form_tag(admins_professional_authentications_path(unsafe_params), method: :get, class: 'form-inline search-form justify-content-end mt-3', remote: true) do %>
|
||||||
|
<div class="form-group status-filter" style="<%= params[:status] != 'pending' ? '' : 'display: none;' %>">
|
||||||
|
<label for="status">审核状态:</label>
|
||||||
|
<% status_options = [['全部', 'processed'], ['已同意', 'agreed'], ['已拒绝', 'refused']] %>
|
||||||
|
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
|
||||||
|
</div>
|
||||||
|
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '姓名/学校/单位检索') %>
|
||||||
|
<%= submit_tag('搜索', class: 'btn btn-primary ml-3') %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="box professional-authentication-list-container">
|
||||||
|
<%= render(partial: 'admins/professional_authentications/shared/list', locals: { applies: @applies }) %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= render(partial: 'admins/shared/admin_common_refuse_modal') %>
|
@ -0,0 +1 @@
|
|||||||
|
$('.professional-authentication-list-container').html("<%= j( render partial: 'admins/professional_authentications/shared/list', locals: { applies: @applies } ) %>");
|
@ -0,0 +1,72 @@
|
|||||||
|
<% is_processed = params[:status].to_s != 'pending' %>
|
||||||
|
|
||||||
|
<table class="table table-hover text-center professional-authentication-list-table">
|
||||||
|
<thead class="thead-light">
|
||||||
|
<tr>
|
||||||
|
<th width="8%">头像</th>
|
||||||
|
<th width="14%">姓名</th>
|
||||||
|
<th width="28%">学校/单位</th>
|
||||||
|
<th width="12%">职称</th>
|
||||||
|
<% unless is_processed %>
|
||||||
|
<th width="10%">
|
||||||
|
照片
|
||||||
|
<i class="fa fa-question-circle" data-toggle="tooltip" data-html="true" data-placement="top" title="审核完成后自动删除图片"></i>
|
||||||
|
</th>
|
||||||
|
<% end %>
|
||||||
|
<th width="16%">时间</th>
|
||||||
|
<% if is_processed %>
|
||||||
|
<th width="14%">拒绝原因</th>
|
||||||
|
<th width="8%">状态</th>
|
||||||
|
<% else %>
|
||||||
|
<th width="18%">操作</th>
|
||||||
|
<% end %>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% if applies.present? %>
|
||||||
|
<% applies.each do |apply| %>
|
||||||
|
<% user = apply.user %>
|
||||||
|
<tr class="professional-authentication-item professional-authentication-<%= apply.id %>">
|
||||||
|
<td>
|
||||||
|
<%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
|
||||||
|
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
<td><%= user.real_name %></td>
|
||||||
|
<td><%= raw [user.school_name.presence, user.department_name.presence].compact.join('<br/>') %></td>
|
||||||
|
<td><%= user.identity %> <%= raw user.user_extension.student? && user.student_id ? "<br/>#{user.student_id}" : '' %></td>
|
||||||
|
|
||||||
|
<% unless is_processed %>
|
||||||
|
<td>
|
||||||
|
<% if File.exists?(disk_professional_auth_filename(user.id)) %>
|
||||||
|
<%= image_tag(professional_auth_file_url(user.id).to_s + "?#{Time.now.to_i}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
|
||||||
|
<% else %>
|
||||||
|
<%= content_tag(:span, '图片已删除', class: 'text-secondary') %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<td><%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %></td>
|
||||||
|
|
||||||
|
<% if is_processed %>
|
||||||
|
<td class="text-secondary"><%= overflow_hidden_span apply.remarks, width: 140 %></td>
|
||||||
|
<td><span class="apply-status-<%= apply.status %>"><%= apply.status_text %></span></td>
|
||||||
|
<% else %>
|
||||||
|
<td class="action-container">
|
||||||
|
<%= agree_link '同意', agree_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?' %>
|
||||||
|
<%= javascript_void_link('拒绝', class: 'action refuse-action',
|
||||||
|
data: {
|
||||||
|
toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id,
|
||||||
|
url: refuse_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}")
|
||||||
|
}) %>
|
||||||
|
</td>
|
||||||
|
<% end %>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<%= render 'admins/shared/no_data_for_table' %>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>
|
@ -1,3 +1,4 @@
|
|||||||
;
|
;
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
$('[data-toggle="popover"]').popover();
|
$('[data-toggle="popover"]').popover();
|
||||||
|
$('img.preview-image').bootstrapViewer();
|
@ -0,0 +1,7 @@
|
|||||||
|
zh-CN:
|
||||||
|
apply_user_authentication:
|
||||||
|
status:
|
||||||
|
'0': '待处理'
|
||||||
|
'1': '已同意'
|
||||||
|
'2': '已拒绝'
|
||||||
|
'3': '已撤销'
|
@ -0,0 +1,19 @@
|
|||||||
|
import React,{Component} from "React";
|
||||||
|
|
||||||
|
export default function LeaderIcon(props = {}) {
|
||||||
|
let icon = null;
|
||||||
|
if (props.small) {
|
||||||
|
icon = <div className="font-8 blueFull Actionbtn" style={{
|
||||||
|
height: '14px',
|
||||||
|
'line-height': '14px',
|
||||||
|
width: '24px',
|
||||||
|
padding: 0,
|
||||||
|
'margin-top': '-2px',
|
||||||
|
'margin-left': '2px',
|
||||||
|
'vertical-align': 'middle', }}>组长</div>
|
||||||
|
} else {
|
||||||
|
icon = <div className="font-8 blueFull Actionbtn" style={{ height: '16px', 'line-height': '16px', width: '30px'}}>组长</div>
|
||||||
|
|
||||||
|
}
|
||||||
|
return icon
|
||||||
|
}
|
@ -1,209 +1,209 @@
|
|||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { Modal, Checkbox, Input, Spin} from "antd";
|
import { Modal, Checkbox, Input, Spin} from "antd";
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import ModalWrapper from "../../common/ModalWrapper"
|
import ModalWrapper from "../../common/ModalWrapper"
|
||||||
import InfiniteScroll from 'react-infinite-scroller';
|
import InfiniteScroll from 'react-infinite-scroller';
|
||||||
|
|
||||||
const Search = Input.Search
|
const Search = Input.Search
|
||||||
const pageCount = 15;
|
const pageCount = 15;
|
||||||
class SendToCourseModal extends Component{
|
class SendToCourseModal extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props);
|
super(props);
|
||||||
this.state={
|
this.state={
|
||||||
checkBoxValues: [],
|
checkBoxValues: [],
|
||||||
course_lists: [],
|
course_lists: [],
|
||||||
course_lists_after_filter: [],
|
course_lists_after_filter: [],
|
||||||
searchValue: '',
|
searchValue: '',
|
||||||
hasMore: true,
|
hasMore: true,
|
||||||
loading: false,
|
loading: false,
|
||||||
page: 1
|
page: 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fetchCourseList = (arg_page) => {
|
fetchCourseList = (arg_page) => {
|
||||||
const page = arg_page || this.state.page;
|
const page = arg_page || this.state.page;
|
||||||
// search=''&
|
// search=''&
|
||||||
let url = `/courses/mine.json?page=${page}&page_size=${pageCount}`
|
let url = `/courses/mine.json?page=${page}&page_size=${pageCount}`
|
||||||
const searchValue = this.state.searchValue.trim()
|
const searchValue = this.state.searchValue.trim()
|
||||||
if (searchValue) {
|
if (searchValue) {
|
||||||
url += `&search=${searchValue}`
|
url += `&search=${searchValue}`
|
||||||
}
|
}
|
||||||
this.setState({ loading: true })
|
this.setState({ loading: true })
|
||||||
axios.get(url, {
|
axios.get(url, {
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (!response.data.data || response.data.data.length == 0) {
|
if (!response.data.data || response.data.data.length == 0) {
|
||||||
this.setState({
|
this.setState({
|
||||||
course_lists: page == 1 ? [] : this.state.course_lists,
|
course_lists: page == 1 ? [] : this.state.course_lists,
|
||||||
page,
|
page,
|
||||||
loading: false,
|
loading: false,
|
||||||
hasMore: false,
|
hasMore: false,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
course_lists: page == 1 ? response.data.data : this.state.course_lists.concat(response.data.data),
|
course_lists: page == 1 ? response.data.data : this.state.course_lists.concat(response.data.data),
|
||||||
course_lists_after_filter: response.data.data,
|
course_lists_after_filter: response.data.data,
|
||||||
page,
|
page,
|
||||||
loading: false,
|
loading: false,
|
||||||
hasMore: response.data.data.length == pageCount
|
hasMore: response.data.data.length == pageCount
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.fetchCourseList()
|
this.fetchCourseList()
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|
||||||
}
|
}
|
||||||
setVisible = (visible) => {
|
setVisible = (visible) => {
|
||||||
this.refs.modalWrapper.setVisible(visible)
|
this.refs.modalWrapper.setVisible(visible)
|
||||||
if (visible == false) {
|
if (visible == false) {
|
||||||
this.setState({
|
this.setState({
|
||||||
checkBoxValues: []
|
checkBoxValues: []
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSendOk = () => {
|
onSendOk = () => {
|
||||||
if (!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
|
if (!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
|
||||||
this.props.showNotification('请先选择要发送至的课堂')
|
this.props.showNotification('请先选择要发送至的课堂')
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(this.props.url==="/files/bulk_send.json"){
|
if(this.props.url==="/files/bulk_send.json"){
|
||||||
axios.post("/files/bulk_send.json", {
|
axios.post("/files/bulk_send.json", {
|
||||||
course_id:this.props.match.params.coursesId,
|
course_id:this.props.match.params.coursesId,
|
||||||
ids: this.props.selectedMessageIds,
|
ids: this.props.selectedMessageIds,
|
||||||
to_course_ids: this.state.checkBoxValues
|
to_course_ids: this.state.checkBoxValues
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.data.status == 0) {
|
if (response.data.status == 0) {
|
||||||
this.setVisible(false)
|
this.setVisible(false)
|
||||||
this.props.gobackonSend(response.data.message)
|
this.props.gobackonSend(response.data.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
const bid = this.props.match.params.boardId
|
const bid = this.props.match.params.boardId
|
||||||
const url = `/boards/${bid}/messages/bulk_send.json`
|
const url = `/boards/${bid}/messages/bulk_send.json`
|
||||||
axios.post(url, {
|
axios.post(url, {
|
||||||
ids: this.props.selectedMessageIds,
|
ids: this.props.selectedMessageIds,
|
||||||
to_course_ids: this.state.checkBoxValues
|
to_course_ids: this.state.checkBoxValues
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.data.status == 0) {
|
if (response.data.status == 0) {
|
||||||
this.setVisible(false)
|
this.setVisible(false)
|
||||||
this.props.showNotification('发送成功')
|
this.props.showNotification('发送成功')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onOk = () => {
|
onOk = () => {
|
||||||
const { course_lists, checkBoxValues } = this.state
|
const { course_lists, checkBoxValues } = this.state
|
||||||
this.onSendOk()
|
this.onSendOk()
|
||||||
// this.props.onOk && this.props.onOk(checkBoxValues)
|
// this.props.onOk && this.props.onOk(checkBoxValues)
|
||||||
|
|
||||||
// this.refs.modalWrapper.setVisible(false)
|
// this.refs.modalWrapper.setVisible(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
onCheckBoxChange = (checkBoxValues) => {
|
onCheckBoxChange = (checkBoxValues) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
checkBoxValues: checkBoxValues
|
checkBoxValues: checkBoxValues
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onSearchChange = (e) => {
|
onSearchChange = (e) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
searchValue: e.target.value
|
searchValue: e.target.value
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
handleInfiniteOnLoad = () => {
|
handleInfiniteOnLoad = () => {
|
||||||
console.log('loadmore...')
|
console.log('loadmore...')
|
||||||
this.fetchCourseList(this.state.page + 1)
|
this.fetchCourseList(this.state.page + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
onSearch = () => {
|
onSearch = () => {
|
||||||
// const course_lists_after_filter = this.state.course_lists.filter( item => item.name.indexOf(this.state.searchValue) != -1 )
|
// const course_lists_after_filter = this.state.course_lists.filter( item => item.name.indexOf(this.state.searchValue) != -1 )
|
||||||
// this.setState({ course_lists_after_filter })
|
// this.setState({ course_lists_after_filter })
|
||||||
this.fetchCourseList(1)
|
this.fetchCourseList(1)
|
||||||
}
|
}
|
||||||
render(){
|
render(){
|
||||||
const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state
|
const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state
|
||||||
const { moduleName } = this.props
|
const { moduleName } = this.props
|
||||||
return(
|
return(
|
||||||
<ModalWrapper
|
<ModalWrapper
|
||||||
ref="modalWrapper"
|
ref="modalWrapper"
|
||||||
title={`发送${moduleName}`}
|
title={`发送${moduleName}`}
|
||||||
{...this.props }
|
{...this.props }
|
||||||
onOk={this.onOk}
|
onOk={this.onOk}
|
||||||
>
|
>
|
||||||
<style>
|
<style>
|
||||||
{`
|
{`
|
||||||
.demo-loading-container {
|
.demo-loading-container {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 93px;
|
bottom: 93px;
|
||||||
width: 82%;
|
width: 82%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}`}
|
}`}
|
||||||
</style>
|
</style>
|
||||||
<p className="color-grey-6 mb20 edu-txt-center" style={{ fontWeight: "bold" }} >选择的{moduleName}发送到<span className="color-orange-tip">指定课堂</span></p>
|
<p className="color-grey-6 mb20 edu-txt-center" style={{ fontWeight: "bold" }} >选择的{moduleName}发送到<span className="color-orange-tip">指定课堂</span></p>
|
||||||
|
|
||||||
<Search
|
<Search
|
||||||
className="mb14"
|
className="mb14"
|
||||||
value={searchValue}
|
value={searchValue}
|
||||||
placeholder="请输入课堂名称进行搜索"
|
placeholder="请输入课堂名称进行搜索"
|
||||||
onChange={this.onSearchChange}
|
onChange={this.onSearchChange}
|
||||||
onSearch={this.onSearch}
|
onSearch={this.onSearch}
|
||||||
></Search>
|
></Search>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
|
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
|
||||||
<div className="edu-back-skyblue padding15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
|
<div className="edu-back-skyblue padding15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
|
||||||
<InfiniteScroll
|
<InfiniteScroll
|
||||||
threshold={10}
|
threshold={10}
|
||||||
initialLoad={false}
|
initialLoad={false}
|
||||||
pageStart={0}
|
pageStart={0}
|
||||||
loadMore={this.handleInfiniteOnLoad}
|
loadMore={this.handleInfiniteOnLoad}
|
||||||
hasMore={!loading && hasMore}
|
hasMore={!loading && hasMore}
|
||||||
useWindow={false}
|
useWindow={false}
|
||||||
>
|
>
|
||||||
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
|
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
|
||||||
|
|
||||||
{ course_lists && course_lists.map( course => {
|
{ course_lists && course_lists.map( course => {
|
||||||
return (
|
return (
|
||||||
<p className="clearfix mb7" key={course.id}>
|
<p className="clearfix mb7" key={course.id}>
|
||||||
<Checkbox className="fl" value={course.id} key={course.id}></Checkbox>
|
<Checkbox className="fl" value={course.id} key={course.id}></Checkbox>
|
||||||
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{course.name}</label></span>
|
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{course.name}</label></span>
|
||||||
</p>
|
</p>
|
||||||
)
|
)
|
||||||
}) }
|
}) }
|
||||||
</Checkbox.Group>
|
</Checkbox.Group>
|
||||||
{loading && hasMore && (
|
{loading && hasMore && (
|
||||||
<div className="demo-loading-container">
|
<div className="demo-loading-container">
|
||||||
<Spin />
|
<Spin />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{/* TODO */}
|
{/* TODO */}
|
||||||
{/* {
|
{/* {
|
||||||
!hasMore && <div>没有更多了。。</div>
|
!hasMore && <div>没有更多了。。</div>
|
||||||
} */}
|
} */}
|
||||||
</InfiniteScroll>
|
</InfiniteScroll>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ModalWrapper>
|
</ModalWrapper>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default SendToCourseModal;
|
export default SendToCourseModal;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,80 +1,80 @@
|
|||||||
.studentList_operation_ul{
|
.studentList_operation_ul{
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
float: right;
|
float: right;
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
.studentList_operation_ul li{
|
.studentList_operation_ul li{
|
||||||
float: left;
|
float: left;
|
||||||
padding:0px 20px;
|
padding:0px 20px;
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
flex: 0 0 26px;
|
flex: 0 0 26px;
|
||||||
line-height: 26px;
|
line-height: 26px;
|
||||||
}
|
}
|
||||||
.studentList_operation_ul li.li_line:after{
|
.studentList_operation_ul li.li_line:after{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
content: '';
|
content: '';
|
||||||
width: 1px;
|
width: 1px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
background-color: #EDEDED;
|
background-color: #EDEDED;
|
||||||
right: 0px;
|
right: 0px;
|
||||||
top:6px;
|
top:6px;
|
||||||
}
|
}
|
||||||
.studentList_operation_ul li:last-child{
|
.studentList_operation_ul li:last-child{
|
||||||
padding-right: 0px;
|
padding-right: 0px;
|
||||||
}
|
}
|
||||||
.studentList_operation_ul li:last-child:after{
|
.studentList_operation_ul li:last-child:after{
|
||||||
width: 0px;
|
width: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 基础的下拉列表、列如排序等 */
|
/* 基础的下拉列表、列如排序等 */
|
||||||
.drop_down_normal li{
|
.drop_down_normal li{
|
||||||
padding: 0px 20px;
|
padding: 0px 20px;
|
||||||
height: 34px;
|
height: 34px;
|
||||||
line-height: 34px;
|
line-height: 34px;
|
||||||
min-width: 96px;
|
min-width: 96px;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stu_table table{
|
.stu_table table{
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
.stu_table .classesName{
|
.stu_table .classesName{
|
||||||
display: block;
|
display: block;
|
||||||
max-width: 428px;
|
max-width: 428px;
|
||||||
}
|
}
|
||||||
.stu_table .ant-table-thead > tr > th{
|
.stu_table .ant-table-thead > tr > th{
|
||||||
padding:21px 16px;
|
padding:21px 16px;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
.stu_table .ant-table-tbody tr:last-child td{
|
.stu_table .ant-table-tbody tr:last-child td{
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
.stu_table table .ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td{
|
.stu_table table .ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td{
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stu_head{
|
.stu_head{
|
||||||
padding-bottom: 15px;
|
padding-bottom: 15px;
|
||||||
}
|
}
|
||||||
.ant-modal-body{
|
.ant-modal-body{
|
||||||
padding:30px 40px;
|
padding:30px 40px;
|
||||||
}
|
}
|
||||||
.color-dark-21{
|
.color-dark-21{
|
||||||
color: #212121;
|
color: #212121;
|
||||||
}
|
}
|
||||||
.tabletd {
|
.tabletd {
|
||||||
background-color:#E6F7FF;
|
background-color:#E6F7FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.yslminheigth{
|
.yslminheigth{
|
||||||
min-height: 20px;
|
min-height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.yslminheigths{
|
.yslminheigths{
|
||||||
min-height: 21px;
|
min-height: 21px;
|
||||||
}
|
}
|
@ -1,45 +1,45 @@
|
|||||||
.ml350 {
|
.ml350 {
|
||||||
margin-left: 40%;
|
margin-left: 40%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ml32 {
|
.ml32 {
|
||||||
margin-left: 32%;
|
margin-left: 32%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.square-Item{
|
.square-Item{
|
||||||
/*min-height: 324px;*/
|
/*min-height: 324px;*/
|
||||||
}
|
}
|
||||||
.square-img{
|
.square-img{
|
||||||
min-height: 210px;
|
min-height: 210px;
|
||||||
}
|
}
|
||||||
.task-hide{
|
.task-hide{
|
||||||
margin-bottom: 0em;
|
margin-bottom: 0em;
|
||||||
}
|
}
|
||||||
.backFAFAFA{
|
.backFAFAFA{
|
||||||
background:#FAFAFA;
|
background:#FAFAFA;
|
||||||
}
|
}
|
||||||
|
|
||||||
.demo {
|
.demo {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
background-color: #0dcecb;
|
background-color: #0dcecb;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding:50px;
|
padding:50px;
|
||||||
}
|
}
|
||||||
.next-loading {
|
.next-loading {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
width:100%;
|
width:100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.next-rating-overlay .next-icon{
|
.next-rating-overlay .next-icon{
|
||||||
color: #FFA800!important;
|
color: #FFA800!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-pagination {
|
.custom-pagination {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ml425{
|
.ml425{
|
||||||
margin-left:42.5%;
|
margin-left:42.5%;
|
||||||
margin-top:20px;
|
margin-top:20px;
|
||||||
}
|
}
|
@ -1,249 +1,249 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import {Pagination,Spin,Checkbox,Modal} from 'antd';
|
import {Pagination,Spin,Checkbox,Modal} from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import NoneData from '../../courses/coursesPublic/NoneData'
|
import NoneData from '../../courses/coursesPublic/NoneData'
|
||||||
import {getImageUrl} from 'educoder';
|
import {getImageUrl} from 'educoder';
|
||||||
import "./usersInfo.css"
|
import "./usersInfo.css"
|
||||||
import Modals from '../../modals/Modals'
|
import Modals from '../../modals/Modals'
|
||||||
|
|
||||||
const dateFormat ="YYYY-MM-DD HH:mm"
|
const dateFormat ="YYYY-MM-DD HH:mm"
|
||||||
class InfosBank extends Component{
|
class InfosBank extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props);
|
super(props);
|
||||||
this.state={
|
this.state={
|
||||||
category:"common",
|
category:"common",
|
||||||
type:"publicly",
|
type:"publicly",
|
||||||
page:1,
|
page:1,
|
||||||
per_page:16,
|
per_page:16,
|
||||||
sort_by:"updated_at",
|
sort_by:"updated_at",
|
||||||
CoursesId:undefined,
|
CoursesId:undefined,
|
||||||
|
|
||||||
totalCount:undefined,
|
totalCount:undefined,
|
||||||
data:undefined,
|
data:undefined,
|
||||||
isSpin:false,
|
isSpin:false,
|
||||||
|
|
||||||
dialogOpen:false,
|
dialogOpen:false,
|
||||||
modalsTopval:undefined,
|
modalsTopval:undefined,
|
||||||
modalsBottomval:undefined,
|
modalsBottomval:undefined,
|
||||||
modalSave:undefined
|
modalSave:undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount=()=>{
|
componentDidMount=()=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
isSpin:true
|
isSpin:true
|
||||||
})
|
})
|
||||||
let{category,type,page,sort_by,CoursesId}=this.state;
|
let{category,type,page,sort_by,CoursesId}=this.state;
|
||||||
this.getCourses(category,type,page,sort_by,CoursesId);
|
this.getCourses(category,type,page,sort_by,CoursesId);
|
||||||
}
|
}
|
||||||
|
|
||||||
getCourses=(category,type,page,sort_by,CoursesId)=>{
|
getCourses=(category,type,page,sort_by,CoursesId)=>{
|
||||||
let url=`/users/${this.props.match.params.username}/question_banks.json`;
|
let url=`/users/${this.props.match.params.username}/question_banks.json`;
|
||||||
axios.get((url),{params:{
|
axios.get((url),{params:{
|
||||||
category,
|
category,
|
||||||
type,
|
type,
|
||||||
page,
|
page,
|
||||||
sort_by,
|
sort_by,
|
||||||
per_page:category && page ==1?17:16,
|
per_page:category && page ==1?17:16,
|
||||||
course_list_id:CoursesId
|
course_list_id:CoursesId
|
||||||
}}).then((result)=>{
|
}}).then((result)=>{
|
||||||
if(result){
|
if(result){
|
||||||
this.setState({
|
this.setState({
|
||||||
totalCount:result.data.count,
|
totalCount:result.data.count,
|
||||||
data:result.data,
|
data:result.data,
|
||||||
isSpin:false
|
isSpin:false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch((error)=>{
|
}).catch((error)=>{
|
||||||
console.log(error);
|
console.log(error);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//切换种类
|
//切换种类
|
||||||
changeCategory=(cate)=>{
|
changeCategory=(cate)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
category:cate,
|
category:cate,
|
||||||
page:1,
|
page:1,
|
||||||
isSpin:true
|
isSpin:true
|
||||||
})
|
})
|
||||||
let{type,sort_by,CoursesId}=this.state;
|
let{type,sort_by,CoursesId}=this.state;
|
||||||
this.getCourses(cate,type,1,sort_by,CoursesId);
|
this.getCourses(cate,type,1,sort_by,CoursesId);
|
||||||
}
|
}
|
||||||
//切换状态
|
//切换状态
|
||||||
changeType=(type)=>{
|
changeType=(type)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
type:type,
|
type:type,
|
||||||
page:1,
|
page:1,
|
||||||
isSpin:true
|
isSpin:true
|
||||||
})
|
})
|
||||||
let{category,sort_by,CoursesId}=this.state;
|
let{category,sort_by,CoursesId}=this.state;
|
||||||
this.getCourses(category,type,1,sort_by,CoursesId);
|
this.getCourses(category,type,1,sort_by,CoursesId);
|
||||||
}
|
}
|
||||||
//切换页数
|
//切换页数
|
||||||
changePage=(page)=>{
|
changePage=(page)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
page,
|
page,
|
||||||
isSpin:true
|
isSpin:true
|
||||||
})
|
})
|
||||||
let{category,type,sort_by,CoursesId}=this.state;
|
let{category,type,sort_by,CoursesId}=this.state;
|
||||||
this.getCourses(category,type,page,sort_by,CoursesId);
|
this.getCourses(category,type,page,sort_by,CoursesId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 进入课堂
|
// 进入课堂
|
||||||
turnToCourses=(url)=>{
|
turnToCourses=(url)=>{
|
||||||
this.props.history.push(url);
|
this.props.history.push(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换排序方式
|
// 切换排序方式
|
||||||
changeOrder= (sort)=>{
|
changeOrder= (sort)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
sort_by:sort,
|
sort_by:sort,
|
||||||
isSpin:true
|
isSpin:true
|
||||||
})
|
})
|
||||||
let{category,type,page,CoursesId}=this.state;
|
let{category,type,page,CoursesId}=this.state;
|
||||||
this.getCourses(category,type,page,sort,CoursesId);
|
this.getCourses(category,type,page,sort,CoursesId);
|
||||||
}
|
}
|
||||||
|
|
||||||
changeCourseListId =(CoursesId)=>{
|
changeCourseListId =(CoursesId)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
CoursesId,
|
CoursesId,
|
||||||
isSpin:true
|
isSpin:true
|
||||||
})
|
})
|
||||||
let{category,type,sort,page}=this.state;
|
let{category,type,sort,page}=this.state;
|
||||||
this.getCourses(category,type,page,sort,CoursesId);
|
this.getCourses(category,type,page,sort,CoursesId);
|
||||||
}
|
}
|
||||||
|
|
||||||
//设为公开/删除
|
//设为公开/删除
|
||||||
setPublic=(index)=>{
|
setPublic=(index)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
dialogOpen:true,
|
dialogOpen:true,
|
||||||
modalsTopval:index==1?"您确定要公开吗?":"确定要删除该题吗?",
|
modalsTopval:index==1?"您确定要公开吗?":"确定要删除该题吗?",
|
||||||
modalsBottomval:index==1?"公开后不能重设为私有":"",
|
modalsBottomval:index==1?"公开后不能重设为私有":"",
|
||||||
modalSave:()=>this.sureOperation(index)
|
modalSave:()=>this.sureOperation(index)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 确定--设为公开/删除
|
// 确定--设为公开/删除
|
||||||
sureOperation=()=>{
|
sureOperation=()=>{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//弹框隐藏
|
//弹框隐藏
|
||||||
handleDialogClose=()=>{
|
handleDialogClose=()=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
dialogOpen:false
|
dialogOpen:false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
let{
|
let{
|
||||||
category,
|
category,
|
||||||
type,
|
type,
|
||||||
page,
|
page,
|
||||||
data,
|
data,
|
||||||
totalCount,
|
totalCount,
|
||||||
sort_by,
|
sort_by,
|
||||||
isSpin,
|
isSpin,
|
||||||
CoursesId,
|
CoursesId,
|
||||||
dialogOpen,
|
dialogOpen,
|
||||||
modalsTopval,
|
modalsTopval,
|
||||||
modalsBottomval,modalSave
|
modalsBottomval,modalSave
|
||||||
} = this.state;
|
} = this.state;
|
||||||
let isStudent = this.props.isStudent();
|
let isStudent = this.props.isStudent();
|
||||||
let is_current=this.props.is_current;
|
let is_current=this.props.is_current;
|
||||||
return(
|
return(
|
||||||
<div className="educontent">
|
<div className="educontent">
|
||||||
<Modals
|
<Modals
|
||||||
modalsType={dialogOpen}
|
modalsType={dialogOpen}
|
||||||
modalsTopval={modalsTopval}
|
modalsTopval={modalsTopval}
|
||||||
modalsBottomval={modalsBottomval}
|
modalsBottomval={modalsBottomval}
|
||||||
modalCancel={this.handleDialogClose}
|
modalCancel={this.handleDialogClose}
|
||||||
modalSave={modalSave}
|
modalSave={modalSave}
|
||||||
></Modals>
|
></Modals>
|
||||||
<Spin size="large" spinning={isSpin}>
|
<Spin size="large" spinning={isSpin}>
|
||||||
<div className="white-panel edu-back-white pt20 pb20 clearfix ">
|
<div className="white-panel edu-back-white pt20 pb20 clearfix ">
|
||||||
<li className={type=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("publicly")}>{is_current ? "我":"TA"}的题库</a></li>
|
<li className={type=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("publicly")}>{is_current ? "我":"TA"}的题库</a></li>
|
||||||
<li className={type=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("personal")}>公共题库</a></li>
|
<li className={type=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("personal")}>公共题库</a></li>
|
||||||
</div>
|
</div>
|
||||||
<div className="edu-back-white padding20-30 bor-top-greyE">
|
<div className="edu-back-white padding20-30 bor-top-greyE">
|
||||||
<ul className="clearfix secondNav">
|
<ul className="clearfix secondNav">
|
||||||
<li className={category=="common" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("common")}>普通作业</a></li>
|
<li className={category=="common" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("common")}>普通作业</a></li>
|
||||||
<li className={category=="group" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("group")}>分组作业</a></li>
|
<li className={category=="group" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("group")}>分组作业</a></li>
|
||||||
<li className={category=="exercise" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("exercise")}>试卷</a></li>
|
<li className={category=="exercise" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("exercise")}>试卷</a></li>
|
||||||
<li className={category=="poll" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("poll")}>问卷</a></li>
|
<li className={category=="poll" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("poll")}>问卷</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div className="edu-txt-left mt10 bankTag">
|
<div className="edu-txt-left mt10 bankTag">
|
||||||
<ul className="inline" id="sourceTag">
|
<ul className="inline" id="sourceTag">
|
||||||
<li className={ CoursesId ? "" : "active" } onClick={()=>this.changeCourseListId()}>
|
<li className={ CoursesId ? "" : "active" } onClick={()=>this.changeCourseListId()}>
|
||||||
<a href="javascript:void(0)">全部</a>
|
<a href="javascript:void(0)">全部</a>
|
||||||
</li>
|
</li>
|
||||||
{
|
{
|
||||||
data && data.course_list && data.course_list.map((item,key)=>{
|
data && data.course_list && data.course_list.map((item,key)=>{
|
||||||
return(
|
return(
|
||||||
<li className={CoursesId==item.id?"active":""} key={key} onClick={()=>this.changeCourseListId(`${item.id}`)}>
|
<li className={CoursesId==item.id?"active":""} key={key} onClick={()=>this.changeCourseListId(`${item.id}`)}>
|
||||||
<a href="javascript:void(0)">{item.name}</a>
|
<a href="javascript:void(0)">{item.name}</a>
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
|
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
|
||||||
<span className="fl color-grey-9">共参与{totalCount}个题库</span>
|
<span className="fl color-grey-9">共参与{totalCount}个题库</span>
|
||||||
<div className="fr">
|
<div className="fr">
|
||||||
<li className="drop_down">
|
<li className="drop_down">
|
||||||
<span className="color-grey-9 font-12">{sort_by=="updated_at"?"时间最新":sort_by=="name"?"作业名称":"贡献者"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
|
<span className="color-grey-9 font-12">{sort_by=="updated_at"?"时间最新":sort_by=="name"?"作业名称":"贡献者"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
|
||||||
<ul className="drop_down_normal">
|
<ul className="drop_down_normal">
|
||||||
<li onClick={()=>this.changeOrder("updated_at")}>时间最新</li>
|
<li onClick={()=>this.changeOrder("updated_at")}>时间最新</li>
|
||||||
<li onClick={()=>this.changeOrder("name")}>作业名称</li>
|
<li onClick={()=>this.changeOrder("name")}>作业名称</li>
|
||||||
<li onClick={()=>this.changeOrder("contributor")}>贡献者</li>
|
<li onClick={()=>this.changeOrder("contributor")}>贡献者</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
</p>
|
</p>
|
||||||
<div className="dataBank_list edu-back-white educontent">
|
<div className="dataBank_list edu-back-white educontent">
|
||||||
{
|
{
|
||||||
!data || data.question_banks.length==0 && <NoneData></NoneData>
|
!data || data.question_banks.length==0 && <NoneData></NoneData>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
data && data.question_banks && data.question_banks.map((item,key)=>{
|
data && data.question_banks && data.question_banks.map((item,key)=>{
|
||||||
return(
|
return(
|
||||||
<div className="dataBank_Item clearfix" key={key}>
|
<div className="dataBank_Item clearfix" key={key}>
|
||||||
<div className="fl dataItemLeft">
|
<div className="fl dataItemLeft">
|
||||||
<Checkbox value={item.id} key={item.id}></Checkbox>
|
<Checkbox value={item.id} key={item.id}></Checkbox>
|
||||||
</div>
|
</div>
|
||||||
<div className="fr dataItemRight bank_item">
|
<div className="fr dataItemRight bank_item">
|
||||||
<p className="mb10 clearfix">
|
<p className="mb10 clearfix">
|
||||||
<span className="dataTitle fl mr80">{item.name}</span>
|
<span className="dataTitle fl mr80">{item.name}</span>
|
||||||
<a href="javascript:void(0)" data-object="2599" className="bank_send fr">发送</a>
|
<a href="javascript:void(0)" data-object="2599" className="bank_send fr">发送</a>
|
||||||
{
|
{
|
||||||
item.is_public ==false ?
|
item.is_public ==false ?
|
||||||
<a href="javascript:void(0)" onClick={()=>this.setPublic(1)} className="bank_public color-blue_4C fr mr60">设为公开</a>:""
|
<a href="javascript:void(0)" onClick={()=>this.setPublic(1)} className="bank_public color-blue_4C fr mr60">设为公开</a>:""
|
||||||
}
|
}
|
||||||
</p>
|
</p>
|
||||||
<p className="itembottom clearfix">
|
<p className="itembottom clearfix">
|
||||||
<span className="fl bottomspan color-grey-9">{item.quotes_count}次引用</span>
|
<span className="fl bottomspan color-grey-9">{item.quotes_count}次引用</span>
|
||||||
<span className="fl bottomspan color-grey-9">{item.solve_count}次答题</span>
|
<span className="fl bottomspan color-grey-9">{item.solve_count}次答题</span>
|
||||||
<span className="fl bottomspan color-grey-9">{moment(item.updated_at).format('YYYY-MM-DD HH:mm')}</span>
|
<span className="fl bottomspan color-grey-9">{moment(item.updated_at).format('YYYY-MM-DD HH:mm')}</span>
|
||||||
<span className="fr"><a href="javascript:void(0)" className="bank_delete color-grey-9" onClick={()=>this.setPublic(2)}>删除</a></span>
|
<span className="fr"><a href="javascript:void(0)" className="bank_delete color-grey-9" onClick={()=>this.setPublic(2)}>删除</a></span>
|
||||||
<span className="bank_list_Tag">{item.course_list_name}</span>
|
<span className="bank_list_Tag">{item.course_list_name}</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
totalCount > 15 &&
|
totalCount > 15 &&
|
||||||
<div className="mt30 mb50 edu-txt-center">
|
<div className="mt30 mb50 edu-txt-center">
|
||||||
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
|
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</Spin>
|
</Spin>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default InfosBank;
|
export default InfosBank;
|
@ -1,115 +1,122 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
import {Link} from 'react-router-dom';
|
import {Link} from 'react-router-dom';
|
||||||
import {Tooltip,Menu} from 'antd';
|
import {Tooltip,Menu} from 'antd';
|
||||||
import {getImageUrl} from 'educoder';
|
import {getImageUrl} from 'educoder';
|
||||||
|
|
||||||
import "./usersInfo.css"
|
import "./usersInfo.css"
|
||||||
import "../../courses/css/members.css"
|
import "../../courses/css/members.css"
|
||||||
import "../../courses/css/Courses.css"
|
import "../../courses/css/Courses.css"
|
||||||
|
|
||||||
import banner from '../../../images/account/infobanner.png'
|
import { LinkAfterLogin } from 'educoder'
|
||||||
|
|
||||||
class InfosBanner extends Component{
|
class InfosBanner extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props);
|
super(props);
|
||||||
}
|
}
|
||||||
render(){
|
render(){
|
||||||
let {
|
let {
|
||||||
data ,
|
data ,
|
||||||
id,
|
id,
|
||||||
login,
|
login,
|
||||||
moduleName,
|
moduleName,
|
||||||
current_user,
|
current_user,
|
||||||
}=this.props;
|
}=this.props;
|
||||||
let is_current=this.props.is_current;
|
let is_current=this.props.is_current;
|
||||||
let {username}= this.props.match.params;
|
let {username}= this.props.match.params;
|
||||||
let {pathname}=this.props.location;
|
let {pathname}=this.props.location;
|
||||||
moduleName=pathname.split("/")[3];
|
moduleName=pathname.split("/")[3];
|
||||||
return(
|
return(
|
||||||
<div className="bannerPanel mb60">
|
<div className="bannerPanel mb60">
|
||||||
<div className="educontent">
|
<div className="educontent">
|
||||||
<div className="clearfix color-white mb25">
|
<div className="clearfix color-white mb25">
|
||||||
<p className="myPhoto mr20 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/></p>
|
<p className="myPhoto mr20 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/></p>
|
||||||
<div className="fl">
|
<div className="fl">
|
||||||
<p className="clearfix mt20">
|
<p className="clearfix mt20">
|
||||||
<span className="username task-hide" style={{"maxWidth":'370px'}}>{data && data.name}</span>
|
<span className="username task-hide" style={{"maxWidth":'370px'}}>{data && data.name}</span>
|
||||||
{
|
{
|
||||||
data && is_current == false && data.identity =="学生" ? "" :
|
data && is_current == false && data.identity =="学生" ? "" :
|
||||||
<span className="userpost"><label>{data && data.identity}</label></span>
|
<span className="userpost"><label>{data && data.identity}</label></span>
|
||||||
}
|
}
|
||||||
</p>
|
</p>
|
||||||
<p className="mt15">
|
<p className="mt15">
|
||||||
<Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}>
|
<Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}>
|
||||||
<i className={ data && data.professional_certification ? "iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-green mr20 ml2":"iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-B8 mr20 ml2"}></i>
|
<i className={ data && data.professional_certification ? "iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-green mr20 ml2":"iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-B8 mr20 ml2"}></i>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
|
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
|
||||||
<i className={ data && data.authentication ? "iconfont icon-renzhengshangjia font-18 user-colorgrey-green":"iconfont icon-renzhengshangjia font-18 user-colorgrey-B8"}></i>
|
<i className={ data && data.authentication ? "iconfont icon-renzhengshangjia font-18 user-colorgrey-green":"iconfont icon-renzhengshangjia font-18 user-colorgrey-B8"}></i>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="fr">
|
<div className="fr">
|
||||||
<div class="fl headtab mt20">
|
<div class="fl headtab mt20">
|
||||||
<span>{is_current ? "我":"TA"}的经验值</span>
|
<span>{is_current ? "我":"TA"}的经验值</span>
|
||||||
<a style={{"cursor":"default"}}>{data && data.experience}</a>
|
<a style={{"cursor":"default"}}>{data && data.experience}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="fl headtab mt20 pr leftTransform pl20">
|
<div class="fl headtab mt20 pr leftTransform pl20">
|
||||||
<span>{is_current ? "我":"TA"}的金币</span>
|
<span>{is_current ? "我":"TA"}的金币</span>
|
||||||
<a style={{"cursor":"default"}}>{data && data.grade}</a>
|
<a style={{"cursor":"default"}}>{data && data.grade}</a>
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
is_current ?
|
is_current ?
|
||||||
<span className="fl mt35 ml60">
|
<span className="fl mt35 ml60">
|
||||||
{
|
{
|
||||||
data && data.attendance_signed ?
|
data && data.attendance_signed ?
|
||||||
<span className="user_default_btn user_grey_btn font-18">已签到</span>
|
<span className="user_default_btn user_grey_btn font-18">已签到</span>
|
||||||
:
|
:
|
||||||
<a herf="javascript:void(0);" onClick={this.props.signFor} className="user_default_btn user_yellow_btn fl font-18">签到</a>
|
<a herf="javascript:void(0);" onClick={this.props.signFor} className="user_default_btn user_yellow_btn fl font-18">签到</a>
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
:
|
:
|
||||||
<span className="fl mt35 ml60">
|
<span className="fl mt35 ml60">
|
||||||
<a href={`/messages/${login}/message_detail?target_ids=${id}`} className="user_default_btn user_yellow_btn fl font-18">私信</a>
|
<LinkAfterLogin
|
||||||
</span>
|
{...this.props}
|
||||||
}
|
{...this.state}
|
||||||
</div>
|
className="user_default_btn user_yellow_btn fl font-18"
|
||||||
</div>
|
to={`/messages/${login}/message_detail?target_ids=${id}`}
|
||||||
<div className="userNav">
|
>
|
||||||
<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
|
私信
|
||||||
<Link
|
</LinkAfterLogin>
|
||||||
onClick={() => this.setState({moduleName: 'courses'})}
|
</span>
|
||||||
to={`/users/${username}/courses`}>翻转课堂</Link>
|
}
|
||||||
</li>
|
</div>
|
||||||
<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
|
</div>
|
||||||
<Link
|
<div className="userNav">
|
||||||
onClick={() => this.setState({moduleName: 'shixuns'})}
|
<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
|
||||||
to={`/users/${username}/shixuns`}>实训项目</Link>
|
<Link
|
||||||
</li>
|
onClick={() => this.setState({moduleName: 'courses'})}
|
||||||
<li className={`${moduleName == 'paths' ? 'active' : '' }`}>
|
to={`/users/${username}/courses`}>翻转课堂</Link>
|
||||||
<Link
|
</li>
|
||||||
onClick={() => this.setState({moduleName: 'paths'})}
|
<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
|
||||||
to={`/users/${username}/paths`}>实践课程</Link>
|
<Link
|
||||||
</li>
|
onClick={() => this.setState({moduleName: 'shixuns'})}
|
||||||
<li className={`${moduleName == 'projects' ? 'active' : '' }`}>
|
to={`/users/${username}/shixuns`}>开发社区</Link>
|
||||||
<Link
|
</li>
|
||||||
onClick={() => this.setState({moduleName: 'projects'})}
|
<li className={`${moduleName == 'paths' ? 'active' : '' }`}>
|
||||||
to={`/users/${username}/projects`}>开发项目</Link>
|
<Link
|
||||||
</li>
|
onClick={() => this.setState({moduleName: 'paths'})}
|
||||||
<li className={`${moduleName == 'package' ? 'active' : '' }`}>
|
to={`/users/${username}/paths`}>实践课程</Link>
|
||||||
<Link
|
</li>
|
||||||
onClick={() => this.setState({moduleName: 'package'})}
|
<li className={`${moduleName == 'projects' ? 'active' : '' }`}>
|
||||||
to={`/users/${username}/package`}>众包</Link>
|
<Link
|
||||||
</li>
|
onClick={() => this.setState({moduleName: 'projects'})}
|
||||||
{((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
|
to={`/users/${username}/projects`}>项目</Link>
|
||||||
&& <li className={`${moduleName == 'videos' ? 'active' : '' }`}>
|
</li>
|
||||||
<Link
|
<li className={`${moduleName == 'package' ? 'active' : '' }`}>
|
||||||
onClick={() => this.setState({moduleName: 'videos'})}
|
<Link
|
||||||
to={`/users/${username}/videos`}>视频</Link>
|
onClick={() => this.setState({moduleName: 'package'})}
|
||||||
</li>}
|
to={`/users/${username}/package`}>众包</Link>
|
||||||
</div>
|
</li>
|
||||||
</div>
|
{((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
|
||||||
</div>
|
&& <li className={`${moduleName == 'videos' ? 'active' : '' }`}>
|
||||||
)
|
<Link
|
||||||
}
|
onClick={() => this.setState({moduleName: 'videos'})}
|
||||||
}
|
to={`/users/${username}/videos`}>视频</Link>
|
||||||
|
</li>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
export default InfosBanner;
|
export default InfosBanner;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue