From c68bb9c09943e3263ae7f52913751f5ed9ea3da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 31 Dec 2019 14:54:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E7=BB=84=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/question/Paperreview_item.js | 135 +++++++++++++++--- .../question/component/PaperDeletModel.js | 44 ++++++ .../question/component/PaperDeletModels.js | 43 ++++++ .../component/Paperreview_itemModel.js | 68 +++++++++ .../question/questioncss/questioncom.css | 8 ++ 5 files changed, 279 insertions(+), 19 deletions(-) create mode 100644 public/react/src/modules/question/component/PaperDeletModel.js create mode 100644 public/react/src/modules/question/component/PaperDeletModels.js create mode 100644 public/react/src/modules/question/component/Paperreview_itemModel.js diff --git a/public/react/src/modules/question/Paperreview_item.js b/public/react/src/modules/question/Paperreview_item.js index 1b17638d0..8588cb17a 100644 --- a/public/react/src/modules/question/Paperreview_item.js +++ b/public/react/src/modules/question/Paperreview_item.js @@ -18,15 +18,10 @@ import './questioncss/questioncom.css'; import '../tpm/newshixuns/css/Newshixuns.css'; import Paperreview_single from './Paperreview_single'; import {DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd'; -import Paperreview_multlple from './Paperreview_multlple'; -import Paperreview_judgment from "./Paperreview_judgment"; -import Paperreview_program from "./Paperreview_program"; -import Choicequestion from './component/Choicequestion'; -import SingleEditor from "./component/SingleEditor"; -import ChoquesEditor from "./component/ChoquesEditor" -import JudquestionEditor from "./component/JudquestionEditor"; -import Bottomsubmit from "../../modules/modals/Bottomsubmit"; -import Listjihe from "./component/Listjihe"; +import PaperDeletModel from './component/PaperDeletModel'; +import PaperDeletModels from './component/PaperDeletModels'; +import Paperreview_itemModel from './component/Paperreview_itemModel'; + const reorder = (list, startIndex, endIndex) => { const result = Array.from(list); @@ -44,7 +39,11 @@ class Paperreview_item extends Component { questions:0, totalscore:0, total:0, - + modalsTypedel:false, + modalsTypey:false, + modalsTypedels:false, + titilesm:"", + titilesms:"", } } @@ -154,11 +153,109 @@ class Paperreview_item extends Component { }) } + Singlemagazine=(name,bool)=>{ + if(bool===true){ + this.setState({ + modalsTypey:true, + titilesm:name + }) + }else { + this.setState({ + modalsTypey:false, + titilesm:"" + }) + } + + + } + + setDownloady=(fenshu)=>{ + const url ="/item_baskets/batch_set_score.json"; + var data ={ + score:fenshu, + item_type:this.state.titilesm==="单选题"?"SINGLE":this.state.titilesm==="多选题"?"MULTIPLE":this.state.titilesm==="判断题"?"JUDGMENT":this.state.titilesm==="编程题"?"PROGRAM":'', + + } + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + this.props.showNotification(`调分成功`); + this.props.getdata({}); + this.Singlemagazine("",false); + } + }).catch((error) => { + console.log(error); + }) + } + + setmodalsTypedel=(bool,type,names)=>{ + if(type===1){ + this.setState({ + modalsTypedel:bool, + titilesms:names + }) + }else{ + this.setState({ + modalsTypedel:bool, + modalsTypedels:true, + titilesms:names + }) + } + + } + + setmodalsTypedels=(bool,type)=>{ + if(type===1){ + this.setState({ + modalsTypedels:bool, + titilesms:"" + }) + }else { + //确定 + const url=`/item_baskets/delete_item_type.json`; + axios.delete((url), { data: { + item_type:this.state.titilesms + }}) + .then((response) => { + if (response.data.status == 0) { + this.props.showNotification('删除成功'); + this.setState({ + titilesms:"" + }) + } + }) + .catch(function (error) { + //console.log(error); + }); + + this.setState({ + modalsTypedels:bool, + }) + } + + } + + render() { - let {questions,totalscore,total} = this.state; + let {questions,totalscore,total,modalsTypedel,modalsTypey,modalsTypedels} = this.state; let {single_questions,multiple_questions,judgement_questions,program_questions,all_score}=this.props; return (
一、单选题
(共{single_questions&&single_questions.questions_count}题;共{single_questions&&single_questions.questions_score}分)
{single_questions===null?"一":"二"}、多选题
(共{multiple_questions&&multiple_questions.questions_count}题;共{multiple_questions&&multiple_questions.questions_score}分)
(共{judgement_questions&&judgement_questions.questions_count}题;共{judgement_questions&&judgement_questions.questions_score}分)
(共{program_questions&&program_questions.questions_count}题;共{program_questions&&program_questions.questions_score}分)
删除大题,将删除该大题下所有小题
确认删除该大题?
确认删除该试题?
+ {this.props.titilesm}:
++ 分/题 +
+