Merge branches 'dev_aliyun', 'yslcompetition' and 'ysm1' of https://bdgit.educoder.net/Hjqreturn/educoder into ysm1

dev_sync_trustie
杨树明 5 years ago
commit 3a0dea5f48

@ -11,7 +11,7 @@ $(document).on('turbolinks:load', function(){
var timeOptions = {
autoclose: 1,
language: 'zh-CN',
format: 'yyyy-mm-dd hh:ii:ss',
format: 'yyyy-mm-dd hh:ii',
minuteStep: 30
};
@ -27,6 +27,8 @@ $(document).on('turbolinks:load', function(){
$(".competition-start-end-date .end-date").datetimepicker(timeOptions);
$(".nav-setting-form .enroll_end_time").datetimepicker(timeOptions);
defineDateRangeSelect('.teaching-mode-date');
// defineTimeRangeSelect('.competition-start-end-date');
@ -194,7 +196,7 @@ $(function () {
$("#requireForm").on("click",".delRequrieBtn",function () {
$(this).parents(".requireForm_item").remove();
});
})
$('.competition-staff-settings').on('click', '.mutiple-limited-radio', function(){
var radio = $(this);
@ -232,4 +234,147 @@ $(function () {
}
});
});
});
// 排行榜设置
//删除小阶段
$("#large_panel").on("click",".small_panel_item_del",function () {
var list = $(this).parents(".small_panel");
$(this).parents(".small_panel_item").remove();
for(var i=0;i < $(list).find(".subName").length;i++){
console.log(i);
$(list).find(".subName").eq(i).html("第"+parseInt(i+1)+"阶段");
}
})
})
//新增子阶段
function add_task_sub(item){
var index = $(item).parents(".large_panel_part").attr("attr_line");
var count= 0;
console.log("sdfsf");
console.log($("#small_panel_"+index).find(".small_panel_item").length > 0);
if($("#small_panel_"+index).find(".small_panel_item").length > 0){
count = parseInt($("#small_panel_"+index).find(".small_panel_item").last().attr("count")) + 1;
console.log($("#small_panel_"+index).find(".small_panel_item").last().attr("count"));
}else{
count = 1;
}
var showCount=parseInt($("#small_panel_"+index).find(".small_panel_item").length) + 1;
var html='<div class="row d-flex small_panel_item" attr_line="sub_'+index+'_'+count+'" count="'+count+'">\n' +
' <span class="col-1 mt-2 subName">第'+showCount+'阶段</span>\n' +
' <div class="flex-1">\n' +
' <div class="row">\n' +
' <span class="mt-2 ml20">有效时间:</span>\n' +
' <div class="col-2 no_padding input_middle">\n' +
' <input class="use_time_begin_'+index+'_'+count+' form-control" placeholder="有效开始时间"/>\n' +
' </div>\n' +
' <span class="mt-2">~</span>\n' +
' <div class="col-2 no_padding input_middle">\n' +
' <input class="use_time_end_'+index+'_'+count+' form-control" placeholder="有效结束时间"/>\n' +
' </div>\n' +
' <span class="col-2 text-right mt-2 no_padding">任务完成要求:</span>\n' +
' <div class="col-1 no_padding input_small">\n' +
' <input type="number" class="form-control" name="task_require_small_'+index+'_'+count+'"/>\n' +
' </div>\n' +
' <span class="mt-2 ml10 mr10">/</span>\n' +
' <div class="col-1 no_padding input_small">\n' +
' <input type="number" class="form-control task_all" onchange="change_total(this)" name="task_require_all_'+index+'_'+count+'"/>\n' +
' </div>\n' +
' <span class=" mt-2">(总任务)</span>\n' +
' <span class="col-1 text-right mt-2 no_padding">成绩来源:</span>\n' +
' <div class="col-2 no_padding input_middle">\n' +
' <select class="form-control" name="source_'+index+'_'+count+'">\n' +
' <option>经验值</option>\n' +
' <option>预测准确率</option>\n' +
' </select>\n' +
' </div>\n' +
' </div>\n' +
' <div class="row mt-2" id="task_Input_sub_'+index+'_'+count+'"></div>\n' +
' </div>\n' +
' <span>\n' +
' <a href="javascript:void(0)" class="btn btn-default ml20 small_panel_item_del">删除</a>\n' +
' </span>\n' +
' </div>';
$("#small_panel_"+index).append(html);
}
// 小阶段修改总任务数
function change_total(item) {
var count=parseInt($(item).val());
var index = $(item).parents(".small_panel_item").attr("attr_line");
var indexLarge = $(item).parents(".large_panel_part").attr("attr_line");
console.log(indexLarge);
console.log(index);
var divCount=parseInt($("#task_Input_"+index).find(".task_Input_div").length);
var html = "";
if(count > divCount){
for(var i=0;i < count-divCount ;i++){
html+='<div class="col-4 row task_Input_div"><span class="col-3 text-center mt-3">任务'+(divCount+i+1)+'</span>\n' +
'<div class="col-8">\n' +
'<input type="text" class="form-control mt-2" name="input_'+index+'_'+(divCount+i+1) +'" placeholder="请填写实训ID">\n' +
'</div>\n' +
'</div>';
}
$("#task_Input_"+index).append(html);
}else{
var delCount = divCount - count ;
console.log(divCount);
console.log(count);
var _max=parseInt($("#task_Input_"+index).find(".task_Input_div:last").index());
console.log(_max);
var _get= _max - delCount;
console.log(_get);
if(count == 0){
$("#task_Input_"+index).empty();
}else{
$("#task_Input_"+index).find(".task_Input_div:gt("+_get+")").remove();
}
}
}
//删除tab
function Del_tab(item) {
$(item).parents(".large_panel_part").remove();
}
//新增tab
function addNewTab() {
var count = parseInt($("#large_panel").find(".large_panel_part").length)+1;
var html = '<div class="large_panel_part" attr_line="'+count+'"><div class="row d-flex mt-3">\n' +
' <span class="col-1 mt-2">tab标题</span>\n' +
' <div class="col-2 no_padding">\n' +
' <input type="text" class="form-control" name="tab_title_1"/>\n' +
' </div>\n' +
' <span class="col-1 text-right mt-2 no_padding">总排行榜占比:</span>\n' +
' <div class="col-1 no_padding">\n' +
' <input type="number" class="form-control" name="tab_percent_'+count+'"/>\n' +
' </div><span class=" mt-2">%</span>\n' +
' <div class="flex-1">\n' +
' <a href="javascript:void(0)"class="btn btn-outline-primary export-action ml20 add_task_sub" onclick="add_task_sub(this)">新增子阶段</a>\n' +
' <a href="javascript:void(0)" class="btn btn-outline-primary export-action ml20">发送短信提醒</a>\n' +
' <a href="javascript:void(0)" class="btn btn-outline-primary export-action ml20">计算成绩</a>\n' +
' </div>\n' +
' <a href="javascript:void(0)" class="btn btn-default ml20" onclick="Del_tab(this)">删除</a>\n' +
' <a href="javascript:void(0)" class="btn btn-outline-primary export-action ml20">保存</a>\n' +
' </div>\n' +
' <div id="small_panel_'+count+'" class="small_panel"></div></div>';
$("#large_panel").append(html);
}

@ -1,6 +1,6 @@
$(document).on('turbolinks:load', function() {
if($('body.admins-enroll-lists-index-page').length > 0){
let search_form = $(".search-form");
var search_form = $(".search-form");
//导出
$(".competition-enroll-list-form").on("click","#enroll-lists-export",function () {
window.location.href = "/admins/competitions/"+$(this).attr("data-competition-id")+"/enroll_lists/export.xlsx?" + search_form.serialize();

@ -5,7 +5,7 @@ $(document).on('turbolinks:load', function() {
allowClear: true
});
let search_form = $(".search-form");
var search_form = $(".search-form");
//导出
$(".shixuns-list-form").on("click","#shixuns-export",function () {
window.location.href = "/admins/shixuns.xls?" + search_form.serialize();

@ -37,6 +37,28 @@
}
.setBtn_s{
height: 35px;
line-height: 5px;
line-height: 20px;
}
.large_panel{
padding:0px 15px;
.large_panel_part{
border-top: 1px solid #eaeaea;
}
.large_panel_part:first-child{
border:none;
}
.large_panel_part >.row ,.small_panel >.row{
border-bottom: 1px solid #eaeaea;
padding:20px 0px;
}
.small_panel{
margin-left: 20px;
}
.row:last-child{
border:none;
}
}
}

@ -29,7 +29,7 @@ input.form-control {
.flex-1 {
flex: 1;
}
.no_padding{padding: 0px!important;}
.font-12 { font-size: 12px !important; }
.font-14 { font-size: 14px !important; }
.font-16 { font-size: 16px !important; }
@ -48,6 +48,10 @@ input.form-control {
.position-r{position:relative;}
.color-grey-c{color:#ccc}
.color-blue{color:#4CACFF}
.color-orange{color: #ff6800}
.inline-block{display:inline-block;}
.hide{display: none;}
.show{display: block;}
.input_small{flex: 0 0 6%!important;}
.input_middle{flex:0 0 13%!important;}

@ -20,7 +20,7 @@ class Admins::CompetitionSettingsController < Admins::BaseController
end
def basic_form_params
params.permit(:identifier, :name, :sub_title, :start_time, :end_time, :mode, :identifier, :bonus, :awards_count, :description, :course_id, :teach_start_time, :teach_end_time)
params.permit(:identifier, :name, :sub_title, :sponsor_schools, :region_schools, :start_time, :end_time, :mode, :identifier, :bonus, :awards_count, :description, :course_id, :teach_start_time, :teach_end_time)
end
def nav_form_params

@ -136,7 +136,7 @@ class Competitions::CompetitionTeamsController < Competitions::BaseController
def tech_mode
# render_not_found if current_competition.mode != 3
@team = current_competition.competition_teams.find_by(id: params[:id])
@team = current_competition.competition_teams.find_by!(id: params[:id])
end
def get_valid_myshixun_count(ids)

@ -70,12 +70,15 @@ class Competitions::CompetitionsController < Competitions::BaseController
def update_md_content
tip_exception("标题和内容不能为空") if params[:name].blank? || params[:content].blank?
tip_exception("缺少competition_module_id") if params[:competition_module_id].blank?
ActiveRecord::Base.transaction do
com_module = current_competition.competition_modules.find_by!(id: params[:competition_module_id])
if params[:md_content_id]
md_content = CompetitionModuleMdContent.find_by!(id: params[:md_content_id])
md_content = CompetitionModuleMdContent.find_by!(id: params[:md_content_id], competition_module_id: com_module.id)
md_content.update_attributes!(name: params[:name], content: params[:content])
else
md_content = CompetitionModuleMdContent.create!(name: params[:name], content: params[:content])
stage = current_competition.competition_stages.find_by(id: params[:stage_id]) if params[:stage_id]
md_content = CompetitionModuleMdContent.create!(name: params[:name], content: params[:content], competition_module_id: com_module.id, competition_stage_id: stage&.id.to_i)
end
Attachment.associate_container(params[:attachment_ids], md_content.id, md_content.class) if params[:attachment_ids]
normal_status("更新成功")

@ -7,6 +7,7 @@ class Competitions::StudentsController < Competitions::BaseController
end
students = User.joins(:user_extension).where(status: 1, user_extensions: { identity: 1 })
students = students.where(user_extensions: { school_id: current_competition.region_schools.pluck(:school_id) }) if current_competition.region_schools.size > 0
students = students.where.not(id: params[:student_ids]) if params[:student_ids].present?
students = students.where('LOWER(CONCAT(lastname, firstname, login, nickname)) LIKE ?', "%#{keyword}%")
@students = students.includes(user_extension: :school).limit(20)

@ -22,6 +22,9 @@ class Competition < ApplicationRecord
has_many :attachments, as: :container, dependent: :destroy
has_many :competition_awards, dependent: :destroy
has_many :competition_schools, dependent: :destroy
has_one :sponsor_schools, -> { where(source: :sponsor) }, class_name: 'CompetitionSchool' # 主办方
has_one :region_schools, -> { where(source: :region) }, class_name: 'CompetitionSchool' # 开放范围
after_create :create_competition_modules
@ -66,7 +69,7 @@ class Competition < ApplicationRecord
# 是否为个人赛
def personal?
competition_staffs.maximum(:maximum) == 1 || (competition_staffs.nil? && max_num == 1)
competition_staffs.sum(:maximum).to_i == 1 || (competition_staffs.nil? && max_num == 1)
end
# 报名是否结束
@ -79,6 +82,12 @@ class Competition < ApplicationRecord
team_members.exists?(user_id: user.id)
end
# 是否开放
def open?(user)
user_school_id = user.user_extension&.school_id.to_i
competition.region_schools.size == 0 || competition.region_schools.exists?(school_id: user_school_id)
end
# 是否禁止教师报名
def teacher_enroll_forbidden?
teacher_staff.blank? || teacher_staff.maximum.zero?

@ -3,7 +3,7 @@ class CompetitionModule < ApplicationRecord
belongs_to :competition
has_many :competition_module_md_contents, dependent: :destroy
has_one :competition_module_md_content, dependent: :destroy
def module_url
result_url = url.present? ? url : case module_type

@ -0,0 +1,5 @@
class CompetitionSchool < ApplicationRecord
# source sponsor: 主办方, region开放范围
belongs_to :competition
belongs_to :school
end

@ -5,6 +5,7 @@ class CompetitionStage < ApplicationRecord
has_many :competition_entries, dependent: :destroy
has_many :competition_scores, dependent: :destroy
has_one :competition_module_md_content, dependent: :destroy
has_one :chart_rule, dependent: :destroy
def min_start_time

@ -20,6 +20,7 @@ class Admins::CompetitionBasicSettingService < ApplicationService
competition.save!
# 竞赛模式相关设置
if competition.mode == 1 || competition.mode == 4
competition.competition_mode_setting&.destroy
else
@ -33,6 +34,23 @@ class Admins::CompetitionBasicSettingService < ApplicationService
setting.save!
end
# 主办方设置
new_school_ids = (params[:sponsor_schools] || []) - competition.sponsor_schools.pluck(:school_id)
delete_school_ids = competition.sponsor_schools.pluck(:school_id) - (params[:sponsor_schools] || [])
new_school_ids.each do |school_id|
CompetitionSchool.create!(competition_id: competition.id, school_id: school_id, source: 'sponsor')
end
competition.sponsor_schools.where(school_id: delete_school_ids).destroy_all
# 开放范围设置
new_region_school_ids = (params[:region_schools] || []) - competition.region_schools.pluck(:school_id)
delete_region_school_ids = competition.region_schools.pluck(:school_id) - (params[:region_schools] || [])
new_region_school_ids.each do |school_id|
CompetitionSchool.create!(competition_id: competition.id, school_id: school_id, source: 'region')
end
competition.region_schools.where(school_id: delete_region_school_ids).destroy_all
competition
end
end

@ -11,6 +11,8 @@ class Competitions::CreatePersonalTeamService < ApplicationService
def call
raise Error, '个人赛才能报名' unless competition.personal?
raise Error, '本竞赛只对指定单位/学校开放' unless competition.open?(user)
is_teacher = user.is_teacher?
raise Error, '本竞赛的参赛者限定为:学生' if is_teacher && competition.teacher_enroll_forbidden?
raise Error, '本竞赛的参赛者限定为:教师' if !is_teacher && competition.member_enroll_forbidden?

@ -13,6 +13,8 @@ class Competitions::JoinTeamService < ApplicationService
invite_code = params[:invite_code].to_s.strip
raise Error, '战队邀请码不能为空' if invite_code.blank?
raise Error, '本竞赛只对指定单位/学校开放' unless competition.open?(user)
is_teacher = user.is_teacher?
raise Error, '本竞赛的参赛者限定为:学生' if is_teacher && competition.teacher_enroll_forbidden?
raise Error, '本竞赛的参赛者限定为:教师' if !is_teacher && competition.member_enroll_forbidden?

@ -35,8 +35,8 @@
起止时间
</div>
<div class="col-5 competition-start-end-date d-flex">
<%= text_field_tag :start_time, @competition.start_time&.strftime('%Y-%m-%d %H:%M:%S'), autocomplete: 'off', class: 'form-control start-date mx-0 mr-2', placeholder: '竞赛开始时间' %>
<%= text_field_tag :end_time, @competition.end_time&.strftime('%Y-%m-%d %H:%M:%S'), autocomplete: 'off', class: 'form-control end-date mx-0', placeholder: '竞赛截止时间' %>
<%= text_field_tag :start_time, @competition.start_time&.strftime('%Y-%m-%d %H:%M'), autocomplete: 'off', class: 'form-control start-date mx-0 mr-2', placeholder: '竞赛开始时间' %>
<%= text_field_tag :end_time, @competition.end_time&.strftime('%Y-%m-%d %H:%M'), autocomplete: 'off', class: 'form-control end-date mx-0', placeholder: '竞赛截止时间' %>
</div>
</div>
@ -156,7 +156,7 @@
<% @competition.competition_modules.each do |com_module| %>
<% case com_module.module_type %>
<% when 'home' %>
<div id="MD_typeFrom">
<div class="mt-3" id="MD_typeFrom">
<div class="row MD_type">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
@ -192,7 +192,7 @@
报名截止时间
</div>
<div class="col-md-3">
<%= text_field_tag :enroll_end_time, @competition.enroll_end_time&.strftime('%Y-%m-%d'), autocomplete: 'off', class: 'form-control enroll_end_time', placeholder: '报名截止时间' %>
<%= text_field_tag :enroll_end_time, @competition.enroll_end_time&.strftime('%Y-%m-%d %H:%M'), autocomplete: 'off', class: 'form-control enroll_end_time', placeholder: '报名截止时间' %>
</div>
</div>
<div class="row mt-2">
@ -311,3 +311,75 @@
</div>
</div>
<div class="card mb-5">
<div class="card-header d-flex justify-content-between align-items-center">
<span>排行榜设置</span>
<a href="javascript:void(0)" class="btn btn-primary btn-custom waves-effect waves-light ml20" onclick="addNewTab();">+ 新增tab</a>
<span class="flex-1 text-right color-orange">实训ID填写示例实训地址为https://www.educoder.net/shixuns/u5plmgka/challenges则填写“u5plmgka”</span>
</div>
<div class="card-body">
<div id="large_panel" class="large_panel">
<div class="large_panel_part" attr_line="1">
<div class="row d-flex">
<span class="col-1 mt-2">tab标题</span>
<div class="col-2 no_padding">
<input type="text" class="form-control" name="tab_title_1"/>
</div>
<span class="col-1 text-right mt-2 no_padding">总排行榜占比:</span>
<div class="col-1 no_padding">
<input type="number" class="form-control" name="tab_percent_1"/>
</div><span class=" mt-2">%</span>
<div class="flex-1">
<a href="javascript:void(0)"class="btn btn-outline-primary export-action ml20 add_task_sub" onclick="add_task_sub(this)">新增子阶段</a>
<a href="javascript:void(0)" class="btn btn-outline-primary export-action ml20">发送短信提醒</a>
<a href="javascript:void(0)" class="btn btn-outline-primary export-action ml20">计算成绩</a>
</div>
<a href="javascript:void(0)" class="btn btn-default ml20" onclick="Del_tab(this)">删除</a>
<a href="javascript:void(0)" class="btn btn-outline-primary export-action ml20">保存</a>
</div>
<div id="small_panel_1" class="small_panel">
<div class="row d-flex small_panel_item" attr_line="sub_1_1" count="1">
<span class="col-1 mt-2 subName">第1阶段</span>
<div class="flex-1">
<div class="row">
<span class="mt-2 ml20">有效时间:</span>
<div class="col-2 no_padding input_middle">
<input class="use_time_begin_1_1 form-control" placeholder="有效开始时间"/>
</div>
<span class="mt-2">~</span>
<div class="col-2 no_padding input_middle">
<input class="use_time_end_1_1 form-control" placeholder="有效结束时间"/>
</div>
<span class="col-2 text-right mt-2 no_padding">任务完成要求:</span>
<div class="col-1 no_padding input_small">
<input type="number" class="form-control" name="task_require_small_1_1"/>
</div>
<span class="mt-2 ml10 mr10">/</span>
<div class="col-1 no_padding input_small">
<input type="number" class="form-control task_all" onchange="change_total(this)" name="task_require_all_1_1"/>
</div>
<span class=" mt-2">(总任务)</span>
<span class="col-1 text-right mt-2 no_padding">成绩来源:</span>
<div class="col-2 no_padding input_middle">
<select class="form-control" name="source_1_1">
<option>经验值</option>
<option>预测准确率</option>
</select>
</div>
</div>
<div class="row mt-2" id="task_Input_sub_1_1"></div>
</div>
<span>
<a href="javascript:void(0)" class="btn btn-default ml20 small_panel_item_del">删除</a>
</span>
</div>
</div>
</div>
</div>
</div>
</div>

@ -1,9 +1,11 @@
json.extract! @module, :id, :name, :position, :url
mds = @module.competition_module_md_contents
json.md_contents mds.each do |md|
md = @module.competition_module_md_content
if md.present?
json.md_id md.id
json.md_name md.name
json.md_content md.content
json.competition_stage_id md.competition_stage_id
json.created_at md.created_at.strftime('%Y-%m-%d %H:%M:%S')
json.attachments do
json.array! md.attachments, partial: 'attachments/attachment_simple', as: :attachment

@ -0,0 +1,11 @@
class CreateCompetitionSchools < ActiveRecord::Migration[5.2]
def change
create_table :competition_schools do |t|
t.references :competition, index: true
t.references :school, index: true
t.string :source
t.timestamps
end
end
end

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -64,6 +64,7 @@ class Registration extends React.Component {
pint: 0,
competition_name: undefined,
mutiple_limited: false,
teamutiple_limited: false,
}
}
@ -117,6 +118,7 @@ class Registration extends React.Component {
teacher_staff: result.data.teacher_staff,
member_staff: result.data.member_staff,
mutiple_limited: result.data.member_staff.mutiple_limited,
teamutiple_limited: result.data.teacher_staff.mutiple_limited
})
if (result.data.enroll_ended === true) {
this.setState({
@ -631,7 +633,7 @@ class Registration extends React.Component {
render() {
const {page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint, competition_name, mutiple_limited} = this.state;
const {page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint, competition_name, mutiple_limited, teamutiple_limited} = this.state;
return (
<div className="newMain clearfix newMainybot">
@ -659,6 +661,7 @@ class Registration extends React.Component {
tmodalsType === true ?
<PersonModal modalsType={tmodalsType} {...this.props} {...this.state} Newtit={Newtit}
mutiple_limited={mutiple_limited}
teamutiple_limited={teamutiple_limited}
itemiddata={itemiddata} GetenrollmentAPI={GetenrollmentAPI}
Tmoconfirm1={(bool) => this.Tmoconfirm1(bool)}
GetenrollmentAPIopens={() => this.GetenrollmentAPI()}

@ -774,6 +774,31 @@ reglistviewdivs2 {
cursor: default;
}
.maxnamewidth85 {
max-width: 85px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
}
.maxnamewidth90 {
max-width: 90px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
}
.maxnamewidth110 {
max-width: 110px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
}
.maxnamewidth160 {
max-width: 160px;
overflow: hidden;

@ -878,37 +878,107 @@ class PersonModal extends Component {
var cpersondiv1Items = [];
if (teacher_ids) {
cpersondiv1Items = teacher_ids.map((item, index) =>
<a className="reglistviewdivss2" key={index} style={{
<a
className={this.props.teamutiple_limited === undefined || this.props.teamutiple_limited === null ? "reglistviewdivss2 " : (this.props.teamutiple_limited === true && item.enrollable === false ? "reglistviewdivss2c" : "reglistviewdivss2 ")}
key={index} style={{
width: "100%",
display: "flex",
justifyContent: " space-around",
alignItems: "center",
height: "40px",
}}
onClick={() => this.getdatacpersondiv1Items(item)}
onClick={() => this.getdatacpersondiv1Items(item)}
>
<p className=" cpersondiv1Items"
style={{
textAlign: "center",
width: "100px"
}}
>{item.name === undefined || item.name === null || item.name === "" ? "--" : item.name}</p>
<p className=" cpersondiv1Items"
style={{
textAlign: "center",
width: "100px"
}}
> {item.identity === undefined || item.identity === null || item.identity === "" ? "--" : item.identity}</p>
<p className=" cpersondiv1Items"
style={{
textAlign: "center",
width: "120px"
}}
>{item.school_name === undefined || item.school_name === null || item.school_name === "" ? "--" : item.school_name}</p>
<style>
{
`
a:hover
{
color: #05101A;
}
`
}
</style>
{item.name === undefined || item.name === null || item.name === "" ?
<a className=" cpersondiv1Items"
style={{
textAlign: "center",
width: "90px"
}}
>--</a>
:
<a title={item.name} className=" cpersondiv1Items maxnamewidth90"
style={{
textAlign: "center",
width: "90px"
}}
>{item.name}</a>
}
{item.identity === undefined || item.identity === null || item.identity === "" ?
<p className=" cpersondiv1Items maxnamewidth85"
style={{
textAlign: "center",
width: "85px"
}}
>--</p>
:
<a title={item.identity} className=" cpersondiv1Items maxnamewidth85"
style={{
textAlign: "center",
width: "85px"
}}
>{item.identity}</a>}
{item.school_name === undefined || item.school_name === null || item.school_name === "" ?
<p className=" cpersondiv1Items"
style={{
textAlign: "center",
width: "110px"
}}
>--</p>
:
<a title={item.school_name} className=" cpersondiv1Items maxnamewidth110"
style={{
textAlign: "center",
width: "110px"
}}
>{item.school_name}</a>
}
{
this.props.teamutiple_limited === undefined || this.props.teamutiple_limited === null ?
<p className=" cpersondiv1Items"
style={{
textAlign: "center",
width: "87px"
}}
>{""}</p>
:
(
this.props.teamutiple_limited === true ?
<p className=" cpersondiv1Items"
style={{
textAlign: "center",
color: "#FF6800",
width: "87px"
}}
>{item.enrollable === false ? "已加入其他战队" : ""}</p>
:
<p className=" cpersondiv1Items"
style={{
textAlign: "center",
width: "87px"
}}
>{""}</p>
)
}
</a>
);
}
@ -953,24 +1023,62 @@ class PersonModal extends Component {
}}
onClick={() => this.getdatacpersondiv1Items2(item)}
>
<p className=" cpersondiv1Items"
style={{
textAlign: "center",
width: "90px"
}}
>{item.name === undefined || item.name === null || item.name === "" ? "--" : item.name}</p>
<p className=" cpersondiv1Items"
style={{
textAlign: "center",
width: "85px"
}}
>{item.identity === undefined || item.identity === null || item.identity === "" ? "--" : item.identity}</p>
<p className=" cpersondiv1Items"
style={{
textAlign: "center",
width: "110px"
}}
>{item.school_name === undefined || item.school_name === null || item.school_name === "" ? "--" : item.school_name}</p>
<style>
{
`
a:hover
{
color: #05101A;
}
`
}
</style>
{item.name === undefined || item.name === null || item.name === "" ?
<a className=" cpersondiv1Items"
style={{
textAlign: "center",
width: "90px"
}}
>--</a>
:
<a title={item.name} className=" cpersondiv1Items maxnamewidth90"
style={{
textAlign: "center",
width: "90px"
}}
>{item.name}</a>
}
{item.student_id === undefined || item.student_id === null || item.student_id === "" ?
<p className=" cpersondiv1Items maxnamewidth85"
style={{
textAlign: "center",
width: "85px"
}}
>--</p>
:
<a title={"学号:" + item.student_id} className=" cpersondiv1Items maxnamewidth85"
style={{
textAlign: "center",
width: "85px"
}}
>{"学号:" + item.student_id}</a>}
{item.school_name === undefined || item.school_name === null || item.school_name === "" ?
<p className=" cpersondiv1Items"
style={{
textAlign: "center",
width: "110px"
}}
>--</p>
:
<a title={item.school_name} className=" cpersondiv1Items maxnamewidth110"
style={{
textAlign: "center",
width: "110px"
}}
>{item.school_name}</a>
}
{
this.props.mutiple_limited === undefined || this.props.mutiple_limited === null ?
<p className=" cpersondiv1Items"
@ -1199,11 +1307,6 @@ class PersonModal extends Component {
`
}
</style>
{/*<Search*/}
{/* */}
{/* placeholder="请输入想要队员姓名的任意关键字进行搜索"*/}
{/* onSearch={(value) => this.onSearch(value)}*/}
{/*/>*/}
<Dropdown overlay={persondiv2} getPopupContainer={trigger => trigger.parentNode}
visible={this.state.person2}>

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe CompetitionSchool, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading…
Cancel
Save