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)
|
||||
json.end_immediately identity < Course::STUDENT && homework.end_immediately(user)
|
||||
charge_ids = homework.course.charge_group_ids(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.view_answer homework.view_answer(identity, user.id) if homework.homework_type != "practice"
|
@ -1,62 +1,69 @@
|
||||
import React,{ Component } from "react";
|
||||
import { WordsBtn } from "educoder";
|
||||
import { Checkbox } from 'antd'
|
||||
const CheckboxGroup = Checkbox.Group;
|
||||
|
||||
class CheckAllGroup extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state = {
|
||||
checkAll: true,
|
||||
checkedValues: []
|
||||
}
|
||||
}
|
||||
|
||||
onCheckAll = () => {
|
||||
this.setState({
|
||||
'checkAll': true,
|
||||
checkedValues: []
|
||||
})
|
||||
this.props.onChange && this.props.onChange([], true);
|
||||
}
|
||||
onChange = (checkedValues) => {
|
||||
if (checkedValues.length > 0) {
|
||||
this.setState({
|
||||
'checkAll': false,
|
||||
checkedValues
|
||||
})
|
||||
this.props.onChange && this.props.onChange(checkedValues, false)
|
||||
} else {
|
||||
this.setState({
|
||||
'checkAll': true,
|
||||
checkedValues: []
|
||||
})
|
||||
this.props.onChange && this.props.onChange(checkedValues, true);
|
||||
}
|
||||
console.log(checkedValues, arguments)
|
||||
}
|
||||
|
||||
render() {
|
||||
let { label, options, checkboxGroupStyle }=this.props;
|
||||
const { checkAll, checkedValues } = this.state;
|
||||
return (
|
||||
<li className="clearfix">
|
||||
<style>{`
|
||||
.groupList .ant-checkbox-group-item{
|
||||
margin-bottom:5px;
|
||||
}
|
||||
`}</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>
|
||||
</span>
|
||||
<div className="fl groupList" style={{maxWidth:"990px"}}>
|
||||
{
|
||||
options.length > 1 && <CheckboxGroup options={options} onChange={this.onChange} value={checkedValues} style={checkboxGroupStyle}/>
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default CheckAllGroup;
|
||||
import React,{ Component } from "react";
|
||||
import { WordsBtn } from "educoder";
|
||||
import { Checkbox } from 'antd'
|
||||
const CheckboxGroup = Checkbox.Group;
|
||||
|
||||
class CheckAllGroup extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state = {
|
||||
checkAll: true,
|
||||
checkedValues: []
|
||||
}
|
||||
}
|
||||
|
||||
onCheckAll = () => {
|
||||
this.setState({
|
||||
'checkAll': true,
|
||||
checkedValues: []
|
||||
})
|
||||
this.props.onChange && this.props.onChange([], true);
|
||||
}
|
||||
onChange = (checkedValues) => {
|
||||
try {
|
||||
if(this.props.comwbool===true){
|
||||
return
|
||||
}
|
||||
}catch (e) {
|
||||
|
||||
}
|
||||
if (checkedValues.length > 0) {
|
||||
this.setState({
|
||||
'checkAll': false,
|
||||
checkedValues
|
||||
})
|
||||
this.props.onChange && this.props.onChange(checkedValues, false)
|
||||
} else {
|
||||
this.setState({
|
||||
'checkAll': true,
|
||||
checkedValues: []
|
||||
})
|
||||
this.props.onChange && this.props.onChange(checkedValues, true);
|
||||
}
|
||||
console.log(checkedValues, arguments)
|
||||
}
|
||||
|
||||
render() {
|
||||
let { label, options, checkboxGroupStyle }=this.props;
|
||||
const { checkAll, checkedValues } = this.state;
|
||||
return (
|
||||
<li className="clearfix">
|
||||
<style>{`
|
||||
.groupList .ant-checkbox-group-item{
|
||||
margin-bottom:5px;
|
||||
}
|
||||
`}</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>
|
||||
</span>
|
||||
<div className="fl groupList" style={{maxWidth:"990px"}}>
|
||||
{
|
||||
options.length > 1 && <CheckboxGroup options={options} onChange={this.onChange} value={checkedValues} style={checkboxGroupStyle}/>
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default CheckAllGroup;
|
||||
|
Loading…
Reference in new issue