新建课堂搜索学校增加加载效果

topic_bank
杨树明 6 years ago
parent e4c805dbbb
commit 7c13d9a4d8

@ -48,6 +48,7 @@ class CoursesNew extends Component {
addonAfteronelenone:0, addonAfteronelenone:0,
addonAfteronelentwo:0, addonAfteronelentwo:0,
bordebool:false, bordebool:false,
smallspinning:false
} }
} }
componentDidMount() { componentDidMount() {
@ -450,8 +451,10 @@ class CoursesNew extends Component {
// }); // });
this.setState({ this.setState({
fetching: true, fetching: true,
school: value school: value,
smallspinning:true
}) })
this.getschool(value) this.getschool(value)
} }
}; };
@ -478,6 +481,7 @@ class CoursesNew extends Component {
}; };
getschool=(value)=>{ getschool=(value)=>{
// this.props.form.setFieldsValue({ // this.props.form.setFieldsValue({
// school: value // school: value
// }) // })
@ -488,20 +492,27 @@ class CoursesNew extends Component {
} }
}).then((result)=>{ }).then((result)=>{
if(result){ if(result){
if (result.data.status===0) { if (result.data.status===0) {
this.setState({ this.setState({
searchlistscholl: result.data.school_names, searchlistscholl: result.data.school_names,
smallspinning:false
}) })
if(result.data.school_names.length!=0){ if(result.data.school_names.length!=0){
this.setState({ this.setState({
fetching: false fetching: false,
}) })
} }
} }else{
this.setState({
smallspinning:false
})
}
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
this.setState({
smallspinning:false
})
}) })
} }
showApplyForAddOrgModal = () => { showApplyForAddOrgModal = () => {
@ -895,6 +906,9 @@ class CoursesNew extends Component {
> >
</AutoComplete> </AutoComplete>
)} )}
<span className={"fl ml20 "}>
<Spin size="small" spinning={this.state.smallspinning}/>
</span>
<span className={"newcoursestitle fl"}> <span className={"newcoursestitle fl"}>
{/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/} {/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/}
</span> </span>

@ -55,6 +55,7 @@ class Goldsubject extends Component {
addonAfteronelentwo:"", addonAfteronelentwo:"",
Whethertocreateanewclassroom:true, Whethertocreateanewclassroom:true,
bordebool:false, bordebool:false,
smallspinning:false
} }
} }
// disabledEndDate= endValue => { // disabledEndDate= endValue => {
@ -570,7 +571,8 @@ class Goldsubject extends Component {
// }); // });
this.setState({ this.setState({
fetching: true, fetching: true,
school: value school: value,
smallspinning:true
}) })
this.getschool(value) this.getschool(value)
} }
@ -598,6 +600,7 @@ class Goldsubject extends Component {
}; };
getschool=(value)=>{ getschool=(value)=>{
// this.props.form.setFieldsValue({ // this.props.form.setFieldsValue({
// school: value // school: value
// }) // })
@ -611,17 +614,24 @@ class Goldsubject extends Component {
if (result.data.status===0) { if (result.data.status===0) {
this.setState({ this.setState({
searchlistscholl: result.data.school_names, searchlistscholl: result.data.school_names,
smallspinning:false
}) })
if(result.data.school_names.length!=0){ if(result.data.school_names.length!=0){
this.setState({ this.setState({
fetching: false fetching: false
}) })
} }
}else{
this.setState({
smallspinning:false
})
} }
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
this.setState({
smallspinning:false
})
}) })
} }
showApplyForAddOrgModal = () => { showApplyForAddOrgModal = () => {
@ -1036,9 +1046,12 @@ class Goldsubject extends Component {
> >
</AutoComplete> </AutoComplete>
)} )}
<span className={"fl ml20 "}>
<Spin size="small" spinning={this.state.smallspinning}/>
</span>
<span className={"newcoursestitle fl"}> <span className={"newcoursestitle fl"}>
{/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/} {/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/}
</span> </span>
<div id='isschool'></div> <div id='isschool'></div>
</Form.Item> </Form.Item>

Loading…
Cancel
Save