From b3d970cfaf1a2ac9416d0c5cedee126505e62bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 8 Jan 2020 20:29:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesLeftNav.js | 10 ++++++---- .../modules/courses/exercise/Exercisesetting.js | 17 ++++++++++------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 16e8a1576..c37b45c84 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -530,20 +530,22 @@ class Coursesleftnav extends Component{ {name:value}).then((result)=>{ if(result!=undefined){ if(result.data.status===0){ - // window.location.reload() - // this.updasaveNavmoda() - // + notification.open({ message:"提示", description:result.data.message }); - trigger('updateNavSuccess') + if(positiontype==="files"){ + this.updasaveNavmoda() + trigger('updateNavSuccess') window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`; } if(positiontype==="boards"){ + this.updasaveNavmoda() + trigger('updateNavSuccess') window.location.href=`/courses/${coursesId}/boards/${result.data.category_id}`; } diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js index b58f1c4e5..0230c9bc7 100644 --- a/public/react/src/modules/courses/exercise/Exercisesetting.js +++ b/public/react/src/modules/courses/exercise/Exercisesetting.js @@ -131,8 +131,11 @@ class Exercisesetting extends Component{ // } // 已有设置数据的查询 - getSettingInfo=()=>{ - this.props.Commonheadofthetestpapers() + getSettingInfo=(type)=>{ + if(type!=1){ + this.props.Commonheadofthetestpapers() + } + let Id=this.props.match.params.Id; let url=`/exercises/${Id}/exercise_setting.json`; axios.get(url).then((result)=>{ @@ -241,10 +244,10 @@ class Exercisesetting extends Component{ let{unified_setting}=this.state if(unified_setting==true){ console.log("统一设置"); - this.UnifiedSetting(); + this.UnifiedSetting( ); }else{ console.log("非统一设置"); - this.NotUnifiedSetting(); + this.NotUnifiedSetting( ); } } }) @@ -347,7 +350,7 @@ class Exercisesetting extends Component{ console.log(result) if(result.status==200){ this.props.showNotification(`${result.data.message}`); - this.getSettingInfo(); + this.getSettingInfo(1); this.cancelEdit(); } }) @@ -367,7 +370,7 @@ class Exercisesetting extends Component{ if(result.status==200){ this.props.showNotification(`${result.data.message}`); this.cancelEdit(); - this.getSettingInfo(); + this.getSettingInfo(1); } }); @@ -559,7 +562,7 @@ class Exercisesetting extends Component{ } //取消编辑 cancelEdit=()=>{ - this.getSettingInfo(); + this.getSettingInfo(1); this.setState({ flagPageEdit:false })