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 (
+ { + modalsTypedel===true? + this.setmodalsTypedel(bool,type,name)}> + :"" + } + { + modalsTypey===true? + this.setDownloady(fs)} Singlemagazine={(name,bool)=>this.Singlemagazine(name,bool)}> + :"" + } + { + modalsTypedels===true? + this.setmodalsTypedels(bool,type)}> + :"" + }
@@ -185,8 +282,8 @@ class Paperreview_item extends Component {

一、单选题

(共{single_questions&&single_questions.questions_count}题;共{single_questions&&single_questions.questions_score}分)

-
删除
-
设置得分
+
this.setmodalsTypedel(true,1,"SINGLE")}>删除
+
this.Singlemagazine("单选题",true)} >设置得分
@@ -245,8 +342,8 @@ class Paperreview_item extends Component {

{single_questions===null?"一":"二"}、多选题

(共{multiple_questions&&multiple_questions.questions_count}题;共{multiple_questions&&multiple_questions.questions_score}分)

-
删除
-
设置得分
+
this.setmodalsTypedel(true,1,"MULTIPLE")}>删除
+
this.Singlemagazine("多选题",true)}>设置得分
@@ -307,8 +404,8 @@ class Paperreview_item extends Component { :"三"}、判断题

(共{judgement_questions&&judgement_questions.questions_count}题;共{judgement_questions&&judgement_questions.questions_score}分)

-
删除
-
设置得分
+
this.setmodalsTypedel(true,1,"JUDGMENT")}>删除
+
this.Singlemagazine("判断题",true)}>设置得分
@@ -374,8 +471,8 @@ class Paperreview_item extends Component { 、编程题

(共{program_questions&&program_questions.questions_count}题;共{program_questions&&program_questions.questions_score}分)

-
删除
-
设置得分
+
this.setmodalsTypedel(true,1,"PROGRAM")}>删除
+
this.Singlemagazine("编程题",true)}>设置得分
diff --git a/public/react/src/modules/question/component/PaperDeletModel.js b/public/react/src/modules/question/component/PaperDeletModel.js new file mode 100644 index 000000000..aa8a1d44e --- /dev/null +++ b/public/react/src/modules/question/component/PaperDeletModel.js @@ -0,0 +1,44 @@ +import React, { Component } from 'react'; +import {getImageUrl} from 'educoder'; +import { Modal} from 'antd'; +import axios from 'axios'; +import './../questioncss/questioncom.css' +//立即申请试用 +class PaperDeletModel extends Component { + + constructor(props) { + super(props); + this.state={ + + } + } + + + render() { + + return( + +
+ +

删除大题,将删除该大题下所有小题

+

确认删除该大题?

+ +
+
+ ) + } +} + +export default PaperDeletModel; diff --git a/public/react/src/modules/question/component/PaperDeletModels.js b/public/react/src/modules/question/component/PaperDeletModels.js new file mode 100644 index 000000000..f39fbcfa8 --- /dev/null +++ b/public/react/src/modules/question/component/PaperDeletModels.js @@ -0,0 +1,43 @@ +import React, { Component } from 'react'; +import {getImageUrl} from 'educoder'; +import { Modal} from 'antd'; +import axios from 'axios'; +import './../questioncss/questioncom.css' +//立即申请试用 +class PaperDeletModel extends Component { + + constructor(props) { + super(props); + this.state={ + + } + } + + + render() { + + return( + + + + ) + } +} + +export default PaperDeletModel; diff --git a/public/react/src/modules/question/component/Paperreview_itemModel.js b/public/react/src/modules/question/component/Paperreview_itemModel.js new file mode 100644 index 000000000..aab404762 --- /dev/null +++ b/public/react/src/modules/question/component/Paperreview_itemModel.js @@ -0,0 +1,68 @@ +import React, { Component } from 'react'; +import {getImageUrl} from 'educoder'; +import { Modal,InputNumber} from 'antd'; +import axios from 'axios'; +import './../questioncss/questioncom.css' +//立即申请试用 +class Paperreview_itemModel extends Component { + + constructor(props) { + super(props); + this.state={ + value:0, + } + } + + onChange=(value)=>{ + console.log("Paperreview_itemModel"); + console.log(value); + this.setState({ + value:value, + }) + } + + render() { + + return( + + +
+
+

+ {this.props.titilesm}:

+ +

+ 分/题 +

+
+ +
+
+ ) + } +} + +export default Paperreview_itemModel; diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index f0964780a..1eaed0f85 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -731,3 +731,11 @@ .backgroudwhites{ background-color: #fff; } + +.ml5{ + margin-left: 5px; +} + +.lh35{ + line-height: 35px; +}