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

dev_auth
cxt 5 years ago
commit e456347bbb

@ -16,14 +16,13 @@ class Competitions::SaveTeamForm
validate :check_teachers_enrollable
def check_teachers_enrollable
if competition.teacher_enroll_forbidden? # 禁止老师报名
return if creator.is_teacher? # 因为创建者有单独校验,所以这里跳过
return if teacher_ids.blank?
if teacher_ids.present?
errors.add(:teacher_ids, :enroll_forbidden)
return
end
return if creator.is_teacher? # 因为创建者有单独校验,所以这里跳过
end
self.teacher_ids = teacher_ids.map(&:to_i)
@ -50,14 +49,13 @@ class Competitions::SaveTeamForm
validate :check_members_enrollable
def check_members_enrollable
if competition.member_enroll_forbidden? # 禁止学生报名
return unless creator.is_teacher? # 因为创建者有单独校验,所以这里跳过
return if member_ids.blank?
if member_ids.present?
errors.add(:member_ids, :enroll_forbidden)
return
end
return unless creator.is_teacher? # 因为创建者有单独校验,所以这里跳过
end
self.member_ids = member_ids.map(&:to_i)

@ -104,11 +104,19 @@ class PersonModal extends Component {
this.setState({
myuser: this.props.user,
mydatas: data,
polls_nametest: polls_nametests
polls_nametest: polls_nametests,
})
this.setState({
GetenrollmentAPI: this.props.GetenrollmentAPI,
})
try {
this.setState({
addonAfter: polls_nametests.length,
})
} catch (e) {
}
}
@ -148,7 +156,6 @@ class PersonModal extends Component {
};
//创建战队
Createateam = () => {
debugger
try {
if (this.state.polls_nametest.length === 0) {
this.props.showNotification(`请输入您的战队名称最多不超过60个字符`);
@ -862,6 +869,10 @@ class PersonModal extends Component {
member_ids, mydatas, booltech, boolstud, GetenrollmentAPI, Thecurrentnumberbool,
Thecurrentnumberboolstu, Thecurrentnumberstu
} = this.state;
const {
teacher_staff,
member_staff
} = this.props;
//Modal
//keyboard是否支持键盘 esc 关闭
//closable 是否显示右上角的关闭按钮
@ -1291,112 +1302,129 @@ class PersonModal extends Component {
{/*导师*/}
<div style={{
display: "flex",
flexDirection: "initial",
marginTop: "14px",
}}>
<p style={{
width: "59px",
marginTop: "9px",
fontSize: "16px",
}}>
{
teacher_staff === undefined || teacher_staff === null ?
"" :
<div>
<div style={{
display: "flex",
flexDirection: "initial",
marginTop: "14px",
}}>
<p style={{
width: "59px",
marginTop: "9px",
fontSize: "16px",
}}>
<span style={{
color: "#f5222d",
fontSize: "16px",
}}>*</span>
导师:
</p>
<style>
{
`
导师:
</p>
<style>
{
`
.yslzxueshiskmcd .ant-input{
height: 40px !important;
width: 487px !important;
}
`
}
</style>
{/*<div className={"yslzxueshiskmcd2"}>*/}
<Dropdown overlay={cpersondiv1} getPopupContainer={trigger => trigger.parentNode}
visible={this.state.person1}>
<Input
className="yslzxueshiskmcd"
placeholder="请输入老师姓名的任意关键字进行搜索,可以后续在添加"
onPressEnter={this.startSearch}
onFocus={this.inputOnFocus}
onBlur={this.inputOnBlur}
onChange={(e) => this.teacheronChange(e)}
value={this.state.keywordteachers}
suffix={
<i class="iconfont icon-sousuo"
onClick={() => this.Getteacherdata(keywordteachers, team_idteachers, teacher_ids)}/>
}
</style>
{/*<div className={"yslzxueshiskmcd2"}>*/}
<Dropdown overlay={cpersondiv1} getPopupContainer={trigger => trigger.parentNode}
visible={this.state.person1}>
<Input
className="yslzxueshiskmcd"
placeholder="请输入老师姓名的任意关键字进行搜索,可以后续在添加"
onPressEnter={this.startSearch}
onFocus={this.inputOnFocus}
onBlur={this.inputOnBlur}
onChange={(e) => this.teacheronChange(e)}
value={this.state.keywordteachers}
suffix={
<i class="iconfont icon-sousuo"
onClick={() => this.Getteacherdata(keywordteachers, team_idteachers, teacher_ids)}/>
}
/>
</Dropdown>
{/*</div>*/}
</div>
{
booltech === true ?
<p style={{marginLeft: "53px", color: "#FF954C", minHeight: "14px"}}>该老师已添加</p>
:
<div style={{marginLeft: "53px", minHeight: "14px", height: "14px"}}></div>
}
/>
</Dropdown>
{/*</div>*/}
</div>
{
booltech === true ?
<p style={{marginLeft: "53px", color: "#FF954C", minHeight: "14px"}}>该老师已添加</p>
:
<div style={{marginLeft: "53px", minHeight: "14px", height: "14px"}}></div>
</div>
}
{/*队员*/}
<div style={{
display: "flex",
flexDirection: "initial",
}}>
<p style={{
width: "59px",
marginTop: "9px",
fontSize: "16px",
}}>
{
member_staff === undefined || member_staff === null ?
"" :
<div>
<div style={{
display: "flex",
flexDirection: "initial",
}}>
<p style={{
width: "59px",
marginTop: "9px",
fontSize: "16px",
}}>
<span style={{
color: "#f5222d",
fontSize: "16px",
}}>*</span>
队员:
</p>
<style>
{
`
队员:
</p>
<style>
{
`
.yslzxueshiskmcd .ant-input{
height: 40px !important;
width: 487px !important;
}
`
}
</style>
<Dropdown overlay={persondiv2} getPopupContainer={trigger => trigger.parentNode}
visible={this.state.person2}>
<Input
className="yslzxueshiskmcd"
placeholder="请输入想要队员姓名的任意关键字进行搜索"
onPressEnter={this.startSearch2}
onFocus={this.inputOnFocus2}
onBlur={this.inputOnBlur2}
onChange={(e) => this.studentsonChange(e)}
value={this.state.keywordstudents}
suffix={
<i class="iconfont icon-sousuo "
onClick={() => this.Getstudentsdata(keywordstudents, team_idstudents, student_ids)}/>
}
</style>
<Dropdown overlay={persondiv2} getPopupContainer={trigger => trigger.parentNode}
visible={this.state.person2}>
<Input
className="yslzxueshiskmcd"
placeholder="请输入想要队员姓名的任意关键字进行搜索"
onPressEnter={this.startSearch2}
onFocus={this.inputOnFocus2}
onBlur={this.inputOnBlur2}
onChange={(e) => this.studentsonChange(e)}
value={this.state.keywordstudents}
suffix={
<i class="iconfont icon-sousuo "
onClick={() => this.Getstudentsdata(keywordstudents, team_idstudents, student_ids)}/>
}
/>
</Dropdown>
</div>
{
boolstud === true ?
<p style={{marginLeft: "53px", color: "#FF954C", minHeight: "18px"}}>该队员已添加</p>
:
<div style={{marginLeft: "53px", minHeight: "18px", height: "18px"}}></div>
}
/>
</Dropdown>
</div>
{
boolstud === true ?
<p style={{marginLeft: "53px", color: "#FF954C", minHeight: "18px"}}>该队员已添加</p>
:
<div style={{marginLeft: "53px", minHeight: "18px", height: "18px"}}></div>
</div>
}
{/*表格*/}
<div style={{marginLeft: "53px", border: "1px solid #E0E0E0"}}>
{/*<PersonModaltion ></PersonModaltion>*/}

Loading…
Cancel
Save