|
|
|
@ -19,6 +19,8 @@ import './../questioncss/questioncom.css';
|
|
|
|
|
import Newknledpots from './Newknledpots'
|
|
|
|
|
const InputGroup = Input.Group;
|
|
|
|
|
const {Option} = Select;
|
|
|
|
|
const queryString = require('query-string');
|
|
|
|
|
|
|
|
|
|
const options = [
|
|
|
|
|
{
|
|
|
|
|
value: '方向',
|
|
|
|
@ -59,6 +61,8 @@ class Itembankstop extends Component {
|
|
|
|
|
|
|
|
|
|
//初始化
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
this.props.getcontentMdRef(this);
|
|
|
|
|
} catch (e) {
|
|
|
|
@ -68,7 +72,53 @@ class Itembankstop extends Component {
|
|
|
|
|
options: this.props.disciplmy,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
console.log("数据");
|
|
|
|
|
console.log(this.props);
|
|
|
|
|
const parsed = queryString.parse(this.props.location.search);
|
|
|
|
|
console.log(parsed);
|
|
|
|
|
try {
|
|
|
|
|
if(JSON.stringify(parsed)==={}||JSON.stringify(parsed)==="{}"){
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
if(parsed.discipline_id){
|
|
|
|
|
if(parsed.sub_discipline_id){
|
|
|
|
|
this.setState({
|
|
|
|
|
rbkc:[parseInt(parsed.discipline_id),parseInt(parsed.sub_discipline_id)]
|
|
|
|
|
})
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
rbkc: [parseInt(parsed.discipline_id),parseInt(parsed.sub_discipline_id)],
|
|
|
|
|
});
|
|
|
|
|
this.getdatasmyss(parseInt(parsed.discipline_id),parseInt(parsed.sub_discipline_id));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(parsed.item_type){
|
|
|
|
|
this.setState({
|
|
|
|
|
rbtx:parsed.item_type,
|
|
|
|
|
})
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
rbtx:parsed.item_type,
|
|
|
|
|
});
|
|
|
|
|
this.props.setitem_type(parsed.item_type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(parsed.difficulty){
|
|
|
|
|
this.setState({
|
|
|
|
|
rbnd:parsed.difficulty,
|
|
|
|
|
})
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
rbnd:parsed.difficulty,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
@ -79,6 +129,7 @@ class Itembankstop extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if(prevProps.disciplinesdata!== this.props.disciplinesdata){
|
|
|
|
|
console.log("新增开始加载了")
|
|
|
|
|
try {
|
|
|
|
|
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
|
|
|
|
|
const didata = this.props.disciplinesdata;
|
|
|
|
@ -110,6 +161,27 @@ class Itembankstop extends Component {
|
|
|
|
|
knowledgepoints2: _result,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const parsed = queryString.parse(this.props.location.search);
|
|
|
|
|
if(JSON.stringify(parsed)==={}||JSON.stringify(parsed)==="{}"){
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
if(parsed.discipline_id){
|
|
|
|
|
if(parsed.sub_discipline_id){
|
|
|
|
|
this.setState({
|
|
|
|
|
rbkc:[parseInt(parsed.discipline_id),parseInt(parsed.sub_discipline_id)]
|
|
|
|
|
})
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
rbkc: [parseInt(parsed.discipline_id),parseInt(parsed.sub_discipline_id)],
|
|
|
|
|
});
|
|
|
|
|
this.getdatasmyss(parseInt(parsed.discipline_id),parseInt(parsed.sub_discipline_id));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -125,6 +197,7 @@ class Itembankstop extends Component {
|
|
|
|
|
this.handletag_disciplinesChange(this.props.item_banksedit.tag_disciplines);
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
//初始化课程
|
|
|
|
|
this.handdisciplinesChange(this.props.item_banksedit.discipline,this.props.item_banksedit.sub_discipline);
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
@ -175,7 +248,42 @@ class Itembankstop extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
getdatasmyss=(id,ids)=>{
|
|
|
|
|
if(this.props.disciplinesdata){
|
|
|
|
|
try {
|
|
|
|
|
if(id &&ids){
|
|
|
|
|
var didata = this.props.disciplinesdata;
|
|
|
|
|
var knowledgepointsdata = [];
|
|
|
|
|
for (var i = 0; i < didata.length; i++) {
|
|
|
|
|
//方向
|
|
|
|
|
if (id === didata[i].id) {
|
|
|
|
|
const fxdidata = didata[i].sub_disciplines;
|
|
|
|
|
for (var j = 0; j < fxdidata.length; j++) {
|
|
|
|
|
//课程
|
|
|
|
|
if (ids === fxdidata[j].id) {
|
|
|
|
|
const zsddata = fxdidata[j].tag_disciplines;
|
|
|
|
|
for (var k = 0; k < zsddata.length; k++) {
|
|
|
|
|
//知识点
|
|
|
|
|
knowledgepointsdata.push(zsddata[k]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
knowledgepoints:knowledgepointsdata,
|
|
|
|
|
knowledgepoints2: knowledgepointsdata,
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
handdisciplinesChange =(name,title)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
rbkc:[name.id,title.id]
|
|
|
|
@ -476,6 +584,11 @@ class Itembankstop extends Component {
|
|
|
|
|
let {page, options,NewknTypedel,knowledgepoints,knowledgepoints2,Knowpoints} = this.state;
|
|
|
|
|
const {getFieldDecorator} = this.props.form;
|
|
|
|
|
|
|
|
|
|
console.log("this.state.rbkc");
|
|
|
|
|
console.log(this.state.rbkc);
|
|
|
|
|
console.log(options);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
|
|
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19">
|
|
|
|
@ -555,15 +668,15 @@ class Itembankstop extends Component {
|
|
|
|
|
<img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("images/educoder/zjzsd.png")} onClick={()=>this.NewknTypedeldel(true)}/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="sortinxdirection" style={{
|
|
|
|
|
height: "33px",
|
|
|
|
|
<div className="sortinxdirection huanhan" style={{
|
|
|
|
|
minHeight: "33px",
|
|
|
|
|
lineHeight: "28px",
|
|
|
|
|
|
|
|
|
|
}}>
|
|
|
|
|
|
|
|
|
|
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<div key={index} className="mytags" style={{
|
|
|
|
|
<div key={index} className={index===0?"mytags mb20":"mytags"} style={{
|
|
|
|
|
position: "relative",
|
|
|
|
|
}}>
|
|
|
|
|
<p className="w100s stestcen lh32">{object.name}</p>
|
|
|
|
|