Merge branch 'dev_aliyun' into dev_classes

dev_jupyter
caicai8 5 years ago
commit b699322b15

@ -0,0 +1,74 @@
$(document).on('turbolinks:load', function() {
if ($('body.admins-salesman-channels-index-page').length > 0) {
// ============= 添加销售人员 ==============
var $addMemberModal = $('.admin-add-salesman-channel-user-modal');
var $addMemberForm = $addMemberModal.find('.admin-add-salesman-channel-user-form');
var $memberSelect = $addMemberModal.find('.salesman-channel-user-select');
var $salesmanIdInput = $('.salesman-channel-list-form').find(".btn-primary");
$addMemberModal.on('show.bs.modal', function(event){
var $link = $(event.relatedTarget);
// var salesmanId = $link.data('salesman_id');
// $salesmanIdInput.val(salesmanId);
$memberSelect.select2('val', ' ');
});
$memberSelect.select2({
theme: 'bootstrap4',
placeholder: '请输入要添加的单位',
multiple: true,
minimumInputLength: 1,
ajax: {
delay: 500,
url: '/admins/schools',
dataType: 'json',
data: function(params){
return { keyword: params.term };
},
processResults: function(data){
return { results: data.schools }
}
},
templateResult: function (item) {
if(!item.id || item.id === '') return '';
return $("<span>" + item.name + "</span>");
},
templateSelection: function(item){
if (item.id) {
}
return item.name || '';
}
});
$addMemberModal.on('click', '.submit-btn', function(){
$addMemberForm.find('.error').html('');
// var salesmanId = $salesmanIdInput.val();
var memberIds = $memberSelect.val();
if (memberIds && memberIds.length > 0) {
$.ajax({
method: 'POST',
dataType: 'json',
url: '/admins/salesman_channels/batch_add',
data: { salesman_id: $salesmanIdInput.data("salesman-id"), school_ids: memberIds },
success: function(){
$.notify({ message: '创建成功' });
$addMemberModal.modal('hide');
setTimeout(function(){
window.location.reload();
}, 500);
},
error: function(res){
var data = res.responseJSON;
$form.find('.error').html(data.message);
}
});
} else {
$addMemberModal.modal('hide');
}
});
}
});

@ -0,0 +1,28 @@
class Admins::SalesmanChannelsController < Admins::BaseController
before_action :set_salesman
def index
@channels = SalesmanChannel.all
end
def batch_add
channel_ids = @salesman.salesman_channels.pluck(:school_id)
school_ids = params[:school_ids] - channel_ids
school_ids.each do |school_id|
school = School.find_by(id: school_id)
next if school.blank?
@salesman.salesman_channels.create!(school_id: school.id)
end
render_ok
end
def destroy
@salesman.salesman_channels.find_by!(id: params[:id]).destroy
end
private
def set_salesman
@salesman = Salesman.find params[:salesman_id]
end
end

@ -4,7 +4,7 @@ class Admins::SchoolsController < Admins::BaseController
params[:sort_direction] ||= 'desc' params[:sort_direction] ||= 'desc'
schools = Admins::SchoolQuery.call(params) schools = Admins::SchoolQuery.call(params)
@total_count = schools.map(&:id).count
@schools = paginate schools @schools = paginate schools
school_ids = @schools.map(&:id) school_ids = @schools.map(&:id)

@ -48,6 +48,19 @@ class ApplicationController < ActionController::Base
EduSetting.get(name) EduSetting.get(name)
end end
# 平台身份权限判断(学生用户无权限)
def identity_auth
ue = current_user.user_extension
tip_exception(403, "..") unless current_user.admin_or_business? || ue.teacher? || ue.professional?
end
# 平台已认证身份判断(已认证的老师和专业人士)
def certi_identity_auth
ue = current_user.user_extension
tip_exception(403, "..") unless current_user.admin_or_business? ||
(current_user.professional_certification && (ue.teacher? || ue.professional?))
end
def shixun_marker def shixun_marker
unless current_user.is_shixun_marker? || current_user.admin_or_business? unless current_user.is_shixun_marker? || current_user.admin_or_business?
tip_exception(403, "..") tip_exception(403, "..")
@ -73,7 +86,7 @@ class ApplicationController < ActionController::Base
check_account check_account
tip_exception(@course.excellent ? 410 : 409, "您没有权限进入") tip_exception(@course.excellent ? 410 : 409, "您没有权限进入")
end end
if @user_course_identity > Course::CREATOR && @user_course_identity <= Course::STUDENT if @user_course_identity > Course::CREATOR && @user_course_identity <= Course::STUDENT && @course.tea_id != current_user.id
# 实名认证和职业认证的身份判断 # 实名认证和职业认证的身份判断
tip_exception(411, "你的实名认证和职业认证审核未通过") if @course.authentication && tip_exception(411, "你的实名认证和职业认证审核未通过") if @course.authentication &&
@course.professional_certification && (!current_user.authentication && !current_user.professional_certification) @course.professional_certification && (!current_user.authentication && !current_user.professional_certification)
@ -308,7 +321,7 @@ class ApplicationController < ActionController::Base
end end
if !User.current.logged? && Rails.env.development? if !User.current.logged? && Rails.env.development?
User.current = User.find 8686 User.current = User.find 1
end end

@ -2,7 +2,7 @@ class CourseGroupsController < ApplicationController
before_action :require_login, :check_auth before_action :require_login, :check_auth
before_action :set_group, except: [:create] before_action :set_group, except: [:create]
before_action :find_course, only: [:create] before_action :find_course, only: [:create]
before_action :teacher_allowed before_action :teacher_allowed, except: [:set_invite_code_halt]
def create def create
tip_exception("分班名称不能为空") if params[:name].blank? tip_exception("分班名称不能为空") if params[:name].blank?
@ -55,6 +55,15 @@ class CourseGroupsController < ApplicationController
end end
end end
# 邀请码停用/启用
def set_invite_code_halt
teacher = @course.teachers.find_by(user_id: current_user.id)
tip_exception(403, "无权限") unless current_user.admin_or_business? ||
(teacher.present? && (teacher.teacher_course_groups.pluck(:course_group_id).include?(@group.id) || teacher.teacher_course_groups.size == 0))
@group.update!(invite_code_halt: !@group.invite_code_halt)
normal_status(0, "成功")
end
private private
def set_group def set_group

@ -1,8 +1,10 @@
class ExaminationBanksController < ApplicationController class ExaminationBanksController < ApplicationController
include PaginateHelper include PaginateHelper
before_action :require_login before_action :require_login
before_action :certi_identity_auth, only: [:create, :edit, :update, :destroy, :set_public, :revoke_item]
before_action :find_exam, except: [:index, :create] before_action :find_exam, except: [:index, :create]
before_action :edit_auth, only: [:update, :destroy, :set_public, :revoke_item] before_action :edit_auth, only: [:update, :destroy, :set_public, :revoke_item]
before_action :identity_auth, only: [:index]
def index def index
exams = ExaminationBankQuery.call(params) exams = ExaminationBankQuery.call(params)

@ -1,5 +1,6 @@
class ExaminationIntelligentSettingsController < ApplicationController class ExaminationIntelligentSettingsController < ApplicationController
before_action :require_login before_action :require_login
before_action :certi_identity_auth, only: [:create, :optinal_items, :save_exam, :exchange_one_item, :exchange_items]
before_action :find_exam, only: [:exchange_one_item, :exchange_items, :save_exam] before_action :find_exam, only: [:exchange_one_item, :exchange_items, :save_exam]
def optinal_items def optinal_items
@ -36,7 +37,7 @@ class ExaminationIntelligentSettingsController < ApplicationController
end end
def exchange_one_item def exchange_one_item
item = @exam.item_baskets.find_by!(id: params[:item_id]) item = @exam.item_baskets.find_by!(item_bank_id: params[:item_id])
exam_type_setting = @exam.examination_type_settings.find_by!(item_type: item.item_type) exam_type_setting = @exam.examination_type_settings.find_by!(item_type: item.item_type)
# 获取可选的题 # 获取可选的题

@ -1,5 +1,6 @@
class ExaminationItemsController < ApplicationController class ExaminationItemsController < ApplicationController
before_action :require_login before_action :require_login
before_action :certi_identity_auth, only: [:create, :destroy, :delete_item_type, :set_score, :batch_set_score, :adjust_position]
before_action :validate_score, only: [:set_score, :batch_set_score] before_action :validate_score, only: [:set_score, :batch_set_score]
before_action :find_exam, only: [:create, :batch_set_score, :delete_item_type] before_action :find_exam, only: [:create, :batch_set_score, :delete_item_type]
before_action :find_item, except: [:create, :batch_set_score, :delete_item_type] before_action :find_item, except: [:create, :batch_set_score, :delete_item_type]

@ -1,8 +1,10 @@
class ItemBanksController < ApplicationController class ItemBanksController < ApplicationController
include PaginateHelper include PaginateHelper
before_action :require_login before_action :require_login
before_action :certi_identity_auth, only: [:create, :edit, :update, :destroy, :set_public]
before_action :find_item, except: [:index, :create] before_action :find_item, except: [:index, :create]
before_action :edit_auth, only: [:update, :destroy, :set_public] before_action :edit_auth, only: [:update, :destroy, :set_public]
before_action :identity_auth, only: [:index]
def index def index
items = ItemBankQuery.call(params) items = ItemBankQuery.call(params)

@ -1,5 +1,6 @@
class ItemBasketsController < ApplicationController class ItemBasketsController < ApplicationController
before_action :require_login before_action :require_login
before_action :certi_identity_auth, only: [:create, :delete_item_type, :destroy, :set_score, :batch_set_score, :adjust_position]
before_action :validate_score, only: [:set_score, :batch_set_score] before_action :validate_score, only: [:set_score, :batch_set_score]
helper_method :current_basket helper_method :current_basket

@ -242,7 +242,8 @@ class SubjectsController < ApplicationController
## 云上实验室过滤 ## 云上实验室过滤
@courses = @courses.where(id: current_laboratory.all_courses) @courses = @courses.where(id: current_laboratory.all_courses)
@none_shixun_ids = @subject.shixuns.joins(:shixun_schools).where("school_id != #{current_user.user_extension.try(:school_id).to_i}").where(use_scope: 1).pluck(:id) @all_shixun_ids = @subject.shixuns.where(use_scope: 0).pluck(:id) +
@subject.shixuns.joins(:shixun_schools).where("school_id = #{current_user.user_extension.try(:school_id).to_i} and use_scope = 1").pluck(:id)
end end
def send_to_course def send_to_course

@ -137,7 +137,7 @@ module ApplicationHelper
# 用户图像url如果不存在的话source为匿名用户即默认使用匿名用户图像 # 用户图像url如果不存在的话source为匿名用户即默认使用匿名用户图像
def url_to_avatar(source) def url_to_avatar(source)
if File.exist?(disk_filename(source.class, source.id)) if File.exist?(disk_filename(source&.class, source&.id))
ctime = File.ctime(disk_filename(source.class, source.id)).to_i ctime = File.ctime(disk_filename(source.class, source.id)).to_i
if source.class.to_s == 'User' if source.class.to_s == 'User'
File.join(relative_path, ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}" File.join(relative_path, ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}"

@ -12,6 +12,12 @@ module CoursesHelper
# end # end
end end
def edit_auth group, teachers
User.current.admin_or_business? ||
teachers.select{|teacher| teacher.user_id == User.current.id &&
(teacher.teacher_course_groups.pluck(:course_group_id).include?(group.id) || teacher.teacher_course_groups.size == 0)}.size > 0
end
# 是否有切换为学生的入口 # 是否有切换为学生的入口
def switch_student_role is_teacher, course, user def switch_student_role is_teacher, course, user
is_teacher && course.course_members.where(user_id: user.id, role: %i(STUDENT)).exists? is_teacher && course.course_members.where(user_id: user.id, role: %i(STUDENT)).exists?

@ -177,6 +177,17 @@ module HomeworkCommonsHelper
type == 2 ? student_works.size : (type == 1 ? student_works.where("work_status != 0").size : student_works.where(work_status: 0).size) type == 2 ? student_works.size : (type == 1 ? student_works.where("work_status != 0").size : student_works.where(work_status: 0).size)
end end
# 作品数统计
def calculate_work_count homework_common, member
count = {}
student_works = homework_common.teacher_works(member)
count[:commit_count] = student_works.select{|work| work.work_status != 0 }.size
count[:uncommit_count] = student_works.select{|work| work.work_status == 0 }.size
count[:compelete_count] = Myshixun.where(id: student_works.pluck(:myshixun_id).reject(&:blank?), status: 1).size
count[:all_count] = student_works.size
count
end
# 上次查重的时间 # 上次查重的时间
def last_review_time homework_common, course_group def last_review_time homework_common, course_group
review = homework_common.homework_group_reviews.where(:course_group_id => course_group.id).last review = homework_common.homework_group_reviews.where(:course_group_id => course_group.id).last

@ -152,7 +152,7 @@ module ShixunsHelper
challenge_program_name = [] challenge_program_name = []
shixun.challenges.map(&:exec_path).each do |exec_path| shixun.challenges.map(&:exec_path).each do |exec_path|
challenge_program_name << "\"#{exec_path}\"" challenge_program_name << "\"#{exec_path}\""
if shixun.main_mirror_name == "Java" || shixun.main_mirror_name == "Openjdk10/VNC" if shixun.main_mirror_name == "Java" || shixun.main_mirror_name == "Openjdk10/VNC" || shixun.main_mirror_name == "JavaWeb"
if exec_path.nil? || exec_path.split("src/")[1].nil? if exec_path.nil? || exec_path.split("src/")[1].nil?
source = "\"\"" source = "\"\""
else else

@ -1,3 +1,27 @@
class SalesmanChannel < ApplicationRecord class SalesmanChannel < ApplicationRecord
belongs_to :salesman, :touch => true, counter_cache: true belongs_to :salesman, :touch => true, counter_cache: true
belongs_to :school
def school_name
school.name
end
def teacher_count
UserExtension.where(school_id: school_id).where.not(identity: 1).count
end
def student_count
UserExtension.where(school_id: school_id, identity: 1).count
end
def course_count
Course.where(school_id: school_id).count
end
def shixuns_count
ShixunMember.joins("join user_extensions on user_extensions.user_id = shixun_members.user_id")
.where(user_extensions: {school_id: school_id}).pluck(:shixun_id).uniq.count
end
end end

@ -0,0 +1,2 @@
$.notify({ message: '操作成功' },{ type: 'success' });
$("<%= params[:element]%>").remove();

@ -0,0 +1,15 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb("#{@salesman.name}的渠道", admins_salesmans_path) %>
<% end %>
<div class="box search-form-container salesman-channel-list-form rig">
<div class="flex-1">
<%= javascript_void_link '新增渠道', class: 'btn btn-primary', data: {salesman_id: @salesman.id, toggle: 'modal', target: '.admin-add-salesman-channel-user-modal' } %>
</div>
</div>
<div class="box admin-list-container salesman-channel-list-container">
<%= render(partial: 'admins/salesman_channels/shared/list') %>
</div>
<%= render 'admins/salesman_channels/shared/add_salesman_channels_user_modal' %>

@ -0,0 +1,30 @@
<div class="modal fade admin-add-salesman-channel-user-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">
<form class="admin-add-salesman-user-form">
<%= hidden_field_tag(:salesman_id, nil) %>
<div class="form-group d-flex">
<label class="col-form-label">单位:</label>
<div class="d-flex flex-column-reverse w-75">
<select id="user_ids" name="user_ids" class="form-control salesman-channel-user-select"></select>
</div>
</div>
<div class="error text-danger"></div>
</form>
</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>

@ -0,0 +1,42 @@
<table class="table table-hover text-center salesman-channel-list-table">
<thead class="thead-light">
<tr>
<th width="6%">序号</th>
<th width="17%" class="text-left">名称</th>
<th width="15%" class="text-left">教师数</th>
<th width="15%" class="text-left">学生数</th>
<th width="15%">课堂数</th>
<th width="15%">实训数</th>
<th width="17%">操作</th>
</tr>
</thead>
<tbody>
<% if @channels.present? %>
<% @channels.each_with_index do |channel, index| %>
<tr class="channel-item salesman-channel-item-<%= channel.id %>">
<td><%= index + 1 %></td>
<td class="text-left">
<span><%= channel.school_name %></span>
</td>
<td class="text-left">
<span><%= channel.teacher_count %></span>
</td>
<td class="text-left">
<span><%= channel.student_count %></span>
</td>
<td>
<%= channel.course_count %>
</td>
<td>
<%= channel.shixuns_count %>
</td>
<td>
<%= delete_link '删除', admins_salesman_channel_path(channel, salesman_id: channel.salesman_id, element: ".salesman-channel-item-#{channel.id}"), class: 'delete-salesman-action' %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>

@ -0,0 +1,6 @@
json.count @total_count
json.schools do
json.array! @schools.each do |school|
json.extract! school, :id, :name
end
end

@ -1,7 +1,8 @@
json.course_groups @course_groups.each do |group| json.course_groups @course_groups.each do |group|
json.(group, :id, :course_members_count, :name) json.(group, :id, :course_members_count, :name, :invite_code_halt)
json.invite_code group.invite_code if @user_course_identity < Course::STUDENT json.invite_code group.invite_code if @user_course_identity < Course::STUDENT
json.member_manager member_manager(group, @teachers) if @user_course_identity < Course::NORMAL json.member_manager member_manager(group, @teachers) if @user_course_identity < Course::NORMAL
json.edit_auth edit_auth(group, @teachers) if @user_course_identity < Course::STUDENT
end end
if @user_course_identity == Course::STUDENT if @user_course_identity == Course::STUDENT

@ -25,9 +25,11 @@ json.homeworks @homework_commons.each do |homework|
json.upper_category_name homework.course_second_category&.name unless params[:category] json.upper_category_name homework.course_second_category&.name unless params[:category]
unless curr_status[:status].include?("未发布") unless curr_status[:status].include?("未发布")
json.commit_count studentwork_count homework, 1, @member work_count = calculate_work_count homework, @member
json.uncommit_count studentwork_count homework, 0, @member json.commit_count work_count[:commit_count]
json.all_count studentwork_count homework, 2, @member json.uncommit_count work_count[:uncommit_count]
json.all_count work_count[:all_count]
json.compelete_count work_count[:compelete_count]
end end
if homework.homework_type == "practice" if homework.homework_type == "practice"

@ -171,7 +171,7 @@ elsif @homework.homework_type == "group" || @homework.homework_type == "normal"
json.user_login @is_evaluation ? "--" : work.user.try(:login) json.user_login @is_evaluation ? "--" : work.user.try(:login)
json.user_name @is_evaluation ? "匿名" : work.user.try(:real_name) json.user_name @is_evaluation ? "匿名" : work.user.try(:real_name)
json.user_img url_to_avatar(@is_evaluation ? "0" : work.user) json.user_img @is_evaluation ? "--" : url_to_avatar(work.user)
end end
end end

@ -7,7 +7,7 @@ end
json.stages @subject.stages.includes(shixuns: [user: :user_extension]) do |stage| json.stages @subject.stages.includes(shixuns: [user: :user_extension]) do |stage|
index = 1 index = 1
json.shixuns stage.shixuns do |shixun| json.shixuns stage.shixuns do |shixun|
if shixun.status == 2 && !shixun.is_jupyter && !@none_shixun_ids.include?(shixun.id) if shixun.status == 2 && !shixun.is_jupyter && @all_shixun_ids.include?(shixun.id)
json.shixun_id shixun.id json.shixun_id shixun.id
json.id shixun.id json.id shixun.id
json.identifier shixun.identifier json.identifier shixun.identifier

@ -662,6 +662,7 @@ Rails.application.routes.draw do
member do member do
post 'rename_group' post 'rename_group'
post 'move_category' post 'move_category'
post 'set_invite_code_halt'
end end
collection do collection do
@ -1360,7 +1361,9 @@ Rails.application.routes.draw do
resources :salesmans, only: [:index, :create, :edit, :update, :destroy] do resources :salesmans, only: [:index, :create, :edit, :update, :destroy] do
post :batch_add, on: :collection post :batch_add, on: :collection
end end
resources :salesman_channels, only: [:index, :create, :edit, :update, :destroy] resources :salesman_channels, only: [:index, :create, :edit, :update, :destroy] do
post :batch_add, on: :collection
end
resources :salesman_customers, only: [:index, :create, :edit, :update, :destroy] do resources :salesman_customers, only: [:index, :create, :edit, :update, :destroy] do
post :batch_add, on: :collection post :batch_add, on: :collection
end end

@ -0,0 +1,5 @@
class AddCodeHaltToCourseGroup < ActiveRecord::Migration[5.2]
def change
add_column :course_groups, :invite_code_halt, :boolean, default: false
end
end

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -274,19 +274,25 @@ class CoursesBanner extends Component {
// 确定 // 确定
ModalAction = () => { ModalAction = () => {
let {coursedata}=this.state; let {coursedata}=this.state;
let that=this;
var push = this.props.history; var push = this.props.history;
let id = this.props.match.params.coursesId; let id = this.props.match.params.coursesId;
//删除 //删除
if (this.state.metype === 1) { if (this.state.metype === 1) {
console.log("删除"); that.setState({
this.modalCancel(); antIcon:true
})
var url = `/courses/${id}.json` var url = `/courses/${id}.json`
axios axios
.delete(url, {}) .delete(url, {})
.then(function (response) { .then(function (response) {
console.log(response.data.status) console.log(response.data.status)
if (response.data.status === 0) { if (response.data.status === 0) {
that.setState({
antIcon:false
})
that.modalCancel();
message.success("删除成功", 1) message.success("删除成功", 1)
push.push(`/courses`) push.push(`/courses`)

@ -277,7 +277,7 @@ class ShixunhomeWorkItem extends Component{
/*list style*/ /*list style*/
.boardsList { .boardsList {
display: flex; display: flex;
align-items: center; align-items: flex-start;
padding-top: 8px; padding-top: 8px;
padding-bottom: 10px; padding-bottom: 10px;
@ -297,12 +297,12 @@ class ShixunhomeWorkItem extends Component{
`}</style> `}</style>
{this.props.isAdmin? {this.props.isAdmin?
<span className={`shixunitem${index} fl`} style={{"height":"55px"}}>{checkBox}</span> <span className={`shixunitem${index} fl`} style={{"height":"55px",paddingTop:"2px"}}>{checkBox}</span>
: :
"" ""
} }
<div className="clearfix ds pr pt5 contentSection" > <div className="clearfix ds pr contentSection" >
<style>{` <style>{`
.maxwidth333{ .maxwidth333{
max-width: 333px; max-width: 333px;
@ -404,14 +404,21 @@ class ShixunhomeWorkItem extends Component{
</h6> </h6>
{/* style={discussMessage.time_status===1||discussMessage.time_status===2||discussMessage.time_status===3||discussMessage.time_status===4||discussMessage.time_status===5||discussMessage.time_status===6?{"maxWidth":"216px"}:{"maxWidth":"550px"}} */}
{
discussMessage && discussMessage.upper_category_name &&
// <ConditionToolTip title={discussMessage.upper_category_name} condition={ discussMessage.upper_category_name.length > 22 }>
<div className="color-grey9 task-hide mt5" title={discussMessage.upper_category_name}>所属目录{discussMessage.upper_category_name}</div>
// </ConditionToolTip>
}
<div className="cl"></div> <div className="cl"></div>
<p className="color-grey mt16 fl" style={{"width":"820px"}}> <p className="color-grey mt15 fl" style={{"width":"820px"}}>
<span > <span >
{/* <a href="/users/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> */} {/* <a href="/users/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> */}
{ discussMessage.author && <span className="mr15 color-grey-3">{discussMessage.author}</span> } { discussMessage.author && <span className="mr15 color-grey-3">{discussMessage.author}</span> }
{discussMessage.commit_count===undefined?"":<span className="mr15 color-grey9">已开始做题 {discussMessage.commit_count}</span>} {discussMessage.commit_count===undefined?"":<span className="mr15 color-grey9">已开始做题 {discussMessage.commit_count}</span>}
{discussMessage.uncommit_count===undefined?"":<span className="mr15 color-grey9">未开始做题 {discussMessage.uncommit_count}</span>} {discussMessage.uncommit_count===undefined?"":<span className="mr15 color-grey9">未开始做题 {discussMessage.uncommit_count}</span>}
{discussMessage.compelete_count===undefined?"":<span className="mr15 color-grey9">已完成做题 {discussMessage.compelete_count}</span>}
{/*<span className="mr15 color-grey9">{discussMessage.replies_count} 3 未评</span>*/} {/*<span className="mr15 color-grey9">{discussMessage.replies_count} 3 未评</span>*/}
{ {
@ -426,12 +433,7 @@ class ShixunhomeWorkItem extends Component{
: :
<span className="mr15 color-grey9">{discussMessage.status_time}</span> <span className="mr15 color-grey9">{discussMessage.status_time}</span>
} }
{
discussMessage && discussMessage.upper_category_name &&
<ConditionToolTip title={discussMessage.upper_category_name} condition={ discussMessage.upper_category_name.length > 22 }>
{ <div className=" color-grey9 task-hide fr" style={discussMessage.time_status===1||discussMessage.time_status===2||discussMessage.time_status===3||discussMessage.time_status===4||discussMessage.time_status===5||discussMessage.time_status===6?{"maxWidth":"216px"}:{"maxWidth":"550px"}} title={discussMessage.upper_category_name}>所属目录{discussMessage.upper_category_name}</div>}
</ConditionToolTip>
}

Loading…
Cancel
Save