Merge branches 'dev_aliyun' and 'issues25489' of https://bdgit.educoder.net/Hjqreturn/educoder into issues25489

issues25489
杨树林 5 years ago
commit 7a6e891eb5

@ -154,7 +154,19 @@ class ShixunsController < ApplicationController
## 获取顶部菜单
def menus
@repertoires = Repertoire.includes(sub_repertoires: [:tag_repertoires]).order("updated_at asc")
where_sql = ShixunTagRepertoire.where("shixun_tag_repertoires.tag_repertoire_id = tag_repertoires.id")
# 云上实验室过滤
unless current_laboratory.main_site?
where_sql = where_sql.joins('JOIN laboratory_shixuns ls ON ls.shixun_id = shixun_tag_repertoires.shixun_id')
end
where_sql = where_sql.select('1').to_sql
tags = TagRepertoire.where("EXISTS(#{where_sql})").distinct.includes(sub_repertoire: :repertoire)
@tags_map = tags.group_by(&:sub_repertoire)
@sub_reps_map = @tags_map.keys.group_by(&:repertoire)
# @repertoires = Repertoire.includes(sub_repertoires: [:tag_repertoires]).order("updated_at asc")
# respond_with @repertoires
render_json

@ -1,5 +1,5 @@
class TrustieHackathon < ApplicationRecord
validates_length_of :description, maximum: 500
#validates_length_of :description, maximum: 10000
has_many :trustie_hacks, :dependent => :destroy
end

@ -13,17 +13,33 @@
# ]
# }]
json.array! @repertoires do |rep|
json.id rep.id
json.name rep.name
# json.array! @repertoires do |rep|
# json.id rep.id
# json.name rep.name
# json.sub_repertoires do
# json.array! rep.sub_repertoires do |sub|
# json.id sub.id
# json.name sub.name
# json.tags do
# json.array! sub.tag_repertoires do |tag|
# json.id tag.id
# json.name tag.name
# end
# end
# end
# end
# end
json.array! @sub_reps_map.keys do |rep|
json.extract! rep, :id, :name
json.sub_repertoires do
json.array! rep.sub_repertoires do |sub|
json.id sub.id
json.name sub.name
json.array! @sub_reps_map[rep] do |sub_rep|
json.extract! sub_rep, :id, :name
json.tags do
json.array! sub.tag_repertoires do |tag|
json.id tag.id
json.name tag.name
json.array! @tags_map[sub_rep] do |tag|
json.extract! tag, :id, :name
end
end
end

@ -20,7 +20,7 @@ class CheckAllGroup extends Component{
this.props.onChange && this.props.onChange([], true);
}
onChange = (checkedValues) => {
if (checkedValues.length > 0 && checkedValues.length != this.props.options.length) {
if (checkedValues.length > 0) {
this.setState({
'checkAll': false,
checkedValues
@ -48,7 +48,7 @@ class CheckAllGroup extends Component{
`}</style>
<span className="fl mr10 color-grey-8">{label}</span>
<span className="fl mr25">
<a href="javascript:void(0);" id="comment_no_limit" className={`pl10 pr10 ${checkAll ? 'check_on' : ''}`} onClick={this.onCheckAll}>不限</a>
<a href="javascript:void(0);" id="comment_no_limit" className={`pl10 pr10 ${checkAll ? 'check_on' : ''}`} onClick={this.onCheckAll}>全部</a>
</span>
<div className="fl groupList" style={{maxWidth:"990px"}}>
{

@ -2153,24 +2153,28 @@ class Studentshavecompletedthelist extends Component {
}
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) {
if (this.state.loadingstate === false) {
this.setState({
loadingstate: true,
course_groupyslstwo: undefined,
unlimiteds: 0,
page:1
})
} else {
this.setState({
course_groupyslstwo: undefined,
unlimiteds: 0,
page:1,
})
}
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 if (checkedValues.length === data.length) {
// if (this.state.loadingstate === false) {
// this.setState({
// loadingstate: true,
// course_groupyslstwo: undefined,
// unlimiteds: 0,
// page:1
// })
// }
//
// else {
// this.setState({
// course_groupyslstwo: undefined,
// unlimiteds: 0,
// page:1,
// })
// }
//
// this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
// }
else {
// //console.log(checkedValues);
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) {
@ -2232,24 +2236,26 @@ 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.state.order_type);
} else if (checkedValues.length === data.length) {
if (this.state.loadingstate === false) {
this.setState({
unlimited: 0,
course_groupyslsthree: undefined,
loadingstate: true,
page:1
})
} else {
this.setState({
unlimited: 0,
course_groupyslsthree: undefined,
page:1
})
}
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 if (checkedValues.length === data.length) {
// if (this.state.loadingstate === false) {
// this.setState({
// unlimited: 0,
// course_groupyslsthree: undefined,
// loadingstate: true,
// page:1
// })
// } else {
// this.setState({
// unlimited: 0,
// course_groupyslsthree: undefined,
// page:1
// })
// }
//
// 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 {
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
@ -2312,24 +2318,26 @@ 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.state.order_type)
} else if (checkedValues.length === data.length) {
if (this.state.loadingstate === false) {
this.setState({
course_groupysls: undefined,
unlimitedtwo: 0,
loadingstate: true,
page:1,
})
} else {
this.setState({
course_groupysls: undefined,
unlimitedtwo: 0,
page:1,
})
}
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 if (checkedValues.length === data.length) {
// if (this.state.loadingstate === false) {
// this.setState({
// course_groupysls: undefined,
// unlimitedtwo: 0,
// loadingstate: true,
// page:1,
// })
// } else {
// this.setState({
// course_groupysls: undefined,
// unlimitedtwo: 0,
// page:1,
// })
// }
//
// 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 {
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
@ -2693,7 +2701,7 @@ class Studentshavecompletedthelist extends Component {
<span className="fl mr10 color-grey-8 ">作品状态</span>
<span className="fl "><a id="graduation_comment_no_limit"
className={unlimiteds === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "}
onClick={() => this.notlimiteds()}>不限</a></span>
onClick={() => this.notlimiteds()}>全部</a></span>
<CheckboxGroup value={course_groupyslstwo}
onChange={(e) => this.checkeboxstwo(e, course_groupyslstwodata && course_groupyslstwodata)}>
{
@ -2724,7 +2732,7 @@ class Studentshavecompletedthelist extends Component {
<span className="fl mr10 color-grey-8 ">你的评阅</span>
<span className="fl "><a id="graduation_comment_no_limit"
className={unlimited === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "}
onClick={() => this.notlimited()}>不限</a></span>
onClick={() => this.notlimited()}>全部</a></span>
<CheckboxGroup value={course_groupyslsthree}
onChange={(e) => this.checkeboxs(e, course_groupyslstwodata && course_groupyslstwodata)}>
@ -2755,7 +2763,7 @@ class Studentshavecompletedthelist extends Component {
<span className="fl mr10 color-grey-8 ">作品状态</span>
<span className="fl "><a id="graduation_comment_no_limit"
className={unlimiteds === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "}
onClick={() => this.notlimiteds()}>不限</a></span>
onClick={() => this.notlimiteds()}>全部</a></span>
<CheckboxGroup value={course_groupyslstwo}
onChange={(e) => this.checkeboxstwo(e, course_groupyslstwodata && course_groupyslstwodata)}>
{
@ -2781,7 +2789,7 @@ class Studentshavecompletedthelist extends Component {
<td className="w70" style={{verticalAlign: "top"}}><span><a
id="graduation_comment_no_limit"
className={unlimitedtwo === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "}
onClick={() => this.funtaskstatustwos()}>不限</a></span>
onClick={() => this.funtaskstatustwos()}>全部</a></span>
</td>
<td>
<CheckboxGroup value={course_groupysls}

@ -229,7 +229,7 @@ class GraduationTaskssettinglist extends Component{
let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search} = this.state;
let listype =list instanceof Array;
if(listype===false||list.length===key){
if(listype===false){
this.setState({
teacher_comment:null,
loadingstate:true
@ -320,14 +320,16 @@ class GraduationTaskssettinglist extends Component{
loadingstate:true
})
this.seacthdata(teacher_comment, null, course_group, cross_comment, order, b_order, search,this.state.page);
}else if(checkedValues.length ===key){
// 全部抖选中 自然就是查找全部 就是空
this.setState({
task_status:undefined,
loadingstate:true
})
this.seacthdata(teacher_comment, null, course_group, cross_comment, order, b_order, search,this.state.page);
}else {
}
// else if(checkedValues.length ===key){
// // 全部抖选中 自然就是查找全部 就是空
// this.setState({
// task_status:undefined,
// loadingstate:true
// })
// this.seacthdata(teacher_comment, null, course_group, cross_comment, order, b_order, search,this.state.page);
// }
else {
//选哪个就替换那个
this.setState({
task_status:checkedValues===key?null:checkedValues,
@ -353,15 +355,17 @@ class GraduationTaskssettinglist extends Component{
loadingstate:true
})
this.seacthdata(teacher_comment, task_status, null, cross_comment, order, b_order, search,this.state.page);
}else if(checkedValues.length ===key){
// 全部抖选中 自然就是查找全部 就是空
this.setState({
course_group:undefined,
loadingstate:true
})
this.seacthdata(teacher_comment, task_status, null, cross_comment, order, b_order, search,this.state.page);
}else {
}
// else if(checkedValues.length ===key){
// // 全部抖选中 自然就是查找全部 就是空
// this.setState({
// course_group:undefined,
// loadingstate:true
// })
// this.seacthdata(teacher_comment, task_status, null, cross_comment, order, b_order, search,this.state.page);
//
// }
else {
//选哪个就替换那个
this.setState({
course_group:checkedValues===key?null:checkedValues,
@ -1141,7 +1145,7 @@ class GraduationTaskssettinglist extends Component{
<span className="fl mr10 color-grey-8">教师评阅</span>
<span className="fl mr25">
<a id="graduation_comment_no_limit" alue={null} className={teacher_comment===null?"pl10 pr10 check_on":"pl10 pr10 "} onClick={this.funteachercomment}>不限</a>
<a id="graduation_comment_no_limit" alue={null} className={teacher_comment===null?"pl10 pr10 check_on":"pl10 pr10 "} onClick={this.funteachercomment}>全部</a>
</span>
<CheckboxGroup value={teacher_comment} onChange={(e)=>this.funteachercomment(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.teacher_comment.length)} style={{ paddingTop: '4px'}}>
{taskslistdata.search_assistants && taskslistdata.search_assistants.teacher_comment && taskslistdata.search_assistants.teacher_comment.map((item,key)=>{
@ -1172,7 +1176,7 @@ class GraduationTaskssettinglist extends Component{
<span className="fl mr10 color-grey-8">作品状态</span>
<span className="fl mr25">
<a id="graduation_comment_no_limit" className={task_status===null||task_status===undefined?"pl10 pr10 check_on":"pl10 pr10 "} onClick={()=>this.funtaskstatus([])}>不限</a>
<a id="graduation_comment_no_limit" className={task_status===null||task_status===undefined?"pl10 pr10 check_on":"pl10 pr10 "} onClick={()=>this.funtaskstatus([])}>全部</a>
</span>
<CheckboxGroup value={task_status} onChange={(e)=>this.funtaskstatus(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.task_status.length)} style={{ paddingTop: '4px'}}>
@ -1194,7 +1198,7 @@ class GraduationTaskssettinglist extends Component{
{taskslistdata.search_assistants&&taskslistdata.search_assistants.course_group_info.length!=0?<li className="clearfix">
<span className="fl mr10 color-grey-8">分班情况</span>
<div className="fl mr25">
<a id="graduation_comment_no_limit" className={course_group===null||course_group===undefined?"pl10 pr10 check_on":"pl10 pr10 "} onClick={()=>this.groupgroup([])}>不限</a>
<a id="graduation_comment_no_limit" className={course_group===null||course_group===undefined?"pl10 pr10 check_on":"pl10 pr10 "} onClick={()=>this.groupgroup([])}>全部</a>
</div>
<div className="fl groupList" style={{maxWidth: '945px'}}>
<CheckboxGroup value={course_group} onChange={(e)=>this.groupgroup(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.course_group_info.length)} style={{width: '1000px', paddingTop: '4px'}}>
@ -1220,7 +1224,7 @@ class GraduationTaskssettinglist extends Component{
<span className="fl mr10 color-grey-8">交叉评阅</span>
<span className="fl mr25">
<a id="graduation_comment_no_limit" value={null} className={cross_comment==null?"pl10 pr10 check_on":"pl10 pr10"} onClick={this.funcross_comment}>不限</a>
<a id="graduation_comment_no_limit" value={null} className={cross_comment==null?"pl10 pr10 check_on":"pl10 pr10"} onClick={this.funcross_comment}>全部</a>
</span>
{taskslistdata.search_assistants&&taskslistdata.search_assistants.cross_comment.map((item,key)=>{
@ -1331,7 +1335,7 @@ class GraduationTaskssettinglist extends Component{
<span className="fl mr10 color-grey-8">教师评阅</span>
<span className="fl mr25">
<a id="graduation_comment_no_limit" alue={null} className={teacher_comment===null?"pl10 pr10 check_on":"pl10 pr10 "} onClick={this.funteachercomment}>不限</a>
<a id="graduation_comment_no_limit" alue={null} className={teacher_comment===null?"pl10 pr10 check_on":"pl10 pr10 "} onClick={this.funteachercomment}>全部</a>
</span>
<CheckboxGroup value={teacher_comment} onChange={(e)=>this.funteachercomment(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.teacher_comment.length)} style={{ paddingTop: '4px'}}>
@ -1364,7 +1368,7 @@ class GraduationTaskssettinglist extends Component{
<span className="fl mr10 color-grey-8">作品状态</span>
<span className="fl mr25">
<a id="graduation_comment_no_limit" className={task_status===null|| task_status===undefined?"pl10 pr10 check_on":"pl10 pr10 "} onClick={()=>this.funtaskstatus([])}>不限</a>
<a id="graduation_comment_no_limit" className={task_status===null|| task_status===undefined?"pl10 pr10 check_on":"pl10 pr10 "} onClick={()=>this.funtaskstatus([])}>全部</a>
</span>
<CheckboxGroup value={task_status} onChange={(e)=>this.funtaskstatus(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.task_status.length)} style={{ paddingTop: '4px'}}>
@ -1387,7 +1391,7 @@ class GraduationTaskssettinglist extends Component{
<span className="fl mr10 color-grey-8">分班情况</span>
<span className="fl mr25">
<a id="graduation_comment_no_limit" className={course_group===null||course_group===undefined?"pl10 pr10 check_on":"pl10 pr10 "} onClick={()=>this.groupgroup([])}>不限</a>
<a id="graduation_comment_no_limit" className={course_group===null||course_group===undefined?"pl10 pr10 check_on":"pl10 pr10 "} onClick={()=>this.groupgroup([])}>全部</a>
</span>
<CheckboxGroup value={course_group} onChange={(e)=>this.groupgroup(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.course_group_info.length)} style={{ paddingTop: '4px'}}>
@ -1409,7 +1413,7 @@ class GraduationTaskssettinglist extends Component{
<span className="fl mr10 color-grey-8">交叉评阅</span>
<span className="fl mr25">
<a id="graduation_comment_no_limit" value={null} className={cross_comment==null?"pl10 pr10 check_on":"pl10 pr10"} onClick={this.funcross_comment}>不限</a>
<a id="graduation_comment_no_limit" value={null} className={cross_comment==null?"pl10 pr10 check_on":"pl10 pr10"} onClick={this.funcross_comment}>全部</a>
</span>
{taskslistdata.search_assistants&&taskslistdata.search_assistants.cross_comment.map((item,key)=>{

@ -2793,15 +2793,7 @@ class Listofworksstudentone extends Component {
page: 1,
})
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) {
this.setState({
unlimited: 0,
course_groupyslstwo: [],
loadingstate: true,
page: 1,
})
this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
} else {
}else {
// console.log(checkedValues);
this.setState({
course_groupyslstwo: checkedValues,
@ -2812,6 +2804,16 @@ class Listofworksstudentone extends Component {
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) {
// // this.setState({
// // unlimited: 0,
// // course_groupyslstwo: [],
// // loadingstate: true,
// // page: 1,
// // })
// // this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
// }
}
//作品状态2
funtaskstatustwot = (checkedValues, data) => {
@ -2827,16 +2829,7 @@ class Listofworksstudentone extends Component {
page: 1,
})
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) {
this.setState({
unlimitedtwo: 1,
course_groupysls: undefined,
checkedValuesineinfo: [],
loadingstate: true,
page: 1,
})
this.Startsortingt(this.state.orders, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.myorders);
} else {
}else {
this.setState({
checkedValuesineinfo: checkedValues,
course_groupysls: checkedValues,
@ -2849,6 +2842,18 @@ class Listofworksstudentone extends Component {
}
// else if (checkedValues.length === data.length) {
// this.setState({
// unlimitedtwo: 1,
// course_groupysls: undefined,
// checkedValuesineinfo: [],
// loadingstate: true,
// page: 1,
// })
// this.Startsortingt(this.state.orders, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.myorders);
// }
}
//搜索学生 文字输入
inputSearchValuest = (e) => {
@ -3559,7 +3564,7 @@ class Listofworksstudentone extends Component {
<span className="fl mr10 color-grey-8 ">作品状态</span>
<span className="fl "><a id="graduation_comment_no_limit"
className={unlimited === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "}
onClick={() => this.notlimiteds()}>不限</a></span>
onClick={() => this.notlimiteds()}>全部</a></span>
<CheckboxGroup value={course_groupyslstwo}
onChange={(e) => this.funtaskstatust(e, task_status && task_status)}
style={{paddingTop: '4px'}}>
@ -3591,7 +3596,7 @@ class Listofworksstudentone extends Component {
<span className="fl mr10 color-grey-8">分班情况</span>
<span className="fl "><a id="graduation_comment_no_limit"
className={unlimitedtwo === 0 ? "pl10 pr10 mr20 " : "pl10 pr10 mr20 check_on"}
onClick={() => this.notlimitedst()}>不限</a></span>
onClick={() => this.notlimitedst()}>全部</a></span>
<CheckboxGroup value={course_groupysls}
onChange={(e) => this.funtaskstatustwot(e, course_group_info && course_group_info)}
style={{paddingTop: '4px', width: '1017px'}}>

@ -919,7 +919,7 @@ class ShixunStudentWork extends Component {
<a id="graduation_comment_no_limit"
onClick={()=>this.groupgroup([])}
className={this.state.group_infolist.length===0?"pl10 pr10 mr20 check_on":"pl10 pr10 mr20 "}>
不限
全部
</a>
</span>

Loading…
Cancel
Save