Merge branch 'dev_item_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_item_bank

merge aliyun
dev_jupyter
tangjiang 5 years ago
commit ce92eb44e1

@ -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));

@ -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 {
}
</style>
<div className="h12"></div>
{
NewknTypedel?
<Newknledpots {...this.state} {...this.props}
NewknTypedeldel={(bool)=>this.NewknTypedeldel(bool)}
NewknTypedeltyoedel={(value)=>this.NewknTypedeltyoedel(value)}
></Newknledpots>
:""
}
<Form onSubmit={this.handleSubmit}>
<Form.Item
@ -430,7 +476,7 @@ class Itembankstop extends Component {
)(
<div className="sortinxdirection">
<InputGroup compact>
<Cascader style={{width: '258px'}} value={this.state.rbkc} options={options} onChange={this.handleFormzhishidian}
<Cascader style={{width: '258px'}} options={options} onChange={this.handleFormzhishidian}
placeholder="请选择..."/>
</InputGroup>
@ -463,7 +509,7 @@ class Itembankstop extends Component {
)(
<div className="sortinxdirection">
<InputGroup compact>
<Select style={{width: '258px'}} value={this.state.rbzsd} onChange={this.handleFormkechen}
<Select style={{width: '258px'}} onChange={this.handleFormkechen}
placeholder="请选择...">
{this.state.knowledgepoints && this.state.knowledgepoints.map((object, index) => {
return (
@ -474,7 +520,7 @@ class Itembankstop extends Component {
</InputGroup>
<img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("/images/educoder/zjzsd.png")}/>
<img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("/images/educoder/zjzsd.png")} onClick={()=>this.NewknTypedeldel(true)}/>
<div className="sortinxdirection" style={{

@ -38,8 +38,8 @@ class PaperDeletModel extends Component {
<Input onInput={this.handleChange} />
</div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.setmodalsTypedel()}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setmodalsTypedel(this.state.newkntypeinput)}>确定</a>
<a className="task-btn mr30 w80" onClick={()=>this.props.NewknTypedeldel(false)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.NewknTypedeltyoedel(this.state.newkntypeinput)}>确定</a>
</div>
</div>
</Modal>

Loading…
Cancel
Save