实践题增加删除按钮功能

dev_unstable^2
杨树明 5 years ago
parent a802aacd6c
commit d51bb8ac43

@ -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()}>提交</a>
<a href={this.props.go_back_url}
className="defalutCancelbtn fl">取消</a>
<a onClick={()=>this.delecbtns()}
className="delectshixuncdbtn fr">删除</a>
</div>
</div>

@ -27,7 +27,6 @@ class InfosBanner extends Component{
let {pathname}=this.props.location;
moduleName=pathname.split("/")[3];
console.log(is_current)
return(
<div className="bannerPanel mb60">
<div className="educontent">

@ -538,6 +538,27 @@ a.edu-greyline-btn:hover,a.edu-greyshallowline-btn:hover{border:1px solid #B2B2B
font-weight: 400;
color: rgba(255,255,255,1);
}
/*删除按钮*/
.delectshixuncdbtn{
display: block;
border: 1px solid #CDCDCD;
background-color: #fafafa;
color: #999!important;
width: 120px;
text-align: center;
height: 30px;
line-height: 30px;
border-radius: 2px;
width: 130px;
height: 40px;
background: rgba(77,124,254,0);
border-radius: 4px;
line-height: 40px;
font-size: 16px;
font-family: MicrosoftYaHei;
font-weight: 400;
}
.defalutSubmitbtn:hover{background-color: #459BE6;border: 1px solid #459BE6;}
/*-------------------------------------------公用按钮以white-btn(或者edu-default-btn无padding)为基础宽度和高度可以用padding填充颜色用edu-color-btnend-----------------------------------------*/

Loading…
Cancel
Save