Merge branches 'dev_aliyun' and 'dev_new_shixunsrepository' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_new_shixunsrepository
commit
e7bd084bf5
@ -1,5 +1,6 @@
|
|||||||
# 教师身份的立即发布、立即截止、代码查重入口的判断
|
# 教师身份的立即发布、立即截止、代码查重入口的判断
|
||||||
json.publish_immediately identity < Course::STUDENT && homework.publish_immediately(user)
|
charge_ids = homework.course.charge_group_ids(user)
|
||||||
json.end_immediately identity < Course::STUDENT && homework.end_immediately(user)
|
json.publish_immediately identity < Course::STUDENT && homework.publish_immediately(charge_ids)
|
||||||
|
json.end_immediately identity < Course::STUDENT && homework.end_immediately(charge_ids)
|
||||||
json.code_review identity < Course::STUDENT && homework.code_review if homework.homework_type == 'practice'
|
json.code_review identity < Course::STUDENT && homework.code_review if homework.homework_type == 'practice'
|
||||||
json.view_answer homework.view_answer(identity, user.id) if homework.homework_type != "practice"
|
json.view_answer homework.view_answer(identity, user.id) if homework.homework_type != "practice"
|
@ -1,62 +1,69 @@
|
|||||||
import React,{ Component } from "react";
|
import React,{ Component } from "react";
|
||||||
import { WordsBtn } from "educoder";
|
import { WordsBtn } from "educoder";
|
||||||
import { Checkbox } from 'antd'
|
import { Checkbox } from 'antd'
|
||||||
const CheckboxGroup = Checkbox.Group;
|
const CheckboxGroup = Checkbox.Group;
|
||||||
|
|
||||||
class CheckAllGroup extends Component{
|
class CheckAllGroup extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
checkAll: true,
|
checkAll: true,
|
||||||
checkedValues: []
|
checkedValues: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onCheckAll = () => {
|
onCheckAll = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
'checkAll': true,
|
'checkAll': true,
|
||||||
checkedValues: []
|
checkedValues: []
|
||||||
})
|
})
|
||||||
this.props.onChange && this.props.onChange([], true);
|
this.props.onChange && this.props.onChange([], true);
|
||||||
}
|
}
|
||||||
onChange = (checkedValues) => {
|
onChange = (checkedValues) => {
|
||||||
if (checkedValues.length > 0) {
|
try {
|
||||||
this.setState({
|
if(this.props.comwbool===true){
|
||||||
'checkAll': false,
|
return
|
||||||
checkedValues
|
}
|
||||||
})
|
}catch (e) {
|
||||||
this.props.onChange && this.props.onChange(checkedValues, false)
|
|
||||||
} else {
|
}
|
||||||
this.setState({
|
if (checkedValues.length > 0) {
|
||||||
'checkAll': true,
|
this.setState({
|
||||||
checkedValues: []
|
'checkAll': false,
|
||||||
})
|
checkedValues
|
||||||
this.props.onChange && this.props.onChange(checkedValues, true);
|
})
|
||||||
}
|
this.props.onChange && this.props.onChange(checkedValues, false)
|
||||||
console.log(checkedValues, arguments)
|
} else {
|
||||||
}
|
this.setState({
|
||||||
|
'checkAll': true,
|
||||||
render() {
|
checkedValues: []
|
||||||
let { label, options, checkboxGroupStyle }=this.props;
|
})
|
||||||
const { checkAll, checkedValues } = this.state;
|
this.props.onChange && this.props.onChange(checkedValues, true);
|
||||||
return (
|
}
|
||||||
<li className="clearfix">
|
console.log(checkedValues, arguments)
|
||||||
<style>{`
|
}
|
||||||
.groupList .ant-checkbox-group-item{
|
|
||||||
margin-bottom:5px;
|
render() {
|
||||||
}
|
let { label, options, checkboxGroupStyle }=this.props;
|
||||||
`}</style>
|
const { checkAll, checkedValues } = this.state;
|
||||||
<span className="fl mr10 color-grey-8">{label}</span>
|
return (
|
||||||
<span className="fl mr25">
|
<li className="clearfix">
|
||||||
<a href="javascript:void(0);" id="comment_no_limit" className={`pl10 pr10 ${checkAll ? 'check_on' : ''}`} onClick={this.onCheckAll}>全部</a>
|
<style>{`
|
||||||
</span>
|
.groupList .ant-checkbox-group-item{
|
||||||
<div className="fl groupList" style={{maxWidth:"990px"}}>
|
margin-bottom:5px;
|
||||||
{
|
}
|
||||||
options.length > 1 && <CheckboxGroup options={options} onChange={this.onChange} value={checkedValues} style={checkboxGroupStyle}/>
|
`}</style>
|
||||||
}
|
<span className="fl mr10 color-grey-8">{label}</span>
|
||||||
</div>
|
<span className="fl mr25">
|
||||||
</li>
|
<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"}}>
|
||||||
}
|
{
|
||||||
export default CheckAllGroup;
|
options.length > 1 && <CheckboxGroup options={options} onChange={this.onChange} value={checkedValues} style={checkboxGroupStyle}/>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export default CheckAllGroup;
|
||||||
|
Loading…
Reference in new issue