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

dev_auth
cxt 6 years ago
commit 941aa4e1ba

@ -0,0 +1,18 @@
$(document).on('turbolinks:load', function() {
$('.admin-modal-container').on('show.bs.modal', '.modal.admin-edit-subject-modal', function(){
var $modal = $('.modal.admin-edit-subject-modal');
var $form = $modal.find('form.admin-edit-subject-form');
$modal.on('click', '.submit-btn', function(){
$form.find('.error').html('');
var url = $form.attr('action');
$.ajax({
method: 'PATCH',
dataType: 'script',
url: url,
data: $form.serialize()
});
});
})
});

@ -46,5 +46,62 @@ $(document).on('turbolinks:load', function() {
$imageElement.show(); $imageElement.show();
$imageElement.next().html('重新上传'); $imageElement.next().html('重新上传');
}) })
// 定义状态切换监听事件
var defineStatusChangeFunc = function(doElement, undoElement, url, callback){
$('.subject-list-container').on('click', doElement, function(){
var $doAction = $(this);
var $undoAction = $doAction.siblings(undoElement);
var subjectId = $doAction.data('id');
customConfirm({
content: '确认进行该操作吗?',
ok: function(){
$.ajax({
url: '/admins/subjects/' + subjectId + url,
method: 'POST',
dataType: 'json',
success: function() {
show_success_flash();
$doAction.hide();
$undoAction.show();
if(callback && typeof callback === "function"){
callback(subjectId, url);
}
}
});
}
});
});
}
// 隐藏与取消隐藏
defineStatusChangeFunc('.hide-action', '.active-action', '/hide');
defineStatusChangeFunc('.active-action', '.hide-action', '/cancel_hide');
// 首页展示与取消首页展示
var homepageShowCallback = function(subjectId, url){
var $subjectItem = $('.subject-list-container').find('.subject-item-' + subjectId);
if(url === '/homepage_show'){
$subjectItem.find('.homepage-show-badge').show();
} else {
$subjectItem.find('.homepage-show-badge').hide();
}
}
defineStatusChangeFunc('.homepage-show-action', '.homepage-hide-action', '/homepage_show', homepageShowCallback);
defineStatusChangeFunc('.homepage-hide-action', '.homepage-show-action', '/cancel_homepage_show', homepageShowCallback);
// 设为金课与取消金课
var excellentCallback = function(subjectId, url){
var $subjectItem = $('.subject-list-container').find('.subject-item-' + subjectId);
if(url === '/excellent'){
$subjectItem.find('.excellent-badge').show();
} else {
$subjectItem.find('.excellent-badge').hide();
}
}
defineStatusChangeFunc('.excellent-action', '.cancel-excellent-action', '/excellent', excellentCallback);
defineStatusChangeFunc('.cancel-excellent-action', '.excellent-action', '/cancel_excellent', excellentCallback);
} }
}); });

@ -66,9 +66,9 @@ function customConfirm(opts){
return $.confirm($.extend({}, defaultOpts, opts)) return $.confirm($.extend({}, defaultOpts, opts))
} }
function show_success_flash(){ function show_success_flash(message){
$.notify({ $.notify({
message: '操作成功' message: message || '操作成功'
},{ },{
type: 'success' type: 'success'
}); });

@ -5,4 +5,67 @@ class Admins::SubjectsController < Admins::BaseController
subjects = Admins::SubjectQuery.call(params) subjects = Admins::SubjectQuery.call(params)
@subjects = paginate subjects.includes(:repertoire, :subject_level_system, user: { user_extension: :school }) @subjects = paginate subjects.includes(:repertoire, :subject_level_system, user: { user_extension: :school })
end end
def edit
@subject = current_subject
end
def update
current_subject.update!(update_params)
flash[:success] = '保存成功'
redirect_to admins_subjects_path
end
def destroy
current_subject.destroy!
render_delete_success
end
# 隐藏
def hide
current_subject.update!(hidden: true)
render_ok
end
# 展示
def cancel_hide
current_subject.update!(hidden: false)
render_ok
end
# 设为主页展示
def homepage_show
current_subject.update!(homepage_show: true)
render_ok
end
# 取消主页展示
def cancel_homepage_show
current_subject.update!(homepage_show: false)
render_ok
end
# 设为金课
def excellent
current_subject.update!(excellent: true)
render_ok
end
# 取消金课
def cancel_excellent
current_subject.update!(excellent: false)
render_ok
end
private
def current_subject
@_current_subject ||= Subject.find(params[:id])
end
def update_params
params.require(:subject).permit(:repertoire_id, :subject_level_system_id, :student_count)
end
end end

@ -6,24 +6,21 @@ class SyncTrustieJob < ApplicationJob
def perform(type, count) def perform(type, count)
Rails.logger.info("#######_________response__sync__start__#########") Rails.logger.info("#######_________response__sync__start__#########")
configs_content = Rails.application.config_for(:configuration)
token = configs_content["sync_token"] token = EduSetting.get('trustie_api_token')
token_url = configs_content["sync_url"] api_host = EduSetting.get('trustie_api_url')
url = "#{token_url}/api/v1/homes/sync_count"
url = "#{api_host}/api/v1/homes/sync_count"
sync_json = { sync_json = {
"token": token, "token": token,
"type": type, "type": type,
"number": count "number": count
} }
uri = URI.parse(url) uri = URI.parse(url)
http = Net::HTTP.new(uri.hostname, uri.port) if api_host
if token_url.include?("https://") http = Net::HTTP.new(uri.hostname, uri.port)
http.use_ssl = true http.send_request('PUT', uri.path, sync_json.to_json, {'Content-Type' => 'application/json'})
Rails.logger.info("#######_________response__sync__end_____#########")
end end
response = http.send_request('PUT', uri.path, sync_json.to_json, {'Content-Type' => 'application/json'})
Rails.logger.info("#######_________response__sync__end_____#########{response.body}")
end end
end end

@ -12,4 +12,8 @@ class ApplicationRecord < ActiveRecord::Base
def display_extra_data(key) def display_extra_data(key)
_extra_data&.[](key) _extra_data&.[](key)
end end
def allow_sync_to_trustie?
Rails.env.production? && EduSetting.get('host_name') == 'https://www.educoder.net'
end
end end

@ -8,7 +8,9 @@ class Project < ApplicationRecord
has_many :issues has_many :issues
has_many :user_grades, dependent: :destroy has_many :user_grades, dependent: :destroy
after_create :sync_project_trustie #同步到trustie after_create do
SyncTrustieJob.perform_later("project", 1) if allow_sync_to_trustie?
end #同步到trustie
# 创建者 # 创建者
def creator def creator
@ -23,7 +25,4 @@ class Project < ApplicationRecord
members.exists?(user_id: user.id) members.exists?(user_id: user.id)
end end
def sync_project_trustie
SyncTrustieJob.perform_later("project", 1)
end
end end

@ -19,7 +19,9 @@ class School < ApplicationRecord
has_many :apply_add_departments, dependent: :destroy has_many :apply_add_departments, dependent: :destroy
has_many :user_extensions, dependent: :nullify has_many :user_extensions, dependent: :nullify
after_create :sync_school_trustie #同步到trustie after_create do
SyncTrustieJob.perform_later("school", 1) if allow_sync_to_trustie? #同步到trustie
end
# 学校管理员 # 学校管理员
def manager?(user) def manager?(user)
@ -41,8 +43,4 @@ class School < ApplicationRecord
def manage_permission?(user) def manage_permission?(user)
manager?(user) || major_manager?(user) || course_manager?(user) manager?(user) || major_manager?(user) || course_manager?(user)
end end
def sync_school_trustie
SyncTrustieJob.perform_later("school", 1)
end
end end

@ -75,7 +75,11 @@ class Shixun < ApplicationRecord
scope :field_for_recommend, lambda{ select([:id, :name, :identifier, :myshixuns_count]) } scope :field_for_recommend, lambda{ select([:id, :name, :identifier, :myshixuns_count]) }
scope :find_by_ids,lambda{|k| where(id:k)} scope :find_by_ids,lambda{|k| where(id:k)}
after_create :send_tiding, :sync_shixun_trustie #同步到trustie after_create :send_tiding
#同步到trustie
after_create do
SyncTrustieJob.perform_later("practical_training_project", 1) if allow_sync_to_trustie?
end
# REDO:  # REDO: 
def propaedeutics def propaedeutics
@ -290,10 +294,6 @@ class Shixun < ApplicationRecord
subjects.where(hidden: 0).uniq subjects.where(hidden: 0).uniq
end end
def sync_shixun_trustie
SyncTrustieJob.perform_later("practical_training_project", 1)
end
private private
def send_tiding def send_tiding

@ -5,7 +5,7 @@ class Subject < ApplicationRecord
include Searchable::Subject include Searchable::Subject
#status :0 编辑中 1 审核中 2 发布 #status :0 编辑中 1 审核中 2 发布
belongs_to :repertoire belongs_to :repertoire, optional: true
belongs_to :user belongs_to :user
belongs_to :subject_level_system, optional: true belongs_to :subject_level_system, optional: true

@ -156,7 +156,9 @@ class User < ApplicationRecord
delegate :gender, :department_id, :school_id, :location, :location_city, :technical_title, to: :user_extension, allow_nil: true delegate :gender, :department_id, :school_id, :location, :location_city, :technical_title, to: :user_extension, allow_nil: true
before_save :update_hashed_password before_save :update_hashed_password
after_create :sync_user_trustie #同步到trustie after_create do
SyncTrustieJob.perform_later("user", 1) if allow_sync_to_trustie?
end
# #
# validations # validations
@ -314,10 +316,6 @@ class User < ApplicationRecord
shixun.shixun_members.exists?(role: 2, user_id: id) shixun.shixun_members.exists?(role: 2, user_id: id)
end end
def sync_user_trustie
SyncTrustieJob.perform_later("user", 1)
end
# TPI的创建者 # TPI的创建者
def creator_of_game?(game) def creator_of_game?(game)
id == game.user_id id == game.user_id

@ -0,0 +1,2 @@
$('.admin-modal-container').html("<%= j( render partial: 'admins/subjects/shared/edit_subject_modal', locals: { subject: @subject } ) %>");
$('.modal.admin-edit-subject-modal').modal('show');

@ -0,0 +1,33 @@
<div class="modal fade admin-edit-subject-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">编辑课程信息</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<%= simple_form_for([:admins, subject], html: { class: 'admin-edit-subject-form' }, defaults: { wrapper_html: { class: 'offset-md-1 col-md-10' } }) do |f| %>
<%= f.input :repertoire_id, label: '技术体系:' do %>
<% repertoire_options = Repertoire.order('CONVERT(name USING gbk) COLLATE gbk_chinese_ci ASC').map{|r| [r.name, r.id]} %>
<%= f.select :repertoire_id, [['请选择', '']] + repertoire_options, {}, class: 'form-control' %>
<% end %>
<%= f.input :subject_level_system_id, label: '等级体系:' do %>
<% level_options = SubjectLevelSystem.all.map{|r| [r.name, r.id]} %>
<%= f.select :subject_level_system_id, [['请选择', '']] + level_options, {}, class: 'form-control' %>
<% end %>
<%= f.input :student_count, as: :integer, label: '开课人数:' %>
<div class="error text-danger"></div>
<% end %>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

@ -7,12 +7,12 @@
<th width="8%">技术体系</th> <th width="8%">技术体系</th>
<th width="8%">等级体系</th> <th width="8%">等级体系</th>
<th width="8%">封面</th> <th width="8%">封面</th>
<th width="8%">创建者</th> <th width="7%">创建者</th>
<th width="10%">单位</th> <th width="10%">单位</th>
<th width="8%">开课人数</th> <th width="8%">开课人数</th>
<th width="10%"><%= sort_tag('创建时间', name: 'created_at', path: admins_subjects_path) %></th> <th width="10%"><%= sort_tag('创建时间', name: 'created_at', path: admins_subjects_path) %></th>
<th width="7%">状态</th> <th width="7%">状态</th>
<th width="14%">操作</th> <th width="15%">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -40,26 +40,26 @@
<td> <td>
<%= display_subject_status(subject) %> <%= display_subject_status(subject) %>
</td> </td>
<td> <td class="action-container">
<%#= javascript_void_link('编辑', class: 'edit-action') %> <%= link_to('编辑', edit_admins_subject_path(subject), remote: true, class: 'edit-action') %>
<%#= javascript_void_link('隐藏', class: 'hide-action', style: subject.hidden? ? 'display:none' : '') %> <%= javascript_void_link('隐藏', class: 'hide-action', data: { id: subject.id }, style: subject.hidden? ? 'display:none' : '') %>
<%#= javascript_void_link('取消隐藏', class: 'active-action', style: subject.hidden? ? '' : 'display:none') %> <%= javascript_void_link('取消隐藏', class: 'active-action', data: { id: subject.id }, style: subject.hidden? ? '' : 'display:none') %>
<%# if subject.published? %> <div class="d-inline">
<!-- <div class="d-inline">--> <%= javascript_void_link('更多', class: 'action dropdown-toggle', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) %>
<%#= javascript_void_link('更多', class: 'action dropdown-toggle', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) %> <div class="dropdown-menu more-action-dropdown">
<!-- <div class="dropdown-menu more-action-dropdown">--> <% if subject.published? %>
<%#= javascript_void_link('首页展示', class: 'dropdown-item homepage-show-action', style: subject.homepage_show? ? 'display:none' : '') %> <%= javascript_void_link('首页展示', class: 'dropdown-item homepage-show-action', data: { id: subject.id }, style: subject.homepage_show? ? 'display:none' : '') %>
<%#= javascript_void_link('取消首页展示', class: 'dropdown-item homepage-hide-action', style: subject.homepage_show? ? '' : 'display:none') %> <%= javascript_void_link('取消首页展示', class: 'dropdown-item homepage-hide-action', data: { id: subject.id }, style: subject.homepage_show? ? '' : 'display:none') %>
<%#= javascript_void_link('选为金课', class: 'dropdown-item excellent-action', style: subject.excellent? ? 'display:none' : '') %> <%= javascript_void_link('选为金课', class: 'dropdown-item excellent-action', data: { id: subject.id }, style: subject.excellent? ? 'display:none' : '') %>
<%#= javascript_void_link('取消金课', class: 'dropdown-item cancel-excellent-action', style: subject.excellent? ? '' : 'display:none') %> <%= javascript_void_link('取消金课', class: 'dropdown-item cancel-excellent-action', data: { id: subject.id }, style: subject.excellent? ? '' : 'display:none') %>
<% end %>
<%#= delete_link '删除', admins_subjects_path(subject, element: ".subject-item-#{subject.id}"), class: 'delete-subject-action' %> <%= delete_link '删除', admins_subject_path(subject, element: ".subject-item-#{subject.id}"), class: 'dropdown-item delete-subject-action' %>
<!-- </div>--> </div>
<!-- </div>--> </div>
<%# end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>

@ -1052,7 +1052,16 @@ Rails.application.routes.draw do
post :drag, on: :collection post :drag, on: :collection
end end
resources :subjects, only: [:index] resources :subjects, only: [:index, :edit, :update, :destroy] do
member do
post :hide
post :cancel_hide
post :homepage_show
post :cancel_homepage_show
post :excellent
post :cancel_excellent
end
end
end end
namespace :cooperative do namespace :cooperative do

@ -0,0 +1,8 @@
class InitTrustieConfig < ActiveRecord::Migration[5.2]
def change
hash = {"trustie_api_token" => "", "trustie_api_url" => ""}
hash.each { |key, value|
EduSetting.find_or_create_by(name: key, value: value)
}
end
end

File diff suppressed because one or more lines are too long

@ -29898,9 +29898,9 @@ function customConfirm(opts){
return $.confirm($.extend({}, defaultOpts, opts)) return $.confirm($.extend({}, defaultOpts, opts))
} }
function show_success_flash(){ function show_success_flash(message){
$.notify({ $.notify({
message: '操作成功' message: message || '操作成功'
},{ },{
type: 'success' type: 'success'
}); });
@ -137789,6 +137789,24 @@ $(document).on('turbolinks:load', function() {
}); });
}) })
}); });
$(document).on('turbolinks:load', function() {
$('.admin-modal-container').on('show.bs.modal', '.modal.admin-edit-subject-modal', function(){
var $modal = $('.modal.admin-edit-subject-modal');
var $form = $modal.find('form.admin-edit-subject-form');
$modal.on('click', '.submit-btn', function(){
$form.find('.error').html('');
var url = $form.attr('action');
$.ajax({
method: 'PATCH',
dataType: 'script',
url: url,
data: $form.serialize()
});
});
})
});
$(document).on('turbolinks:load', function() { $(document).on('turbolinks:load', function() {
var $modal = $('.modal.admin-import-course-member-modal'); var $modal = $('.modal.admin-import-course-member-modal');
if ($modal.length > 0) { if ($modal.length > 0) {
@ -138526,6 +138544,63 @@ $(document).on('turbolinks:load', function() {
$imageElement.show(); $imageElement.show();
$imageElement.next().html('重新上传'); $imageElement.next().html('重新上传');
}) })
// 定义状态切换监听事件
var defineStatusChangeFunc = function(doElement, undoElement, url, callback){
$('.subject-list-container').on('click', doElement, function(){
var $doAction = $(this);
var $undoAction = $doAction.siblings(undoElement);
var subjectId = $doAction.data('id');
customConfirm({
content: '确认进行该操作吗?',
ok: function(){
$.ajax({
url: '/admins/subjects/' + subjectId + url,
method: 'POST',
dataType: 'json',
success: function() {
show_success_flash();
$doAction.hide();
$undoAction.show();
if(callback && typeof callback === "function"){
callback(subjectId, url);
}
}
});
}
});
});
}
// 隐藏与取消隐藏
defineStatusChangeFunc('.hide-action', '.active-action', '/hide');
defineStatusChangeFunc('.active-action', '.hide-action', '/cancel_hide');
// 首页展示与取消首页展示
var homepageShowCallback = function(subjectId, url){
var $subjectItem = $('.subject-list-container').find('.subject-item-' + subjectId);
if(url === '/homepage_show'){
$subjectItem.find('.homepage-show-badge').show();
} else {
$subjectItem.find('.homepage-show-badge').hide();
}
}
defineStatusChangeFunc('.homepage-show-action', '.homepage-hide-action', '/homepage_show', homepageShowCallback);
defineStatusChangeFunc('.homepage-hide-action', '.homepage-show-action', '/cancel_homepage_show', homepageShowCallback);
// 设为金课与取消金课
var excellentCallback = function(subjectId, url){
var $subjectItem = $('.subject-list-container').find('.subject-item-' + subjectId);
if(url === '/excellent'){
$subjectItem.find('.excellent-badge').show();
} else {
$subjectItem.find('.excellent-badge').hide();
}
}
defineStatusChangeFunc('.excellent-action', '.cancel-excellent-action', '/excellent', excellentCallback);
defineStatusChangeFunc('.cancel-excellent-action', '.excellent-action', '/cancel_excellent', excellentCallback);
} }
}); });
$(document).on('turbolinks:load', function() { $(document).on('turbolinks:load', function() {

File diff suppressed because one or more lines are too long

@ -951,9 +951,8 @@ class Registration extends React.Component {
{ {
type === 4 || type === 5 ? type === 4 || type === 5 ?
<RegistrationSearch {...this.props} {...this.state} <RegistrationSearch {...this.props} {...this.state} count={count}
count={count} RegistrationSearchvalue={(value) => this.RegistrationSearchvalue(value)}></RegistrationSearch>
RegistrationSearchvalue={(value) => this.RegistrationSearchvalue(value)}></RegistrationSearch>
: "" : ""
} }
{/*<Registrationitem></Registrationitem>*/} {/*<Registrationitem></Registrationitem>*/}

@ -63,7 +63,9 @@ class RegistrationSearch extends React.Component {
lineHeight: " 24px" lineHeight: " 24px"
}}>战队总数<span }}>战队总数<span
style={{color: "#459BE5", fontSize: "16px"}}>{this.props.count}</span><span style={{color: "#459BE5", fontSize: "16px"}}>{this.props.count}</span><span
style={{marginLeft: "5px",}}></span></p> style={{marginLeft: "5px", marginRight: "15px",}}></span> <span
style={{color: "#459BE5"}}>{this.props.members_count}</span><span
style={{marginLeft: "5px"}}></span></p>
</div> </div>
) )
} }

@ -53,14 +53,6 @@ class CompetitionsIndex extends Component{
this.getdata(e.key,page) this.getdata(e.key,page)
}; };
setcompetitonurl=(url)=>{
if(url!=null){
// this.props.history.push(url);
window.location.href=url;
}
}
PaginationCourse=(pageNumber)=>{ PaginationCourse=(pageNumber)=>{
let {category}=this.state; let {category}=this.state;
this.setState({ this.setState({
@ -68,6 +60,7 @@ class CompetitionsIndex extends Component{
}) })
this.getdata(category,pageNumber); this.getdata(category,pageNumber);
} }
render() { render() {
let {datas,page,count}=this.state; let {datas,page,count}=this.state;
@ -124,14 +117,14 @@ class CompetitionsIndex extends Component{
size="large" size="large"
dataSource={datas&&datas} dataSource={datas&&datas}
renderItem={(item,key) => ( renderItem={(item,key) => (
<a target="_blank" href={item.competition_status==="ended"?`/competitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/competitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/competitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/competitions/${item.identifier}/common_header`:null} <a target="_blank" href={item.competition_status==="ended"?`/competitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"?item.permission.editable==true?`/competitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/competitions/${item.identifier}/common_header`:null}
className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"? className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"?
this.props.current_user&&this.props.current_user.admin===true?"competitionstitlesshou":this.props.current_user&&this.props.current_user.business===true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"} item.permission.editable==true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"}
> >
<div className={"CompetitionsList"} > <div className={"CompetitionsList"} >
{item.competition_status==="nearly_published"? {item.competition_status==="nearly_published"?
this.props.current_user&&this.props.current_user.admin===true?"":this.props.current_user&&this.props.current_user.business===true?"":<div className={"CompetitionsListzhezhao"}>即将发布 敬请期待</div>:""} item.permission.editable==true?"":<div className={"CompetitionsListzhezhao"}>即将发布 敬请期待</div>:""}
{/*<div className={"CompetitionsListzhezhao"}>即将发布 敬请期待</div>*/} {/*<div className={"CompetitionsListzhezhao"}>即将发布 敬请期待</div>*/}
{/*{item.description===null||item.description===undefined||item.description===""?<style>*/} {/*{item.description===null||item.description===undefined||item.description===""?<style>*/}
{/*{*/} {/*{*/}
@ -180,9 +173,9 @@ class CompetitionsIndex extends Component{
> >
<List.Item.Meta <List.Item.Meta
title={<a className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"? title={<a className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"?
this.props.current_user&&this.props.current_user.admin===true?"competitionstitlesshou":this.props.current_user&&this.props.current_user.business===true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"}> item.permission.editable==true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"}>
<a target="_blank" className={"competitionstitles"} <a target="_blank" className={"competitionstitles"}
href={item.competition_status==="ended"?`/competitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/competitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/competitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/competitions/${item.identifier}/common_header`:null} href={item.competition_status==="ended"?`/competitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? item.permission.editable==true?`/competitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/competitions/${item.identifier}/common_header`:null}
>{item.name}{item.sub_title===null?"":`——${item.sub_title}`}</a> >{item.name}{item.sub_title===null?"":`——${item.sub_title}`}</a>
{/*<span>{item.sub_title===null?"":*/} {/*<span>{item.sub_title===null?"":*/}
{/*<Tag className="competitionsrelative" color="#87d068">{item.sub_title}</Tag>}*/} {/*<Tag className="competitionsrelative" color="#87d068">{item.sub_title}</Tag>}*/}

@ -27,6 +27,7 @@ const CommonWorkSetting = Loadable({
loader: () => import('./CommonWorkSetting'), loader: () => import('./CommonWorkSetting'),
loading:Loading, loading:Loading,
}) })
//普通作业列表
const CommonWorkList = Loadable({ const CommonWorkList = Loadable({
loader: () => import('./CommonWorkList'), loader: () => import('./CommonWorkList'),
loading:Loading, loading:Loading,

@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip,Spin, Pagination} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip,Spin, Pagination} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import locale from 'antd/lib/date-picker/locale/zh_CN'; import locale from 'antd/lib/date-picker/locale/zh_CN';
import { WordsBtn, ConditionToolTip, queryString,getImageUrl, on, off, NoneData} from 'educoder'; import {WordsBtn, ConditionToolTip, queryString, getImageUrl, on, off, NoneData, sortDirections} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
@ -97,7 +97,7 @@ function buildColumns(that, student_works, studentData) {
}} title={text && text.length > 5 ? text : ''}> }} title={text && text.length > 5 ? text : ''}>
{/* <Tooltip placement="bottom" title={text}> {/* <Tooltip placement="bottom" title={text}>
</Tooltip> */} </Tooltip> */}
{record.is_leader ? {record.is_leader ?
<div style={{ display: 'flex', 'flex-direction': 'column', 'align-items': 'center'}}> <div style={{ display: 'flex', 'flex-direction': 'column', 'align-items': 'center'}}>
<div >{text}</div> <div >{text}</div>
<LeaderIcon></LeaderIcon> <LeaderIcon></LeaderIcon>
@ -112,12 +112,13 @@ function buildColumns(that, student_works, studentData) {
title: '学号', title: '学号',
dataIndex: 'student_id', dataIndex: 'student_id',
key: 'student_id', key: 'student_id',
sorter: true,
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a href="javascript:;" <a href="javascript:;"
title={text && text.length > 12 ? text : ''} title={text && text.length > 12 ? text : ''}
style={{color:'#9A9A9A', 'text-overflow': 'ellipsis', 'white-space': 'nowrap', 'width': '98px', display: 'block', overflow: 'hidden' style={{color:'#9A9A9A', 'text-overflow': 'ellipsis', 'white-space': 'nowrap', 'width': '98px', display: 'block', overflow: 'hidden'
, margin: '0 auto', cursor: 'default'}} , margin: '0 auto', cursor: 'default'}}
>{record.student_id}</a> >{record.student_id}</a>
</span> </span>
@ -131,9 +132,8 @@ function buildColumns(that, student_works, studentData) {
title: '分班', title: '分班',
key: 'group_name', key: 'group_name',
dataIndex: 'group_name', dataIndex: 'group_name',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a href="javascript:;" style={{color:'#9A9A9A', cursor: 'default'}}>{record.group_name}</a> <a href="javascript:;" style={{color:'#9A9A9A', cursor: 'default'}}>{record.group_name}</a>
</span> </span>
), ),
@ -162,9 +162,10 @@ function buildColumns(that, student_works, studentData) {
render: (project_info, record) => ( render: (project_info, record) => (
<span> <span>
{project_info && project_info.name && <a href={project_info.id == -1 ? 'javascript:void(0)' : `/projects/${project_info.id}`} {project_info && project_info.name &&
target={ project_info.id == -1 ? '' : "_blank" } <a href={project_info.id == -1 ? 'javascript:void(0)' : `/projects/${project_info.id}`}
className="overflowHidden1" style={{color:'#4CACFF', width: that.state.anonymous_comment ? '80px' : '130px', margin: '0 auto', display: 'block'}} title={project_info.name} target={ project_info.id == -1 ? '' : "_blank" }
className="overflowHidden1" style={{color:'#4CACFF', width: that.state.anonymous_comment ? '80px' : '130px', margin: '0 auto', display: 'block'}} title={project_info.name}
>{project_info.name}</a>} >{project_info.name}</a>}
</span> </span>
), ),
@ -201,7 +202,9 @@ function buildColumns(that, student_works, studentData) {
title: '更新时间', title: '更新时间',
dataIndex: 'update_time', dataIndex: 'update_time',
key: 'update_time', key: 'update_time',
sorter: true,
defaultSortOrder: 'descend',
sortDirections: sortDirections,
render: (update_time, record) => ( render: (update_time, record) => (
<span> <span>
<a href="javascript:;" style={{color:'#989898', cursor: 'default'}}>{update_time ? moment(update_time).format('YYYY-MM-DD HH:mm') : '--'}</a> <a href="javascript:;" style={{color:'#989898', cursor: 'default'}}>{update_time ? moment(update_time).format('YYYY-MM-DD HH:mm') : '--'}</a>
@ -233,7 +236,7 @@ function buildColumns(that, student_works, studentData) {
/** /**
* 2名助教进行了评分 * 2名助教进行了评分
平均分85.0 平均分85.0
* *
*/ */
render: (teaching_asistant_score, record) => ( render: (teaching_asistant_score, record) => (
<span> <span>
@ -253,10 +256,9 @@ function buildColumns(that, student_works, studentData) {
} }
if (that.state.anonymous_comment) { if (that.state.anonymous_comment) {
/** /**
开启了匿评的才显示此列悬浮TIP示例 开启了匿评的才显示此列悬浮TIP示例
3名学生进行了匿评 3名学生进行了匿评
有效平均分80.0 有效平均分80.0
*/ */
@ -293,7 +295,7 @@ function buildColumns(that, student_works, studentData) {
render: (appeal_all_count, record) => ( render: (appeal_all_count, record) => (
<span> <span>
{ !!appeal_all_count && {!!appeal_all_count &&
<Tooltip placement="bottom" title={`共有${appeal_all_count}条匿评申诉,${record.appeal_deal_count}条待处理`}> <Tooltip placement="bottom" title={`共有${appeal_all_count}条匿评申诉,${record.appeal_deal_count}条待处理`}>
<span style={{ minWidth: '30px', display: 'inline-block', textAlign: 'center' }}> <span style={{ minWidth: '30px', display: 'inline-block', textAlign: 'center' }}>
{`${record.appeal_deal_count}/${appeal_all_count}`} {`${record.appeal_deal_count}/${appeal_all_count}`}
@ -306,10 +308,12 @@ function buildColumns(that, student_works, studentData) {
} }
if (!niPingAndIsStudent) { if (!niPingAndIsStudent) {
columns.push({ columns.push({
width: 70, width: '113px',
title: '最终成绩', title: '最终成绩',
key: 'work_score', key: 'work_score',
dataIndex: 'work_score', dataIndex: 'work_score',
sorter: true,
sortDirections: sortDirections,
render: (work_score, record) => { render: (work_score, record) => {
return ( return (
<span> <span>
@ -317,8 +321,8 @@ function buildColumns(that, student_works, studentData) {
getScoreTip(work_score, getScoreTip(work_score,
<div> <div>
<div>{`${record.user_name}${record.user_login}`}</div> <div>{`${record.user_name}${record.user_login}`}</div>
{ record.ultimate_score ? {record.ultimate_score ?
<div>最终调整成绩{record.work_score}</div> : <div>最终调整成绩{record.work_score}</div> :
<div> <div>
{ record.final_score && <div>作业评分{record.final_score}</div> } { record.final_score && <div>作业评分{record.final_score}</div> }
{ record.late_penalty >= 0 && <div>迟交扣分{record.late_penalty}</div>} { record.late_penalty >= 0 && <div>迟交扣分{record.late_penalty}</div>}
@ -396,6 +400,7 @@ class CommonWorkList extends Component{
isSpin:true, isSpin:true,
left_time: {}, left_time: {},
category: {}, category: {},
b_order: 'desc',
} }
} }
onTablePagination = (page) => { onTablePagination = (page) => {
@ -412,6 +417,7 @@ class CommonWorkList extends Component{
} }
componentDidMount() { componentDidMount() {
console.log("CommonWorkList 分班list 开始加载");
this.fetchList() this.fetchList()
on('commonwork_fetch_all', this.fetchAllListener) on('commonwork_fetch_all', this.fetchAllListener)
$("html").animate({ scrollTop: $('html').scrollTop() - 100 }); $("html").animate({ scrollTop: $('html').scrollTop() - 100 });
@ -430,7 +436,7 @@ class CommonWorkList extends Component{
} }
_getRequestParams() { _getRequestParams() {
const { search, arg_work_status, arg_teacher_comment, arg_course_group, order, page, arg_member_work } = this.state const {search, arg_work_status, arg_teacher_comment, arg_course_group, order, page, arg_member_work, b_order} = this.state
return { return {
page, page,
search, search,
@ -439,7 +445,7 @@ class CommonWorkList extends Component{
teacher_comment: arg_teacher_comment.length == 0 ? '' : arg_teacher_comment[0], teacher_comment: arg_teacher_comment.length == 0 ? '' : arg_teacher_comment[0],
order, order,
limit: PAGE_SIZE, limit: PAGE_SIZE,
b_order: orderMap[order], b_order: b_order,
group_id:arg_course_group, group_id:arg_course_group,
member_work: arg_member_work member_work: arg_member_work
} }
@ -472,7 +478,6 @@ class CommonWorkList extends Component{
}) })
} }
teacherCommentOptionChange = (values, isAllChecked) => { teacherCommentOptionChange = (values, isAllChecked) => {
this.setState({arg_teacher_comment: isAllChecked ? [] : values, page: 1}, () => { this.setState({arg_teacher_comment: isAllChecked ? [] : values, page: 1}, () => {
@ -494,8 +499,12 @@ class CommonWorkList extends Component{
this.fetchList() this.fetchList()
}) })
} }
funorder = (order) => { funorder = (order, b_order) => {
this.setState({ order }, () => { this.setState({
order: order
,
b_order: b_order
}, () => {
this.fetchList() this.fetchList()
}) })
} }
@ -547,6 +556,64 @@ class CommonWorkList extends Component{
} }
//普通作业tbale 列表塞选数据
table1handleChange = (pagination, filters, sorter) => {
//"ascend" 升序
//"descend" 降序
if (JSON.stringify(sorter) === "{}") {
//没有选择
} else {
// 时间
try {
if (sorter.columnKey === "update_time") {
let myyslorder = "";
if (sorter.order === "ascend") {
myyslorder = "asc";
} else if (sorter.order === "descend") {
myyslorder = "desc";
}
this.funorder("update_time", myyslorder);
}
} catch (e) {
}
//成绩
try {
if (sorter.columnKey === "work_score") {
let myyslorder = "";
if (sorter.order === "ascend") {
myyslorder = "asc";
} else if (sorter.order === "descend") {
myyslorder = "desc";
}
this.funorder("work_score", myyslorder)
}
} catch (e) {
}
//学号
try {
if (sorter.columnKey === "student_id") {
let myyslorder = "";
if (sorter.order === "ascend") {
myyslorder = "asc";
} else if (sorter.order === "descend") {
myyslorder = "desc";
}
this.funorder("student_id", myyslorder)
}
} catch (e) {
}
}
}
render(){ render(){
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
const dateFormat = 'YYYY-MM-DD HH:mm'; const dateFormat = 'YYYY-MM-DD HH:mm';
@ -562,7 +629,7 @@ class CommonWorkList extends Component{
ultimate_score, work_score, student_comment_count, appeal_all_count, appeal_deal_count, ultimate_score, work_score, student_comment_count, appeal_all_count, appeal_deal_count,
late_penalty, absence_penalty, appeal_penalty late_penalty, absence_penalty, appeal_penalty
,end_immediately ,publish_immediately , end_immediately, publish_immediately
, homework_id, visible, work_group, project_info, is_leader , homework_id, visible, work_group, project_info, is_leader
} =this.state; } =this.state;
@ -675,7 +742,7 @@ class CommonWorkList extends Component{
/> />
{/* 内容区 */} {/* 内容区 */}
<style>{` <style>{`
.ant-table-thead > tr > th, .ant-table-tbody > tr > td { .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
text-align: center; text-align: center;
@ -729,57 +796,11 @@ class CommonWorkList extends Component{
} }
</span>} </span>}
{/* { isAdminOrStudent && student_works && !!student_works.length && <div className="fr color-grey-6 edu-menu-panel">
<p style={{color: '#989898'}} className="color-grey-6"><a data-remote="true" className="font-12">
{order==="update_time"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}</a><i
className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i></p>
<ul className="edu-menu-list" style={{ textAlign: 'center'}}>
<li onClick={(e)=>this.funorder("update_time")} ><a data-remote="true" className={order==="update_time"?"color-blue":""}>更新时间</a>
</li>
<li onClick={(e)=>this.funorder("work_score" )} ><a data-remote="true" className={order==="work_score"?"color-blue":""}>最终成绩</a>
</li>
<li onClick={(e)=>this.funorder("student_id" )} ><a data-remote="true" className={order==="student_id"?"color-blue":""}>学生学号</a>
</li>
</ul>
</div> } */}
{
isAdminOrStudent && student_works && !!student_works.length &&
<div className="fr">
<li className="drop_down">
<span className="color-grey-9 font-12">
{order==="update_time"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}
</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
<ul className="drop_down_normal">
<li className={''} onClick={()=>this.funorder("update_time")}>更新时间</li>
<li className={''} onClick={()=>this.funorder("work_score")}>最终成绩</li>
<li className={''} onClick={()=>this.funorder("student_id")}>学生学号</li>
</ul>
</li>
</div>
}
</div> </div>
</div> } </div> }
{/*
"commit_count": 10, //已交数(学生身份)
"uncommit_count": 12, //未交数(学生身份)
"left_time": { //学生身份剩余的时间和状态
"status": "剩余补交时间",
"time": "24 天 24分 23秒"
},
*/}
{/* { isStudent && <div id="graduation_work_list" style={{padding:'10px 30px 10px 40px'}}>
<div className="clearfix">
<span className="fl color-grey-6 font-12">
<span className="color-orange-tip">{commit_count}</span> {uncommit_count}
<span className="color-orange-tip">{left_time.time}</span>
</span>
</div>
</div> } */}
<style>{` <style>{`
.workListContent .ant-table-thead > tr > th { .workListContent .ant-table-thead > tr > th {
border-bottom: none; border-bottom: none;
@ -791,11 +812,12 @@ class CommonWorkList extends Component{
`}</style> `}</style>
{ isStudent &&StudentData===undefined?"":StudentData===undefined?"": { isStudent &&StudentData===undefined?"":StudentData===undefined?"":
<Table <Table
className="studentTable" className="studentTable"
dataSource={StudentData} dataSource={StudentData}
columns={columns} onChange={this.table1handleChange}
pagination={false} columns={columns}
showHeader={ !student_works || student_works.length == 0} pagination={false}
showHeader={ !student_works || student_works.length == 0}
/> />
} }
@ -824,21 +846,15 @@ class CommonWorkList extends Component{
</Spin> </Spin>
: :
<React.Fragment> <React.Fragment>
{/* pagination={work_count > PAGE_SIZE ? { //分页
total: work_count, //数据总数量 <Table
pageSize: PAGE_SIZE, //显示几条一页 className="stageTable"
current: page, dataSource={student_works}
} : false} columns={columns}
showQuickJumper
onChange={this.onTablePagination} pagination={false}
*/} onChange={this.table1handleChange}
<Table loading={loadingstate}
className="stageTable"
dataSource={student_works}
columns={columns}
showQuickJumper
pagination={false}
loading={loadingstate}
/> />
</React.Fragment> </React.Fragment>
@ -846,7 +862,7 @@ class CommonWorkList extends Component{
</div> </div>
</div> </div>
{work_count > PAGE_SIZE && <Pagination {work_count > PAGE_SIZE && <Pagination
style={{ textAlign: 'center', marginBottom: '20px' }} style={{ textAlign: 'center', marginBottom: '20px' }}
showQuickJumper pageSize={PAGE_SIZE} onChange={this.onTablePagination} current={page} total={work_count} />} showQuickJumper pageSize={PAGE_SIZE} onChange={this.onTablePagination} current={page} total={work_count} />}

@ -20,7 +20,7 @@ import '../poll/pollStyle.css'
import moment from 'moment'; import moment from 'moment';
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
import './yslexercisetable.css'; import './yslexercisetable.css';
import {getImageUrl, toPath} from 'educoder'; import {getImageUrl, toPath, sortDirections} from 'educoder';
import CheckBoxGroup from "../../page/component/CheckBoxGroup"; import CheckBoxGroup from "../../page/component/CheckBoxGroup";
import NoneData from '../../../modules/courses/coursesPublic/NoneData' import NoneData from '../../../modules/courses/coursesPublic/NoneData'
const Search = Input.Search; const Search = Input.Search;
@ -110,6 +110,8 @@ class Studentshavecompletedthelist extends Component {
align: 'center', align: 'center',
className: "edu-txt-center font-14 maxnamewidth175", className: "edu-txt-center font-14 maxnamewidth175",
width:'175px', width:'175px',
sorter: true,
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span className="maxnamewidth175" style={{ <span className="maxnamewidth175" style={{
width:'175px', width:'175px',
@ -200,6 +202,9 @@ class Studentshavecompletedthelist extends Component {
align: 'center', align: 'center',
className: "edu-txt-center font-14", className: "edu-txt-center font-14",
width:'175px', width:'175px',
sorter: true,
defaultSortOrder: 'descend',
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span style={{ <span style={{
width:'175px', width:'175px',
@ -294,6 +299,8 @@ class Studentshavecompletedthelist extends Component {
key: 'efficiencyscore', key: 'efficiencyscore',
align: 'center', align: 'center',
className: "edu-txt-center font-14", className: "edu-txt-center font-14",
sorter: true,
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span> <span>
{record.efficiencyscore === "--" ? {record.efficiencyscore === "--" ?
@ -877,6 +884,8 @@ class Studentshavecompletedthelist extends Component {
key: 'stduynumber', key: 'stduynumber',
align: 'center', align: 'center',
className: "edu-txt-center font-14", className: "edu-txt-center font-14",
sorter: true,
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span> <span>
{record.stduynumber === "--" ? {record.stduynumber === "--" ?
@ -930,6 +939,9 @@ class Studentshavecompletedthelist extends Component {
key: 'updatetime', key: 'updatetime',
align: 'center', align: 'center',
className: "edu-txt-center font-14", className: "edu-txt-center font-14",
sorter: true,
defaultSortOrder: 'descend',
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span> <span>
{record.updatetime==="--"? {record.updatetime==="--"?
@ -978,6 +990,8 @@ class Studentshavecompletedthelist extends Component {
key: 'efficiencyscore', key: 'efficiencyscore',
align: 'center', align: 'center',
className: "edu-txt-center font-14", className: "edu-txt-center font-14",
sorter: true,
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span> <span>
{record.efficiencyscore === "--" ? {record.efficiencyscore === "--" ?
@ -1221,6 +1235,7 @@ class Studentshavecompletedthelist extends Component {
}, },
], ],
exercise_status:0, exercise_status:0,
order_type: "desc",
} }
// console.log("Studentshavecompletedthelist"); // console.log("Studentshavecompletedthelist");
// console.log(props.current_status); // console.log(props.current_status);
@ -1244,7 +1259,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, pageNumber, 20); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, pageNumber, 20, this.state.order_type);
} }
paginationonChanges = (pageNumber) => { paginationonChanges = (pageNumber) => {
@ -1261,7 +1276,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdata(this.state.order, null, null, null, null, pageNumber, this.state.limit) this.Searchdata(this.state.order, null, null, null, null, pageNumber, this.state.limit, this.state.order_type);
} }
@ -1459,9 +1474,9 @@ class Studentshavecompletedthelist extends Component {
thiss.Generatenewdatasy(response.data.exercise_users, response); thiss.Generatenewdatasy(response.data.exercise_users, response);
} }
}).catch((error) => { }).catch((error) => {
console.log(error); // console.log(error);
console.log("其实数据加载失败了"); // console.log("其实数据加载失败了");
console.log("1111"); // console.log("1111");
}); });
@ -1613,60 +1628,8 @@ class Studentshavecompletedthelist extends Component {
} }
//排序
funorder = (e) => {
if (e === "end_at") {
// 时间
// 时间排序是从小到大
if (this.state.loadingstate === true) {
this.setState({
order: "end_at",
})
} else {
this.setState({
order: "end_at",
loadingstate: true,
})
}
this.Searchdata(e, null, null, null, null, this.state.page, this.state.limit)
}
if (e === "score") {
// 成绩
//成绩排序是从大到小
if (this.state.loadingstate === true) {
this.setState({
order: "score",
})
} else {
this.setState({
order: "score",
loadingstate: true,
})
}
this.Searchdata(e, null, null, null, null, this.state.page, this.state.limit)
}
if (e === "student_id") {
//学号
//学号排序是从大到小
if (this.state.loadingstate === true) {
this.setState({
order: "student_id",
})
} else {
this.setState({
order: "student_id",
loadingstate: true
})
}
this.Searchdata(e, null, null, null, null, this.state.page, this.state.limit) Searchdata = (order, commit_status, review, exercise_group_id, search, page, limit, order_type) => {
}
}
Searchdata = (order, commit_status, review, exercise_group_id, search, page, limit) => {
var exercise_id = this.props.match.params.Id; var exercise_id = this.props.match.params.Id;
// console.log(731); // 764 935 // console.log(731); // 764 935
var url = `/exercises/${exercise_id}/exercise_lists.json`; var url = `/exercises/${exercise_id}/exercise_lists.json`;
@ -1678,6 +1641,7 @@ class Studentshavecompletedthelist extends Component {
search: "", search: "",
page: page, page: page,
limit: limit, limit: limit,
order_type: order_type,
} }
axios.get(url, { axios.get(url, {
params: params params: params
@ -2050,7 +2014,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
Searchdatasys = (order, commit_status, review, exercise_group_id, search, page, limit) => { Searchdatasys = (order, commit_status, review, exercise_group_id, search, page, limit, order_type) => {
var exercise_id = this.props.match.params.Id; var exercise_id = this.props.match.params.Id;
var url = `/exercises/${exercise_id}/exercise_lists.json`; var url = `/exercises/${exercise_id}/exercise_lists.json`;
axios.get((url), { axios.get((url), {
@ -2062,6 +2026,7 @@ class Studentshavecompletedthelist extends Component {
search: search, search: search,
page: page, page: page,
limit: limit, limit: limit,
order_type: order_type
} }
}).then((response) => { }).then((response) => {
// console.log("528"); // console.log("528");
@ -2098,7 +2063,7 @@ class Studentshavecompletedthelist extends Component {
page:1, page:1,
}) })
} }
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, null, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, null, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} }
// notlimiteds = () => { // notlimiteds = () => {
// this.setState({ // this.setState({
@ -2125,7 +2090,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, undefined, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, undefined, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} }
checkeboxstwo = (checkedValues, data) => { checkeboxstwo = (checkedValues, data) => {
// console.log(checkedValues) // console.log(checkedValues)
@ -2146,7 +2111,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else if (checkedValues.length === data.length) { } else if (checkedValues.length === data.length) {
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
@ -2163,10 +2128,10 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else { } else {
// console.log(checkedValues); // console.log(checkedValues);
this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
loadingstate: true, loadingstate: true,
@ -2196,7 +2161,7 @@ class Studentshavecompletedthelist extends Component {
course_groups: null, course_groups: null,
unlimitedtwo: 0 unlimitedtwo: 0
}) })
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, undefined, this.state.searchtext, null, null) this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, undefined, this.state.searchtext, null, null, this.state.order_type)
} }
checkeboxs = (checkedValues, data) => { checkeboxs = (checkedValues, data) => {
@ -2225,7 +2190,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else if (checkedValues.length === data.length) { } else if (checkedValues.length === data.length) {
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
@ -2242,7 +2207,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else { } else {
// console.log(checkedValues); // console.log(checkedValues);
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
@ -2260,7 +2225,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} }
} }
@ -2283,7 +2248,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, undefined, this.state.searchtext, 1, this.state.limit) this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, undefined, this.state.searchtext, 1, this.state.limit, this.state.order_type)
} }
funtaskstatustwo = (checkedValues, data) => { funtaskstatustwo = (checkedValues, data) => {
@ -2305,7 +2270,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit) this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.order_type)
} else if (checkedValues.length === data.length) { } else if (checkedValues.length === data.length) {
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
@ -2322,7 +2287,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit) this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.order_type)
} else { } else {
// console.log(checkedValues); // console.log(checkedValues);
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
@ -2343,7 +2308,7 @@ class Studentshavecompletedthelist extends Component {
} }
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit) this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.order_type)
this.props.setcourse_groupysls(checkedValues) this.props.setcourse_groupysls(checkedValues)
} }
@ -2364,7 +2329,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} }
}; };
//搜索学生按钮输入 老师 //搜索学生按钮输入 老师
@ -2381,7 +2346,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, value, 1, this.state.limit); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, value, 1, this.state.limit, this.state.order_type);
// this.Startsorting(this.state.order,this.state.checkedValuesine,this.state.checkedValuesineinfo,value); // this.Startsorting(this.state.order,this.state.checkedValuesine,this.state.checkedValuesineinfo,value);
// console.log(value) // console.log(value)
@ -2416,60 +2381,175 @@ class Studentshavecompletedthelist extends Component {
}; };
//排序 //老师试卷table 列表塞选数据
funordersy = (e) => { table1handleChange = (pagination, filters, sorter) => {
console.log(this.state.course_groupyslstwo); //"ascend" 升序
debugger //"descend" 降序
if (e === "end_at") { if (JSON.stringify(sorter) === "{}") {
// 时间 //没有选择
// 时间排序是从小到大 } else {
if (this.state.loadingstate === false) { try {
this.setState({ //时间排序
order: "end_at", if (sorter.columnKey === "updatetime") {
loadingstate: true, if (sorter.order === "ascend") {
}) //升序
} else { this.setState({
this.setState({ order: "end_at",
order: "end_at", loadingstate: true,
}) order_type: "asc"
})
this.Searchdatasys("end_at", this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "asc");
} else if (sorter.order === "descend") {
//降序
this.setState({
order: "end_at",
loadingstate: true,
order_type: "desc"
})
this.Searchdatasys("end_at", this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "desc");
}
}
} catch (e) {
} }
this.Searchdatasys(e, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page,this.state.limit); try {
} //学生学号排序
if (sorter.columnKey === "stduynumber") {
if (sorter.order === "ascend") {
//升序
this.setState({
order: "student_id",
loadingstate: true,
order_type: "asc"
})
this.Searchdatasys("student_id", this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "asc");
} else if (sorter.order === "descend") {
//降序
this.setState({
order: "student_id",
loadingstate: true,
order_type: "desc"
})
this.Searchdatasys("student_id", this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "desc");
if (e === "score") { }
// 成绩 }
//成绩排序是从大到小 } catch (e) {
if (this.state.loadingstate === false) {
this.setState({ }
order: "score",
loadingstate: true, try {
}) //成绩排序排序
} else { if (sorter.columnKey === "efficiencyscore") {
this.setState({ if (sorter.order === "ascend") {
order: "score", //升序
}) this.setState({
order: "score",
loadingstate: true,
order_type: "asc"
})
this.Searchdatasys("score", this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "asc");
} else if (sorter.order === "descend") {
//降序
this.setState({
order: "score",
loadingstate: true,
order_type: "desc"
})
this.Searchdatasys("score", this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "desc");
}
}
} catch (e) {
} }
this.Searchdatasys(e, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page,this.state.limit);
} }
}
//学生问卷table 列表塞选数据
table1handleChangestuden = (pagination, filters, sorter) => {
if (JSON.stringify(sorter) === "{}") {
//没有选择
} else {
try {
//时间排序
if (sorter.columnKey === "updatetime") {
if (sorter.order === "ascend") {
//升序
this.setState({
order: "end_at",
loadingstate: true,
order_type: "asc"
})
this.Searchdata("end_at", null, null, null, null, this.state.page, this.state.limit, "asc");
} else if (sorter.order === "descend") {
//降序
this.setState({
order: "end_at",
loadingstate: true,
order_type: "desc"
})
this.Searchdata("end_at", null, null, null, null, this.state.page, this.state.limit, "desc");
}
}
} catch (e) {
}
try {
//学生学号排序
if (sorter.columnKey === "stduynumber") {
if (sorter.order === "ascend") {
//升序
this.setState({
order: "student_id",
loadingstate: true,
order_type: "asc"
})
this.Searchdata("student_id", null, null, null, null, this.state.page, this.state.limit, "asc");
} else if (sorter.order === "descend") {
//降序
this.setState({
order: "student_id",
loadingstate: true,
order_type: "desc"
})
this.Searchdata("student_id", null, null, null, null, this.state.page, this.state.limit, "desc");
}
}
} catch (e) {
if (e === "student_id") {
//学号
//学号排序是从大到小
if (this.state.loadingstate === false) {
this.setState({
order: "student_id",
loadingstate: true,
})
} else {
this.setState({
order: "student_id",
})
} }
this.Searchdatasys(e, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page,this.state.limit); try {
//成绩排序排序
if (sorter.columnKey === "efficiencyscore") {
if (sorter.order === "ascend") {
//升序
this.setState({
order: "score",
loadingstate: true,
order_type: "asc"
})
this.Searchdata("score", null, null, null, null, this.state.page, this.state.limit, "asc");
} else if (sorter.order === "descend") {
//降序
this.setState({
order: "score",
loadingstate: true,
order_type: "desc"
})
this.Searchdata("score", null, null, null, null, this.state.page, this.state.limit, "desc");
}
}
} catch (e) {
}
} }
} }
setExerciseReviewAndAnswer = () => { setExerciseReviewAndAnswer = () => {
@ -2635,23 +2715,6 @@ class Studentshavecompletedthelist extends Component {
style={{color: '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.total_users}</span><span style={{color: '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.total_users}</span><span
className="color-orange-tip"></span>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_all_users} </span> className="color-orange-tip"></span>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_all_users} </span>
<div className="fr color-grey-6 edu-menu-panel">
<ul>
<li className="edu-position edu-position-hidebox">
<a className="font-12">
{order === "end_at" ? "时间" : order === "score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12"></i>
<ul className="edu-position-hide undis mt10">
<li><a onClick={(e) => this.funordersy("end_at")} data-remote="true"
className=" font-12" style={{textAlign: "center "}}>提交时间</a></li>
<li><a onClick={(e) => this.funordersy("score")} data-remote="true"
className=" font-12" style={{textAlign: "center "}}>最终成绩</a></li>
<li><a onClick={(e) => this.funordersy("student_id")} data-remote="true"
className=" font-12" style={{textAlign: "center "}}>学生学号</a></li>
</ul>
</li>
</ul>
</div>
</div> </div>
</div> </div>
@ -2676,6 +2739,7 @@ class Studentshavecompletedthelist extends Component {
columns={columnsys} columns={columnsys}
className="mysjysltable1" className="mysjysltable1"
pagination={false} pagination={false}
onChange={this.table1handleChange}
loading={loadingstate} loading={loadingstate}
// onChange={this.TablePaginationsy} // onChange={this.TablePaginationsy}
/>} />}
@ -2882,26 +2946,8 @@ class Studentshavecompletedthelist extends Component {
<span <span
style={{color: '#FF6800'}}> {Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_end_time}</span>} style={{color: '#FF6800'}}> {Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_end_time}</span>}
</span> </span>
<div className="fr color-grey-6 edu-menu-panel">
<ul>
<li className="edu-position edu-position-hidebox">
<a className="font-12 ">
{order === "end_at" ? "时间" : order === "score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i>
<ul className="edu-position-hide undis mt10">
<li><a onClick={(e) => this.funorder("end_at")} data-remote="true"
className=" font-12" style={{textAlign: "center "}}>提交时间</a>
</li>
<li><a onClick={(e) => this.funorder("score")} data-remote="true"
className=" font-12" style={{textAlign: "center "}}>最终成绩</a>
</li>
<li><a onClick={(e) => this.funorder("student_id")} data-remote="true"
className=" font-12" style={{textAlign: "center "}}>学生学号</a>
</li>
</ul>
</li>
</ul>
</div>
</div> </div>
</div> </div>
@ -2936,6 +2982,7 @@ class Studentshavecompletedthelist extends Component {
columns={columns} columns={columns}
pagination={false} pagination={false}
className="mysjysltable4" className="mysjysltable4"
onChange={this.table1handleChangestuden}
loading={loadingstate} loading={loadingstate}
/>}</div> />}</div>
</div> </div>

@ -515,7 +515,7 @@ class GraduationTaskDetail extends Component{
</div> </div>
</div> </div>
<Switch {...this.props}> <Switch {...this.props}>
{/*//毕设任务列表*/}
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/list" <Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/list"
render={ render={
(props) => (<GraduationTaskslist {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} setend_time={(time)=>this.setend_time(time)} tab={`list`}/>) (props) => (<GraduationTaskslist {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} setend_time={(time)=>this.setend_time(time)} tab={`list`}/>)

@ -1,7 +1,7 @@
import React,{Component} from "React"; import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Pagination, Table, Divider, Tag,Tooltip} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Pagination, Table, Divider, Tag,Tooltip} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import { getImageUrl , NoneData } from 'educoder'; import {getImageUrl, NoneData, sortDirections} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import moment from 'moment'; import moment from 'moment';
import HomeworkModal from "../../coursesPublic/HomeworkModal"; import HomeworkModal from "../../coursesPublic/HomeworkModal";
@ -19,7 +19,7 @@ const Search = Input.Search;
const qs = require('qs'); const qs = require('qs');
//毕设任务列表
class GraduationTaskssettinglist extends Component{ class GraduationTaskssettinglist extends Component{
constructor(props){ constructor(props){
@ -66,7 +66,7 @@ class GraduationTaskssettinglist extends Component{
this.props.triggerRef(this) this.props.triggerRef(this)
}catch(e){ }catch(e){
} }
} }
goback=()=>{ goback=()=>{
@ -160,12 +160,68 @@ class GraduationTaskssettinglist extends Component{
}) })
} }
TablePagination=(e)=>{ TablePagination = (pagination, filters, sorter) => {
// console.log(e.current);
// this.setState({
// page:e.current
// })
if (JSON.stringify(sorter) === "{}") {
//没有选择
} else {
//stduynumber 学号
try {
//学生学号排序
if (sorter.columnKey === "stduynumber") {
let orderlumn = "";
if (sorter.order === "ascend") {
//升序
orderlumn = "asc";
} else if (sorter.order === "descend") {
//降序
orderlumn = "desc";
}
this.funorder("student_id", orderlumn)
}
} catch (e) {
this.setState({ }
page:e.current
}) //turnovertime 时间
try {
//学生学号排序
if (sorter.columnKey === "turnovertime") {
let orderlumn = "";
if (sorter.order === "ascend") {
//升序
orderlumn = "asc";
} else if (sorter.order === "descend") {
//降序
orderlumn = "desc";
}
this.funorder("update_time", orderlumn);
}
} catch (e) {
}
//finalscore 成绩
try {
//学生学号排序
if (sorter.columnKey === "finalscore") {
let orderlumn = "";
if (sorter.order === "ascend") {
//升序
orderlumn = "asc";
} else if (sorter.order === "descend") {
//降序
orderlumn = "desc";
}
this.funorder("work_score", orderlumn);
}
} catch (e) {
}
}
} }
funteachercomment=(list,key)=> { funteachercomment=(list,key)=> {
@ -234,47 +290,14 @@ class GraduationTaskssettinglist extends Component{
} }
funorder=(value)=>{ funorder = (value, newb_order) => {
let {teacher_comment, task_status, course_group, cross_comment, b_order, search,order} = this.state; let {teacher_comment, task_status, course_group, cross_comment, b_order, search,order} = this.state;
let newb_order; this.setState({
if(order===value){ order: value,
if(b_order==="desc"){ b_order: newb_order,
loadingstate: true
this.setState({ })
order:value,
b_order:"asc"
})
newb_order="asc";
}else{
this.setState({
order:value,
b_order:"desc"
})
newb_order="desc";
}
}else{
if(b_order==="desc"){
this.setState({
order:value,
b_order:"desc"
})
newb_order="desc";
}else{
this.setState({
order:value,
b_order:"asc"
})
newb_order="asc";
}
}
this.setState({
loadingstate:true
})
this.seacthdata(teacher_comment, task_status, course_group, cross_comment, value, newb_order, search,this.state.page); this.seacthdata(teacher_comment, task_status, course_group, cross_comment, value, newb_order, search,this.state.page);
} }
@ -747,6 +770,8 @@ class GraduationTaskssettinglist extends Component{
dataIndex: 'stduynumber', dataIndex: 'stduynumber',
key: 'stduynumber', key: 'stduynumber',
className:'edu-txt-center', className:'edu-txt-center',
sorter: true,
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span> <span>
<div style={{color:'#9A9A9A'}} className={"studentnumber"} title={record.stduynumber}>{record.stduynumber}</div> <div style={{color:'#9A9A9A'}} className={"studentnumber"} title={record.stduynumber}>{record.stduynumber}</div>
@ -798,6 +823,9 @@ class GraduationTaskssettinglist extends Component{
dataIndex: 'turnovertime', dataIndex: 'turnovertime',
key: 'turnovertime', key: 'turnovertime',
className:'edu-txt-center', className:'edu-txt-center',
sorter: true,
defaultSortOrder: 'descend',
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:'#989898'}}> <a style={{color:'#989898'}}>
@ -839,6 +867,8 @@ class GraduationTaskssettinglist extends Component{
key: 'finalscore', key: 'finalscore',
dataIndex: 'finalscore', dataIndex: 'finalscore',
className:'edu-txt-center', className:'edu-txt-center',
sorter: true,
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="right" title={record.finalscore.work_score==="--"?"未评阅": <pre> <Tooltip placement="right" title={record.finalscore.work_score==="--"?"未评阅": <pre>
@ -1220,20 +1250,7 @@ class GraduationTaskssettinglist extends Component{
{this.props.isAdmin()===true?<span className="fl color-grey-6 font-12"> {this.props.isAdmin()===true?<span className="fl color-grey-6 font-12">
<span className="color-orange-tip">{taskslistdata&&taskslistdata.work_count}</span> <span className="color-orange-tip">{taskslistdata&&taskslistdata.work_count}</span>
个检索结果{taskslistdata&&taskslistdata.all_work_count} 学生</span>:""} 个检索结果{taskslistdata&&taskslistdata.all_work_count} 学生</span>:""}
{this.props.isAdmin()===true?<div className="fr color-grey-6 edu-menu-panel">
<p>
<a data-remote="true" class="color-grey-6 font-12">
{order==="update_time"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i></p>
<ul className="edu-menu-list edu-menu-lists" style={{width: '87px'}}>
<li onClick={(e)=>this.funorder("update_time")}><a data-remote="true">更新时间</a>
</li>
<li onClick={(e)=>this.funorder("work_score" )}><a data-remote="true">最终成绩</a>
</li>
<li onClick={(e)=>this.funorder("student_id" )}><a data-remote="true">学生学号</a>
</li>
</ul>
</div>:""}
</div> </div>
{this.props.isStudent()===true? {this.props.isStudent()===true?
@ -1409,27 +1426,6 @@ class GraduationTaskssettinglist extends Component{
<div id="graduation_work_list" style={{ padding: '18px 40px 10px',height: '56px'}}> <div id="graduation_work_list" style={{ padding: '18px 40px 10px',height: '56px'}}>
{this.props.isAdmin()===true?
<div className="clearfix">
<span className="fl color-grey-6 font-12">
<span className="color-orange-tip">{taskslistdata&&taskslistdata.work_count}</span>
个检索结果{taskslistdata&&taskslistdata.work_count} 学生
</span>
<div className="fr color-grey-6 edu-menu-panel">
<p><a data-remote="true">
{order==="update_time"?"时间":order==="work_score"?"成绩":order==="student_id"?"学号":""}排序</a><i
className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i></p>
<ul className="edu-menu-list">
<li onClick={(e)=>this.funorder("update_time")} className={order==="update_time"?"none":""}><a data-remote="true">时间</a>
</li>
<li onClick={(e)=>this.funorder("work_score" )} className={order==="work_score"?"none":""}><a data-remote="true">成绩</a>
</li>
<li onClick={(e)=>this.funorder("student_id" )} className={order==="student_id"?"none":""}><a data-remote="true">学号</a>
</li>
</ul>
</div>
</div>
:""}
{this.props.isStudent()===true? {this.props.isStudent()===true?
<div className="clearfix"> <div className="clearfix">
<span className="mr15 color-grey9"> <span className="mr15 color-grey9">

@ -1,7 +1,7 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import {Checkbox,Input,Table, Pagination} from "antd"; import {Checkbox,Input,Table, Pagination} from "antd";
import { WordsBtn } from 'educoder' import {WordsBtn, sortDirections} from 'educoder'
import moment from 'moment'; import moment from 'moment';
import CheckAllGroup from '../common/button/CheckAllGroup' import CheckAllGroup from '../common/button/CheckAllGroup'
import NoneData from "../coursesPublic/NoneData" import NoneData from "../coursesPublic/NoneData"
@ -49,7 +49,8 @@ class PollDetailTabFirst extends Component{
poll_types:undefined, poll_types:undefined,
course_groups:undefined, course_groups:undefined,
options_Class:[], options_Class:[],
poll_end_at:"" poll_end_at: "",
order_type: "desc"
} }
} }
// 搜索框搜索 // 搜索框搜索
@ -59,12 +60,12 @@ class PollDetailTabFirst extends Component{
}) })
} }
searchInfo=()=>{ searchInfo=()=>{
let{order,search,commit_status,poll_group_id,page}=this.state let {order, search, commit_status, poll_group_id, page, order_type} = this.state
this.getTableList(order,search,commit_status,poll_group_id,page); this.getTableList(order, search, commit_status, poll_group_id, page, order_type);
} }
// 获取接口数据 // 获取接口数据
getTableList=(order,search,commit_status,poll_group_id,page)=>{ getTableList = (order, search, commit_status, poll_group_id, page, order_type) => {
let pollId=this.props.match.params.pollId; let pollId=this.props.match.params.pollId;
let courseid=this.props.match.params.coursesId; let courseid=this.props.match.params.coursesId;
let url=`/polls/${pollId}/poll_lists.json`; let url=`/polls/${pollId}/poll_lists.json`;
@ -76,7 +77,8 @@ class PollDetailTabFirst extends Component{
search:search, search:search,
commit_status:commit_status, commit_status:commit_status,
poll_group_id:poll_group_id, poll_group_id:poll_group_id,
page:page page: page,
order_type: order_type
} }
}).then((result)=>{ }).then((result)=>{
if(result){ if(result){
@ -128,8 +130,8 @@ class PollDetailTabFirst extends Component{
} }
componentDidMount(){ componentDidMount(){
let {order,search,commit_status,poll_group_id,page}=this.state; let {order, search, commit_status, poll_group_id, page, order_type} = this.state;
this.getTableList(order,search,commit_status,poll_group_id,page); this.getTableList(order, search, commit_status, poll_group_id, page, order_type);
} }
// 翻页 // 翻页
@ -137,17 +139,17 @@ class PollDetailTabFirst extends Component{
this.setState({ this.setState({
page:pageNumber page:pageNumber
}) })
let {order,search,commit_status,poll_group_id}=this.state; let {order, search, commit_status, poll_group_id, order_type} = this.state;
this.getTableList(order,search,commit_status,poll_group_id,pageNumber); this.getTableList(order, search, commit_status, poll_group_id, pageNumber, order_type);
} }
//排序 //排序
changeOrder=(order)=>{ changeOrder = (order, order_type) => {
this.setState({ this.setState({
order:order order:order
}) })
let {search,commit_status,poll_group_id,page}=this.state; let {search,commit_status,poll_group_id,page}=this.state;
this.getTableList(order,search,commit_status,poll_group_id,page); this.getTableList(order, search, commit_status, poll_group_id, page, order_type);
} }
//选择分班情况 //选择分班情况
classOptionsChange = (values,all) => { classOptionsChange = (values,all) => {
@ -155,8 +157,8 @@ class PollDetailTabFirst extends Component{
this.setState({ this.setState({
poll_group_id:status poll_group_id:status
}) })
let {order,search,commit_status,page}=this.state; let {order, search, commit_status, page, order_type} = this.state;
this.getTableList(order,search,commit_status,status,page); this.getTableList(order, search, commit_status, status, page, order_type);
} }
//选择提交状态 //选择提交状态
statusOptionChange=(values,all)=>{ statusOptionChange=(values,all)=>{
@ -164,10 +166,69 @@ class PollDetailTabFirst extends Component{
this.setState({ this.setState({
commit_status:status commit_status:status
}) })
let {order,search,poll_group_id,page}=this.state; let {order, search, poll_group_id, page, order_type} = this.state;
this.getTableList(order,search,status,poll_group_id,page); this.getTableList(order, search, status, poll_group_id, page, order_type);
} }
//问卷table 列表塞选数据
table1handleChange = (pagination, filters, sorter) => {
//"ascend" 升序
//"descend" 降序
if (JSON.stringify(sorter) === "{}") {
//没有选择
} else {
try {
//学生学号排序
if (sorter.columnKey === "StudentNo") {
if (sorter.order === "ascend") {
//升序
this.setState({
order_type: "asc",
order: "student_id",
loadingstate: true,
});
this.changeOrder("student_id", "asc");
} else if (sorter.order === "descend") {
//降序
this.setState({
order_type: "desc",
order: "student_id",
loadingstate: true,
})
this.changeOrder("student_id", "desc");
}
}
} catch (e) {
}
try {
//提交时间排序
if (sorter.columnKey === "time") {
if (sorter.order === "ascend") {
//升序
this.setState({
order_type: "asc",
order: "end_at",
loadingstate: true,
})
this.changeOrder("end_at", "asc");
} else if (sorter.order === "descend") {
//降序
this.setState({
order_type: "desc",
order: "end_at",
loadingstate: true,
})
this.changeOrder("end_at", "desc");
}
}
} catch (e) {
}
}
}
render(){ render(){
let {order,search,data,page,limit,course_groups,poll_types,options_Class,dataInfo,poll_end_at}=this.state; let {order,search,data,page,limit,course_groups,poll_types,options_Class,dataInfo,poll_end_at}=this.state;
const isAdmin =this.props.isAdmin(); const isAdmin =this.props.isAdmin();
@ -197,6 +258,8 @@ class PollDetailTabFirst extends Component{
dataIndex: 'StudentNo', dataIndex: 'StudentNo',
key: 'StudentNo', key: 'StudentNo',
className:"edu-txt-center", className:"edu-txt-center",
sorter: true,
sortDirections: sortDirections,
render:(StudentNo,item,index)=>{ render:(StudentNo,item,index)=>{
return( return(
item.StudentNo ? <span>{item.StudentNo}</span> : "--" item.StudentNo ? <span>{item.StudentNo}</span> : "--"
@ -227,9 +290,12 @@ class PollDetailTabFirst extends Component{
}, { }, {
title: '提交时间', title: '提交时间',
dataIndex: 'time', dataIndex: 'time',
key: 'time', key: 'time',
className:"edu-txt-center", className:"edu-txt-center",
width:160, width:160,
sorter: true,
defaultSortOrder: 'descend',
sortDirections: sortDirections,
render:(time,item,index)=>{ render:(time,item,index)=>{
return( return(
item.time == null ? <span className="color-grey-9">--</span> : moment(item.time).format('YYYY-MM-DD HH:mm') item.time == null ? <span className="color-grey-9">--</span> : moment(item.time).format('YYYY-MM-DD HH:mm')
@ -289,7 +355,7 @@ class PollDetailTabFirst extends Component{
</div> </div>
</div> </div>
{ {
course_groups && course_groups.length > 1 ? course_groups && course_groups.length > 1 ?
<div className="mt15"> <div className="mt15">
<CheckAllGroup options={options_Class} label={'分班情况:'} onChange={this.classOptionsChange}></CheckAllGroup> <CheckAllGroup options={options_Class} label={'分班情况:'} onChange={this.classOptionsChange}></CheckAllGroup>
</div> </div>
@ -304,38 +370,39 @@ class PollDetailTabFirst extends Component{
isAdmin ? <span className="fl color-grey-3 font-12"><span className="color-orange-tip">{poll_types && poll_types.total_users}</span>{poll_types && poll_types.poll_users_count} </span> :"" isAdmin ? <span className="fl color-grey-3 font-12"><span className="color-orange-tip">{poll_types && poll_types.total_users}</span>{poll_types && poll_types.poll_users_count} </span> :""
} }
{ {
isStudent ? isStudent ?
<span className="fl color-grey-3 font-12"> <span className="fl color-grey-3 font-12">
{poll_types && poll_types.answer_users===undefined?"":<span className="mr15"><span className="color-orange-tip">{poll_types && poll_types.answer_users}</span> </span>} {poll_types && poll_types.answer_users===undefined?"":<span className="mr15"><span className="color-orange-tip">{poll_types && poll_types.answer_users}</span> </span>}
{poll_types && poll_types.unanswer_users===undefined?"":<span className="mr15">{poll_types && poll_types.unanswer_users} 未交</span>} {poll_types && poll_types.unanswer_users===undefined?"":<span className="mr15">{poll_types && poll_types.unanswer_users} 未交</span>}
{ {
poll_end_at != "0" ? poll_end_at != "0" ?
<span className="color-grey-9"> 剩余提交时间<span className="color-orange-tip">{poll_end_at}</span></span> <span className="color-grey-9"> 剩余提交时间<span className="color-orange-tip">{poll_end_at}</span></span>
:"" : ""
} }
</span> </span>
:"" : ""
}
{
isAdmin &&
<div className="fr">
<li className="drop_down">
<span className="color-grey-9 font-12">{order=="end_at"?"提交时间":"学生学号"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
<ul className="drop_down_normal">
<li onClick={()=>this.changeOrder("end_at")}>提交时间</li>
<li onClick={()=>this.changeOrder("student_id")}>学生学号</li>
</ul>
</li>
</div>
} }
{/*{*/}
{/* isAdmin && */}
{/* <div className="fr">*/}
{/* <li className="drop_down">*/}
{/* <span className="color-grey-9 font-12">{order=="end_at"?"提交时间":"学生学号"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>*/}
{/* <ul className="drop_down_normal">*/}
{/* <li onClick={()=>this.changeOrder("end_at")}>提交时间</li>*/}
{/* <li onClick={()=>this.changeOrder("student_id")}>学生学号</li>*/}
{/* </ul>*/}
{/* </li>*/}
{/* </div>*/}
{/*}*/}
</div>} </div>}
<div className="edu-table edu-back-white minH-560"> <div className="edu-table edu-back-white minH-560">
{ {
data && data.length>0 ?<Table columns={columns} dataSource={data} pagination={false}></Table> :<NoneData></NoneData> data && data.length > 0 ? <Table columns={columns} dataSource={data} pagination={false}
onChange={this.table1handleChange}></Table> : <NoneData></NoneData>
} }
</div> </div>
{ {
poll_types && poll_types.total_users && poll_types.total_users > limit ? poll_types && poll_types.total_users && poll_types.total_users > limit ?
<div className="edu-txt-center mt30 mb50"> <div className="edu-txt-center mt30 mb50">
<Pagination showQuickJumper current={page} onChange={this.changePage} pageSize={limit} total={poll_types.total_users}></Pagination> <Pagination showQuickJumper current={page} onChange={this.changePage} pageSize={limit} total={poll_types.total_users}></Pagination>
</div>:"" </div>:""

@ -1,6 +1,6 @@
import React, {Component} from "react"; import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn, ActionBtn} from 'educoder'; import {WordsBtn, ActionBtn, sortDirections} from 'educoder';
import { import {
Form, Form,
Select, Select,
@ -818,6 +818,7 @@ class Listofworksstudentone extends Component {
}, },
], ],
b_order: "desc", b_order: "desc",
myorders: "desc",
allow_late: false, allow_late: false,
checkedValuesine: undefined, checkedValuesine: undefined,
checkedValuesineinfo: [], checkedValuesineinfo: [],
@ -872,6 +873,8 @@ class Listofworksstudentone extends Component {
key: 'stduynumber', key: 'stduynumber',
align: "center", align: "center",
className: 'font-14 maxnamewidth110', className: 'font-14 maxnamewidth110',
sorter: true,
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span className="maxnamewidth110"> <span className="maxnamewidth110">
{record.stduynumber === undefined ? {record.stduynumber === undefined ?
@ -1091,6 +1094,8 @@ class Listofworksstudentone extends Component {
key: 'finalscore', key: 'finalscore',
align: 'center', align: 'center',
className: 'font-14', className: 'font-14',
sorter: true,
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span> <span>
{ {
@ -1204,6 +1209,8 @@ class Listofworksstudentone extends Component {
key: 'stduynumber', key: 'stduynumber',
align: "center", align: "center",
className: 'font-14 maxnamewidth110', className: 'font-14 maxnamewidth110',
sorter: true,
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span className="maxnamewidth110"> <span className="maxnamewidth110">
{record.stduynumber === undefined ? {record.stduynumber === undefined ?
@ -1416,6 +1423,8 @@ class Listofworksstudentone extends Component {
key: 'finalscore', key: 'finalscore',
align: 'center', align: 'center',
className: 'font-14', className: 'font-14',
sorter: true,
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span> <span>
{ {
@ -1530,6 +1539,7 @@ class Listofworksstudentone extends Component {
// } // }
// //
// } // }
componentDidMount() { componentDidMount() {
// console.log("componentDidMount "); // console.log("componentDidMount ");
// console.log("调用子组件 "); // console.log("调用子组件 ");
@ -1548,6 +1558,68 @@ class Listofworksstudentone extends Component {
// this.Gettitleinformation(homeworkid); // this.Gettitleinformation(homeworkid);
this.Getalistofworks(homeworkid, false); this.Getalistofworks(homeworkid, false);
} }
//实训作业tbale 列表塞选数据
table1handleChange = (pagination, filters, sorter) => {
//"ascend" 升序
//"descend" 降序
if (JSON.stringify(sorter) === "{}") {
//没有选择
} else {
// console.log(sorter);
try {
//学生学号排序
if (sorter.columnKey === "stduynumber") {
if (sorter.order === "ascend") {
//升序
this.setState({
myorders: "asc",
orders: "student_id",
loadingstate: true,
});
this.Startsortingt("student_id", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "asc");
} else if (sorter.order === "descend") {
//降序
this.setState({
myorders: "desc",
orders: "student_id",
loadingstate: true,
})
this.Startsortingt("student_id", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "desc");
}
}
} catch (e) {
}
try {
//学生成绩排序
if (sorter.columnKey === "finalscore") {
if (sorter.order === "ascend") {
//升序
this.setState({
myorders: "asc",
orders: "work_score",
loadingstate: true,
})
this.Startsortingt("work_score", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "asc");
} else if (sorter.order === "descend") {
//降序
this.setState({
myorders: "desc",
orders: "work_score",
loadingstate: true,
})
this.Startsortingt("work_score", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "desc");
}
}
} catch (e) {
}
}
}
/////////老师操作 /////////老师操作
// tearchar=()=>{ // tearchar=()=>{
// var homeworkid = this.props.match.params.homeworkid; // var homeworkid = this.props.match.params.homeworkid;
@ -2275,7 +2347,7 @@ class Listofworksstudentone extends Component {
//开始排序操作 //开始排序操作
Startsortingt = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit) => { Startsortingt = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit, myorders) => {
//要提交的作品状态checkedValuesine //要提交的作品状态checkedValuesine
//要提交的分班状态checkedValuesineinfo //要提交的分班状态checkedValuesineinfo
//searchtext 输入的姓名和学号 //searchtext 输入的姓名和学号
@ -2285,10 +2357,18 @@ class Listofworksstudentone extends Component {
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
let urll = `/homework_commons/${homeworkid}/works_list.json?`; let urll = `/homework_commons/${homeworkid}/works_list.json?`;
var order = "asc"; var order = this.state.order;
if (ordervlue === "update_time") {
order = "desc"; try {
if (myorders === null || myorders === undefined) {
} else {
order = myorders;
}
} catch (e) {
} }
var checkedValuesines = checkedValuesine; var checkedValuesines = checkedValuesine;
var checkedValuesineinfos = checkedValuesineinfo; var checkedValuesineinfos = checkedValuesineinfo;
var searchtexts = searchtext var searchtexts = searchtext
@ -2591,7 +2671,7 @@ class Listofworksstudentone extends Component {
loadingstate: true, loadingstate: true,
page: 1, page: 1,
}) })
this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
} else if (checkedValues.length === data.length) { } else if (checkedValues.length === data.length) {
this.setState({ this.setState({
unlimited: 0, unlimited: 0,
@ -2599,7 +2679,7 @@ class Listofworksstudentone extends Component {
loadingstate: true, loadingstate: true,
page: 1, page: 1,
}) })
this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
} else { } else {
// console.log(checkedValues); // console.log(checkedValues);
this.setState({ this.setState({
@ -2608,7 +2688,7 @@ class Listofworksstudentone extends Component {
loadingstate: true, loadingstate: true,
page: 1, page: 1,
}) })
this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
} }
} }
@ -2625,7 +2705,7 @@ class Listofworksstudentone extends Component {
loadingstate: true, loadingstate: true,
page: 1, page: 1,
}) })
this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit); this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.myorders);
} else if (checkedValues.length === data.length) { } else if (checkedValues.length === data.length) {
this.setState({ this.setState({
unlimitedtwo: 1, unlimitedtwo: 1,
@ -2634,7 +2714,7 @@ class Listofworksstudentone extends Component {
loadingstate: true, loadingstate: true,
page: 1, page: 1,
}) })
this.Startsortingt(this.state.orders, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, 1, this.state.limit); this.Startsortingt(this.state.orders, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.myorders);
} else { } else {
this.setState({ this.setState({
checkedValuesineinfo: checkedValues, checkedValuesineinfo: checkedValues,
@ -2643,7 +2723,7 @@ class Listofworksstudentone extends Component {
loadingstate: true, loadingstate: true,
page: 1, page: 1,
}) })
this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit); this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.myorders);
} }
@ -2676,7 +2756,7 @@ class Listofworksstudentone extends Component {
page: 1, page: 1,
limit: 20, limit: 20,
}) })
this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, value, 1, 20); this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, value, 1, 20, this.state.myorders);
// console.log(value) // console.log(value)
@ -2692,43 +2772,10 @@ class Listofworksstudentone extends Component {
page: 1, page: 1,
limit: 20, limit: 20,
}) })
this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1, 20); this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1, 20, this.state.myorders);
}
}
//排序
funordert = (e) => {
if (e === "update_time") {
// 时间
// 时间排序是从小到大
this.setState({
orders: "update_time",
loadingstate: true,
})
this.Startsortingt("update_time", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
}
if (e === "work_score") {
// 成绩
//成绩排序是从大到小
this.setState({
orders: "work_score",
loadingstate: true,
})
this.Startsortingt("work_score", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
}
if (e === "student_id") {
//学号
//学号排序是从大到小
this.setState({
orders: "student_id",
loadingstate: true,
})
this.Startsortingt("student_id", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
} }
} }
// 调分 // 调分
// 查看学员实训信息 // 查看学员实训信息
@ -2771,7 +2818,7 @@ class Listofworksstudentone extends Component {
.then((response) => { .then((response) => {
if (response.data.status == '0') { if (response.data.status == '0') {
this.setState({visible: false}); this.setState({visible: false});
this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, this.state.myorders);
this.props.showNotification(`调分成功`); this.props.showNotification(`调分成功`);
} }
}) })
@ -2958,7 +3005,7 @@ class Listofworksstudentone extends Component {
loadingstate: true, loadingstate: true,
page: 1, page: 1,
}) })
this.Startsortingt(this.state.orders, [], this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Startsortingt(this.state.orders, [], this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
} }
notlimitedst = () => { notlimitedst = () => {
@ -2969,7 +3016,7 @@ class Listofworksstudentone extends Component {
course_groupysls: undefined, course_groupysls: undefined,
loadingstate: true, loadingstate: true,
}) })
this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, [], this.state.searchtext, 1, this.state.limit); this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, [], this.state.searchtext, 1, this.state.limit, this.state.myorders);
} }
//立即截止确定按钮 //立即截止确定按钮
coursetaskend = () => { coursetaskend = () => {
@ -3050,8 +3097,7 @@ class Listofworksstudentone extends Component {
page: pageNumber, page: pageNumber,
loadingstate: true, loadingstate: true,
}) })
this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, pageNumber, this.state.limit); this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, pageNumber, this.state.limit, this.state.myorders);
} }
setComputeTimet = () => { setComputeTimet = () => {
@ -3454,24 +3500,6 @@ class Listofworksstudentone extends Component {
` `
} }
</style> </style>
<div className="fr edu-menu-panel">
<ul>
<li className="edu-position edu-position-hidebox">
<a className="font-12">
{orders === "update_time" ? "时间" : orders === "work_score" ? "成绩" : orders === "student_id" ? "学号" : ""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 "></i>
<ul className="edu-position-hide undis mt10">
<li><a onClick={(e) => this.funordert("update_time")} data-remote="true"
className=" font-12" style={{textAlign: "center"}}>更新时间</a></li>
<li><a onClick={(e) => this.funordert("work_score")} data-remote="true"
className=" font-12" style={{textAlign: "center"}}>当前成绩</a></li>
<li><a onClick={(e) => this.funordert("student_id")} data-remote="true"
className=" font-12" style={{textAlign: "center"}}>学生学号</a></li>
</ul>
</li>
</ul>
</div>
</div> </div>
@ -3514,6 +3542,7 @@ class Listofworksstudentone extends Component {
dataSource={datajs} dataSource={datajs}
columns={columns} columns={columns}
pagination={false} pagination={false}
onChange={this.table1handleChange}
loading={loadingstate} loading={loadingstate}
/>} />}
</div> </div>

@ -1,6 +1,6 @@
import React, {Component} from "react"; import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn,ActionBtn} from 'educoder'; import {WordsBtn, ActionBtn, sortDirections} from 'educoder';
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal'; import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal"; import HomeworkModal from "../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal"; import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
@ -43,7 +43,7 @@ const qs = require('qs');
//课堂作业设置 //课堂作业设置
//作品列表(教师) //代码查重
class ShixunStudentWork extends Component { class ShixunStudentWork extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -341,48 +341,15 @@ class ShixunStudentWork extends Component {
this.getcode_review_results(order,b_order,page,limit,group_infolist,search) this.getcode_review_results(order,b_order,page,limit,group_infolist,search)
} }
funorder=(value)=>{ funorder = (value, myyslorder) => {
let {order,b_order,page,limit,group_infolist,search} = this.state; let {order,b_order,page,limit,group_infolist,search} = this.state;
let newb_order;
if(order===value){
if(b_order==="desc"){
this.setState({
order:value,
b_order:"asc"
})
newb_order="asc";
}else{
this.setState({
order:value,
b_order:"desc"
})
newb_order="desc";
}
}else{
if(b_order==="desc"){
this.setState({
order:value,
b_order:"desc"
})
newb_order="desc";
}else{
this.setState({
order:value,
b_order:"asc"
})
newb_order="asc";
}
}
this.setState({ this.setState({
loadingstate:true, loadingstate:true,
order: value,
b_order: myyslorder
}) })
this.getcode_review_results(value,newb_order,page,limit,group_infolist,search) this.getcode_review_results(value, myyslorder, page, limit, group_infolist, search)
} }
groupgroup=(checkedValues)=>{ groupgroup=(checkedValues)=>{
@ -668,7 +635,56 @@ class ShixunStudentWork extends Component {
DownloadType:false, DownloadType:false,
DownloadMessageval:undefined DownloadMessageval:undefined
}) })
};
//代码查重tbale 列表塞选数据
table1handleChange = (pagination, filters, sorter) => {
//"ascend" 升序
//"descend" 降序
if (JSON.stringify(sorter) === "{}") {
//没有选择
} else {
// console.log(sorter);
try {
//学生学号排序
if (sorter.columnKey === "stduynumber") {
var myyslorder = "";
if (sorter.order === "ascend") {
//升序
myyslorder = "asc";
} else if (sorter.order === "descend") {
//降序
myyslorder = "desc";
}
this.funorder("student_id", myyslorder);
}
} catch (e) {
}
try {
//相似度排序
if (sorter.columnKey === "classroom") {
var myyslorder = "";
if (sorter.order === "ascend") {
//升序
myyslorder = "asc";
} else if (sorter.order === "descend") {
//降序
myyslorder = "desc";
}
this.funorder("code_rate", myyslorder);
}
} catch (e) {
}
}
} }
render() { render() {
let { let {
data, data,
@ -708,6 +724,8 @@ class ShixunStudentWork extends Component {
title: '学号', title: '学号',
dataIndex: 'stduynumber', dataIndex: 'stduynumber',
key: 'stduynumber', key: 'stduynumber',
sorter: true,
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{"color": '#9A9A9A', "text-align": "center"}}>{record.stduynumber}</a> <a style={{"color": '#9A9A9A', "text-align": "center"}}>{record.stduynumber}</a>
@ -718,6 +736,9 @@ class ShixunStudentWork extends Component {
title: '相似度', title: '相似度',
key: 'classroom', key: 'classroom',
dataIndex: 'classroom', dataIndex: 'classroom',
sorter: true,
defaultSortOrder: 'descend',
sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{"color": record.classroom>=90?'#FF6800':"#747A7F", "text-align": "center"}}>{isNaN(record.classroom)?"--":record.classroom}%</a> <a style={{"color": record.classroom>=90?'#FF6800':"#747A7F", "text-align": "center"}}>{isNaN(record.classroom)?"--":record.classroom}%</a>
@ -929,24 +950,7 @@ class ShixunStudentWork extends Component {
{data&&data.copy_reviews_count}</span> {data&&data.copy_reviews_count}</span>
个疑似抄袭作品{data&&data.all_reviews_count}作品 </span> 个疑似抄袭作品{data&&data.all_reviews_count}作品 </span>
<div className="fr color-grey-6 edu-menu-panel" style={{color: '#989898'}}>
<p>
<a data-remote="true" className={"color-grey-9 font-12"}>
{order === "code_rate" ? "相似度" : order === "student_id" ? "学号" : ""}
</a>
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i>
</p>
<ul className="edu-menu-list" style={{"width": "80px"}}>
<li onClick={(e) => this.funorder("code_rate")}>
<a className={"color-grey-9 font-12"} style={{"text-align": "center "}}>相似度</a>
</li>
<li onClick={(e) => this.funorder("student_id")}>
<a className={"color-grey-9 font-12"} style={{"text-align": "center "}}>学号</a>
</li>
</ul>
</div>
</div> </div>
@ -968,6 +972,7 @@ class ShixunStudentWork extends Component {
</div>:<Table </div>:<Table
dataSource={datalist} dataSource={datalist}
columns={columns} columns={columns}
onChange={this.table1handleChange}
pagination={false} pagination={false}
/>} />}

@ -127,6 +127,7 @@ class Trainingjobsetting extends Component {
end_timebool:false, end_timebool:false,
late_timesbool:false, late_timesbool:false,
work_efficiencys:false, work_efficiencys:false,
task_pass: false, //是否允许跳关
} }
// console.log("获取到的值") // console.log("获取到的值")
// console.log("Trainingjobsetting") // console.log("Trainingjobsetting")
@ -272,6 +273,7 @@ class Trainingjobsetting extends Component {
publish_timebool:publish_timebools, publish_timebool:publish_timebools,
end_timebool:end_timebools, end_timebool:end_timebools,
late_timesbool:late_timess, late_timesbool:late_timess,
task_pass: result.data.task_pass,
rules:array, rules:array,
rulest:arrays, rulest:arrays,
rulesdata:rulesdatas, rulesdata:rulesdatas,
@ -701,33 +703,51 @@ class Trainingjobsetting extends Component {
// console.log(e.target.checked); // console.log(e.target.checked);
} }
//数据表创建 //是否跳关设置
onChangedatasheet = (e, index) => { onChangedatasheet = (e, index) => {
var challenge_settings = this.state.challenge_settings; var challenge_settings = this.state.challenge_settings;
var bool= false; let {task_pass} = this.state;
for (var i = 0; i < challenge_settings.length; i++) { if (task_pass === true) {
if (i === index) { // 可以跳关
if (challenge_settings[i].checked === true) { for (var i = 0; i < challenge_settings.length; i++) {
challenge_settings[i].checked = false if (i === index) {
bool=false; if (challenge_settings[i].checked === true) {
} else { challenge_settings[i].checked = false
challenge_settings[i].checked = true } else {
bool=true; challenge_settings[i].checked = true
} }
} }
} }
for (var i = 0; i < challenge_settings.length; i++) { } else {
if(bool=== true){ //不能跳关
if (i < index) { var bool= false;
challenge_settings[i].checked = true //先判断如果是点击的关口 checked 根据点击进行切换
} for (var i = 0; i < challenge_settings.length; i++) {
}else{ if (i === index) {
if (i > index) { if (challenge_settings[i].checked === true) {
challenge_settings[i].checked = false challenge_settings[i].checked = false
} bool=false;
} } else {
challenge_settings[i].checked = true
bool=true;
}
}
}
//小于被选中的checked 都被选中 如果是大于被选中的checked 就全部隐藏掉
for (var i = 0; i < challenge_settings.length; i++) {
if(bool=== true){
if (i < index) {
challenge_settings[i].checked = true
}
}else{
if (i > index) {
challenge_settings[i].checked = false
}
}
} }
}
// console.log(e.target.checked) // console.log(e.target.checked)
// console.log(index) // console.log(index)
this.setState({ this.setState({
@ -2085,7 +2105,7 @@ class Trainingjobsetting extends Component {
const dataformat = 'YYYY-MM-DD HH:mm'; const dataformat = 'YYYY-MM-DD HH:mm';
let {flagPageEdit,testscripttiptype,publish_timebool,end_timebool,late_timesbool,work_efficiencys,flagPageEdits,flagPageEditstwo,flagPageEditsbox,whethertopay,handclass,flagPageEditsthrees, flagPageEditsfor,rules,rulest,unifiedsetting,group_settings, course_group,unit_e_tip, borreds,borredss,unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles} = this.state; let {flagPageEdit, testscripttiptype, publish_timebool, end_timebool, late_timesbool, work_efficiencys, flagPageEdits, flagPageEditstwo, flagPageEditsbox, whethertopay, handclass, flagPageEditsthrees, flagPageEditsfor, rules, rulest, unifiedsetting, group_settings, course_group, unit_e_tip, borreds, borredss, unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles, task_pass} = this.state;
// console.log(publish_timebool); // console.log(publish_timebool);
// console.log(!flagPageEditstwo); // console.log(!flagPageEditstwo);
const radioStyle = { const radioStyle = {
@ -2511,7 +2531,8 @@ class Trainingjobsetting extends Component {
</span> </span>
</div> </div>
<p className="ml20 mt15 c_grey font-13 " style={{color:"#666666"}}> 关卡名称<span <p className="ml20 mt15 c_grey font-13 " style={{color:"#666666"}}> 关卡名称<span
className="color-grey-c font-14 ml10">(需要学生完成的任务请选中,暂不支持跳关选择)</span></p> className="color-orange-tip font-14 ml10">{task_pass === false ? "(请选中需要学生完成的关卡,该实训不支持跳关学习)" : "(请选中需要学生完成的关卡,该实训支持跳关学习)"}</span>
</p>
<div className="ml40 mt15" > <div className="ml40 mt15" >
{this.state.challenge_settings === undefined ? "" : this.state.challenge_settings.map((object, index) => { {this.state.challenge_settings === undefined ? "" : this.state.challenge_settings.map((object, index) => {
return ( return (
@ -2528,6 +2549,7 @@ class Trainingjobsetting extends Component {
value={object.challenge_score} value={object.challenge_score}
/> />
<span className="ml10" style={{color:"#999999"}}></span> <span className="ml10" style={{color:"#999999"}}></span>
<span className="ml40">{object.difficulty}</span>
</li> </li>
) )
})} })}

@ -1,6 +1,6 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import {Table, Pagination,Tooltip,Spin, Row, Col ,Tabs} from "antd"; import {Table, Pagination,Tooltip,Spin, Row, Col ,Tabs} from "antd";
import { WordsBtn,on, off, trigger } from 'educoder'; import { WordsBtn,on, off, trigger ,getImageUrl} from 'educoder';
import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom'; import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom';
import axios from'axios'; import axios from'axios';
import './Statistics.css'; import './Statistics.css';
@ -11,14 +11,28 @@ class Statistics extends Component{
this.state={ this.state={
nd1:60, nd1:60,
nd2:40, nd2:40,
nd3:20 nd3:20,
data:undefined
} }
} }
componentDidMount() { componentDidMount() {
this.setState({ this.setState({
isSpin:true, isSpin:true,
})
let courseId=this.props.match.params.coursesId;
let url=`/courses/${courseId}/statistics.json`;
axios.get(url).then((result) => {
if (result) {
this.setState({
data:result.data.top_scores
})
}
}).catch((error) => {
console.log(error);
this.setState({
isSpins:false,
})
}) })
} }
@ -28,7 +42,7 @@ class Statistics extends Component{
} }
render(){ render(){
let {nd1,nd2,nd3}=this.state; let {nd1,nd2,nd3,data}=this.state;
return( return(
<React.Fragment > <React.Fragment >
@ -42,80 +56,148 @@ class Statistics extends Component{
</Row> </Row>
<Row type="flex" justify="center" align="bottom"> <Row type="flex" justify="center" align="bottom">
<Col span={3}> {data&&data.map((item,key)=>{
<li className="pr rankingss"> if(key===3){
<a href="https://test-newweb.educoder.net/users/cao_jl" className="color-dark"> return(
<img src="https://test-newweb.educoder.net/images/avatars/User/g"/> <Col span={3}>
</a> <li className="pr rankingss">
</li> <a href={`/users/${item.user_login}`} className="color-dark">
</Col> <img src={getImageUrl(`images/${item.avatar_url}`)}/>
</a>
<Col span={5}> </li>
<li className="pr rankingss"> </Col>
<a href="https://test-newweb.educoder.net/users/cao_jl" className="color-dark"> )
<img src="https://test-newweb.educoder.net/images/avatars/User/g" className={"mb10"}/> }
</a>
</li> })}
<Col className={`height-${nd2}`}> {data&&data.map((item,key)=>{
if(key===1){
</Col> return(
</Col> <Col span={5}>
<li className="pr rankingss">
<Col span={5} className={"relatives"}> <a href={`/users/${item.user_login}`} className="color-dark">
<li className="pr rankingss"> <img src={getImageUrl(`images/${item.avatar_url}`)} className={"mb10"}/>
<img src="https://test-newweb.educoder.net/images/educoder/huangguan.png" className="huangguans mb5" /> </a>
<a href="https://test-newweb.educoder.net/users/cao_jl" className="color-dark"> </li>
<img src="https://test-newweb.educoder.net/images/avatars/User/g" className={"mb10"}/> <Col className={`height-${nd2}`}>
</a>
</li> </Col>
<Col className={`height-${nd1}`}> </Col>
)
</Col> }
</Col>
})}
<Col span={5}>
<li className="pr rankingss"> {data&&data.map((item,key)=>{
<a href="https://test-newweb.educoder.net/users/cao_jl" className="color-dark"> if(key===0){
<img src="https://test-newweb.educoder.net/images/avatars/User/g" className={"mb10"}/> return(
</a> <Col span={5} className={"relatives"}>
</li> <li className="pr rankingss">
<Col className={`height-${nd3}`}> <img src="https://test-newweb.educoder.net/images/educoder/huangguan.png" className="huangguans mb5" />
<a href={`/users/${item.user_login}`} className="color-dark">
<img src={getImageUrl(`images/${item.avatar_url}`)} className={"mb10 mt5"}/>
</a>
</li>
<Col className={`height-${nd1}`}>
</Col>
</Col>
)
}
})}
{data&&data.map((item,key)=>{
if(key===2){
return(
<Col span={5}>
<li className="pr rankingss">
<a href={`/users/${item.user_login}`} className="color-dark">
<img src={getImageUrl(`images/${item.avatar_url}`)} className={"mb10"}/>
</a>
</li>
<Col className={`height-${nd3}`}>
</Col>
</Col>
)
}
})}
{data&&data.map((item,key)=>{
if(key===4){
return(
<Col span={3}>
<li className="pr rankingss">
<a href={`/users/${item.user_login}`} className="color-dark">
<img src={getImageUrl(`images/${item.avatar_url}`)}/>
</a>
</li>
</Col>
)
}
})}
</Col>
</Col>
<Col span={3}>
<li className="pr rankingss">
<a href="https://test-newweb.educoder.net/users/cao_jl" className="color-dark">
<img src="https://test-newweb.educoder.net/images/avatars/User/g"/>
</a>
</li>
</Col>
</Row> </Row>
<Row className="mt10" type="flex" justify="center" align="bottom"> <Row className="mt10" type="flex" justify="center" align="bottom">
<Col span={3} className={"Statisticscenter"}>
<Col>威震江湖</Col> {data&&data.map((item,key)=>{
<Col>4th</Col> if(key===3){
</Col> return(
<Col span={5} className={"Statisticscenter"}> <Col span={3} className={"Statisticscenter"}>
<Col>神魔遮天</Col> <Col>{item.user_name}</Col>
<Col>2th</Col> <Col>4th</Col>
</Col> </Col>
<Col span={5} className={"Statisticscenter"}> )
<Col>雄霸天下</Col> }
<Col>1th</Col> })}
</Col> {data&&data.map((item,key)=>{
<Col span={5} className={"Statisticscenter"}> if(key===1){
<Col>不灭战神</Col> return(
<Col>3th</Col> <Col span={5} className={"Statisticscenter"}>
</Col> <Col>{item.user_name}</Col>
<Col span={3} className={"Statisticscenter"}> <Col>2th</Col>
<Col>霸气初现</Col> </Col>
<Col>5th</Col> )
</Col> }
})}
{data&&data.map((item,key)=>{
if(key===0){
return(
<Col span={5} className={"Statisticscenter"}>
<Col>{item.user_name}</Col>
<Col>1th</Col>
</Col>
)
}
})}
{data&&data.map((item,key)=>{
if(key===2){
return(
<Col span={5} className={"Statisticscenter"}>
<Col>{item.user_name}</Col>
<Col>3th</Col>
</Col>
)
}
})}
{data&&data.map((item,key)=>{
if(key===4){
return(
<Col span={3} className={"Statisticscenter"}>
<Col>{item.user_name}</Col>
<Col>5th</Col>
</Col>
)
}
})}
</Row> </Row>
</p> </p>
</div> </div>

Loading…
Cancel
Save