|
|
|
@ -556,19 +556,37 @@ class Itembankstop extends Component {
|
|
|
|
|
id: result.data.tag_discipline_id,
|
|
|
|
|
name:value,
|
|
|
|
|
}
|
|
|
|
|
this.state.knowledgepoints.push(leydata);
|
|
|
|
|
const _result =[];
|
|
|
|
|
this.state.knowledgepoints.filter(item => {
|
|
|
|
|
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
|
|
|
|
|
_result.push(item);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Knowpoints: this.state.Knowpoints,
|
|
|
|
|
knowledgepoints: this.state.knowledgepoints,
|
|
|
|
|
knowledgepoints2: _result,
|
|
|
|
|
})
|
|
|
|
|
if(this.state.Knowpoints.length>=5){
|
|
|
|
|
this.state.knowledgepoints.push(leydata);
|
|
|
|
|
const _result =[];
|
|
|
|
|
this.state.knowledgepoints.filter(item => {
|
|
|
|
|
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
|
|
|
|
|
_result.push(item);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Knowpoints: this.state.Knowpoints,
|
|
|
|
|
knowledgepoints: this.state.knowledgepoints,
|
|
|
|
|
knowledgepoints2: _result,
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.state.Knowpoints.push(leydata);
|
|
|
|
|
this.state.knowledgepoints.push(leydata);
|
|
|
|
|
const _result =[];
|
|
|
|
|
this.state.knowledgepoints.filter(item => {
|
|
|
|
|
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
|
|
|
|
|
_result.push(item);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.setState({
|
|
|
|
|
Knowpoints: this.state.Knowpoints,
|
|
|
|
|
knowledgepoints: this.state.knowledgepoints,
|
|
|
|
|
knowledgepoints2: _result,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
//console.log(error);
|
|
|
|
|