|
|
|
@ -33,6 +33,7 @@ class Collaborators extends Component {
|
|
|
|
|
Collaboratorsvisible: false,
|
|
|
|
|
Collaboratorsvisibleadmin: false,
|
|
|
|
|
value: 1,
|
|
|
|
|
page: 1,
|
|
|
|
|
Searchadmin: [],
|
|
|
|
|
allChangechecked: false,
|
|
|
|
|
Collaboratorslist: [],
|
|
|
|
@ -155,6 +156,9 @@ class Collaborators extends Component {
|
|
|
|
|
}
|
|
|
|
|
onSearchadmin = (value) => {
|
|
|
|
|
let {collaboratorList,user_name,school_name} = this.state;
|
|
|
|
|
this.setState({
|
|
|
|
|
Searchadmin: [],
|
|
|
|
|
})
|
|
|
|
|
// if (value === "") {
|
|
|
|
|
// this.setState({
|
|
|
|
|
// Searchadmin: [],
|
|
|
|
@ -172,7 +176,7 @@ class Collaborators extends Component {
|
|
|
|
|
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
let newlist = response.data;
|
|
|
|
|
let newlist = response.data.users;
|
|
|
|
|
for (var i = 0; i < newlist.length; i++) {
|
|
|
|
|
newlist[i].checked = false
|
|
|
|
|
}
|
|
|
|
@ -336,7 +340,48 @@ class Collaborators extends Component {
|
|
|
|
|
collaboratorListsumtype:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contentViewScrolledit=(e)=>{
|
|
|
|
|
//滑动到底判断
|
|
|
|
|
|
|
|
|
|
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
|
|
|
|
|
let {page,collaboratorList,user_name,school_name,Searchadmin} = this.state;
|
|
|
|
|
let newpage=page+1;
|
|
|
|
|
let newSearchadmin=Searchadmin
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
let url = "/shixuns/" + id + "/add_collaborators.json";
|
|
|
|
|
axios.get(url,{params:{
|
|
|
|
|
user_name:user_name ,
|
|
|
|
|
school_name:school_name,
|
|
|
|
|
page:newpage
|
|
|
|
|
}}).then((response) => {
|
|
|
|
|
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
let newlist = response.data.users;
|
|
|
|
|
for (var i = 0; i < newlist.length; i++) {
|
|
|
|
|
newlist[i].checked = false
|
|
|
|
|
newSearchadmin.push(newlist[i])
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(newSearchadmin)
|
|
|
|
|
this.setState({
|
|
|
|
|
Searchadmin: newSearchadmin,
|
|
|
|
|
collaboratorList: collaboratorList,
|
|
|
|
|
page:newpage
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let {
|
|
|
|
|
collaboratorList,
|
|
|
|
|
Collaboratorsvisible,
|
|
|
|
@ -445,13 +490,13 @@ class Collaborators extends Component {
|
|
|
|
|
>搜索</a>
|
|
|
|
|
<p className="clearfix pl35 mt20">
|
|
|
|
|
<span className="fl edu-txt-w80 task-hide font-bd ml10 edu-txt-left">姓名</span>
|
|
|
|
|
<span className="fl edu-txt-w80 task-hide font-bd">呢称</span>
|
|
|
|
|
<span className="fl edu-txt-w80 task-hide font-bd">职业</span>
|
|
|
|
|
<span className="fl edu-txt-w180 task-hide font-bd ml50">单位</span>
|
|
|
|
|
</p>
|
|
|
|
|
<div className="mt5" style={{background: '#f7f9fd'}}>
|
|
|
|
|
|
|
|
|
|
<div className="clearfix">
|
|
|
|
|
<ul className="upload_select_box fl" id="search_not_teachers_list">
|
|
|
|
|
<ul className="upload_select_box fl" id="search_not_teachers_list" onScroll={this.contentViewScrolledit}>
|
|
|
|
|
{Searchadmin.length === 0 ? <li style={{textAlign: 'center'}}>
|
|
|
|
|
<span>请试试搜索一下</span>
|
|
|
|
|
</li> : Searchadmin.map((item, key) => {
|
|
|
|
@ -460,10 +505,12 @@ class Collaborators extends Component {
|
|
|
|
|
<Checkbox className="fl mr20" checked={item.checked}
|
|
|
|
|
onChange={(e) => this.selectChangenickname(e, key)}
|
|
|
|
|
id={item.user_id}></Checkbox>
|
|
|
|
|
<a className="task-hide color-grey3 ml20 fl span1 edu-txt-w80">{item.nickname}</a>
|
|
|
|
|
<a className="task-hide color-grey3 fl span1 edu-txt-w80 edu-txt-left">{item.nickname}</a>
|
|
|
|
|
<span className="task-hide fl color-grey edu-txt-w80 span2">{item.identify}</span>
|
|
|
|
|
<span
|
|
|
|
|
className="span3 color-grey fl edu-txt-w260 task-hide">{item.school_name}</span>
|
|
|
|
|
title={item.school_name}
|
|
|
|
|
style={{width: '150px'}}
|
|
|
|
|
className="span3 color-grey fl edu-txt-w260 task-hide ml50 task-hide" >{item.school_name}</span>
|
|
|
|
|
</li>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|