diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js index f5c3307e2..3608b7ad0 100644 --- a/public/react/src/modules/question/Questionitem_banks.js +++ b/public/react/src/modules/question/Questionitem_banks.js @@ -14,18 +14,13 @@ import { } from "antd"; import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; import Itembankstop from "./component/Itembankstop"; -import NoneData from './component/NoneData'; import './questioncss/questioncom.css'; import '../tpm/newshixuns/css/Newshixuns.css'; -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"; -// var itembankstop=null; -// var singleEditor=null; -// var Judquestio=null; -// var Choques=null; + class Questionitem_banks extends Component { constructor(props) { super(props); @@ -212,13 +207,6 @@ class Questionitem_banks extends Component { } preservation = () => { - //////console.log("preservation"); - // //////console.log(this.contentMdRef); - // //////console.log(this.answerMdRef); - //////console.log("preservation222"); - //////console.log(this.contentMdRef.Getdatas()); - //////console.log("preservation3333"); - //////console.log(this.answerMdRef.onSave()); const params = this.props && this.props.match && this.props.match.params; var url = ""; var boolnew = true; @@ -232,20 +220,19 @@ class Questionitem_banks extends Component { // "编辑" } - if (this.contentMdRef.Getdatas().length === 0) { - this.scrollToAnchor("Itembankstopid"); - return; - } - + if(this.state.item_type !== "PROGRAM"){ + if (this.contentMdRef.Getdatas().length === 0) { + this.scrollToAnchor("Itembankstopid"); + return; + } - console.log("preservation"); - console.log(this.contentMdRef.Getdatas()); - var Getdatasdata=this.contentMdRef.Getdatas(); - if (this.state.item_type === null) { + var Getdatasdata=this.contentMdRef.Getdatas(); + if (this.state.item_type === null) { + return + } + } - return - } if (this.state.item_type === "SINGLE") { if (this.answerMdRef != null) { //单选题 @@ -578,6 +565,7 @@ class Questionitem_banks extends Component { } + export default SnackbarHOC()(TPMIndexHOC(Questionitem_banks)); diff --git a/public/react/src/modules/question/component/Itembankstop.js b/public/react/src/modules/question/component/Itembankstop.js index 2c149c86e..0806493b5 100644 --- a/public/react/src/modules/question/component/Itembankstop.js +++ b/public/react/src/modules/question/component/Itembankstop.js @@ -16,7 +16,7 @@ import { Col, Row, InputNumber, DatePicker, AutoComplete, Button, Tag } from "antd"; import './../questioncss/questioncom.css'; - +import Newknledpots from './Newknledpots' const InputGroup = Input.Group; const {Option} = Select; const options = [ @@ -53,6 +53,7 @@ class Itembankstop extends Component { rbkc: undefined, knowledgepoints: [], options: [], + NewknTypedel:false } } @@ -86,6 +87,7 @@ class Itembankstop extends Component { } componentDidUpdate(prevProps) { + //编辑的时候 if (prevProps.item_banksedit !== this.props.item_banksedit) { if (this.props.item_banksedit.item_type) { @@ -377,9 +379,44 @@ class Itembankstop extends Component { } + NewknTypedeldel=(bool)=>{ + this.setState({ + NewknTypedel:bool + }) + + } + + NewknTypedeltyoedel=(value)=>{ + if(value===null||value===""){ + this.props.showNotification(`请输入知识点`); + return + } + + if(value.length===0){ + this.props.showNotification(`请输入知识点`); + return + } + var data={ + name:"", + sub_discipline_id:"" + } + const url="/tag_disciplines.json"; + axios.post(url,data) + .then((result) => { + if (result.data.status == 0) { + this.props.showNotification(`新增知识点成功!`); + } + }).catch((error) => { + //console.log(error); + }) + + this.setState({ + NewknTypedel:false + }) + } render() { - let {page, options} = this.state; + let {page, options,NewknTypedel} = this.state; const {getFieldDecorator} = this.props.form; //console.log("renderrenderrender"); //console.log(this.props.item_banksedit); @@ -418,6 +455,15 @@ class Itembankstop extends Component { }
+ { + NewknTypedel? + this.NewknTypedeldel(bool)} + NewknTypedeltyoedel={(value)=>this.NewknTypedeltyoedel(value)} + > + :"" + } +
- @@ -463,7 +509,7 @@ class Itembankstop extends Component { )(
-