From 6a8de41685d63f56946f1687910a66c7a98613f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 26 Dec 2019 10:41:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=AF=95=E9=A2=98=E6=A0=8F?= =?UTF-8?q?=E9=A2=98=E7=9B=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/question/Question.js | 72 ++++++++++++++++--- .../question/component/QuestionModals.js | 66 +++++++++++++++++ public/react/src/modules/tpm/NewHeader.js | 6 +- public/react/src/modules/tpm/TPMIndex.css | 24 +++++++ 4 files changed, 156 insertions(+), 12 deletions(-) create mode 100644 public/react/src/modules/question/component/QuestionModals.js diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index 795e9193c..5bc4c6614 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -12,6 +12,7 @@ import { } from "antd"; import Headplugselection from "./component/Headplugselection"; import QuestionModal from "./component/QuestionModal"; +import QuestionModals from "./component/QuestionModals"; import Contentpart from "./component/Contentpart"; import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; import NoneData from './component/NoneData'; @@ -31,8 +32,10 @@ class Question extends Component { visible: false, placement: 'right', modalsType: false, + modalsTypes:false, titilesm: "设为公开后,所有成员均可使用试题", titiless: "是否设置为公开?", + titilesms:"单选题", titbool: false, Contentdata: [], difficulty: null, @@ -173,6 +176,21 @@ class Question extends Component { 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 = () => { //确认 if (this.state.titbool === true) { @@ -363,6 +381,7 @@ class Question extends Component { keywords: this.state.keywords, }; this.getdata(data); + this.getbasket_listdata(); } }).catch((error) => { console.log(error); @@ -384,6 +403,7 @@ class Question extends Component { keywords: this.state.keywords, }; this.getdata(data); + this.getbasket_listdata(); } }).catch((error) => { console.log(error); @@ -403,12 +423,37 @@ class Question extends Component { 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() { 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, program_questions_count, single_questions_count, subjective_questions_count } = this.state; @@ -428,7 +473,14 @@ class Question extends Component { .newHeaders{ position: fixed; top: 0px; - z-index: 9999999 ; + z-index: 999 !important; + } + .ant-drawer { + z-index: 800 !important; +} + .ant-notification{ + position: fixed; + z-index: 1500 !important; } .newFooter{ position: relative; @@ -447,6 +499,8 @@ class Question extends Component { }}> :""} + this.modalCancels()} + setDownloads={(e) => this.setDownloads(e)}> this.modalCancel()} setDownload={() => this.setDownload()}> + :
this.showQuestionModals("SINGLE")} >

单选题{'('}{single_questions_count}{')'}

+

this.showQuestionModals("MULTIPLE")}>

多选题{'('}{multiple_questions_count}{')'}

+

this.showQuestionModals("JUDGMENT")}>

判断题{'('}{judgement_questions_count}{')'}

+

this.showQuestionModals("COMPLETION")}>

填空题{'('}{completion_questions_count}{')'}

+

this.showQuestionModals("SUBJECTIVE")}>

简答题{'('}{subjective_questions_count}{')'}

+

this.showQuestionModals("PROGRAM")}>

编程题{'('}{program_questions_count}{')'}

+

+

是否删除试题栏中{ + + 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"? + "实训题" + :"" + + }

+ +
+ + ) + } +} + +export default QuestionModals; diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 903728c72..6fc7de03a 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -881,11 +881,11 @@ submittojoinclass=(value)=>{ const contents = (
- 试题库 +

试题库

- 试卷库 +

试卷库

); diff --git a/public/react/src/modules/tpm/TPMIndex.css b/public/react/src/modules/tpm/TPMIndex.css index aab7ae00e..d84d5f08b 100644 --- a/public/react/src/modules/tpm/TPMIndex.css +++ b/public/react/src/modules/tpm/TPMIndex.css @@ -243,3 +243,27 @@ body>.-task-title { .xiaoshou{ 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; +}