diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index e4f48faae..71ac9bd8d 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -931,21 +931,22 @@ class Question extends Component { /> {/*头部*/} this.chakanjiexibool(e)} - getitem_basketss={(id) => this.getitem_basketss(id)} - selectallquestionsonthispage={() => this.selectallquestionsonthispage()} - getitem_baskets={(e) => this.getitem_baskets(e)} - setdatafuns={(e) => this.setdatafuns(e)} - setdatafunsval={(e) => this.setdatafunsval(e)} - handleVisibleChanges={(e) => this.handleVisibleChanges(e)} - handleVisibleChange={(e) => this.handleVisibleChange(e)} - showmodels={(e) => this.showmodels(e)} - showmodelysl={(e) => this.showmodelysl(e)} - callback={(e) => this.callback(e)} - setoj_status={(e) => this.setoj_status(e)} - showmodelsInaudit={(e) => this.showmodelsInaudit(e)} + pages={this.state.page} + Isitapopup={"false"} + chakanjiexiboolindex={this.state.chakanjiexiboolindex} + chakanjiexibool={(e)=>this.chakanjiexibool(e)} + getitem_basketss={(id)=>this.getitem_basketss(id)} + selectallquestionsonthispage={()=>this.selectallquestionsonthispage()} + getitem_baskets={(e)=>this.getitem_baskets(e)} + setdatafuns={(e) => this.setdatafuns(e)} + setdatafunsval={(e) => this.setdatafunsval(e)} + handleVisibleChanges={(e) => this.handleVisibleChanges(e)} + handleVisibleChange={(e) => this.handleVisibleChange(e)} + showmodels={(e) => this.showmodels(e)} + showmodelysl={(e) => this.showmodelysl(e)} + callback={(e) => this.callback(e)} + setoj_status={(e)=>this.setoj_status(e)} + showmodelsInaudit={(e)=>this.showmodelsInaudit(e)} > { diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js index a5f5ab8c1..6a5b11136 100644 --- a/public/react/src/modules/question/Questionitem_banks.js +++ b/public/react/src/modules/question/Questionitem_banks.js @@ -1,5 +1,6 @@ -import React, { Component } from "react"; -import { SnackbarHOC } from 'educoder'; +import React, {Component} from "react"; +import {Link, NavLink} from 'react-router-dom'; +import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder'; import axios from 'axios'; import { Breadcrumb } from "antd"; import TPMIndexHOC from "../tpm/TPMIndexHOC"; @@ -25,13 +26,25 @@ class Questionitem_banks extends Component { myquestion_choicesco: [], disciplinesdata: [], knowledgepoints: [], - disciplmy: [] + disciplmy:[], + pages:1, } } //初始化 componentDidMount() { + const query = this.props.location.search; + const parsed = queryString.parse(query); + console.log(parsed); + try { + this.setState({ + pages:parsed.pages + }) + }catch (e) { + + } + // let {defaultActiveKey}= this.state; // var data={ // public:defaultActiveKey @@ -444,9 +457,10 @@ class Questionitem_banks extends Component { } if (this.state.item_type === "PROGRAM") { //编程题 跳转到 oj 中创建 - var myrbkc = []; - var Getdatasdatas = Getdatasdata[2].rbzsd; - for (let myda of Getdatasdatas) { + debugger + var myrbkc=[]; + var Getdatasdatas=Getdatasdata[2].rbzsd; + for(let myda of Getdatasdatas) { myrbkc.push(myda.id); } @@ -455,9 +469,12 @@ class Questionitem_banks extends Component { sub_discipline_id: Getdatasdata[3].rbkc[1], tag_discipline_id: myrbkc, }); - console.log(Getdatasdata[3].rbkc[1].join(',')); - // window.open( `/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=\"\"&tag_discipline_id=\"\"&newoj=1&=pages=\"\"`); + let arrays=myrbkc.join(','); + // console.log("开始打印了"); + // console.log(arrays); + + window.open( `/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=${Getdatasdata[3].rbkc[1]}&tag_discipline_id=${arrays}&newoj=1&pages=${this.state.pages}`); } diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index f640a54a6..9061b4bd7 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -52,47 +52,47 @@ class Contentpart extends Component { this.props.callback(defaultActiveKeys); } } - xinzenw = (e) => { - var urls = "?"; - if (this.props.discipline_id) { - if (urls === "?") { - urls = urls + `discipline_id=${this.props.discipline_id}` - } else { - urls = urls + `&discipline_id=${this.props.discipline_id}` - } + xinzenw=(e)=>{ + var urls=""; + if(this.props.discipline_id){ + // if(urls==="?"){ + // urls=urls+`discipline_id=${this.props.discipline_id}` + // }else { + urls=urls+`&discipline_id=${this.props.discipline_id}` + // } + } + if(this.props.sub_discipline_id){ + // if(urls==="?"){ + // urls=urls+`sub_discipline_id=${this.props.sub_discipline_id}` + // }else { + urls=urls+`&sub_discipline_id=${this.props.sub_discipline_id}` + // } } - if (this.props.sub_discipline_id) { - if (urls === "?") { - urls = urls + `sub_discipline_id=${this.props.sub_discipline_id}` - } else { - urls = urls + `&sub_discipline_id=${this.props.sub_discipline_id}` - } + if(this.props.tag_discipline_id){ + // if(urls==="?"){ + // urls=urls+`sub_discipline_id=${this.props.tag_discipline_id}` + // }else { + urls=urls+`&sub_discipline_id=${this.props.tag_discipline_id}` + // } } - if (this.props.tag_discipline_id) { - if (urls === "?") { - urls = urls + `sub_discipline_id=${this.props.tag_discipline_id}` - } else { - urls = urls + `&sub_discipline_id=${this.props.tag_discipline_id}` - } + if(this.props.difficulty){ + // if(urls==="?"){ + // urls=urls+`difficulty=${this.props.difficulty}&` + // }else { + urls=urls+`&difficulty=${this.props.difficulty}` + // } } - if (this.props.difficulty) { - if (urls === "?") { - urls = urls + `difficulty=${this.props.difficulty}&` - } else { - urls = urls + `&difficulty=${this.props.difficulty}` - } - } - if (this.props.item_type) { - if (urls === "?") { - urls = urls + `item_type=${this.props.item_type}` - } else { - urls = urls + `&item_type=${this.props.item_type}` - } + if(this.props.item_type){ + // if(urls==="?"){ + // urls=urls+`item_type=${this.props.item_type}` + // }else { + urls=urls+`&item_type=${this.props.item_type}` + // } } + this.props.history.push("/question/newitem?pages="+this.props.pages+urls); - this.props.history.push("/question/newitem" + urls); } render() { let { page } = this.state; @@ -316,12 +316,13 @@ class Contentpart extends Component { keindex={index} items={object} key={index} - getitem_basketss={(id) => this.props.getitem_basketss(id)} - getitem_baskets={(e) => this.props.getitem_baskets(e)} - showmodels={(e) => this.props.showmodels(e)} - showmodelysl={(e) => this.props.showmodelysl(e)} - showmodelsInaudit={(e) => this.props.showmodelsInaudit(e)} - > + pages={this.props.pages} + getitem_basketss={(id)=>this.props.getitem_basketss(id)} + getitem_baskets={(e)=>this.props.getitem_baskets(e)} + showmodels={(e)=>this.props.showmodels(e)} + showmodelysl={(e)=>this.props.showmodelysl(e)} + showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)} + > ) diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index d21e12d35..9c3766dc1 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -366,7 +366,7 @@ class Listjihe extends Component { this.props.Isitapopup&&this.props.Isitapopup==="true"? "" : - +

编辑 @@ -376,7 +376,7 @@ class Listjihe extends Component { this.props.Isitapopup&&this.props.Isitapopup==="true"? "" : - +

编辑