From d51bb8ac437c1d655bbd1dcadafbf28bdbd12e81 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, 27 Aug 2019 17:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E9=A2=98=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tpm/challengesnew/TpmQuestionEdit.js | 17 ++++++++++++++- .../src/modules/user/usersInfo/InfosBanner.js | 1 - public/stylesheets/educoder/edu-main.css | 21 +++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/challengesnew/TpmQuestionEdit.js b/public/react/src/modules/tpm/challengesnew/TpmQuestionEdit.js index 32b56aae1..d0e6f98bd 100644 --- a/public/react/src/modules/tpm/challengesnew/TpmQuestionEdit.js +++ b/public/react/src/modules/tpm/challengesnew/TpmQuestionEdit.js @@ -4,6 +4,8 @@ import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Tooltip} from import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; +import axios from 'axios'; + import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; const Option = Select.Option; @@ -21,7 +23,17 @@ export default class TpmQuestionEdit extends Component { componentDidMount() { } - + delecbtns=()=>{ + let url=`/shixuns/${this.props.match.params.shixunId}/challenges/${this.props.match.params.checkpointId}/destroy_challenge_choose.json`; + axios.delete((url), { data: { + choose_id:this.props.match.params.choose_id + }}) + .then((result)=>{ + if(result.data.status===1){ + window.location.href=`/shixuns/${this.props.match.params.shixunId}/challenges/${this.props.match.params.checkpointId}/editquestion`; + } + }) + } render() { @@ -202,6 +214,9 @@ export default class TpmQuestionEdit extends Component { onClick={()=>this.props.answer_subit()}>提交 取消 + + this.delecbtns()} + className="delectshixuncdbtn fr">删除 diff --git a/public/react/src/modules/user/usersInfo/InfosBanner.js b/public/react/src/modules/user/usersInfo/InfosBanner.js index 382dab93a..3aa329ec9 100644 --- a/public/react/src/modules/user/usersInfo/InfosBanner.js +++ b/public/react/src/modules/user/usersInfo/InfosBanner.js @@ -27,7 +27,6 @@ class InfosBanner extends Component{ let {pathname}=this.props.location; moduleName=pathname.split("/")[3]; - console.log(is_current) return(