From d75d507ab3cf1db86a99cf524b25d5b1d7f22478 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 6 Mar 2020 14:10:23 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=80=97=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E5=87=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/shixuns.rake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/tasks/shixuns.rake diff --git a/lib/tasks/shixuns.rake b/lib/tasks/shixuns.rake new file mode 100644 index 000000000..f2cdddc52 --- /dev/null +++ b/lib/tasks/shixuns.rake @@ -0,0 +1,18 @@ +#coding=utf-8 + + +desc "纠正学生实训耗时不准的问题" + +namespace :shixuns do + task correct_the_shixun_cost_time: :environment do + puts "myshixun_id: #{ENV['myshixun_id']}" + if ENV['myshixun_id'].present? + myshixun = Myshixun.find(ENV['myshixun_id']) + myshixun.games.where(status: 2).each do |game| + cost_time = game.open_time.to_i - game.end_time.to_i + game.update_column(:cost_time, cost_time) + end + end + + end +end \ No newline at end of file From bdb9e7b1ad1349237f1e864799b432ea7d82a53f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 6 Mar 2020 14:18:53 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/shixuns.rake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tasks/shixuns.rake b/lib/tasks/shixuns.rake index f2cdddc52..bca3d6db6 100644 --- a/lib/tasks/shixuns.rake +++ b/lib/tasks/shixuns.rake @@ -9,7 +9,11 @@ namespace :shixuns do if ENV['myshixun_id'].present? myshixun = Myshixun.find(ENV['myshixun_id']) myshixun.games.where(status: 2).each do |game| + puts "open_time: #{game.open_time.to_i}" + puts "end_time: #{game.end_time.to_i}" + puts "game_id: #{game.id}" cost_time = game.open_time.to_i - game.end_time.to_i + puts "cost_time: #{cost_time}" game.update_column(:cost_time, cost_time) end end From be87a6ec2f683315e9cac19c0bacff1d803744dd Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 6 Mar 2020 14:20:03 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E4=BF=AE=E6=AD=A3games=E7=9A=84=E8=80=97?= =?UTF-8?q?=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/shixuns.rake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/tasks/shixuns.rake b/lib/tasks/shixuns.rake index bca3d6db6..0249c98f1 100644 --- a/lib/tasks/shixuns.rake +++ b/lib/tasks/shixuns.rake @@ -9,11 +9,7 @@ namespace :shixuns do if ENV['myshixun_id'].present? myshixun = Myshixun.find(ENV['myshixun_id']) myshixun.games.where(status: 2).each do |game| - puts "open_time: #{game.open_time.to_i}" - puts "end_time: #{game.end_time.to_i}" - puts "game_id: #{game.id}" - cost_time = game.open_time.to_i - game.end_time.to_i - puts "cost_time: #{cost_time}" + cost_time = game.end_time.to_i - game.open_time.to_i game.update_column(:cost_time, cost_time) end end From 90c030926ae9f0e5aa57d3ca00e09162f391a66d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 6 Mar 2020 14:21:20 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E8=AF=84=E6=B5=8B=E8=80=97=E6=97=B6?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/shixuns.rake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tasks/shixuns.rake b/lib/tasks/shixuns.rake index 0249c98f1..ce6d2b80d 100644 --- a/lib/tasks/shixuns.rake +++ b/lib/tasks/shixuns.rake @@ -9,7 +9,11 @@ namespace :shixuns do if ENV['myshixun_id'].present? myshixun = Myshixun.find(ENV['myshixun_id']) myshixun.games.where(status: 2).each do |game| + puts "open_time: #{game.open_time.to_i}" + puts "end_time: #{game.end_time.to_i}" + puts "game_id: #{game.id}" cost_time = game.end_time.to_i - game.open_time.to_i + puts "cost_time: #{cost_time}" game.update_column(:cost_time, cost_time) end end From 1e6381b256443c727ad480f984152fc94a98fc08 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 6 Mar 2020 14:24:09 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/shixuns.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/shixuns.rake b/lib/tasks/shixuns.rake index ce6d2b80d..28795a099 100644 --- a/lib/tasks/shixuns.rake +++ b/lib/tasks/shixuns.rake @@ -14,7 +14,7 @@ namespace :shixuns do puts "game_id: #{game.id}" cost_time = game.end_time.to_i - game.open_time.to_i puts "cost_time: #{cost_time}" - game.update_column(:cost_time, cost_time) + game.update_column!(:cost_time, cost_time) end end From 257aa29880ef37cf5526a449c7cf79f4404c0226 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 6 Mar 2020 14:25:11 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/shixuns.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/shixuns.rake b/lib/tasks/shixuns.rake index 28795a099..84f8afd34 100644 --- a/lib/tasks/shixuns.rake +++ b/lib/tasks/shixuns.rake @@ -14,7 +14,7 @@ namespace :shixuns do puts "game_id: #{game.id}" cost_time = game.end_time.to_i - game.open_time.to_i puts "cost_time: #{cost_time}" - game.update_column!(:cost_time, cost_time) + game.update_attributes!(cost_time: cost_time) end end From 029591a9b653c87ff81ef33cff9e5159851c416b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Mar 2020 16:40:56 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/question/Questionitem_banks.js | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js index 0b8f0213e..b70332269 100644 --- a/public/react/src/modules/question/Questionitem_banks.js +++ b/public/react/src/modules/question/Questionitem_banks.js @@ -22,6 +22,7 @@ import JudquestionEditor from "./component/JudquestionEditor"; import Bottomsubmit from "../../modules/modals/Bottomsubmit"; import { connect } from 'react-redux'; import actions from "../../redux/actions"; +var restricte=false; class Questionitem_banks extends Component { constructor(props) { super(props); @@ -37,7 +38,8 @@ class Questionitem_banks extends Component { knowledgepoints: [], disciplmy:[], pages:1, - } + + } } @@ -309,6 +311,7 @@ class Questionitem_banks extends Component { .then((result) => { if (result.data.status == 0) { // this.props.showNotification(`新增单选题成功`); + this.restricte=true; this.props.history.replace('/question'); } @@ -320,6 +323,7 @@ class Questionitem_banks extends Component { .then((result) => { if (result.data.status == 0) { // this.props.showNotification(`编辑单选题成功`); + this.restricte=true; this.props.history.replace('/question'); @@ -387,6 +391,7 @@ class Questionitem_banks extends Component { .then((result) => { if (result.data.status == 0) { // this.props.showNotification(`新增多选题成功`); + this.restricte=true; this.props.history.replace('/question'); @@ -400,6 +405,7 @@ class Questionitem_banks extends Component { .then((result) => { if (result.data.status == 0) { // this.props.showNotification(`编辑多选题成功`); + this.restricte=true; this.props.history.replace('/question'); @@ -454,6 +460,7 @@ class Questionitem_banks extends Component { .then((result) => { if (result.data.status == 0) { // this.props.showNotification(`新增判断题成功`); + this.restricte=true; this.props.history.replace('/question'); } @@ -466,6 +473,7 @@ class Questionitem_banks extends Component { .then((result) => { if (result.data.status == 0) { // this.props.showNotification(`编辑判断题成功`); + this.restricte=true; this.props.history.replace('/question'); } @@ -498,10 +506,12 @@ class Questionitem_banks extends Component { let arrays=myrbkc.join(','); // console.log("开始打印了"); // console.log(arrays); - - // window.open( `/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=${Getdatasdata[3].rbkc[1]}&tag_discipline_id=${arrays}&newoj=1&pages=${this.state.pages}`); - - this.props.history.replace( `/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=${Getdatasdata[3].rbkc[1]}&tag_discipline_id=${arrays}&newoj=1&pages=${this.state.pages}`); + this.restricte=true; + window.open(`/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=${Getdatasdata[3].rbkc[1]}&tag_discipline_id=${arrays}&newoj=1&pages=${this.state.pages}`); + setTimeout(() => { + this.restricte=true; + }, 1000); + // this.props.history.replace( `/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=${Getdatasdata[3].rbkc[1]}&tag_discipline_id=${arrays}&newoj=1&pages=${this.state.pages}`); } @@ -517,24 +527,30 @@ class Questionitem_banks extends Component { } render() { - let {page, limit, count, Headertop, visible, placement, modalsType, item_type} = this.state; + let {page, limit, count, Headertop, visible, placement, modalsType, item_type,restricte} = this.state; const params = this.props && this.props.match && this.props.match.params; // ////console.log(params); return (
- '你确定离开此页面吗?'} - /> + { + restricte===false? + '你确定离开此页面吗?'} + /> + : + "" + } + :"" - } + { + debugger; let{Addcoursestype}=this.state; this.setState({ isSpin:true }) let {invite_code,professor,assistant_professor,student}=this.state; + invite_code="MBTAP"; if(invite_code===undefined||invite_code===""){ this.setState({ invite_codetype:true, @@ -269,13 +271,18 @@ class Addcourses extends Component{ this.props.history.push('/courses/2704/boards/8367/messages/42072') return; } - if(response.data.course_id!=undefined){ - this.submitasyn(response.data.course_id) - } notification.open({ message:"提示", description:response.data.message - }); + }); + if(response.data.course_id!=undefined){ + this.submitasyn(response.data.course_id) + }else{ + // 无返回课程id则是选择的教师或者助教身份,成功后跳转到课堂首页 + // console.log(this.props); + // console.log(this.props.history.push); + window.location.href="/courses"; + } if(Addcoursestype===true){ this.props.hideAddcoursestype(); } diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index 873b1d9d7..e599bfa93 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -73,8 +73,8 @@ class CoursesNew extends Component { period: data.class_period===undefined?'':data.class_period===null?'':data.class_period===null?'':data.class_period==="null"?'':data.class_period+"", credit: data.credit===undefined?'':data.credit===null?'':data.credit===null?'':data.credit==="null"?'':data.credit+"", checkboxgroup: data.course_module_types, - Realnamecertification: data.authentication, - Professionalcertification:data.professional_certification, + // Realnamecertification: data.authentication, + // Professionalcertification:data.professional_certification, endtime: data.end_date === undefined ? "" : moment(data.end_date, dateFormat), school:data.school @@ -84,8 +84,8 @@ class CoursesNew extends Component { datatime: data.end_date, dataname:data.name, is_public: data.is_public === 1 ? true : false, - Realnamecertification: data.authentication, - Professionalcertification:data.professional_certification, + // Realnamecertification: data.authentication, + // Professionalcertification:data.professional_certification, addonAfteronelenone: data.class_period===undefined?'':data.class_period===null?'':data.class_period===null?'':data.class_period==="null"?'':data.class_period, addonAfteronelentwo:data.credit===undefined?'':data.credit===null?'':data.credit===null?'':data.credit==="null"?'':data.credit, @@ -237,8 +237,8 @@ class CoursesNew extends Component { end_date: datatime===undefined?"":datatime, is_public: is_public === true || is_public === 1 ? 1 : 0, course_module_types: values.checkboxgroup, - authentication: this.state.Realnamecertification, - professional_certification: this.state.Professionalcertification, + // authentication: this.state.Realnamecertification, + // professional_certification: this.state.Professionalcertification, school:values.school } ).then((response) => { @@ -313,8 +313,8 @@ class CoursesNew extends Component { end_date: datatime===undefined?"":datatime, is_public: is_public === true || is_public === 1 ? 1 : 0, course_module_types: values.checkboxgroup, - authentication: this.state.Realnamecertification, - professional_certification: this.state.Professionalcertification, + // authentication: this.state.Realnamecertification, + // professional_certification: this.state.Professionalcertification, school:values.school } ).then((response) => { @@ -953,7 +953,7 @@ class CoursesNew extends Component { )}
-
+ {/*
-
+
*/}
{ + if(info.response){ let shixunId = this.props.match.params.shixunId; let {message,filspath}=this.state; if(message===""||message===undefined){ @@ -105,13 +109,20 @@ class RepositoryAddFileupload_files extends Component { secret_repository:Repositoryflag }}) .then((response) => { - if (response.data.status == 0) { - this.props.showNotification("删除成功") + if (response.data.status === 0) { + let fileList = this.state.fileList.filter(item=>item.uid !== info.uid); + this.setState({ + fileList + }) + this.props.showNotification("删除成功"); } }) .catch(function (error) { console.log(error); }); + }else{ + this.props.showNotification("还未上传完成,无法进行删除操作!"); + } } FormInput=(e)=>{ @@ -195,7 +206,7 @@ class RepositoryAddFileupload_files extends Component { return false } - this.props.showNotification("上传成功") + // this.props.showNotification("上传成功"); }, }; From f614c99827291c79988081da2a76559b1edb46a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Mar 2020 19:38:26 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/testpaper/Intecomponents.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/public/react/src/modules/testpaper/Intecomponents.js b/public/react/src/modules/testpaper/Intecomponents.js index 8776b6a9e..ce5040821 100644 --- a/public/react/src/modules/testpaper/Intecomponents.js +++ b/public/react/src/modules/testpaper/Intecomponents.js @@ -282,6 +282,34 @@ class Intecomponents extends Component { } preservation = () => { + + let mylistcour=1; + try { + mylistcour=this.state.single_question_count+this.state.multiple_question_count+this.state.judgement_question_count+this.state.program_question_count + }catch (e) { + + } + if(mylistcour===0){ + this.props.showNotification(`没有题不能组卷`); + return; + } + + let arraycour=1; + try { + arraycour=this.Judquestio.Getdatas()[3].rbdxt+this.Judquestio.Getdatas()[4].rbdxtx+ this.Judquestio.Getdatas()[5].rbpdt+this.Judquestio.Getdatas()[6].rbbct + + }catch (e) { + + } + + if(arraycour===0){ + this.props.showNotification(`没有设置题型及数量不能组卷`); + return; + } + + + + if (this.Judquestio.Getdatas().length === 0) { this.scrollToAnchor("Itembankstopid"); return; From 9daef0475ff10ed7033a056bca504123b4da7690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Mar 2020 19:39:43 +0800 Subject: [PATCH 16/18] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/NewHeader.js | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index dccdbc5a7..8d3c85378 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -1075,21 +1075,21 @@ submittojoinclass=(value)=>{ ` } - { - Periofters===true? -
  • - -
    -
    - 题库 -
    -
    -
    -
  • - :"" - } + {/*{*/} + {/* Periofters===true?*/} + {/*
  • */} + {/* */} + {/*
    */} + {/*
    */} + {/* 题库*/} + {/*
    */} + {/*
    */} + {/*
    */} + {/*
  • */} + {/* :""*/} + {/*}*/}
  • Date: Fri, 6 Mar 2020 20:04:35 +0800 Subject: [PATCH 17/18] issue --- .../react/src/modules/courses/boards/index.js | 10 ++-- .../courses/coursesPublic/Addcourses.js | 2 - .../RepositoryAddFileupload_file.js | 46 +++++++++---------- 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/public/react/src/modules/courses/boards/index.js b/public/react/src/modules/courses/boards/index.js index ea49e862b..9c18313fe 100644 --- a/public/react/src/modules/courses/boards/index.js +++ b/public/react/src/modules/courses/boards/index.js @@ -98,12 +98,12 @@ class Boards extends Component{ this.fetchBoards() this.fetchAll() - on('updateNavSuccess', this.updateNavSuccess) + // on('updateNavSuccess', this.updateNavSuccess) } - componentWillUnmount() { - off('updateNavSuccess', this.updateNavSuccess) - } + // componentWillUnmount() { + // off('updateNavSuccess', this.updateNavSuccess) + // } updateNavSuccess = () => { this.fetchBoards() if (this.props.match.params.boardId == this.state.boardid) { @@ -112,7 +112,7 @@ class Boards extends Component{ } componentDidUpdate = (prevProps) => { - if ( prevProps.match.params.boardId != this.props.match.params.boardId ) { + if ( prevProps.match.params.boardId !== this.props.match.params.boardId ) { this.setState({ isSpin:true }) diff --git a/public/react/src/modules/courses/coursesPublic/Addcourses.js b/public/react/src/modules/courses/coursesPublic/Addcourses.js index ab26787ea..fb0a8a920 100644 --- a/public/react/src/modules/courses/coursesPublic/Addcourses.js +++ b/public/react/src/modules/courses/coursesPublic/Addcourses.js @@ -194,13 +194,11 @@ class Addcourses extends Component{ } submittojoinclass=()=>{ - debugger; let{Addcoursestype}=this.state; this.setState({ isSpin:true }) let {invite_code,professor,assistant_professor,student}=this.state; - invite_code="MBTAP"; if(invite_code===undefined||invite_code===""){ this.setState({ invite_codetype:true, diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js index 71161bb89..eb0557472 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js @@ -65,7 +65,6 @@ class RepositoryAddFileupload_files extends Component { fileList = fileList.map(file => { if (file.response) { if (file.response.status===0) { - } } return file; @@ -76,34 +75,35 @@ class RepositoryAddFileupload_files extends Component { }; onAttachmentRemove=(info)=>{ + console.log(info); if(info.response){ - let shixunId = this.props.match.params.shixunId; - let {message,filspath}=this.state; - if(message===""||message===undefined){ - this.props.showNotification('删除文件请先填写提交信息'); - return - } + let shixunId = this.props.match.params.shixunId; + let {message,filspath}=this.state; + if(message===""||message===undefined){ + this.props.showNotification('删除文件请先填写提交信息'); + return; + } - let matchpath =this.props.match.path; + let matchpath =this.props.match.path; - let Repositoryflag =undefined; + let Repositoryflag =undefined; - if( matchpath.indexOf("repository")>-1){ - Repositoryflag =undefined; - } - if(matchpath.indexOf("secret_repository")>-1){ - Repositoryflag =true; - } + if( matchpath.indexOf("repository")>-1){ + Repositoryflag =undefined; + } + if(matchpath.indexOf("secret_repository")>-1){ + Repositoryflag =true; + } - let newfilspath=filspath; + let newfilspath=filspath; - if(newfilspath===""){ - newfilspath=info.name - }else{ - newfilspath=filspath+"/"+info.name - } - const url = `/shixuns//${shixunId}/delete_git_file.json`; - axios.delete(url, { data: { + if(newfilspath===""){ + newfilspath=info.name + }else{ + newfilspath=filspath+"/"+info.name + } + const url = `/shixuns//${shixunId}/delete_git_file.json`; + axios.delete(url, { data: { path:newfilspath, message:message, secret_repository:Repositoryflag From 760c2edfddaba7770828c0d65097abd9be26aba0 Mon Sep 17 00:00:00 2001 From: dinglink <837816638@qq.com> Date: Fri, 6 Mar 2020 20:31:36 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=80=BC=E4=BC=9A=E5=8F=A0=E5=8A=A0=E5=8F=8A?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=80=BC=E4=BC=9A=E6=8D=A2=E6=88=90=E5=9C=A8?= =?UTF-8?q?=E5=8F=A6=E5=A4=96=E4=B8=80=E4=B8=AA=E8=AF=BE=E5=A0=82=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=8D=E5=AF=B9=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/paths/statics/index.js | 10 ++++++---- public/react/src/redux/actions/static.js | 4 +++- public/react/src/redux/reducers/staticReducer.js | 4 +++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/paths/statics/index.js b/public/react/src/modules/paths/statics/index.js index aa5592cd4..b4eeec035 100644 --- a/public/react/src/modules/paths/statics/index.js +++ b/public/react/src/modules/paths/statics/index.js @@ -23,7 +23,7 @@ const App = (props) => { total, staticList, changeParams, - initTotal + initTotal, } = props; // const [datas, setDatas] = useState([]); // const [sortedInfo, setSortedInfo] = useState({}); @@ -212,7 +212,8 @@ const App = (props) => { sorter: (a, b) => a.cost_time - b.cost_time } ]; - + + useEffect(() => { changeParams({ page: 1 @@ -224,6 +225,7 @@ const App = (props) => { pathId && staticList(pathId); } + // const { // study_count, // course_study_count, @@ -249,7 +251,6 @@ const App = (props) => { // 恢复初始值 changeParams(params); initTotal(); - console.log(staticList) pathId && staticList(pathId); } @@ -335,8 +336,9 @@ const mapStateToProps = (state) => { return { subject_info, other_info, - total + total, } + }; const mapDispatchToProps = (dispatch) => ({ diff --git a/public/react/src/redux/actions/static.js b/public/react/src/redux/actions/static.js index bc689c868..77c4e0267 100644 --- a/public/react/src/redux/actions/static.js +++ b/public/react/src/redux/actions/static.js @@ -12,13 +12,15 @@ import { fetchStaticList } from "../../services/staticService"; export const staticList = (id) => { return (dispatch, getState) => { const { params, total_count, other_info } = getState().staticReducer; - if (other_info.length===20||total_count !== 0 && total_count === other_info.length) return; + // console.log('统计数据=====>>>>>', params); + // if (total_count !== 0 && total_count === other_info.length) return; fetchStaticList(id, params).then(res => { // console.log('统计数据=====>>>>>', res); const {data} = res; if (data.status === 0) { dispatch({ type: types.GET_STATIC_INFO, + other_info:data.data.other_info, payload: data.data }); } diff --git a/public/react/src/redux/reducers/staticReducer.js b/public/react/src/redux/reducers/staticReducer.js index 7d2202d03..3790b2638 100644 --- a/public/react/src/redux/reducers/staticReducer.js +++ b/public/react/src/redux/reducers/staticReducer.js @@ -38,12 +38,14 @@ const initalState = { const staticReducer = (state = initalState, action) => { const { payload = {}, type } = action; const {subject_info, other_info = [], total = {}, total_count} = payload; + switch (type) { case types.GET_STATIC_INFO: return { ...state, subject_info, - other_info: state.other_info.concat(other_info), + other_info, + // other_info: state.other_info.concat(other_info), total, total_count, params: Object.assign({}, state.params, { page: state.params.page + 1 })