Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_daiao
cxt 5 years ago
commit 0868eb87a9

@ -42,12 +42,7 @@ class Selectresource extends Component{
getallfiles:false,
searchtype:'getallfiles',
Radiovalue:0,
datatime:undefined,
course_group_publish_times:[
{
group_id : [],
publish_time :undefined,
}],
datatime:undefined
}
}
componentDidMount() {
@ -79,7 +74,7 @@ class Selectresource extends Component{
}
SenttotheSearch=(value)=>{
let {searchtype}=this.state;
let {searchtype}=this.state;
if(searchtype==="getallfiles"){
this.getallfiles(value,1)
}else if(searchtype==="getmyfiles"){
@ -91,32 +86,32 @@ class Selectresource extends Component{
setupdatalist=(url,newpage)=>{
let {Resourcelist,Searchvalue}=this.state;
if(Resourcelist!=undefined){
let newResourcelist=Resourcelist.files;
axios.get(url,{
params:{
page:newpage,
page_size:15,
search:Searchvalue,
}
}).then((result)=>{
let newResourcelist=Resourcelist.files;
axios.get(url,{
params:{
page:newpage,
page_size:15,
search:Searchvalue,
}
}).then((result)=>{
var list=result.data.data.files;
var list=result.data.data.files;
for(var i=0;i<list.length; i++ ){
newResourcelist.push(list[i])
newResourcelist.push(list[i])
}
let lists={
total_count:Resourcelist.total_count,
files:newResourcelist
}
let lists={
total_count:Resourcelist.total_count,
files:newResourcelist
}
this.setState({
Resourcelist:lists,
hometypepvisible:false,
getallfiles:true,
page:newpage
})
}).catch((error)=>{
console.log(error)
})
}).catch((error)=>{
console.log(error)
})
}
}
contentViewScroll=(e)=>{
@ -152,7 +147,7 @@ class Selectresource extends Component{
// this.props.funshixunmodallist(Searchvalue,types,true,1)
// this.props.funpatheditarry([])
if(types==="all"){
this.getallfiles(undefined,1)
this.getallfiles(undefined,1)
}else if(types==="my"){
this.getmyfiles(undefined,1)
}
@ -168,12 +163,12 @@ class Selectresource extends Component{
search:value,
}
}).then((result)=>{
this.setState({
Resourcelist:result.data.data,
hometypepvisible:false,
getallfiles:true,
searchtype:'getallfiles'
})
this.setState({
Resourcelist:result.data.data,
hometypepvisible:false,
getallfiles:true,
searchtype:'getallfiles'
})
}).catch((error)=>{
console.log(error)
})
@ -189,11 +184,11 @@ class Selectresource extends Component{
search:value,
}
}).then((result)=>{
this.setState({
Resourcelist: result.data.data,
hometypepvisible:false,
searchtype:'getmyfiles'
})
this.setState({
Resourcelist: result.data.data,
hometypepvisible:false,
searchtype:'getmyfiles'
})
}).catch((error)=>{
console.log(error)
})
@ -201,7 +196,7 @@ class Selectresource extends Component{
hidecouseShixunModal=()=>{
this.props.hidecouseShixunModal()
this.props.hidecouseShixunModal()
}
ModalCancelModalCancel=()=>{
@ -217,22 +212,22 @@ class Selectresource extends Component{
savecouseShixunModal=()=>{
let {patheditarry,datatime,Radiovalue,course_group_publish_times}=this.state;
let {patheditarry,datatime,Radiovalue}=this.state;
let {coursesId,attachmentId}=this.props;
let url="/files/import.json";
if(patheditarry===undefined||patheditarry.length===0){
this.setState({
patheditarrytype:true
})
return
}else{
this.setState({
patheditarrytype:false
})
}
if(this.state.Radiovalue===1&&this.props.course_groups.length===0){
let url="/files/import.json";
if(patheditarry===undefined||patheditarry.length===0){
this.setState({
patheditarrytype:true
})
return
}else{
this.setState({
patheditarrytype:false
})
}
if(this.state.Radiovalue===1){
if(datatime===undefined||datatime===null||datatime=== ""){
this.setState({
Radiovaluetype:true
@ -249,17 +244,16 @@ class Selectresource extends Component{
course_id:coursesId,
attachment_ids:patheditarry,
course_second_category_id:this.props.coursesidtype===undefined||this.props.coursesidtype==="node"?0:attachmentId,
delay_publish:Radiovalue,
publish_time:this.props.course_groups.length===0?Radiovalue===1?datatime===undefined? undefined:datatime:undefined:undefined,
group_settings:this.props.course_groups.length===0?undefined:course_group_publish_times
delay_publish:Radiovalue,
publish_time:Radiovalue===1?datatime:undefined
}
).then((response) => {
if(response.data.status===0){
this.ModalCancelModalCancel();
this.props.updataleftNavfun();
this.props.showNotification("选用资源成功");
this.props.setupdate(attachmentId)
}
if(response.data.status===0){
this.ModalCancelModalCancel();
this.props.updataleftNavfun();
this.props.showNotification("选用资源成功");
this.props.setupdate(attachmentId)
}
}).catch((error) => {
console.log(error)
})
@ -277,58 +271,15 @@ class Selectresource extends Component{
});
}
onChangeTimepublish= (date, dateString,key,type) => {
if(type===1){
this.setState({
datatime:handleDateString(dateString),
})
}else if(type===2){
let {course_group_publish_times}=this.state;
let newgroup_publish=course_group_publish_times;
for(var i=0; i<newgroup_publish.length; i++){
if(i===parseInt(key)){
newgroup_publish[i].publish_time=handleDateString(dateString);
}
}
this.setState({
course_group_publish_times:newgroup_publish,
})
}
}
onChangeTimepublish= (date, dateString) => {
addgrouppublish=()=>{
let newlist=this.state.course_group_publish_times;
newlist.push( {
group_id : undefined,
publish_time :undefined,
})
this.setState({
course_group_publish_times:newlist
})
}
deletegrouppublish=(key)=>{
let newlist=this.state.course_group_publish_times;
newlist.splice(key,1);
this.setState({
course_group_publish_times:newlist
datatime:handleDateString(dateString),
})
}
selectassigngroups=(e,index,key)=>{
debugger
let {course_group_publish_times}=this.state;
let newgroup_publish=course_group_publish_times;
for(var i=0; i<newgroup_publish.length; i++){
if(i===parseInt(key)){
newgroup_publish[i].group_id=e;
}
}
this.setState({
course_group_publish_times:newgroup_publish,
})
}
}
render(){
let {Searchvalue,type,Resourcelist,hometypepvisible,patheditarry,datatime,course_group_publish_times}=this.state;
let {Searchvalue,type,Resourcelist,hometypepvisible,patheditarry,datatime}=this.state;
let {visible}=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
const radioStyle = {
@ -336,8 +287,6 @@ class Selectresource extends Component{
height: '30px',
lineHeight: '30px',
};
console.log(course_group_publish_times)
return(
<div>
{/*提示*/}
@ -350,73 +299,73 @@ class Selectresource extends Component{
/>
{visible===true?
<Modal
keyboard={false}
title="选用资源"
visible={visible}
closable={false}
footer={null}
width="600px"
destroyOnClose={true}
>
<style>
{
`
<Modal
keyboard={false}
title="选用资源"
visible={visible}
closable={false}
footer={null}
width="600px"
destroyOnClose={true}
>
<style>
{
`
.ant-modal-body{
padding: 30px 0px;
}
`
}
</style>
}
</style>
<Spin indicator={antIcon} spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<style>{`
<style>{`
.newupload_conboxtop{
margin-top: -30px;
}
#shixun_tab_div{
padding: 0 30px;
padding-top:15px;
padding-top:30px;
}
.search-news{
width: 237px!important;
height: 30px;
margin-bottom: 15px;
margin-bottom: 30px;
}
`}</style>
<div className="newupload_conbox newupload_conboxtop">
<div className="clearfix shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag("all")} className={ type==="all" ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
<li className="fl mr5 mt5 ml15"> <a onClick={()=>this.changeTag("my")} className={ type==="my" ? " active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>我的资源</a></li>
<div className="fr search-news" >
<Search
placeholder="请输入发布人或名称进行搜索"
value={Searchvalue}
onInput={this.SenttotheValue}
onSearch={(value) => this.SenttotheSearch(value)}
style={{width: '100%'}}
/>
<div className="newupload_conbox newupload_conboxtop">
<div className="clearfix shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag("all")} className={ type==="all" ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
<li className="fl mr5 mt5 ml15"> <a onClick={()=>this.changeTag("my")} className={ type==="my" ? " active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>我的资源</a></li>
<div className="fr search-news" >
<Search
placeholder="请输入发布人或名称进行搜索"
value={Searchvalue}
onInput={this.SenttotheValue}
onSearch={(value) => this.SenttotheSearch(value)}
style={{width: '100%'}}
/>
</div>
</div>
</div>
<style>{`
<style>{`
.greybackHead{
padding:0px 30px;
}
.fontlefts{text-align: left;}
`}</style>
<ul className="clearfix greybackHead edu-txt-center">
<li className="fl paddingleft22 fontlefts" style={{width:'220px'}}>资源名称</li>
<li className="fl edu-txt-left" style={{width:'80px'}}>大小</li>
<li className="fl" style={{width:'100px'}}>发布人</li>
<li className="fl" style={{width:'100px'}}>时间</li>
</ul>
<ul className="clearfix greybackHead edu-txt-center">
<li className="fl paddingleft22 fontlefts" style={{width:'220px'}}>资源名称</li>
<li className="fl edu-txt-left" style={{width:'80px'}}>大小</li>
<li className="fl" style={{width:'100px'}}>发布人</li>
<li className="fl" style={{width:'100px'}}>时间</li>
</ul>
<style>{`
<style>{`
.color-grey-9a{color: #9A9A9A !important;}
.datastyle{
width: 120px;
@ -424,169 +373,87 @@ class Selectresource extends Component{
height: 37px;
}
.scrollbox{
height:145px !important;
height:250px !important;
}
.selectfilsbox{
height: 50px;
line-height: 50px;
}
`}</style>
<div className="over210 pl20 pr20 scrollbox"
onScroll={this.contentViewScroll}
>
{
Resourcelist === undefined ?"":Resourcelist.files.length===0?<NoneData/>:
<Checkbox.Group style={{ width: '100%' }} value={patheditarry} onChange={this.shixunhomeworkedit}>
{
Resourcelist.files.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE selectfilsbox" key={key}>
<li className="fl" style={{width:'220px'}}>
<Checkbox
value={item.id}
key={item.id}
className="fl task-hide edu-txt-left"
style={{"width":"220px"}}
name="shixun_homework[]"
>
<label style={{"textAlign":"left","color":"#4C4C4C"}} className="task-hide" title={item.title}>{item.title}</label>
</Checkbox>
</li>
<li className="fl edu-txt-left task-hide paddingl5 color-grey-9a" style={{width:'90px'}}>{item.filesize}</li>
<li className="fl paddingl10 color-grey-9a" style={{width:'100px'}}>{item.author.name}</li>
<li className="fl color-grey-9a paddingl10 datastyle">{formatDate(item.created_on)}</li>
</div>
)
})
}
</Checkbox.Group>
}
</div>
<div className="over210 pl20 pr20 scrollbox"
onScroll={this.contentViewScroll}
>
<div className={"mt10"}>
<span className={"color-ooo fl mt6 ml20"}>发布设置</span>
<Radio.Group onChange={this.RadioonChange} value={this.state.Radiovalue} style={{'width': '460px'}}>
<Radio style={radioStyle} value={0}>
立即发布
</Radio>
<Tooltip placement="bottom" title={this.props.isStudent()===true?"不支持学生延迟发布":""} >
<Radio style={radioStyle} value={1} className={"fl"} disabled={this.props.isStudent()}>
<span className={"mr5"}>延期发布</span>
{this.props.course_groups.length>0?"":<DatePicker
dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }}
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
id={"startime"}
showToday={false}
width={"210px"}
value={this.state.Radiovalue===1?datatime===undefined||datatime===""?undefined:moment(datatime, dateFormat):undefined}
onChange={(e,index)=>this.onChangeTimepublish(e,index,undefined,1)}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
disabled={this.state.Radiovalue===1?false:true}
/>}
</Radio>
</Tooltip>
<span className={"fl mt5 color-grey-c"}>(按照设置的时间定时发布)</span>
</Radio.Group>
<style>{`
.Selectleft20{
margin-left: 20px !important;
width: 176px;
height: 40px;
}
#startimes .ant-calendar-picker-icon{
margin-top:-11px;
}
.resourcebox{
max-height:106px;
overflow: auto;
}
.ml70{
margin-left:70px;
}
`}</style>
{this.props.course_groups.length>0?this.props.isStudent()===true?"":<div className={"resourcebox"}>
{this.state.Radiovalue===1?<style>
{
`
.ant-input, .ant-input .ant-input-suffix {
background-color: #fff!important;
}
`
}
</style>:""}
{
course_group_publish_times.map((item,key)=>{
return(
<div className={"mt10"} key={key}>
<Select
mode="multiple"
className={"ml70"}
disabled={this.state.Radiovalue===1?false:true}
placeholder="请选择分班名称"
value={item.group_id}
style={{ width: 200 }}
onChange={(e,index)=>this.selectassigngroups(e,index,key)}
>
{this.props.course_groups.map((items,keys)=>{
let type=0
{course_group_publish_times.map((itsem,kesy)=>{
if(itsem.group_id===items.id){
type=1
return
}
})}
if(type===0){
return(
<Option value={items.name} key={keys} id={items.id}>{items.name}</Option>
)
}
})}
</Select>
<DatePicker
disabled={this.state.Radiovalue===1?false:true}
dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }}
locale={locale}
showToday={false}
format={dateFormat}
placeholder="请选择发布时间"
id={"startimes"}
className={"Selectleft20 "}
width={"200px"}
value={item.publish_time===undefined||item.publish_time===""?undefined:moment(item.publish_time, dateFormat)}
onChange={(e,index)=>this.onChangeTimepublish(e,index,key,2)}
// onChange={ this.onChangeTimepublish }
disabledTime={disabledDateTime}
disabledDate={disabledDate}
/>
{key!=0?<i className="iconfont icon-shanchu color-grey-c font-14 font-n ml20" onClick={()=>this.deletegrouppublish(key)}></i>:""}
{key+1===this.props.course_groups.length?"":<i className="iconfont icon-tianjiafangda color-green ml15" onClick={this.addgrouppublish}></i>}
</div>
)
})
Resourcelist === undefined ?"":Resourcelist.files.length===0?<NoneData/>:
<Checkbox.Group style={{ width: '100%' }} value={patheditarry} onChange={this.shixunhomeworkedit}>
{
Resourcelist.files.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE selectfilsbox" key={key}>
<li className="fl" style={{width:'220px'}}>
<Checkbox
value={item.id}
key={item.id}
className="fl task-hide edu-txt-left"
style={{"width":"220px"}}
name="shixun_homework[]"
>
<label style={{"textAlign":"left","color":"#4C4C4C"}} className="task-hide" title={item.title}>{item.title}</label>
</Checkbox>
</li>
<li className="fl edu-txt-left task-hide paddingl5 color-grey-9a" style={{width:'90px'}}>{item.filesize}</li>
<li className="fl paddingl10 color-grey-9a" style={{width:'100px'}}>{item.author.name}</li>
<li className="fl color-grey-9a paddingl10 datastyle">{formatDate(item.created_on)}</li>
</div>
)
})
}
</Checkbox.Group>
}
</div>:""}
</div>
</div>
<div className={"mt10"}>
<span className={"color-ooo fl mt6 ml20"}>发布设置</span>
<Radio.Group onChange={this.RadioonChange} value={this.state.Radiovalue} style={{'width': '460px'}}>
<Radio style={radioStyle} value={0}>
立即发布
</Radio>
<Tooltip placement="bottom" title={this.props.isStudent()===true?"不支持学生延迟发布":""} >
<Radio style={radioStyle} value={1} className={"fl"} disabled={this.props.isStudent()}>
<span className={"mr5"}>延期发布</span>
<DatePicker
dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }}
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
id={"startime"}
showToday={false}
width={"210px"}
value={this.state.Radiovalue===1?datatime===undefined||datatime===""?undefined:moment(datatime, dateFormat):undefined}
onChange={(e,index)=>this.onChangeTimepublish(e,index,undefined,1)}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
disabled={this.state.Radiovalue===1?false:true}
/>
</Radio>
</Tooltip>
<span className={"fl mt5 color-grey-c"}>(按照设置的时间定时发布)</span>
</Radio.Group>
</div>
{this.state.patheditarrytype===true?<p className={"color-red ml20"}>请选择资源</p>:""}
{this.state.Radiovaluetype===true?<p className={"color-red ml20"}>发布时间不能为空</p>:""}
<div className="mt20 marginauto clearfix edu-txt-center">
{this.state.patheditarrytype===true?<p className={"color-red ml20"}>请选择资源</p>:""}
{this.state.Radiovaluetype===true?<p className={"color-red ml20"}>发布时间不能为空</p>:""}
<div className="mt20 marginauto clearfix edu-txt-center">
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.hidecouseShixunModal}>取消</a>
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>
</div>
</div>
</div>
</Spin>
</Modal>:""}
</Spin>
</Modal>:""}
</div>
)
}

@ -14,12 +14,12 @@ function range(start, end) {
}
return result;
}
function disabledDateTime() {
return {
// disabledHours: () => range(0, 24).splice(4, 20),
disabledMinutes: () => range(1, 30).concat(range(31, 60)),
// disabledSeconds: () => range(0,60)
}
// disabledSeconds: () => [0, 60],
};
}
function disabledDate(current) {
@ -45,8 +45,8 @@ class Sendresource extends Component{
// moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
course_group_publish_times:[
{
group_id : undefined,
publish_time :undefined,
course_group_id : undefined,
publish_time :""
}],
course_groups:undefined,
course_groups_count:undefined,
@ -86,34 +86,34 @@ class Sendresource extends Component{
}
onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
.then((response) => {
if (response.data) {
const { status } = response.data;
if (status == 0) {
this.setState({
fileListtype:false,
fileList:[]
})
}
}
})
.catch(function (error) {
console.log(error);
});
this.setState({
fileListtype:false,
})
}else{
this.setState({
fileListtype:false,
fileList:[]
})
}
if(!file.percent || file.percent == 100){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
.then((response) => {
if (response.data) {
const { status } = response.data;
if (status == 0) {
this.setState({
fileListtype:false,
fileList:[]
})
}
}
})
.catch(function (error) {
console.log(error);
});
this.setState({
fileListtype:false,
})
}else{
this.setState({
fileListtype:false,
fileList:[]
})
}
}
ModalCancelModalCancel=()=>{
@ -127,7 +127,7 @@ class Sendresource extends Component{
}
Saves=()=>{
let {fileList,description,is_public,datatime,Radiovalue,course_group_publish_times} =this.state;
let {fileList,description,is_public,datatime,Radiovalue} =this.state;
let newfileList=[];
for(var list of fileList){
@ -141,7 +141,7 @@ class Sendresource extends Component{
return
}
if(this.state.Radiovalue===1&&this.props.course_groups.length===0){
if(this.state.Radiovalue===1){
if(datatime===undefined||datatime===null||datatime=== ""){
this.setState({
Radiovaluetype:true
@ -156,7 +156,6 @@ class Sendresource extends Component{
if(description===undefined){
}else if(description.length>100){
@ -177,10 +176,9 @@ class Sendresource extends Component{
course_second_category_id:this.props.coursesidtype===undefined||this.props.coursesidtype==="node"?0:attachmentId,
attachment_ids:newfileList,
is_public:is_public,
publish_time:this.props.course_groups.length===0?Radiovalue===1?datatime===undefined? undefined:datatime:undefined:"",
publish_time:Radiovalue===1?datatime===undefined? undefined:datatime:undefined,
description:description,
delay_publish:Radiovalue,
group_settings:this.props.course_groups.length===0?"":course_group_publish_times
}).then((result)=>{
if(result.data.status===0){
@ -239,42 +237,10 @@ class Sendresource extends Component{
Radiovalue: e.target.value,
});
}
addgrouppublish=()=>{
let newlist=this.state.course_group_publish_times;
newlist.push( {
group_id : undefined,
publish_time :undefined,
})
this.setState({
course_group_publish_times:newlist
})
}
deletegrouppublish=(key)=>{
let newlist=this.state.course_group_publish_times;
newlist.splice(key,1);
this.setState({
course_group_publish_times:newlist
})
}
selectassigngroups=(e,index,key)=>{
let {course_group_publish_times}=this.state;
let newgroup_publish=course_group_publish_times;
for(var i=0; i<newgroup_publish.length; i++){
if(i===parseInt(key)){
newgroup_publish[i].group_id=e;
}
}
this.setState({
course_group_publish_times:newgroup_publish,
})
}
render(){
let { newfileListtype,descriptiontype,
is_public,
datatime,
course_group_publish_times
}=this.state;
const uploadProps = {
@ -299,7 +265,7 @@ class Sendresource extends Component{
};
//console.log(this.state.course_group_publish_times)
console.log(this.props.course_groups)
return(
<div>
{/*提示*/}
@ -406,8 +372,8 @@ class Sendresource extends Component{
{this.props.course_is_public===true?<div>
<span className={"color-ooo"}>公开</span><Checkbox checked={is_public} onChange={this.onChangepublic}>
<span className={"font-14 color-ooo"}>选中所有用户可见否则课堂成员可见</span>
</Checkbox>
<span className={"font-14 color-ooo"}>选中所有用户可见否则课堂成员可见</span>
</Checkbox>
</div>:""}
<style>{`
@ -434,110 +400,31 @@ class Sendresource extends Component{
立即发布
</Radio>
<Tooltip placement="bottom" title={this.props.isStudent()===true?"不支持学生延迟发布":""}>
<Radio style={radioStyle} value={1} className={"fl"} disabled={this.props.isStudent()}>
<span className={"mr5"}>延期发布</span>
{this.props.course_groups.length===0?
<DatePicker
dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }}
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
id={"startime"}
showToday={false}
width={"210px"}
value={this.state.Radiovalue===1?datatime===undefined||datatime===""?undefined:moment(datatime, dateFormat):undefined}
onChange={(e,index)=>this.onChangeTimepublish(e,index,undefined,1)}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
disabled={this.state.Radiovalue===1?false:true}
/>:""}
</Radio>
<Radio style={radioStyle} value={1} className={"fl"} disabled={this.props.isStudent()}>
<span className={"mr5"}>延期发布</span>
{this.props.course_groups.length===0?
<DatePicker
dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }}
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
id={"startime"}
showToday={false}
width={"210px"}
value={this.state.Radiovalue===1?datatime===undefined||datatime===""?undefined:moment(datatime, dateFormat):undefined}
onChange={(e,index)=>this.onChangeTimepublish(e,index,undefined,1)}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
disabled={this.state.Radiovalue===1?false:true}
/>:""}
</Radio>
</Tooltip>
<span className={"fl mt5 color-grey-c"}>(按照设置的时间定时发布)</span>
</Radio.Group>
<style>{`
.Selectleft20{
margin-left: 20px !important;
width: 176px;
height: 40px;
}
#startimes .ant-calendar-picker-icon{
margin-top:-11px;
}
.resourcebox{
max-height:150px;
overflow: auto;
}
.ml70{
margin-left:70px;
}
`}</style>
{this.props.course_groups.length>0?this.props.isStudent()===true?"":<div className={"resourcebox"}>
{this.state.Radiovalue===1?<style>
{
`
.ant-input, .ant-input .ant-input-suffix {
background-color: #fff!important;
}
`
}
</style>:""}
{
course_group_publish_times.map((item,key)=>{
return(
<div className={"mt10"} key={key}>
<Select
mode="multiple"
disabled={this.state.Radiovalue===1?false:true}
placeholder="请选择分班名称"
value={item.group_id}
style={{ width: 200 }}
onChange={(e,index)=>this.selectassigngroups(e,index,key)}
>
{this.props.course_groups.map((items,keys)=>{
let type=0
{course_group_publish_times.map((itsem,kesy)=>{
if(itsem.group_id===items.id){
type=1
return
}
})}
if(type===0){
return(
<Option value={items.name} key={keys} id={items.id}>{items.name}</Option>
)
}
})}
</Select>
<DatePicker
disabled={this.state.Radiovalue===1?false:true}
dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }}
locale={locale}
showToday={false}
format={dateFormat}
placeholder="请选择发布时间"
id={"startimes"}
className={"Selectleft20 "}
width={"200px"}
value={item.publish_time===undefined||item.publish_time===""?undefined:moment(item.publish_time, dateFormat)}
onChange={(e,index)=>this.onChangeTimepublish(e,index,key,2)}
// onChange={ this.onChangeTimepublish }
disabledTime={disabledDateTime}
disabledDate={disabledDate}
/>
{key!=0?<i className="iconfont icon-shanchu color-grey-c font-14 font-n ml20" onClick={()=>this.deletegrouppublish(key)}></i>:""}
{key+1===this.props.course_groups.length?"":<i className="iconfont icon-tianjiafangda color-green ml15" onClick={this.addgrouppublish}></i>}
</div>
)
})
}
</div>:""}
</Radio.Group>
</div>

Loading…
Cancel
Save