From a8f4b758d3a8a9c70ea6436bec765d6d99e2dede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 8 Oct 2019 14:46:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AE=BE=E7=BD=AE=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/exercise/Exercisesetting.js | 11 +++++++++++ .../src/modules/courses/poll/PollDetailTabForth.js | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js index 96cc17ca8..54a4306d8 100644 --- a/public/react/src/modules/courses/exercise/Exercisesetting.js +++ b/public/react/src/modules/courses/exercise/Exercisesetting.js @@ -93,13 +93,24 @@ class Exercisesetting extends Component{ //加载 componentDidMount=()=>{ this.getSettingInfo(); + // window.addEventListener('click', this.handleClick); try { this.props.triggerRef(this); }catch (e) { } + + if(this.props.Commonheadofthetestpaper!=undefined){ + this.editSetting() + } } + componentDidUpdate = (prevProps) => { + if(prevProps.Commonheadofthetestpaper!= this.props.Commonheadofthetestpaper){ + this.editSetting() + } + } + _getRequestParams() { const { order, exercise_group_id,searchtext, page ,limit} = this.state return { diff --git a/public/react/src/modules/courses/poll/PollDetailTabForth.js b/public/react/src/modules/courses/poll/PollDetailTabForth.js index 22205b188..57fd91cfd 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabForth.js +++ b/public/react/src/modules/courses/poll/PollDetailTabForth.js @@ -83,8 +83,15 @@ class PollDetailTabForth extends Component{ componentDidMount=()=>{ this.getSettingInfo(); //window.addEventListener('click', this.handleClick); + if(this.props.pollDetail!=undefined){ + this.editSetting(); + } + } + componentDidUpdate = (prevProps) => { + if(prevProps.pollDetail!= this.props.pollDetail){ + this.editSetting(); + } } - handleClick=(e)=>{ console.log(e); }