|
|
|
@ -1,17 +1,7 @@
|
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
|
|
|
|
|
|
import { Redirect } from 'react-router';
|
|
|
|
|
|
|
|
|
|
import {Modal, Button, Radio, Input, Checkbox, message, Spin, Icon, Pagination} from 'antd';
|
|
|
|
|
|
|
|
|
|
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
|
|
|
|
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
|
|
|
|
|
import { CircularProgress } from 'material-ui/Progress';
|
|
|
|
|
|
|
|
|
|
import {getImageUrl, toPath} from 'educoder'
|
|
|
|
|
|
|
|
|
|
import axios from 'axios';
|
|
|
|
@ -53,6 +43,7 @@ class Collaborators extends Component {
|
|
|
|
|
limit: 20,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
|
|
|
|
@ -73,11 +64,13 @@ class Collaborators extends Component {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updatacomponentDiddata = () => {
|
|
|
|
|
updatacomponentDiddata = (pageNumber) => {
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
|
|
|
|
|
let collaborators = `/shixuns/` + id + `/collaborators.json`;
|
|
|
|
|
axios.get(collaborators).then((response) => {
|
|
|
|
|
axios.get((collaborators),{params:{
|
|
|
|
|
page:pageNumber?pageNumber:undefined
|
|
|
|
|
}}).then((response) => {
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
|
if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) {
|
|
|
|
|
|
|
|
|
@ -179,10 +172,12 @@ class Collaborators extends Component {
|
|
|
|
|
// }
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
let url = "/shixuns/" + id + "/add_collaborators.json";
|
|
|
|
|
axios.get(url,{params:{
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
params: {
|
|
|
|
|
user_name: user_name,
|
|
|
|
|
school_name: school_name,
|
|
|
|
|
}}).then((response) => {
|
|
|
|
|
}
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) {
|
|
|
|
|
this.setState({
|
|
|
|
|
spinnings: false
|
|
|
|
@ -392,11 +387,13 @@ class Collaborators extends Component {
|
|
|
|
|
let newSearchadmin = Searchadmin
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
let url = "/shixuns/" + id + "/add_collaborators.json";
|
|
|
|
|
axios.get(url,{params:{
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
params: {
|
|
|
|
|
user_name: user_name,
|
|
|
|
|
school_name: school_name,
|
|
|
|
|
page: newpage
|
|
|
|
|
}}).then((response) => {
|
|
|
|
|
}
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) {
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
@ -420,6 +417,9 @@ class Collaborators extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
onChangepageNumber=(pageNumber)=>{
|
|
|
|
|
this.updatacomponentDiddata(pageNumber);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let {
|
|
|
|
@ -450,7 +450,7 @@ class Collaborators extends Component {
|
|
|
|
|
|
|
|
|
|
const antIcon = <Icon type="loading" style={{fontSize: 24}} spin/>;
|
|
|
|
|
|
|
|
|
|
// console.log(Searchadmin)
|
|
|
|
|
// console.log(collaboratorList)
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<style>
|
|
|
|
@ -466,11 +466,13 @@ class Collaborators extends Component {
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<div className={"edu-back-white"}>
|
|
|
|
|
<p className="sortinxdirection sortinxdirectionbox"
|
|
|
|
|
style={{display: this.props.identity < 5 ? "flex" : "none"}}
|
|
|
|
|
>
|
|
|
|
|
<div className="yslwushiwidth">
|
|
|
|
|
<p className="edu-default-btn edu-greenback-btn ml20 height28 mt25 color333hezuo">{collaboratorList&&collaboratorList.length}人</p>
|
|
|
|
|
<p
|
|
|
|
|
className="edu-default-btn edu-greenback-btn ml20 height28 mt25 color333hezuo">{collaboratorList && collaboratorList.member_count}人</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="yslwushiwidth xaxisreverseorder pt25">
|
|
|
|
@ -562,11 +564,15 @@ class Collaborators extends Component {
|
|
|
|
|
{/*/>*/}
|
|
|
|
|
<span className="mr10">姓名或手机号:</span>
|
|
|
|
|
|
|
|
|
|
<Input placeholder="请输入姓名或手机号码搜索" value={user_name} onInput={(e) => {this.setState({user_name: e.target.value})}}
|
|
|
|
|
<Input placeholder="请输入姓名或手机号码搜索" value={user_name} onInput={(e) => {
|
|
|
|
|
this.setState({user_name: e.target.value})
|
|
|
|
|
}}
|
|
|
|
|
style={{width: '215px'}}
|
|
|
|
|
></Input>
|
|
|
|
|
<span className="label ml10 " style={{minWidth: '36px'}}>单位:</span>
|
|
|
|
|
<Input placeholder="请输入单位名称" className="ml10" value={school_name} onInput={(e) => {this.setState({school_name: e.target.value})}}
|
|
|
|
|
<Input placeholder="请输入单位名称" className="ml10" value={school_name} onInput={(e) => {
|
|
|
|
|
this.setState({school_name: e.target.value})
|
|
|
|
|
}}
|
|
|
|
|
style={{width: '215px'}}
|
|
|
|
|
>
|
|
|
|
|
</Input>
|
|
|
|
@ -584,7 +590,8 @@ class Collaborators extends Component {
|
|
|
|
|
<div className="mt5" style={{background: '#f7f9fd'}}>
|
|
|
|
|
<Spin indicator={antIcon} spinning={this.state.spinnings}>
|
|
|
|
|
<div className="clearfix">
|
|
|
|
|
<ul className="upload_select_box fl" id="search_not_teachers_list" onScroll={this.contentViewScrolledit}>
|
|
|
|
|
<ul className="upload_select_box fl" id="search_not_teachers_list"
|
|
|
|
|
onScroll={this.contentViewScrolledit}>
|
|
|
|
|
{Searchadmin === undefined ? <li style={{textAlign: 'center'}}>
|
|
|
|
|
<span>请试试搜索一下</span>
|
|
|
|
|
</li> : Searchadmin.length === 0 ? <NoneData/> : Searchadmin.map((item, key) => {
|
|
|
|
@ -640,36 +647,48 @@ class Collaborators extends Component {
|
|
|
|
|
</style>
|
|
|
|
|
<div className="pl20" id="collaborators_list_info">
|
|
|
|
|
{
|
|
|
|
|
collaboratorList===undefined?"":collaboratorList.map((item,key)=>{
|
|
|
|
|
if(key<collaboratorListsum){
|
|
|
|
|
collaboratorList === undefined || collaboratorList.length === 0 ? "" : collaboratorList.members.map((item, key) => {
|
|
|
|
|
return (
|
|
|
|
|
<div className="collaborators-item clearfix sortinxdirection ysltithead" key={key}>
|
|
|
|
|
<a href={item.user.user_url} target="_blank" className="mr20 fl">
|
|
|
|
|
<img alt="用户头像" className="radius" height="80" src={getImageUrl("images/"+item.user.image_url)} width="80"/></a>
|
|
|
|
|
<a href={item.user.user_url} target="_blank" className="mr20 fl edu-position">
|
|
|
|
|
<img alt="用户头像" className="radius" height="48" src={getImageUrl("images/" + item.user.image_url)}
|
|
|
|
|
width="48"/>
|
|
|
|
|
<span className={item && item.user && item.user.shixun_manager === true ? "ml20 yslusercjz newyslusercjz" : "none "}
|
|
|
|
|
// style={{display: this.props.power === false ? "none" : "inline-block"}}
|
|
|
|
|
>
|
|
|
|
|
<p
|
|
|
|
|
className="yslusercjztest newyslusercjztest">{item.user.shixun_manager === true ? "创建者" : ""}</p></span>
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="fl collaborators-item-middles">
|
|
|
|
|
<p className="mb10 ">
|
|
|
|
|
<a href={item.user.user_url} target="_blank" className="yslusername">{item.user.name}</a>
|
|
|
|
|
|
|
|
|
|
<span className={item&&item.user&&item.user.shixun_manager === true?"ml20 yslusercjz ":"ml20"} style={{display:this.props.power===false?"none":"inline-block"}}><p className="yslusercjztest">{item.user.shixun_manager === true ? "创建者" : ""}</p></span>
|
|
|
|
|
{/*<span*/}
|
|
|
|
|
{/* className={item && item.user && item.user.shixun_manager === true ? "ml20 yslusercjz " : "ml20"}*/}
|
|
|
|
|
{/* style={{display: this.props.power === false ? "none" : "inline-block"}}><p*/}
|
|
|
|
|
{/* className="yslusercjztest">{item.user.shixun_manager === true ? "创建者" : ""}</p></span>*/}
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p className="color-grey-B2 font-12 mb10 sortinxdirection mt14">
|
|
|
|
|
<p className="hezuozhe660 sortinxdirection space-between">
|
|
|
|
|
<p className="hezuozhe630 sortinxdirection space-between">
|
|
|
|
|
{/*<p className={item.user.identity===null||item.user.identity===undefined||item.user.identity===""?" font-16 ":"mr20 font-16 w70"}>{item.user.identity}</p>*/}
|
|
|
|
|
<p className={item.user.school_name===null||item.user.school_name===""?"":"mr40 font-16 maxnamewidth150"}>{item.user.school_name}</p>
|
|
|
|
|
<p className="fabushixunwidth color888hezuo">发布实训项目 <span className="ml2">{item.user.user_shixuns_count}</span></p>
|
|
|
|
|
<p
|
|
|
|
|
className={item.user.school_name === null || item.user.school_name === "" ? "" : "mr40 font-16 maxnamewidth150 color888hezuo"}>{item.user.school_name}</p>
|
|
|
|
|
<p className="fabushixunwidth color888hezuo">发布实训项目 <span
|
|
|
|
|
className="ml2">{item.user.user_shixuns_count}</span></p>
|
|
|
|
|
</p>
|
|
|
|
|
<div className="xaxisreverseorder yslwushiwidth10">
|
|
|
|
|
{item.user.shixun_manager === true ? "" :
|
|
|
|
|
|
|
|
|
|
<i className="iconfont icon-shanchu newbianji1 color-grey-c font-16 w40"
|
|
|
|
|
style={{display: this.props.power === false ? "none" : "block"}}
|
|
|
|
|
onClick={() => this.collaborators_delete(item.user.user_id)}>
|
|
|
|
|
</i>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
{/*删除n12.17*/}
|
|
|
|
|
{/*<div className="xaxisreverseorder yslwushiwidth10">*/}
|
|
|
|
|
{/* {item.user.shixun_manager === true ? "" :*/}
|
|
|
|
|
|
|
|
|
|
{/* <i className="iconfont icon-shanchu newbianji1 color-grey-c font-16 w40"*/}
|
|
|
|
|
{/* style={{display: this.props.power === false ? "none" : "block"}}*/}
|
|
|
|
|
{/* onClick={() => this.collaborators_delete(item.user.user_id)}>*/}
|
|
|
|
|
{/* </i>*/}
|
|
|
|
|
{/* }*/}
|
|
|
|
|
{/*</div>*/}
|
|
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
{/*<p className="mb10">*/}
|
|
|
|
@ -682,9 +701,7 @@ class Collaborators extends Component {
|
|
|
|
|
</div>
|
|
|
|
|
{/*<a href="/watchers/unwatch?object_id=3039&object_type=user&shixun_id=61&target_id=3039" className="fr user_default_btn user_private_btn mt30 font-16 mr20" data-method="post" data-remote="true" rel="nofollow">取消关注</a>*/}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
<Modal
|
|
|
|
@ -706,23 +723,28 @@ class Collaborators extends Component {
|
|
|
|
|
</Modal>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
className={collaboratorList.length>10&&collaboratorListsumtype===true?"":"none"}
|
|
|
|
|
style={{textAlign:'center',borderTop:'1px solid #eee'}}>
|
|
|
|
|
<a className="loadMore" onClick={this.loadMore}>加载更多</a>
|
|
|
|
|
{/*{*/}
|
|
|
|
|
{/* mylistansum>5?*/}
|
|
|
|
|
{/* <div className="edu-txt-center mt40 mb40">*/}
|
|
|
|
|
{/* <Pagination showQuickJumper current={page}*/}
|
|
|
|
|
{/* onChange={this.paginationonChanges} pageSize={limit}*/}
|
|
|
|
|
{/* total={mylistansum}*/}
|
|
|
|
|
{/* ></Pagination>*/}
|
|
|
|
|
{/* </div>*/}
|
|
|
|
|
{/* :""*/}
|
|
|
|
|
{/*}*/}
|
|
|
|
|
{/*<div*/}
|
|
|
|
|
{/* className={collaboratorList.length > 10 && collaboratorListsumtype === true ? "" : "none"}*/}
|
|
|
|
|
{/* style={{textAlign: 'center', borderTop: '1px solid #eee'}}>*/}
|
|
|
|
|
{/* <a className="loadMore" onClick={this.loadMore}>加载更多</a>*/}
|
|
|
|
|
{/* /!*{*!/*/}
|
|
|
|
|
{/* /!* mylistansum>5?*!/*/}
|
|
|
|
|
{/* /!* <div className="edu-txt-center mt40 mb40">*!/*/}
|
|
|
|
|
{/* /!* <Pagination showQuickJumper current={page}*!/*/}
|
|
|
|
|
{/* /!* onChange={this.paginationonChanges} pageSize={limit}*!/*/}
|
|
|
|
|
{/* /!* total={mylistansum}*!/*/}
|
|
|
|
|
{/* /!* ></Pagination>*!/*/}
|
|
|
|
|
{/* /!* </div>*!/*/}
|
|
|
|
|
{/* /!* :""*!/*/}
|
|
|
|
|
{/* /!*}*!/*/}
|
|
|
|
|
|
|
|
|
|
{/*</div>*/}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{collaboratorList && collaboratorList.member_count>10?<div className={"edu-txt-center mt30 "}>
|
|
|
|
|
<Pagination showQuickJumper defaultCurrent={1} total={collaboratorList && collaboratorList.member_count} onChange={this.onChangepageNumber} />
|
|
|
|
|
</div>:""}
|
|
|
|
|
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|