From 82a5f03af1ebcd5e2d8fccf2ec3aed96017c2779 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 31 Aug 2019 17:18:08 +0800 Subject: [PATCH 1/5] change size --- app/views/admins/video_applies/shared/_list.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/admins/video_applies/shared/_list.html.erb b/app/views/admins/video_applies/shared/_list.html.erb index ff9e0f06e..6c7570629 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 %> 拒绝原因 @@ -30,8 +31,8 @@ <%= user.real_name %> <%= link_to video.title, video.file_url, :target => "_blank" %> <%= link_to "播放视频",video.file_url, target: "_blank" %> + <%= video.filesize&.to_s(:human_size) %> <%= v.updated_at.strftime('%Y-%m-%d %H:%M') %> - <% if is_processed %> <%= overflow_hidden_span v.reason %> <%= t("admins_apply_status.status.#{v.status}") %> From c95b4da38f0f4ebd1ab9242947e318b2c9144f2a Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 31 Aug 2019 17:19:14 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=A7=86=E9=A2=91=E7=9A=84=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admins/video_applies/shared/_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admins/video_applies/shared/_list.html.erb b/app/views/admins/video_applies/shared/_list.html.erb index 6c7570629..8ddbfb3ca 100644 --- a/app/views/admins/video_applies/shared/_list.html.erb +++ b/app/views/admins/video_applies/shared/_list.html.erb @@ -30,8 +30,8 @@ <%= user.real_name %> <%= link_to video.title, video.file_url, :target => "_blank" %> - <%= link_to "播放视频",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 %> From 7b414914735ca8aa5e7969b5e88157b696c07712 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Sat, 31 Aug 2019 17:46:26 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E9=99=90=E5=88=B6=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=BF=85=E9=A1=BB=E5=B8=A6.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMRepositoryComponent.js | 7 +++++++ .../tpm/shixunchild/Repository/RepositoryAddFile.js | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) 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/Repository/RepositoryAddFile.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js index c13e2a5a2..8f81d9406 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('请输入正确的文件路径'); }else{ callback(); } From 29bdd529f68baf09dd6585eb7ab558ee0bce4495 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Sat, 31 Aug 2019 17:49:51 +0800 Subject: [PATCH 4/5] =?UTF-8?q?check=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E5=90=8E=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js index 8f81d9406..7fe6e2bcd 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js @@ -92,7 +92,7 @@ class RepositoryAddFile extends Component { if(!value){ callback('文件名不能为空'); }else if (value == "/" || value.indexOf('.') == -1 ) { - callback('请输入正确的文件路径'); + callback('请输入正确的文件路径,如:src/HelloWord.java'); }else{ callback(); } From 16fec9e90ede69612c0153c5167c18b58c05a022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sun, 1 Sep 2019 22:10:05 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=E8=B0=83=E6=95=B4=E5=A4=A7=E5=B0=8F=E5=88=B0=E5=BA=95?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/busyWork/CommonWorkPost.js | 7 +++++-- .../react/src/modules/courses/coursesPublic/PathModal.js | 4 +++- .../src/modules/courses/coursesPublic/SelectResource.js | 4 +++- .../src/modules/courses/coursesPublic/ShixunModal.js | 5 ++++- .../modules/courses/coursesPublic/modal/ShixunModal2.js | 4 +++- .../src/modules/courses/exercise/Ecerciseallbackagain.js | 5 ++++- .../graduation/tasks/GraduationTasksSubmitedit.js | 9 ++++++--- .../courses/graduation/tasks/GraduationTasksSubmitnew.js | 5 ++++- .../shixunHomework/Shixunworkdetails/ShixunWorkModal.js | 5 ++++- public/react/src/modules/message/js/MessagChat.js | 4 +++- .../modules/paths/PathDetail/DetailCardsEditAndAdd.js | 5 ++++- .../modules/paths/PathDetail/DetailCardsEditAndEdit.js | 5 ++++- .../src/modules/paths/PathDetail/addCollaborators.js | 5 ++++- .../tpm/shixunchild/Collaborators/Collaborators.js | 4 +++- 14 files changed, 54 insertions(+), 17 deletions(-) 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/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