From 6ff6052e26f3ed5fb457e1cf60b4e66559f914bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 15 Oct 2019 14:21:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A8=A1=E5=9D=97=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=B8=8A=E4=BC=A0=E5=92=8C=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/Resource/index.js | 2 +- .../courses/coursesPublic/SelectSetting.js | 308 +++--------------- .../courses/coursesPublic/sendResource.js | 271 ++++----------- public/stylesheets/educoder/edu-main.css | 1 + 4 files changed, 117 insertions(+), 465 deletions(-) diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index 03627a59f..3423d87f0 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -770,7 +770,7 @@ class Fileslists extends Component{ has_course_groups={this.state.has_course_groups} attachmentId={this.state.coursesecondcategoryid} />:""} - + {/*设置资源*/} {Settingtype&&Settingtype===true?{ newcourse_groups.push ({ @@ -96,7 +78,6 @@ class Selectsetting extends Component{ datalist:response.data, description: response.data.description, is_public: response.data.is_public, - unified_setting: response.data.unified_setting, datatime:response.data.publish_time, // is_public:response.data.course_groups, //attachment_histories:response.data.attachment_histories @@ -145,21 +126,6 @@ class Selectsetting extends Component{ this.getalldata() } - } - onChangepublics=(e)=>{ - console.log(e.target.checked) - this.setState({ - is_public:e.target.checked - }) - - } - - onChangesettings=(e)=>{ - console.log(e.target.checked) - this.setState({ - unified_setting:e.target.checked - }) - } settextarea=(e)=>{ @@ -180,7 +146,7 @@ class Selectsetting extends Component{ } savecouseShixunModal=()=>{ - let {fileList,is_public,unified_setting,description,datatime,course_groups}=this.state; + let {fileList,is_public,description,datatime,course_groups}=this.state; let newfileList=[]; for(var list of fileList){ @@ -196,29 +162,6 @@ class Selectsetting extends Component{ return } - // course_groups.forEach((item,key)=>{ - // if(item.course_group_id===undefined||item.publish_time===undefined){ - // this.setState({ - // course_group_publish_timestype:true - // }) - // return - // } - // }) - - // if(unified_setting===false){ - // - // course_groups.forEach((item,key)=>{ - // if(item.course_group_id===undefined){ - // this.setState({ - // course_group_idtypes:true - // }) - // return - // } - // }) - // - // } - - let coursesId=this.props.match.params.coursesId; let attachmentId=this.props.attachmentId; let url="/files/"+this.props.discussMessageid+".json"; @@ -228,7 +171,6 @@ class Selectsetting extends Component{ new_attachment_id:newfileList.length===0?undefined:newfileList, course_second_category_id:this.props.coursesidtype===undefined||this.props.coursesidtype==="node"?0:attachmentId, is_public:is_public, - is_unified_setting:unified_setting, publish_time:unified_setting===true?datatime===undefined?moment(new Date()).format('YYYY-MM-DD HH'):datatime:undefined, description:description, course_group_publish_times:unified_setting===false?course_groups:undefined @@ -244,7 +186,6 @@ class Selectsetting extends Component{ } onChangeTimepublish= (date, dateString) => { - // console.log('startValue', dateString); this.setState({ datatime:handleDateString(dateString), }) @@ -268,31 +209,6 @@ class Selectsetting extends Component{ } } - // onAttachmentRemove = (file) => { - // // confirm({ - // // title: '确定要删除这个附件吗?', - // // okText: '确定', - // // cancelText: '取消', - // // // content: 'Some descriptions', - // // onOk: () => { - // // this.deleteAttachment(file) - // // }, - // // onCancel() { - // // console.log('Cancel'); - // // }, - // // }); - // // return false; - // - // // this.setState({ - // // Modalstype:true, - // // Modalstopval:'确定要删除这个附件吗?', - // // ModalSave: ()=>this.deleteAttachment(file), - // // ModalCancel:this.cancelAttachment - // // }) - // // return false; - // - // this.deleteAttachment(file); - // } onAttachmentRemove = (file) => { @@ -309,14 +225,7 @@ class Selectsetting extends Component{ fileListtype:false, fileList:[] }) - // this.setState((state) => { - // const index = state.fileList.indexOf(file); - // const newFileList = state.fileList.slice(); - // newFileList.splice(index, 1); - // return { - // fileList: newFileList, - // }; - // }); + } } }) @@ -332,63 +241,15 @@ class Selectsetting extends Component{ fileList:[] }) } - // const url = `/attachments/${file.response ? file.response.id : file.uid}.json` - } - onChangeTimepublishs= (date, dateString,key) => { - let {course_groups}=this.state; - let newgroup_publish=course_groups; - for(var i=0; i{ - let {course_groups}=this.state; - let newgroup_publish=course_groups; - for(var i=0; i{ - let newlist=this.state.course_groups; - newlist.splice(key,1); - this.setState({ - course_groups:newlist - }) - } - - addgrouppublish=()=>{ - let newlist=this.state.course_groups; - newlist.push( { - course_group_id : undefined, - publish_time :"" - // moment(new Date()).format('YYYY-MM-DD HH:mm') - }) - this.setState({ - course_groups:newlist - }) - } render(){ - let {is_public,unified_setting,course_groups,datatime,description,datalist,course_group_publish_timestype}=this.state; + let {datatime,description,datalist}=this.state; const uploadProps = { width: 600, - // https://github.com/ant-design/ant-design/issues/15505 - // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 - // showUploadList: false, action: `${getUrl()}/api/attachments.json`, onChange: this.handleChange, onRemove: this.onAttachmentRemove, @@ -401,9 +262,11 @@ class Selectsetting extends Component{ return isLt150M; }, }; - - - // console.log(this.props.has_course_groups) + const radioStyle = { + display: 'block', + height: '30px', + lineHeight: '30px', + }; return(
*/} - {/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/} - {/*return(*/} - {/*

*/} - {/**/} - {/**/} - {/**/} - {/**/} - {/*{item.name}*/} - {/**/} - {/**/} - {/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"123":bytesToSize(item.filesize)}*/} - {/**/} - {/*this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}>*/} - {/*

*/} - {/*)*/} - {/*})}*/} - {this.state.newfileListtypes===true?

请先上传资源

:""}

@@ -648,19 +480,14 @@ class Selectsetting extends Component{ } `} - {/*

*/} - {/**/} - {/*勾选后所有用户可见,否则仅课堂成员可见*/} - {/**/} - {/*
*/} - {/*{this.props.has_course_groups&&this.props.has_course_groups===true?:""}*/} - {this.state.course_groupss&&this.state.course_groupss.length>0? - 统一设置(选中则所有分班使用相同的发布设置,否则各个单独设置) - :""} + {this.props.course_is_public===true?
+ 公开: + 选中,所有用户可见,否则课堂成员可见 + +
:""} + + + - - {/*this.props.has_course_groups&&this.props.has_course_groups===true?:""*/} -
- {unified_setting===false? - this.state.course_groups&&this.state.course_groups.map((item,key)=>{ - return( -
- - - - - - this.onChangeTimepublishs(e,index,key)} - // onChange={ this.onChangeTimepublish } - disabledTime={disabledDateTime} - disabledDate={disabledDate} - /> - - {key!=0?this.deletegrouppublish(key)}>:""} - {key===course_groups.length-1?:""} -
- ) - }):""} -
-

- {unified_setting===true? -

- - - -

:""} - {/*{this.state.course_group_idtypes===true?

请选择分班

:""}*/} - - {/*{course_group_publish_timestype===true?

请填写完整

:""}*/} + +
+ 发布设置: + + + 立即发布 + + + 延迟发布 + + + (按照设置的时间定时发布) + +
+ {descriptiontype===true?

请输入资源描述,最大限制100个字符

:""} + {this.state.Radiovaluetype===true?

发布时间不能为空

:""}
{this.props.Cancelname} this.Saves()}>{this.props.Savesname} diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css index 64663634c..6e2fa2b7c 100644 --- a/public/stylesheets/educoder/edu-main.css +++ b/public/stylesheets/educoder/edu-main.css @@ -197,6 +197,7 @@ input::-ms-clear{display:none;} .color-white{color: #ffffff!important;} /*黑色*/ .color-dark{color: #05101a!important;} +.color-ooo{color: #000!important;} /*灰色*/ .color-grey-name{color: #1A0B00!important;} .color-grey-fa{color: #FAFAFA!important;}