From 200617796d01e23c981651f68b0cae8ea206ea05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 20 Aug 2019 16:07:47 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/exercise/Studentshavecompletedthelist.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 921834b80..3e0d5b0e3 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -1182,7 +1182,7 @@ class Studentshavecompletedthelist extends Component { }) } - this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, pageNumber, 20); + this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, pageNumber, 20); } paginationonChanges = (pageNumber) => { @@ -2423,7 +2423,7 @@ class Studentshavecompletedthelist extends Component { " min-width": " 1200px", }}> {/*老师*/} -
请在完成条件后重试
请在完成条件后重试
*/} - {/**/} - {/**/} - {/**/} - {/**/} - {/*{item.name}*/} - {/**/} - {/**/} - {/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"123":bytesToSize(item.filesize)}*/} - {/**/} - {/*this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}>*/} - {/*
*/} - {/*)*/} + {/*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?请先上传资源
:""} - {/**/} - {/**/} - - {/*
+ - {/*
*/} ++
请选择分班
:""}*/} diff --git a/public/react/src/modules/courses/coursesPublic/sendResource.js b/public/react/src/modules/courses/coursesPublic/sendResource.js index 20f22b119..576c9b514 100644 --- a/public/react/src/modules/courses/coursesPublic/sendResource.js +++ b/public/react/src/modules/courses/coursesPublic/sendResource.js @@ -8,18 +8,18 @@ import moment from 'moment'; const CheckboxGroup = Checkbox.Group; const Option = Select.Option; function range(start, end) { - const result = []; - for (let i = start; i < end; i++) { - result.push(i); - } - return result; + const result = []; + for (let i = start; i < end; i++) { + result.push(i); + } + return result; } function disabledDateTime() { - return { - // disabledHours: () => range(0, 24).splice(4, 20), - disabledMinutes: () => range(1, 30).concat(range(31, 60)), - // disabledSeconds: () => [0, 60], - }; + return { + // disabledHours: () => range(0, 24).splice(4, 20), + disabledMinutes: () => range(1, 30).concat(range(31, 60)), + // disabledSeconds: () => [0, 60], + }; } function disabledDate(current) { @@ -29,63 +29,63 @@ function disabledDate(current) { const dateFormat="YYYY-MM-DD HH:mm"; class Sendresource extends Component{ - constructor(props){ - super(props); - this.state={ - group_ids:[], - fileList:[], - Modalstype:false, - Modalstopval:"", - ModalCancel:"", - ModalSave:"", + constructor(props){ + super(props); + this.state={ + group_ids:[], + fileList:[], + Modalstype:false, + Modalstopval:"", + ModalCancel:"", + ModalSave:"", fileListtype:false, - loadtype:false, - is_unified_setting:true, - is_public:false, - datatime:undefined, - // moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), - course_group_publish_times:[ - { - course_group_id : undefined, - publish_time :"" - }], - course_groups:undefined, - course_groups_count:undefined - } - } - - - componentDidMount() { - - 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_groups: response.data.course_groups, - course_groups_count:response.data.course_groups_count - }) - }) - .catch(function (error) { - console.log(error); - }); - } - - } - - //勾选实训 - shixunhomeworkedit=(list)=>{ - - this.setState({ - group_ids:list - }) - - } - // 附件相关 START - handleChange = (info) => { + loadtype:false, + is_unified_setting:true, + is_public:false, + datatime:undefined, + // moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), + course_group_publish_times:[ + { + course_group_id : undefined, + publish_time :"" + }], + course_groups:undefined, + course_groups_count:undefined + } + } + + + componentDidMount() { + + 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_groups: response.data.course_groups, + course_groups_count:response.data.course_groups_count + }) + }) + .catch(function (error) { + console.log(error); + }); + } + + } + + //勾选实训 + shixunhomeworkedit=(list)=>{ + + this.setState({ + group_ids:list + }) + + } + // 附件相关 START + handleChange = (info) => { let fileList = info.fileList; if(info.file.status!="removed"){ @@ -98,280 +98,280 @@ class Sendresource extends Component{ fileList: appendFileSizeToUploadFileAll(fileList), }); } - } + } - // onAttachmentRemove = (file) => { - // + // onAttachmentRemove = (file) => { + // // this.setState({ // fileListtype:false, // }) - // // confirm({ - // // title: '确定要删除这个附件吗?', - // // okText: '确定', - // // cancelText: '取消', - // // // content: 'Some descriptions', - // // onOk: () => { - // // this.deleteAttachment(file) - // // }, - // // onCancel() { - // // console.log('Cancel'); - // // }, - // // }); - // // return false; + // // 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.setState({ + // // Modalstype:true, + // // Modalstopval:'确定要删除这个附件吗?', + // // ModalSave: ()=>this.deleteAttachment(file), + // // ModalCancel:this.cancelAttachment + // // }) + // // return false; // - // this.deleteAttachment(file); - // } + // this.deleteAttachment(file); + // } onAttachmentRemove = (file) => { - 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) { + 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); - }); + } + }) + .catch(function (error) { + console.log(error); + }); + this.setState({ + fileListtype:false, + }) + } + + ModalCancelModalCancel=()=>{ + this.setState({ + Modalstype:false, + Modalstopval:"", + ModalSave:this.ModalCancelModalCancel, + loadtype:false + }) + this.props.Cancel() + } + Saves=()=>{ + + let id=this.props.categoryid; + let {fileList,description,is_public,is_unified_setting,datatime,course_group_publish_times} =this.state; + + let newfileList=[]; + for(var list of fileList){ + newfileList.push(list.response.id) + } + + if(newfileList.length===0){ this.setState({ - fileListtype:false, + newfileListtype:true }) - } - - ModalCancelModalCancel=()=>{ - this.setState({ - Modalstype:false, - Modalstopval:"", - ModalSave:this.ModalCancelModalCancel, - loadtype:false - }) - this.props.Cancel() - } - Saves=()=>{ - - let id=this.props.categoryid; - let {fileList,description,is_public,is_unified_setting,datatime,course_group_publish_times} =this.state; - - let newfileList=[]; - for(var list of fileList){ - newfileList.push(list.response.id) - } - - if(newfileList.length===0){ - this.setState({ - newfileListtype:true - }) - return - } - // if(is_unified_setting===false){ - // course_group_publish_times.forEach((item,key)=>{ - // if(item.course_group_id===undefined||item.publish_time===undefined){ - // this.setState({ - // course_group_publish_timestype:true - // }) - // return - // } - // }) - // - // } - - - - if(description===undefined){ - - }else if(description.length>100){ - - this.setState({ - descriptiontype:true - }) - return - } - - let coursesId=this.props.match.params.coursesId; - let attachmentId=this.props.attachmentId; - let url="/files/upload.json"; - - - axios.post(url,{ - course_id:coursesId, - course_second_category_id:this.props.coursesidtype===undefined||this.props.coursesidtype==="node"?0:attachmentId, - attachment_ids:newfileList, - is_public:is_public, - is_unified_setting:is_unified_setting, - publish_time:is_unified_setting===true?datatime===undefined? moment(new Date()).format('YYYY-MM-DD HH:mm'):datatime:undefined, - description:description, - course_group_publish_times:is_unified_setting===false?course_group_publish_times:undefined - }).then((result)=>{ - - if(result.data.status===0){ - // this.setState({ - // Modalstype:true, - // Modalstopval:result.data.message, - // ModalSave:this.ModalCancelModalCancel, - // loadtype:true - // }) - this.ModalCancelModalCancel(); - this.props.updataleftNavfun(); - // this.props.showNotification(result.data.message); - this.props.showNotification("上传资源成功"); - this.props.setupdate(this.props.attachmentId) - } - }) - - - - } - - settextarea=(e)=>{ - this.setState({ - description:e.target.value - }) - } - - onChangesetting=(e)=>{ - - this.setState({ - is_unified_setting:e.target.checked - }) - - } - - onChangepublic=(e)=>{ - - this.setState({ - is_public:e.target.checked - }) - - } - - 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- - -
- - } -+
{ @@ -433,152 +433,152 @@ class Sendresource extends Component{ (单个文件最大150M) :""} -
+ {/**/} {/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/} - {/*debugger*/} - {/*return(*/} - {/**/} - {/**/} - {/**/} - {/**/} - {/**/} - {/*{item.name}*/} - {/**/} - {/**/} - {/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"":bytesToSize(item.filesize)}*/} - {/**/} - {/*this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}>*/} - {/*
*/} - {/*)*/} + {/*debugger*/} + {/*return(*/} + {/**/} + {/**/} + {/**/} + {/**/} + {/**/} + {/*{item.name}*/} + {/**/} + {/**/} + {/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"":bytesToSize(item.filesize)}*/} + {/**/} + {/*this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}>*/} + {/*
*/} + {/*)*/} {/*})}*/} - {newfileListtype===true&&this.state.fileListtype===false?请先上传资源
:""} - - {/**/} - {/**/} - - {/*
+ {newfileListtype===true&&this.state.fileListtype===false?
请先上传资源
:""} + ++ + +
请填写完整
:""}*/} - - {descriptiontype===true?请输入资源描述,最大限制100个字符
:""} - - -请填写完整
:""}*/} + + {descriptiontype===true?请输入资源描述,最大限制100个字符
:""} + + +