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] =?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? + '你确定离开此页面吗?'} + /> + : + "" + } +