删除试题栏题目功能

yslnewtiku
杨树林 5 years ago
parent 9a5e99ed2d
commit 6a8de41685

@ -12,6 +12,7 @@ import {
} from "antd"; } from "antd";
import Headplugselection from "./component/Headplugselection"; import Headplugselection from "./component/Headplugselection";
import QuestionModal from "./component/QuestionModal"; import QuestionModal from "./component/QuestionModal";
import QuestionModals from "./component/QuestionModals";
import Contentpart from "./component/Contentpart"; import Contentpart from "./component/Contentpart";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import NoneData from './component/NoneData'; import NoneData from './component/NoneData';
@ -31,8 +32,10 @@ class Question extends Component {
visible: false, visible: false,
placement: 'right', placement: 'right',
modalsType: false, modalsType: false,
modalsTypes:false,
titilesm: "设为公开后,所有成员均可使用试题", titilesm: "设为公开后,所有成员均可使用试题",
titiless: "是否设置为公开?", titiless: "是否设置为公开?",
titilesms:"单选题",
titbool: false, titbool: false,
Contentdata: [], Contentdata: [],
difficulty: null, difficulty: null,
@ -173,6 +176,21 @@ class Question extends Component {
modalsType: false modalsType: false
}) })
} }
modalCancels=()=>{
this.setState({
modalsTypes: false
})
}
showQuestionModals =(item_type)=>{
this.setState({
modalsTypes: true,
titilesms:item_type,
})
}
setDownloads=(item_type)=>{
this.Deletebigquestiontype(item_type);
}
setDownload = () => { setDownload = () => {
//确认 //确认
if (this.state.titbool === true) { if (this.state.titbool === true) {
@ -363,6 +381,7 @@ class Question extends Component {
keywords: this.state.keywords, keywords: this.state.keywords,
}; };
this.getdata(data); this.getdata(data);
this.getbasket_listdata();
} }
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
@ -384,6 +403,7 @@ class Question extends Component {
keywords: this.state.keywords, keywords: this.state.keywords,
}; };
this.getdata(data); this.getdata(data);
this.getbasket_listdata();
} }
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
@ -403,12 +423,37 @@ class Question extends Component {
this.getitem_baskets(data); this.getitem_baskets(data);
} }
//删除大题型
Deletebigquestiontype =(item_type)=>{
const url=`/item_baskets/delete_item_type.json`;
axios.delete((url), { data: {
item_type:item_type
}})
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('删除成功');
var data = {
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
};
this.getdata(data);
this.getbasket_listdata();
}
})
.catch(function (error) {
console.log(error);
});
}
render() { render() {
let { let {
page, limit, count, Headertop, visible, placement, modalsType, basket_list, page, limit, count, Headertop, visible, placement, modalsType, modalsTypes,basket_list,
completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count, completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count,
program_questions_count, single_questions_count, subjective_questions_count program_questions_count, single_questions_count, subjective_questions_count
} = this.state; } = this.state;
@ -428,7 +473,14 @@ class Question extends Component {
.newHeaders{ .newHeaders{
position: fixed; position: fixed;
top: 0px; top: 0px;
z-index: 9999999 ; z-index: 999 !important;
}
.ant-drawer {
z-index: 800 !important;
}
.ant-notification{
position: fixed;
z-index: 1500 !important;
} }
.newFooter{ .newFooter{
position: relative; position: relative;
@ -447,6 +499,8 @@ class Question extends Component {
}}></div> }}></div>
:""} :""}
<QuestionModals {...this.props}{...this.state} modalsTypes={modalsTypes} modalCancels={() => this.modalCancels()}
setDownloads={(e) => this.setDownloads(e)}></QuestionModals>
<QuestionModal {...this.props}{...this.state} modalsType={modalsType} modalCancel={() => this.modalCancel()} <QuestionModal {...this.props}{...this.state} modalsType={modalsType} modalCancel={() => this.modalCancel()}
setDownload={() => this.setDownload()}></QuestionModal> setDownload={() => this.setDownload()}></QuestionModal>
<SiderBar <SiderBar
@ -485,7 +539,7 @@ class Question extends Component {
{ {
` `
.ant-drawer-content-wrapper{ .ant-drawer-content-wrapper{
width: 235px; width: 200px !important;
overflowhidden; overflowhidden;
margin-top: 62px; margin-top: 62px;
} }
@ -515,7 +569,7 @@ class Question extends Component {
{ {
single_questions_count === 0 ? single_questions_count === 0 ?
"" ""
: <div className="sortinxdirection"> : <div className="sortinxdirection" onClick={()=>this.showQuestionModals("SINGLE")} >
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14">单选题{'('}{single_questions_count}{')'}</p> className="w50s intermediatecenterysls sortinxdirection font-14">单选题{'('}{single_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w50s intermediatecenterysls xaxisreverseorder"><i
@ -526,7 +580,7 @@ class Question extends Component {
multiple_questions_count === 0 ? multiple_questions_count === 0 ?
"" ""
: :
<div className="sortinxdirection"> <div className="sortinxdirection" onClick={()=>this.showQuestionModals("MULTIPLE")}>
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14">多选题{'('}{multiple_questions_count}{')'}</p> className="w50s intermediatecenterysls sortinxdirection font-14">多选题{'('}{multiple_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w50s intermediatecenterysls xaxisreverseorder"><i
@ -537,7 +591,7 @@ class Question extends Component {
judgement_questions_count === 0 ? judgement_questions_count === 0 ?
"" ""
: :
<div className="sortinxdirection"> <div className="sortinxdirection" onClick={()=>this.showQuestionModals("JUDGMENT")}>
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14">判断题{'('}{judgement_questions_count}{')'}</p> className="w50s intermediatecenterysls sortinxdirection font-14">判断题{'('}{judgement_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w50s intermediatecenterysls xaxisreverseorder"><i
@ -548,7 +602,7 @@ class Question extends Component {
completion_questions_count === 0 ? completion_questions_count === 0 ?
"" ""
: :
<div className="sortinxdirection"> <div className="sortinxdirection" onClick={()=>this.showQuestionModals("COMPLETION")}>
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14">填空题{'('}{completion_questions_count}{')'}</p> className="w50s intermediatecenterysls sortinxdirection font-14">填空题{'('}{completion_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w50s intermediatecenterysls xaxisreverseorder"><i
@ -559,7 +613,7 @@ class Question extends Component {
subjective_questions_count === 0 ? subjective_questions_count === 0 ?
"" ""
: :
<div className="sortinxdirection"> <div className="sortinxdirection" onClick={()=>this.showQuestionModals("SUBJECTIVE")}>
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14">简答题{'('}{subjective_questions_count}{')'}</p> className="w50s intermediatecenterysls sortinxdirection font-14">简答题{'('}{subjective_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w50s intermediatecenterysls xaxisreverseorder"><i
@ -581,7 +635,7 @@ class Question extends Component {
program_questions_count === 0 ? program_questions_count === 0 ?
"" ""
: :
<div className="sortinxdirection"> <div className="sortinxdirection" onClick={()=>this.showQuestionModals("PROGRAM")}>
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14">编程题{'('}{program_questions_count}{')'}</p> className="w50s intermediatecenterysls sortinxdirection font-14">编程题{'('}{program_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w50s intermediatecenterysls xaxisreverseorder"><i

@ -0,0 +1,66 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import './../questioncss/questioncom.css'
//立即申请试用
class QuestionModals extends Component {
constructor(props) {
super(props);
this.state={
}
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="提示"
centered={true}
visible={this.props.modalsTypes===undefined?false:this.props.modalsTypes}
width="442px"
>
<div className="educouddiv">
<div className={"tabeltext-alignleft mt10"}><p className="titiles">是否删除试题栏中{
this.props.titilesms&&this.props.titilesms==="SINGLE"?
"单选题"
:
this.props.titilesms&&this.props.titilesms==="MULTIPLE"?
"多选题"
:
this.props.titilesms&&this.props.titilesms==="JUDGMENT"?
"判断题"
:
this.props.titilesms&&this.props.titilesms==="COMPLETION"?
"填空题"
:
this.props.titilesms&&this.props.titilesms==="SUBJECTIVE"?
"简答题"
:
this.props.titilesms&&this.props.titilesms==="PROGRAM"?
"编程题"
:
this.props.titilesms&&this.props.titilesms==="PRACTICAL"?
"实训题"
:""
}</p></div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.modalCancels()}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownloads(this.props.titilesms)}>确定</a>
</div>
</div>
</Modal>
)
}
}
export default QuestionModals;

@ -881,11 +881,11 @@ submittojoinclass=(value)=>{
const contents = ( const contents = (
<div className="questiontypes" style={{ <div className="questiontypes" style={{
width:'93px', width:'93px',
height:'100px', height:'80px',
}}> }}>
<Link to={'/question'}>试题库</Link> <a href={'/question'} ><p className="questiontype">试题库</p></a>
<p className="questiontypeheng"></p> <p className="questiontypeheng"></p>
<Link to={'/question'}>试卷库</Link> <a href={'/question'} ><p className="questiontype">试卷库</p></a>
<p className="questiontypeheng"></p> <p className="questiontypeheng"></p>
</div> </div>
); );

@ -243,3 +243,27 @@ body>.-task-title {
.xiaoshou{ .xiaoshou{
cursor:pointer cursor:pointer
} }
.questiontypes{
width:37px;
height:17px;
font-size:12px;
color:rgba(51,51,51,1);
line-height:17px;
cursor:pointer;
}
.questiontype{
width: 100%;
font-size: 12px;
color: #333333;
line-height: 17px;
text-align: center;
padding: 11px;
cursor:pointer;
}
.questiontypeheng{
width:100%;
height:1px;
background: #EEEEEE;
}

Loading…
Cancel
Save