diff --git a/app/views/admins/video_applies/shared/_list.html.erb b/app/views/admins/video_applies/shared/_list.html.erb index ff9e0f06e..8ddbfb3ca 100644 --- a/app/views/admins/video_applies/shared/_list.html.erb +++ b/app/views/admins/video_applies/shared/_list.html.erb @@ -6,7 +6,8 @@ 头像 姓名 视频名称 - 播放链接 + 视频大小 + 播放链接 时间 <% if is_processed %> 拒绝原因 @@ -29,9 +30,9 @@ <%= user.real_name %> <%= link_to video.title, video.file_url, :target => "_blank" %> + <%= video.filesize&.to_s(:human_size) %> <%= link_to "播放视频",video.file_url, target: "_blank" %> <%= v.updated_at.strftime('%Y-%m-%d %H:%M') %> - <% if is_processed %> <%= overflow_hidden_span v.reason %> <%= t("admins_apply_status.status.#{v.status}") %> diff --git a/public/react/src/modules/courses/busyWork/CommonWorkPost.js b/public/react/src/modules/courses/busyWork/CommonWorkPost.js index 5b43a8237..664fefd2c 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkPost.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkPost.js @@ -409,7 +409,7 @@ class CommonWorkPost extends Component{ } }).then((result)=>{ - if(result.status===200){ + if(result){ this.setState({ page: result.data.members.length == 0 ? page - 1 : page, members: page != 1 && search == this.state.lastSearch ? this.state.members.concat(result.data.members) : result.data.members, @@ -426,7 +426,10 @@ class CommonWorkPost extends Component{ contentViewScroll=(e)=>{ //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ // console.log("到达底部"); let{ search,page,limit }=this.state; diff --git a/public/react/src/modules/courses/coursesPublic/PathModal.js b/public/react/src/modules/courses/coursesPublic/PathModal.js index 33a2cb68d..b6b37559d 100644 --- a/public/react/src/modules/courses/coursesPublic/PathModal.js +++ b/public/react/src/modules/courses/coursesPublic/PathModal.js @@ -123,8 +123,10 @@ class PathModal extends Component{ contentViewScrolledit=(e)=>{ //滑动到底判断 const {shixunmodallist} = this.state; + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ if(shixunmodallist.subject_list.length===0){ return; diff --git a/public/react/src/modules/courses/coursesPublic/SelectResource.js b/public/react/src/modules/courses/coursesPublic/SelectResource.js index f9433ddf7..47ec9ac47 100644 --- a/public/react/src/modules/courses/coursesPublic/SelectResource.js +++ b/public/react/src/modules/courses/coursesPublic/SelectResource.js @@ -101,9 +101,11 @@ class Selectresource extends Component{ } contentViewScroll=(e)=>{ let {page,searchtype}=this.state; + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ let newpage=page+1; let url if(searchtype==="getallfiles"){ diff --git a/public/react/src/modules/courses/coursesPublic/ShixunModal.js b/public/react/src/modules/courses/coursesPublic/ShixunModal.js index 24bb7310e..a38b3f6e9 100644 --- a/public/react/src/modules/courses/coursesPublic/ShixunModal.js +++ b/public/react/src/modules/courses/coursesPublic/ShixunModal.js @@ -102,7 +102,10 @@ class ShixunModal extends Component{ contentViewScrolledit=(e)=>{ const {shixunmodallist}=this.state; //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight) { + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1) { if (shixunmodallist.shixun_list.length === 0) { return; diff --git a/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js b/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js index 59f157597..5331ac014 100644 --- a/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js +++ b/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js @@ -41,8 +41,10 @@ class ShixunModal extends Component{ contentViewScrolledit=(e)=>{ //滑动到底判断 + let newscrollTop=parseInt(e.currentTarget.scrollTop) + let allclientHeight=e.currentTarget.clientHeight+newscrollTop - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ let {Searchvalue,type,page}=this.state; let newpage=page+1 diff --git a/public/react/src/modules/courses/exercise/Ecerciseallbackagain.js b/public/react/src/modules/courses/exercise/Ecerciseallbackagain.js index 3e100fdab..8aa6af17b 100644 --- a/public/react/src/modules/courses/exercise/Ecerciseallbackagain.js +++ b/public/react/src/modules/courses/exercise/Ecerciseallbackagain.js @@ -53,7 +53,10 @@ class Ecerciseallbackagain extends Component{ contentViewScroll=(e)=>{ //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ let {page,limit,datalist}=this.state; let newpage=page+1; let newdata=datalist; diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js index 0d5a756de..070ca8b6d 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js @@ -47,7 +47,7 @@ class GraduationTasksSubmitedit extends Component{ let url = "/graduation_works/"+workId+"/edit.json"; axios.get(url).then((result)=>{ - if(result.status===200){ + if(result){ console.log(result.data.description); this.setState({ @@ -246,7 +246,7 @@ class GraduationTasksSubmitedit extends Component{ limit:limit }).then((result)=>{ - if(result.status===200){ + if(result){ if(types===1){ if(result.data.members.length>0) { result.data.members.map((item, key) => { @@ -279,7 +279,10 @@ class GraduationTasksSubmitedit extends Component{ contentViewScroll=(e)=>{ //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ // console.log("到达底部"); let{ search,page,limit,workslist}=this.state; diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index 9ebefcaef..e73c1872b 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -270,7 +270,10 @@ class GraduationTasksSubmitnew extends Component{ contentViewScroll=(e)=>{ //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ // console.log("到达底部"); let{ search,page,limit }=this.state; diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index 293310a90..daa0868a8 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -86,7 +86,10 @@ class ShixunWorkModal extends Component{ contentViewScroll=(e)=>{ //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ let {page,limit,group_list}=this.state; let newpage=page+1; let newgroup_list=group_list; diff --git a/public/react/src/modules/message/js/MessagChat.js b/public/react/src/modules/message/js/MessagChat.js index 52c8d9870..bd87ad90f 100644 --- a/public/react/src/modules/message/js/MessagChat.js +++ b/public/react/src/modules/message/js/MessagChat.js @@ -83,9 +83,11 @@ class MessagChat extends Component{ } // 滑动刷新 contentViewScrolledit=(e)=>{ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ // console.log("滑动到底判断"); let {page}=this.state; let newpage=page+1 diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index 9f4d49a04..9ed079957 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -299,7 +299,10 @@ class DetailCardsEditAndAdd extends Component{ contentViewScrolladd=(e)=>{ const {ChooseShixunList}=this.state; //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ if(ChooseShixunList.shixun_list.length===0){ return diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js index b6c7e53b2..c7ca9538b 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js @@ -339,7 +339,10 @@ class DetailCardsEditAndEdit extends Component{ contentViewScrolledit=(e)=>{ //滑动到底判断 const {ChooseShixunList}=this.state; - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ if(ChooseShixunList.shixun_list.length===0){ return diff --git a/public/react/src/modules/paths/PathDetail/addCollaborators.js b/public/react/src/modules/paths/PathDetail/addCollaborators.js index 056e69b31..646ea5ead 100644 --- a/public/react/src/modules/paths/PathDetail/addCollaborators.js +++ b/public/react/src/modules/paths/PathDetail/addCollaborators.js @@ -127,7 +127,10 @@ class addCollaborators extends Component{ contentViewScroll=(e)=>{ //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ // console.log("到达底部"); let id=this.props.match.params.pathId; diff --git a/public/react/src/modules/tpm/TPMRepositoryComponent.js b/public/react/src/modules/tpm/TPMRepositoryComponent.js index b0be1475d..a9c2e6854 100644 --- a/public/react/src/modules/tpm/TPMRepositoryComponent.js +++ b/public/react/src/modules/tpm/TPMRepositoryComponent.js @@ -37,6 +37,7 @@ class TPMRepositoryComponent extends Component { setContentWidth100 = (flag) => { const newFileContent = flag === false ? '' : this.state.fileContent this.setState({ + // isCodeFile isContentWidth100: flag, fileContent: newFileContent }) @@ -145,12 +146,18 @@ class TPMRepositoryComponent extends Component { // this.props.setLoadingContent(false) const trees = response.data.trees + const treeIsFileMap = {} if (!trees || !Array.isArray(trees)) { // this.props.showSnackbar('无法找到对应的资源,请变更地址或联系管理员!') // return; + } else { + trees.forEach(item => { + treeIsFileMap[item.name] = item.type == 'blob' + }) } if(response.status === 200){ this.setState({ + treeIsFileMap, ...response.data, repositoryLoading: false }); diff --git a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js index ea99b740d..9fbb2d716 100644 --- a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js +++ b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js @@ -372,8 +372,10 @@ class Collaborators extends Component { contentViewScrolledit=(e)=>{ //滑动到底判断 + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ let {page,collaboratorList,user_name,school_name,Searchadmin} = this.state; let newpage=page+1; let newSearchadmin=Searchadmin diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js index c13e2a5a2..7fe6e2bcd 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js @@ -89,10 +89,10 @@ class RepositoryAddFile extends Component { } checkPath= (rule, value, callback) =>{ - if (value == "/" ) { - callback('请输入正确的文件路径'); - }else if(!value){ + if(!value){ callback('文件名不能为空'); + }else if (value == "/" || value.indexOf('.') == -1 ) { + callback('请输入正确的文件路径,如:src/HelloWord.java'); }else{ callback(); }