|
|
@ -271,8 +271,8 @@ class CommonWorkSetting extends Component{
|
|
|
|
absence_penalty = 2
|
|
|
|
absence_penalty = 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
evaluation_start = ''
|
|
|
|
evaluation_start = null
|
|
|
|
evaluation_end = ''
|
|
|
|
evaluation_end = null
|
|
|
|
evaluation_num = 0
|
|
|
|
evaluation_num = 0
|
|
|
|
absence_penalty = 0
|
|
|
|
absence_penalty = 0
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -484,6 +484,7 @@ class CommonWorkSetting extends Component{
|
|
|
|
publish_time_type, end_time_type
|
|
|
|
publish_time_type, end_time_type
|
|
|
|
} = this.state;
|
|
|
|
} = this.state;
|
|
|
|
let group_settings_param = []
|
|
|
|
let group_settings_param = []
|
|
|
|
|
|
|
|
let max_un_unified_setting_end_time = null
|
|
|
|
if (!unified_setting) {
|
|
|
|
if (!unified_setting) {
|
|
|
|
const result = this.refs.pollDetailTabForthRules.notUnifiedSettingCheck(this.state.rules);
|
|
|
|
const result = this.refs.pollDetailTabForthRules.notUnifiedSettingCheck(this.state.rules);
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
@ -494,6 +495,9 @@ class CommonWorkSetting extends Component{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
group_settings_param = result.rules.map(item => {
|
|
|
|
group_settings_param = result.rules.map(item => {
|
|
|
|
|
|
|
|
if (!max_un_unified_setting_end_time || moment(item.end_time) > moment(max_un_unified_setting_end_time)) {
|
|
|
|
|
|
|
|
max_un_unified_setting_end_time = item.end_time;
|
|
|
|
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
group_id: item.course_group_id,
|
|
|
|
group_id: item.course_group_id,
|
|
|
|
publish_time: item.publish_time,
|
|
|
|
publish_time: item.publish_time,
|
|
|
@ -517,16 +521,22 @@ class CommonWorkSetting extends Component{
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let temp_publish_time
|
|
|
|
let temp_publish_time = publish_time
|
|
|
|
let temp_end_time
|
|
|
|
let temp_end_time = end_time
|
|
|
|
if (unified_setting) {
|
|
|
|
if (!temp_publish_time) {
|
|
|
|
let temp_publish_time = publish_time
|
|
|
|
const publish_time_moment = getNextHalfHourOfMoment(moment());
|
|
|
|
let temp_end_time = end_time
|
|
|
|
temp_publish_time = publish_time_moment.format(dateFormat);
|
|
|
|
if (!temp_publish_time) {
|
|
|
|
}
|
|
|
|
const publish_time_moment = getNextHalfHourOfMoment(moment());
|
|
|
|
if (!temp_end_time) {
|
|
|
|
temp_publish_time = publish_time_moment.format(dateFormat);
|
|
|
|
temp_end_time = moment(handleDateString(temp_publish_time)).add(1, 'months').format(dateFormat)
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!temp_end_time) {
|
|
|
|
|
|
|
|
temp_end_time = moment(handleDateString(temp_publish_time)).add(1, 'months').format(dateFormat)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
temp_end_time = max_un_unified_setting_end_time
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 已发布的不检查
|
|
|
|
// 已发布的不检查
|
|
|
|
const isUnPublish= homework_status.indexOf(STATUS_UN_PUBLISH) != -1
|
|
|
|
const isUnPublish= homework_status.indexOf(STATUS_UN_PUBLISH) != -1
|
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
@ -534,20 +544,22 @@ class CommonWorkSetting extends Component{
|
|
|
|
const publish_time_editable = isUnPublish;
|
|
|
|
const publish_time_editable = isUnPublish;
|
|
|
|
const end_time_editable = isAdmin || !end_time || moment(end_time) > current;
|
|
|
|
const end_time_editable = isAdmin || !end_time || moment(end_time) > current;
|
|
|
|
|
|
|
|
|
|
|
|
if (publish_time_editable && temp_publish_time && moment(temp_publish_time) < moment()) {
|
|
|
|
if (unified_setting) {
|
|
|
|
this.setState({
|
|
|
|
if (publish_time_editable && temp_publish_time && moment(temp_publish_time) < moment()) {
|
|
|
|
publicTimeTip: '发布时间不能小于当前时间'
|
|
|
|
this.setState({
|
|
|
|
})
|
|
|
|
publicTimeTip: '发布时间不能小于当前时间'
|
|
|
|
scrollTo('.publicTimeTip')
|
|
|
|
})
|
|
|
|
return false
|
|
|
|
scrollTo('.publicTimeTip')
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
// 已截止的不检查
|
|
|
|
}
|
|
|
|
if (end_time_editable && temp_end_time && moment(temp_end_time) <= moment(temp_publish_time)) {
|
|
|
|
// 已截止的不检查
|
|
|
|
this.setState({
|
|
|
|
if (end_time_editable && temp_end_time && moment(temp_end_time) <= moment(temp_publish_time)) {
|
|
|
|
publicTimeTip: '截止时间必须晚于发布时间'
|
|
|
|
this.setState({
|
|
|
|
})
|
|
|
|
publicTimeTip: '截止时间必须晚于发布时间'
|
|
|
|
scrollTo('.publicTimeTip')
|
|
|
|
})
|
|
|
|
return false
|
|
|
|
scrollTo('.publicTimeTip')
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
publicTimeTip: ''
|
|
|
|
publicTimeTip: ''
|
|
|
@ -1201,7 +1213,7 @@ class CommonWorkSetting extends Component{
|
|
|
|
<span className={"font-14 color-grey-9 ml10"}></span>
|
|
|
|
<span className={"font-14 color-grey-9 ml10"}></span>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{anonymous_comment_time_tip && <div className={" anonymous_comment_time_tip color-red ml60"} style={{marginTop: '-6px'}}>{anonymous_comment_time_tip}</div>}
|
|
|
|
{<div className={" anonymous_comment_time_tip color-red ml60"} style={{marginTop: '-6px'}}>{anonymous_comment_time_tip}</div>}
|
|
|
|
|
|
|
|
|
|
|
|
{/* 匿评数量 */}
|
|
|
|
{/* 匿评数量 */}
|
|
|
|
<div className={"h20 mb30 ml60"}>
|
|
|
|
<div className={"h20 mb30 ml60"}>
|
|
|
|