|
|
@ -78,11 +78,10 @@ class Selectsetting extends Component{
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
datalist:response.data,
|
|
|
|
datalist:response.data,
|
|
|
|
description: response.data.description,
|
|
|
|
description: response.data.description,
|
|
|
|
is_public: response.data.is_public,
|
|
|
|
is_public:response.data.is_public,
|
|
|
|
datatime:response.data.publish_time,
|
|
|
|
datatime:response.data.publish_time,
|
|
|
|
// is_public:response.data.course_groups,
|
|
|
|
Radiovalue:response.data.delay_publish===false?0:1,
|
|
|
|
//attachment_histories:response.data.attachment_histories
|
|
|
|
//attachment_histories:response.data.attachment_histories
|
|
|
|
course_groups:newcourse_groups
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -92,23 +91,6 @@ class Selectsetting extends Component{
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let coursesId=this.props.match.params.coursesId;
|
|
|
|
|
|
|
|
if(this.props.isAdmin()){
|
|
|
|
|
|
|
|
let url = `/courses/${coursesId}/all_course_groups.json`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.then((response) => {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
course_groupss: response.data.course_groups,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -147,7 +129,7 @@ class Selectsetting extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
savecouseShixunModal=()=>{
|
|
|
|
savecouseShixunModal=()=>{
|
|
|
|
let {fileList,is_public,description,datatime,course_groups}=this.state;
|
|
|
|
let {fileList,is_public,description,datatime,Radiovalue}=this.state;
|
|
|
|
|
|
|
|
|
|
|
|
let newfileList=[];
|
|
|
|
let newfileList=[];
|
|
|
|
for(var list of fileList){
|
|
|
|
for(var list of fileList){
|
|
|
@ -183,13 +165,12 @@ class Selectsetting extends Component{
|
|
|
|
axios.put(url,{
|
|
|
|
axios.put(url,{
|
|
|
|
course_id:coursesId,
|
|
|
|
course_id:coursesId,
|
|
|
|
new_attachment_id:newfileList.length===0?undefined:newfileList,
|
|
|
|
new_attachment_id:newfileList.length===0?undefined:newfileList,
|
|
|
|
course_second_category_id:this.props.coursesidtype===undefined||this.props.coursesidtype==="node"?0:attachmentId,
|
|
|
|
// course_second_category_id:this.props.coursesidtype===undefined||this.props.coursesidtype==="node"?0:attachmentId,
|
|
|
|
is_public:is_public,
|
|
|
|
is_public:is_public,
|
|
|
|
publish_time:unified_setting===true?datatime===undefined?moment(new Date()).format('YYYY-MM-DD HH'):datatime:undefined,
|
|
|
|
publish_time:Radiovalue===0?undefined:datatime===undefined?moment(new Date()).format('YYYY-MM-DD HH'):datatime,
|
|
|
|
description:description,
|
|
|
|
description:description,
|
|
|
|
course_group_publish_times:unified_setting===false?course_groups:undefined
|
|
|
|
delay_publish:Radiovalue
|
|
|
|
}).then((result)=>{
|
|
|
|
}).then((result)=>{
|
|
|
|
|
|
|
|
|
|
|
|
if(result.data.status===0){
|
|
|
|
if(result.data.status===0){
|
|
|
|
this.props.setupdate(attachmentId)
|
|
|
|
this.props.setupdate(attachmentId)
|
|
|
|
this.props.showNotification("设置资源成功");
|
|
|
|
this.props.showNotification("设置资源成功");
|
|
|
@ -263,6 +244,11 @@ class Selectsetting extends Component{
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RadioonChange=(e)=>{
|
|
|
|
RadioonChange=(e)=>{
|
|
|
|
|
|
|
|
if(e.target.value===0){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
datatime:undefined
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
Radiovalue: e.target.value,
|
|
|
|
Radiovalue: e.target.value,
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -289,6 +275,8 @@ class Selectsetting extends Component{
|
|
|
|
height: '30px',
|
|
|
|
height: '30px',
|
|
|
|
lineHeight: '30px',
|
|
|
|
lineHeight: '30px',
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(this.state.datatime)
|
|
|
|
return(
|
|
|
|
return(
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<style>
|
|
|
|
<style>
|
|
|
@ -515,7 +503,7 @@ class Selectsetting extends Component{
|
|
|
|
`}
|
|
|
|
`}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
{this.props.course_is_public===true?<div>
|
|
|
|
{this.props.course_is_public===true?<div>
|
|
|
|
<span className={"color-ooo"}>公开:</span><Checkbox checked={this.state.is_public} onChange={this.onChangepublic}>
|
|
|
|
<span className={"color-ooo"}>公开:</span><Checkbox checked={this.state.is_public} onChange={(e)=>this.onChangepublic(e)}>
|
|
|
|
<span className={"font-14 color-ooo"}>选中,所有用户可见,否则课堂成员可见</span>
|
|
|
|
<span className={"font-14 color-ooo"}>选中,所有用户可见,否则课堂成员可见</span>
|
|
|
|
</Checkbox>
|
|
|
|
</Checkbox>
|
|
|
|
</div>:""}
|
|
|
|
</div>:""}
|
|
|
@ -530,13 +518,14 @@ class Selectsetting extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
<div className={this.props.course_is_public===true?"mt10":""}>
|
|
|
|
<div className={this.props.course_is_public===true?"mt10":""}>
|
|
|
|
<span className={"color-ooo fl mt6"}>发布设置:</span>
|
|
|
|
<span className={"color-ooo fl mt6"}>发布设置:</span>
|
|
|
|
<Radio.Group onChange={this.RadioonChange} value={this.state.Radiovalue} style={{'width': '460px'}}>
|
|
|
|
<Radio.Group onChange={(e)=>this.RadioonChange(e)} value={this.state.Radiovalue} style={{'width': '460px'}}>
|
|
|
|
<Radio style={radioStyle} value={0}>
|
|
|
|
<Radio style={radioStyle} value={0}>
|
|
|
|
立即发布
|
|
|
|
立即发布
|
|
|
|
</Radio>
|
|
|
|
</Radio>
|
|
|
|
<Radio style={radioStyle} value={1} className={"fl"}>
|
|
|
|
<Radio style={radioStyle} value={1} className={"fl"}>
|
|
|
|
<span className={"mr5"}>延迟发布</span>
|
|
|
|
<span className={"mr5"}>延迟发布</span>
|
|
|
|
<DatePicker
|
|
|
|
<DatePicker
|
|
|
|
|
|
|
|
|
|
|
|
showToday={false}
|
|
|
|
showToday={false}
|
|
|
|
dropdownClassName="hideDisable"
|
|
|
|
dropdownClassName="hideDisable"
|
|
|
|
showTime={{ format: 'HH:mm' }}
|
|
|
|
showTime={{ format: 'HH:mm' }}
|
|
|
|