From 1036126607d2ebed1df6b360acd346a004587655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 8 Jan 2020 09:27:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 4 +- .../src/modules/question/NewMyShixunModel.js | 50 +++++++++++-------- .../react/src/modules/question/Paperreview.js | 43 ++++++++++++++-- .../src/modules/question/Paperreview_item.js | 2 +- public/react/src/modules/question/Question.js | 1 - .../question/component/ChoquesEditor.js | 2 +- .../modules/question/component/Contentpart.js | 5 +- .../question/component/Itembankstop.js | 31 +++++------- .../modules/question/component/Listjihe.js | 19 +++++-- .../comthetestpaper/Comthetestpapers.js | 18 ++++++- .../comthetestpaper/Comthetestpaperst.js | 45 +++++++++++------ .../question/questioncss/questioncom.css | 5 +- .../modules/testpaper/Paperlibraryeditid.js | 17 ++++++- 13 files changed, 171 insertions(+), 71 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index a18e395dd..177328dfa 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -82,8 +82,8 @@ export function initAxiosInterceptors(props) { // proxy = "https://testeduplus2.educoder.net" //proxy="http://47.96.87.25:48080" proxy="https://pre-newweb.educoder.net" - // proxy="https://test-newweb.educoder.net" - proxy="https://test-jupyterweb.educoder.net" + proxy="https://test-newweb.educoder.net" + // proxy="https://test-jupyterweb.educoder.net" //proxy="http://192.168.2.63:3001" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; diff --git a/public/react/src/modules/question/NewMyShixunModel.js b/public/react/src/modules/question/NewMyShixunModel.js index e8acf2202..9db5d242f 100644 --- a/public/react/src/modules/question/NewMyShixunModel.js +++ b/public/react/src/modules/question/NewMyShixunModel.js @@ -91,7 +91,7 @@ class NewMyShixunModel extends Component { page: this.state.page, per_page:10, oj_status:null, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -117,7 +117,7 @@ class NewMyShixunModel extends Component { page: 1, per_page:10, oj_status:null, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); } @@ -141,7 +141,7 @@ class NewMyShixunModel extends Component { page: 1, per_page:10, oj_status:null, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); } @@ -156,7 +156,7 @@ class NewMyShixunModel extends Component { public: defaultActiveKey, page:1, per_page:10, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -209,7 +209,7 @@ class NewMyShixunModel extends Component { page: 1, per_page:10, oj_status:null, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -342,7 +342,7 @@ class NewMyShixunModel extends Component { page: pageNumber, per_page:10, oj_status:this.state.oj_status, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -461,7 +461,7 @@ class NewMyShixunModel extends Component { page:1, per_page:10, oj_status:null, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -488,7 +488,7 @@ class NewMyShixunModel extends Component { per_page:10, keywords:null, oj_status:null, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -543,7 +543,7 @@ class NewMyShixunModel extends Component { page: this.state.page, per_page:10, oj_status:this.state.oj_status, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -567,7 +567,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); } @@ -593,7 +593,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -639,7 +639,13 @@ class NewMyShixunModel extends Component { //选用 getitem_baskets=(data)=>{ //选用题型可以上传单个 或者多个题型 - let url="/examination_items.json"; + let url=""; + if(this.props.exam_id===undefined){ + url="/item_baskets.json"; + }else{ + url="/examination_items.json"; + } + axios.post(url, data) .then((result) => { @@ -655,7 +661,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdatasy(data); this.getbasket_listdata(); @@ -669,11 +675,15 @@ class NewMyShixunModel extends Component { } // 撤销 getitem_basketss=(id)=>{ - //选用题型可以上传单个 或者多个题型 - let url=`/examination_banks/${id}/revoke_item.json`; + let url=""; + if(this.props.exam_id===undefined){ + url=`/item_baskets/${id}.json`; + }else{ + url=`/examination_banks/${id}/revoke_item.json`; + } axios.delete(url,{ data: { - item_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }}) .then((result) => { if (result.data.status == 0) { @@ -688,7 +698,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdatasy(data); this.getbasket_listdata(); @@ -729,7 +739,7 @@ class NewMyShixunModel extends Component { } const data={ item_ids:item_idsdata, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), } this.getitem_baskets(data); this.setState({ @@ -758,7 +768,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); this.getbasket_listdata(); @@ -796,7 +806,7 @@ class NewMyShixunModel extends Component { page: this.state.page, per_page:10, oj_status:oj_status, - exam_id:this.props.exam_id + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); } diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js index 9014ba92b..b65127c8d 100644 --- a/public/react/src/modules/question/Paperreview.js +++ b/public/react/src/modules/question/Paperreview.js @@ -24,6 +24,7 @@ import JudquestionEditor from "./component/JudquestionEditor"; import Paperreview_item from "./Paperreview_item" import Bottomsubmit from "../../modules/modals/Bottomsubmit"; import Comthetestpaperst from "./comthetestpaper/Comthetestpaperst"; +import NewMyShixunModel from "../question/NewMyShixunModel"; //人工组卷预览 class Paperreview extends Component { constructor(props) { @@ -49,7 +50,7 @@ class Paperreview extends Component { difficulty:null, name:null, duration:null, - + newmyshixunmodelbool:false, } // single_questions:null, 单选题 @@ -245,14 +246,50 @@ class Paperreview extends Component { getcontentMdRef = (Ref) => { this.contentMdRef = Ref; } + + setnewmyshixunmodelbool=(bool)=>{ + if(bool===true){ + let scrollToTop = window.setInterval(function() { + let pos = window.pageYOffset; + if ( pos > 0 ) { + window.scrollTo( 0, pos - 20 ); // how far to scroll on each step + } else { + window.clearInterval( scrollToTop ); + } + }, 2); + } + this.setState({ + newmyshixunmodelbool:bool + }) + var data = {} + this.getdata(data); + } render() { - let {page, limit, count, Headertop, visible, placement, modalsType, item_type,Cohetepaperbool} = this.state; + let {page, limit, count, Headertop, visible, placement, modalsType, item_type,Cohetepaperbool,newmyshixunmodelbool} = this.state; const params = this.props && this.props.match && this.props.match.params; // //console.log(params); return (
+ { + newmyshixunmodelbool===true? + + :"" + } + + { + newmyshixunmodelbool===true? +
+ this.setnewmyshixunmodelbool(e)}> +
+ : + "" + }
- {getFieldDecorator('rbnd', - { + {getFieldDecorator('rbnd' + , + {initialValue: this.state.rbnd, rules: [{required: true, message: '请选择难度'}], } )( - + 简单 适中 困难 diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index c117ce20a..5d37aeccd 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -928,7 +928,6 @@ height: 100%; overflow-y: scroll !important; width: 100%; - margin-top: 60px !important; position: fixed; top:0px; bottom: 0px; @@ -936,3 +935,7 @@ z-index: 999999; right: 0px; } + +.searchwidth{ + width: 347px !important; +} diff --git a/public/react/src/modules/testpaper/Paperlibraryeditid.js b/public/react/src/modules/testpaper/Paperlibraryeditid.js index 4845ba757..1b3ee95ef 100644 --- a/public/react/src/modules/testpaper/Paperlibraryeditid.js +++ b/public/react/src/modules/testpaper/Paperlibraryeditid.js @@ -22,8 +22,10 @@ import Paperlibraryseeid_item from './component/Paperlibraryseeid_item'; import Comthetestpaperst from '../question/comthetestpaper/Comthetestpaperst'; import Paperlibraryseeid_itemss from './component/Paperlibraryseeid_itemss'; import JudquestionEditor from "../question/component/JudquestionEditor"; -import NewMyShixunModel from "../question/NewMyShixunModel" -//人工组卷预览 +import NewMyShixunModel from "../question/NewMyShixunModel"; + + +//试卷编辑 class Paperlibraryeditid extends Component { constructor(props) { super(props); @@ -187,9 +189,20 @@ class Paperlibraryeditid extends Component { } setnewmyshixunmodelbool=(bool)=>{ + if(bool===true){ + let scrollToTop = window.setInterval(function() { + let pos = window.pageYOffset; + if ( pos > 0 ) { + window.scrollTo( 0, pos - 20 ); // how far to scroll on each step + } else { + window.clearInterval( scrollToTop ); + } + }, 2); + } this.setState({ newmyshixunmodelbool:bool }) + this.getdata(); } render() {