Commit f947fee5 by zhangleyuan

feat:处理讲师清除问题

parent ef7e7e47
...@@ -279,14 +279,17 @@ class AddLiveClass extends React.Component { ...@@ -279,14 +279,17 @@ class AddLiveClass extends React.Component {
style={{ width: 240, marginTop: 6 }} style={{ width: 240, marginTop: 6 }}
disabled={!isEdit ? true: false} disabled={!isEdit ? true: false}
showSearch showSearch
allowClear
filterOption={(input, option) => option} filterOption={(input, option) => option}
onPopupScroll={this.handleScrollTeacherList} onPopupScroll={this.handleScrollTeacherList}
suffixIcon={<span className="icon iconfont" style={{fontSize:'12px',color:'#BFBFBF'}}>&#xe835;</span>} suffixIcon={<span className="icon iconfont" style={{fontSize:'12px',color:'#BFBFBF'}}>&#xe835;</span>}
onChange={(value,option) => { onChange={(value,option) => {
console.log("value",value); if(option){
this.props.onChange('teacherId',value,'teacherType',option.children) this.props.onChange('teacherId',value,'teacherType',option.children)
}else{
this.props.onChange('teacherId',value,'teacherType',"")
}
}} }}
onSearch={(value) => { onSearch={(value) => {
teacherQuery.nickName = value teacherQuery.nickName = value
this.setState({ this.setState({
...@@ -295,6 +298,18 @@ class AddLiveClass extends React.Component { ...@@ -295,6 +298,18 @@ class AddLiveClass extends React.Component {
this.getTeacherList() this.getTeacherList()
}) })
}} }}
onClear ={(value)=>{
this.setState({
teacherQuery:{
size: 15,
current: 1,
nickName:null
}
}, () => {
this.getTeacherList()
})
}
}
getPopupContainer={() => getPopupContainer={() =>
document.getElementById("teacher") document.getElementById("teacher")
} }
...@@ -325,8 +340,14 @@ class AddLiveClass extends React.Component { ...@@ -325,8 +340,14 @@ class AddLiveClass extends React.Component {
filterOption={(input, option) => option} filterOption={(input, option) => option}
onPopupScroll={this.handleScrollAssistantList} onPopupScroll={this.handleScrollAssistantList}
onChange={(value,option) => { onChange={(value,option) => {
console.log('option',option); if(!option.length){
assistantQuery.nickName = ""
this.setState({
assistantQuery
},()=>this.props.onChange('assistant',value,'assistantType',option) )
}else{
this.props.onChange('assistant',value,'assistantType',option) this.props.onChange('assistant',value,'assistantType',option)
}
}} }}
onSearch={(value) => { onSearch={(value) => {
assistantQuery.nickName = value assistantQuery.nickName = value
...@@ -336,6 +357,14 @@ class AddLiveClass extends React.Component { ...@@ -336,6 +357,14 @@ class AddLiveClass extends React.Component {
this.getAssistantList() this.getAssistantList()
}) })
}} }}
onClear ={(value)=>{
assistantQuery.nickName = ""
this.setState({
assistantQuery
}, () => {
this.getAssistantList()
})
}}
getPopupContainer={() => getPopupContainer={() =>
document.getElementById("assistant-teacher") document.getElementById("assistant-teacher")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment