|
|
|
@ -20,18 +20,12 @@ const InputGroup = Input.Group;
|
|
|
|
|
const { Option } = Select;
|
|
|
|
|
const options = [
|
|
|
|
|
{
|
|
|
|
|
value: 'zhejiang',
|
|
|
|
|
label: 'Zhejiang',
|
|
|
|
|
value: '方向',
|
|
|
|
|
label: '方向',
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
value: 'hangzhou',
|
|
|
|
|
label: 'Hangzhou',
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
value: 'xihu',
|
|
|
|
|
label: 'West Lake',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
value: '课程',
|
|
|
|
|
label: '课程',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
@ -42,12 +36,6 @@ const options = [
|
|
|
|
|
{
|
|
|
|
|
value: 'nanjing',
|
|
|
|
|
label: 'Nanjing',
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
value: 'zhonghuamen',
|
|
|
|
|
label: 'Zhong Hua Men',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
@ -60,6 +48,8 @@ class Itembankstop extends Component {
|
|
|
|
|
page:1,
|
|
|
|
|
Knowpoints:[],
|
|
|
|
|
rbtx:undefined,
|
|
|
|
|
knowledgepoints:[],
|
|
|
|
|
options:[],
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//初始化
|
|
|
|
@ -69,6 +59,10 @@ class Itembankstop extends Component {
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
knowledgepoints:this.props.knowledgepoints,
|
|
|
|
|
options:this.props.disciplmy
|
|
|
|
|
})
|
|
|
|
|
////console.log("componentDidMount");
|
|
|
|
|
////console.log(this.state);
|
|
|
|
|
////console.log(this.props);
|
|
|
|
@ -101,6 +95,21 @@ class Itembankstop extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(prevProps.knowledgepoints !== this.props.knowledgepoints){
|
|
|
|
|
this.setState({
|
|
|
|
|
knowledgepoints:this.props.knowledgepoints
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(prevProps.disciplmy !== this.props.disciplmy){
|
|
|
|
|
this.setState({
|
|
|
|
|
options:this.props.disciplmy
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
onChange=(e)=> {
|
|
|
|
|
////console.log(`checked = ${e.target.checked}`);
|
|
|
|
@ -155,6 +164,26 @@ class Itembankstop extends Component {
|
|
|
|
|
rbkc:value,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var arr= this.state.knowledgepoints;
|
|
|
|
|
for(let data of arr) {
|
|
|
|
|
if(data.id===value){
|
|
|
|
|
this.state.Knowpoints.push(data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var tmp = JSON.parse(JSON.stringify(this.state.knowledgepoints));
|
|
|
|
|
for(var i=0;i<tmp.length;i++){
|
|
|
|
|
debugger
|
|
|
|
|
if(tmp[i].id===value) {
|
|
|
|
|
this.state.knowledgepoints.splice(i, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Knowpoints:this.state.Knowpoints,
|
|
|
|
|
knowledgepoints:this.state.knowledgepoints,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleFormzhishidian=(value)=>{
|
|
|
|
@ -164,9 +193,7 @@ class Itembankstop extends Component {
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
rbzsd:value,
|
|
|
|
|
});
|
|
|
|
|
this.setState({
|
|
|
|
|
Knowpoints:value,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleFormtixing=(value)=>{
|
|
|
|
@ -186,6 +213,14 @@ class Itembankstop extends Component {
|
|
|
|
|
////console.log('Clicked! But prevent default.');
|
|
|
|
|
}
|
|
|
|
|
deletesobject=(item,index)=>{
|
|
|
|
|
var arr= this.state.Knowpoints ;
|
|
|
|
|
for(let data of arr) {
|
|
|
|
|
if(data.id===item.id){
|
|
|
|
|
this.state.knowledgepoints.push(data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var tmp = JSON.parse(JSON.stringify(this.state.Knowpoints));
|
|
|
|
|
for(var i=0;i<tmp.length;i++){
|
|
|
|
|
if(i>=index){
|
|
|
|
@ -197,22 +232,17 @@ class Itembankstop extends Component {
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
rbzsd:this.state.Knowpoints,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Knowpoints:this.state.Knowpoints,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// ////console.log("deletesobject");
|
|
|
|
|
// ////console.log(item);
|
|
|
|
|
// ////console.log(index);
|
|
|
|
|
// ////console.log(this.state.Knowpoints);
|
|
|
|
|
// ////console.log("tmp");
|
|
|
|
|
// ////console.log(tmp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let {page}=this.state;
|
|
|
|
|
let {page,options}=this.state;
|
|
|
|
|
const { getFieldDecorator } = this.props.form;
|
|
|
|
|
//console.log("renderrenderrender");
|
|
|
|
|
//console.log(this.props.item_banksedit);
|
|
|
|
@ -251,39 +281,62 @@ class Itembankstop extends Component {
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<div className="h12"></div>
|
|
|
|
|
<Form onSubmit={this.handleSubmit}>
|
|
|
|
|
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="课程"
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator("rbkc",
|
|
|
|
|
{getFieldDecorator("rbzsd",
|
|
|
|
|
{
|
|
|
|
|
rules: [{ required: true, message: '请选择课程' }],
|
|
|
|
|
}
|
|
|
|
|
)(
|
|
|
|
|
|
|
|
|
|
<div className="sortinxdirection">
|
|
|
|
|
<InputGroup compact >
|
|
|
|
|
<Select style={{ width: '258px' }} onChange={this.handleFormkechen} placeholder="请选择...">
|
|
|
|
|
|
|
|
|
|
<Option value="Home">Home</Option>
|
|
|
|
|
<Option value="Company">Company</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
<Cascader style={{ width: '258px' }} defaultValue={this.state.Knowpoints} options={options} onChange={this.handleFormzhishidian} placeholder="请选择..." />
|
|
|
|
|
</InputGroup>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*<div className="sortinxdirection" style={{*/}
|
|
|
|
|
{/* height: "33px",*/}
|
|
|
|
|
{/* lineHeight: "28px",*/}
|
|
|
|
|
|
|
|
|
|
{/*}}>*/}
|
|
|
|
|
|
|
|
|
|
{/* {this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {*/}
|
|
|
|
|
{/* return (*/}
|
|
|
|
|
{/* <div className="mytags" style={{*/}
|
|
|
|
|
{/* position: "relative",*/}
|
|
|
|
|
{/* }}>*/}
|
|
|
|
|
{/* <p className="w100s stestcen lh32">{object}</p>*/}
|
|
|
|
|
{/* <i className="iconfont icon-roundclose font-25 lg ml7 icondowncolorss" onClick={()=>this.deletesobject(object,index)}></i>*/}
|
|
|
|
|
{/* </div>*/}
|
|
|
|
|
{/* )*/}
|
|
|
|
|
{/* })}*/}
|
|
|
|
|
|
|
|
|
|
{/*</div>*/}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form onSubmit={this.handleSubmit}>
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="知识点"
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator("rbzsd",
|
|
|
|
|
{getFieldDecorator("rbkc",
|
|
|
|
|
{
|
|
|
|
|
rules: [{ required: true, message: '请选择知识点' }],
|
|
|
|
|
}
|
|
|
|
|
)(
|
|
|
|
|
<div className="sortinxdirection">
|
|
|
|
|
<InputGroup compact >
|
|
|
|
|
<Cascader style={{ width: '258px' }} defaultValue={this.state.Knowpoints} options={options} onChange={this.handleFormzhishidian} placeholder="请选择..." />
|
|
|
|
|
<Select style={{ width: '258px' }} onChange={this.handleFormkechen} placeholder="请选择...">
|
|
|
|
|
{this.state.knowledgepoints&&this.state.knowledgepoints.map((object, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<Option value={object.id}>{object.name}</Option>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
</Select>
|
|
|
|
|
</InputGroup>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="sortinxdirection" style={{
|
|
|
|
|
height: "33px",
|
|
|
|
|
lineHeight: "28px",
|
|
|
|
@ -295,7 +348,7 @@ class Itembankstop extends Component {
|
|
|
|
|
<div className="mytags" style={{
|
|
|
|
|
position: "relative",
|
|
|
|
|
}}>
|
|
|
|
|
<p className="w100s stestcen lh32">{object}</p>
|
|
|
|
|
<p className="w100s stestcen lh32">{object.name}</p>
|
|
|
|
|
<i className="iconfont icon-roundclose font-25 lg ml7 icondowncolorss" onClick={()=>this.deletesobject(object,index)}></i>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
@ -303,7 +356,6 @@ class Itembankstop extends Component {
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|