|
|
|
@ -1,18 +1,8 @@
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
|
|
|
|
|
|
import { Redirect } from 'react-router';
|
|
|
|
|
import {Modal, Button, Radio, Input, Checkbox, message, Spin, Icon, Pagination} from 'antd';
|
|
|
|
|
|
|
|
|
|
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 {getImageUrl, toPath} from 'educoder'
|
|
|
|
|
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
@ -42,46 +32,49 @@ class Collaborators extends Component {
|
|
|
|
|
Collaboratorslisttype: false,
|
|
|
|
|
collaborators_deletetype: false,
|
|
|
|
|
collaborators_deletevalue: null,
|
|
|
|
|
onSearchcalue:"",
|
|
|
|
|
collaboratorListsum:10,
|
|
|
|
|
collaboratorListsumtype:true,
|
|
|
|
|
user_name:undefined,
|
|
|
|
|
school_name:undefined,
|
|
|
|
|
spinnings:false,
|
|
|
|
|
useristrue:false,
|
|
|
|
|
mylistansum:6,
|
|
|
|
|
limit:20,
|
|
|
|
|
onSearchcalue: "",
|
|
|
|
|
collaboratorListsum: 10,
|
|
|
|
|
collaboratorListsumtype: true,
|
|
|
|
|
user_name: undefined,
|
|
|
|
|
school_name: undefined,
|
|
|
|
|
spinnings: false,
|
|
|
|
|
useristrue: false,
|
|
|
|
|
mylistansum: 6,
|
|
|
|
|
limit: 20,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
let id=this.props.match.params.shixunId;
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
|
|
|
|
|
let collaborators=`/shixuns/`+id+`/collaborators.json`;
|
|
|
|
|
axios.get(collaborators).then((response)=> {
|
|
|
|
|
if(response.status===200){
|
|
|
|
|
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
|
|
|
|
|
let collaborators = `/shixuns/` + id + `/collaborators.json`;
|
|
|
|
|
axios.get(collaborators).then((response) => {
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
|
if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) {
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
collaboratorList: response.data
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error)=>{
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) {
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
collaboratorList: response.data
|
|
|
|
|
});
|
|
|
|
@ -96,14 +89,14 @@ class Collaborators extends Component {
|
|
|
|
|
if (type === "cooperation") {
|
|
|
|
|
this.setState({
|
|
|
|
|
Collaboratorsvisibleadmin: false,
|
|
|
|
|
Collaboratorslist:[],
|
|
|
|
|
Searchadmin:[]
|
|
|
|
|
Collaboratorslist: [],
|
|
|
|
|
Searchadmin: []
|
|
|
|
|
});
|
|
|
|
|
} else if (type === "admin") {
|
|
|
|
|
this.setState({
|
|
|
|
|
Collaboratorsvisible: false,
|
|
|
|
|
Collaboratorslist:[],
|
|
|
|
|
Searchadmin:[]
|
|
|
|
|
Collaboratorslist: [],
|
|
|
|
|
Searchadmin: []
|
|
|
|
|
});
|
|
|
|
|
} else if (type === "collaborators_deletetype") {
|
|
|
|
|
this.setState({
|
|
|
|
@ -116,12 +109,12 @@ class Collaborators extends Component {
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Collaboratorslist: [],
|
|
|
|
|
Searchadmin:undefined,
|
|
|
|
|
onSearchcalue:""
|
|
|
|
|
Searchadmin: undefined,
|
|
|
|
|
onSearchcalue: ""
|
|
|
|
|
})
|
|
|
|
|
let admintype = this.props.identity;
|
|
|
|
|
if (admintype>4) {
|
|
|
|
|
this.props.showSnackbar("您没有权限");
|
|
|
|
|
if (admintype > 4) {
|
|
|
|
|
this.props.showNotification("您没有权限");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (type === "cooperation") {
|
|
|
|
@ -136,9 +129,9 @@ class Collaborators extends Component {
|
|
|
|
|
// this.setState({
|
|
|
|
|
// Collaboratorsvisible: true
|
|
|
|
|
// })
|
|
|
|
|
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
|
|
|
|
|
if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) {
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
Collaboratorsvisible: true,
|
|
|
|
|
Collaboratorslist: response.data
|
|
|
|
@ -157,17 +150,17 @@ class Collaborators extends Component {
|
|
|
|
|
value: e.target.value,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
onSearchadmins=(e)=>{
|
|
|
|
|
onSearchadmins = (e) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
onSearchcalue:e.target.value
|
|
|
|
|
onSearchcalue: e.target.value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
onSearchadmin = (value) => {
|
|
|
|
|
|
|
|
|
|
let {collaboratorList,user_name,school_name} = this.state;
|
|
|
|
|
let {collaboratorList, user_name, school_name} = this.state;
|
|
|
|
|
this.setState({
|
|
|
|
|
// Searchadmin: undefined,
|
|
|
|
|
spinnings:true,
|
|
|
|
|
spinnings: true,
|
|
|
|
|
})
|
|
|
|
|
// if (value === "") {
|
|
|
|
|
// this.setState({
|
|
|
|
@ -179,15 +172,17 @@ class Collaborators extends Component {
|
|
|
|
|
// }
|
|
|
|
|
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,
|
|
|
|
|
}}).then((response) => {
|
|
|
|
|
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
params: {
|
|
|
|
|
user_name: user_name,
|
|
|
|
|
school_name: school_name,
|
|
|
|
|
}
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) {
|
|
|
|
|
this.setState({
|
|
|
|
|
spinnings:false
|
|
|
|
|
spinnings: false
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
let newlist = response.data.users;
|
|
|
|
|
for (var i = 0; i < newlist.length; i++) {
|
|
|
|
|
newlist[i].checked = false
|
|
|
|
@ -195,7 +190,7 @@ class Collaborators extends Component {
|
|
|
|
|
this.setState({
|
|
|
|
|
Searchadmin: newlist,
|
|
|
|
|
collaboratorList: collaboratorList,
|
|
|
|
|
spinnings:false
|
|
|
|
|
spinnings: false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -226,16 +221,16 @@ class Collaborators extends Component {
|
|
|
|
|
alltype = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(newlist.length===0){
|
|
|
|
|
if (newlist.length === 0) {
|
|
|
|
|
this.setState({
|
|
|
|
|
Searchadmin: newlist,
|
|
|
|
|
allChangechecked: alltype,
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
Searchadmin: newlist,
|
|
|
|
|
allChangechecked: alltype,
|
|
|
|
|
useristrue:false
|
|
|
|
|
useristrue: false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -256,7 +251,7 @@ class Collaborators extends Component {
|
|
|
|
|
submit_add_collaborators_form = () => {
|
|
|
|
|
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
let {Searchadmin,collaboratorList} = this.state;
|
|
|
|
|
let {Searchadmin, collaboratorList} = this.state;
|
|
|
|
|
let newlist = Searchadmin;
|
|
|
|
|
let user_ids = []
|
|
|
|
|
if (newlist.length === 0) {
|
|
|
|
@ -271,9 +266,9 @@ class Collaborators extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(var i=0; i<user_ids.length;i++){
|
|
|
|
|
for(var j=0; j<collaboratorList.length;j++){
|
|
|
|
|
if(user_ids[i]===collaboratorList[j].user.user_id){
|
|
|
|
|
for (var i = 0; i < user_ids.length; i++) {
|
|
|
|
|
for (var j = 0; j < collaboratorList.length; j++) {
|
|
|
|
|
if (user_ids[i] === collaboratorList[j].user.user_id) {
|
|
|
|
|
message.error("添加失败,重复添加!");
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
@ -281,9 +276,9 @@ class Collaborators extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(user_ids.length===0){
|
|
|
|
|
if (user_ids.length === 0) {
|
|
|
|
|
this.setState({
|
|
|
|
|
useristrue:true
|
|
|
|
|
useristrue: true
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -292,11 +287,11 @@ class Collaborators extends Component {
|
|
|
|
|
user_ids: user_ids
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
this.updatacomponentDiddata();
|
|
|
|
|
this.props.showSnackbar(response.data.message);
|
|
|
|
|
this.props.showNotification(response.data.message);
|
|
|
|
|
this.setState({
|
|
|
|
|
Collaboratorsvisibleadmin: false,
|
|
|
|
|
Collaboratorslist:[],
|
|
|
|
|
Searchadmin:[]
|
|
|
|
|
Collaboratorslist: [],
|
|
|
|
|
Searchadmin: []
|
|
|
|
|
})
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
@ -315,13 +310,13 @@ class Collaborators extends Component {
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
|
|
|
|
|
let url = "/shixuns/" + id + "/change_manager.json";
|
|
|
|
|
if(addadminrediovalue===undefined){
|
|
|
|
|
if (addadminrediovalue === undefined) {
|
|
|
|
|
this.setState({
|
|
|
|
|
Collaboratorsvisible: false,
|
|
|
|
|
Collaboratorslist:[],
|
|
|
|
|
Searchadmin:[]
|
|
|
|
|
Collaboratorslist: [],
|
|
|
|
|
Searchadmin: []
|
|
|
|
|
});
|
|
|
|
|
this.props.showSnackbar("所选人员为空,没有更换成功");
|
|
|
|
|
this.props.showNotification("所选人员为空,没有更换成功");
|
|
|
|
|
this.CollaboratorsshowModal("admin")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -332,11 +327,11 @@ class Collaborators extends Component {
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
Collaboratorsvisible: false,
|
|
|
|
|
Collaboratorslist:[],
|
|
|
|
|
Searchadmin:[]
|
|
|
|
|
Collaboratorslist: [],
|
|
|
|
|
Searchadmin: []
|
|
|
|
|
});
|
|
|
|
|
this.updatacomponentDiddata();
|
|
|
|
|
this.props.showSnackbar(response.data.message);
|
|
|
|
|
this.props.showNotification(response.data.message);
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
@ -361,7 +356,7 @@ class Collaborators extends Component {
|
|
|
|
|
this.props.history.push('/shixuns')
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.props.showSnackbar(response.data.message);
|
|
|
|
|
this.props.showNotification(response.data.message);
|
|
|
|
|
this.updatacomponentDiddata();
|
|
|
|
|
this.setState({
|
|
|
|
|
collaborators_deletetype: false
|
|
|
|
@ -371,35 +366,37 @@ class Collaborators extends Component {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
loadMore=()=>{
|
|
|
|
|
let {collaboratorList}=this.state;
|
|
|
|
|
loadMore = () => {
|
|
|
|
|
let {collaboratorList} = this.state;
|
|
|
|
|
this.setState({
|
|
|
|
|
collaboratorListsum:collaboratorList.length,
|
|
|
|
|
collaboratorListsumtype:false
|
|
|
|
|
collaboratorListsum: collaboratorList.length,
|
|
|
|
|
collaboratorListsumtype: false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contentViewScrolledit=(e)=>{
|
|
|
|
|
contentViewScrolledit = (e) => {
|
|
|
|
|
|
|
|
|
|
//滑动到底判断
|
|
|
|
|
let newscrollTop=parseInt(e.currentTarget.scrollTop);
|
|
|
|
|
let allclientHeight=e.currentTarget.clientHeight+newscrollTop;
|
|
|
|
|
let newscrollTop = parseInt(e.currentTarget.scrollTop);
|
|
|
|
|
let allclientHeight = e.currentTarget.clientHeight + newscrollTop;
|
|
|
|
|
|
|
|
|
|
if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){
|
|
|
|
|
let {page,collaboratorList,user_name,school_name,Searchadmin} = this.state;
|
|
|
|
|
let newpage=page+1;
|
|
|
|
|
let newSearchadmin=Searchadmin
|
|
|
|
|
if (e.currentTarget.scrollHeight - allclientHeight === 0 || e.currentTarget.scrollHeight - allclientHeight === 1 || e.currentTarget.scrollHeight - allclientHeight === -1) {
|
|
|
|
|
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) {
|
|
|
|
|
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{
|
|
|
|
|
} else {
|
|
|
|
|
let newlist = response.data.users;
|
|
|
|
|
for (var i = 0; i < newlist.length; i++) {
|
|
|
|
|
newlist[i].checked = false
|
|
|
|
@ -409,7 +406,7 @@ class Collaborators extends Component {
|
|
|
|
|
this.setState({
|
|
|
|
|
Searchadmin: newSearchadmin,
|
|
|
|
|
collaboratorList: collaboratorList,
|
|
|
|
|
page:newpage
|
|
|
|
|
page: newpage
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -420,7 +417,15 @@ class Collaborators extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onChangepageNumber=(pageNumber)=>{
|
|
|
|
|
this.updatacomponentDiddata(pageNumber);
|
|
|
|
|
}
|
|
|
|
|
toggleHover=(type,key)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
hovertype:type,
|
|
|
|
|
hoverkey:type===false?undefined:key
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
let {
|
|
|
|
|
collaboratorList,
|
|
|
|
@ -448,34 +453,59 @@ class Collaborators extends Component {
|
|
|
|
|
lineHeight: '30px',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
|
|
|
|
|
const antIcon = <Icon type="loading" style={{fontSize: 24}} spin/>;
|
|
|
|
|
|
|
|
|
|
console.log(Searchadmin)
|
|
|
|
|
// console.log(collaboratorList)
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<p className=" mt30 sortinxdirection"
|
|
|
|
|
style={{display:this.props.identity<5?"flex":"none"}}
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.sortinxdirectionbox{
|
|
|
|
|
height: 76px;
|
|
|
|
|
border-bottom: 1px solid #F4F4F4;
|
|
|
|
|
}
|
|
|
|
|
.pt25{
|
|
|
|
|
padding-top:25px;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</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 yslwushiwidthcolortest">共{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">
|
|
|
|
|
<a onClick={() => this.showCollaboratorsvisible("cooperation")}
|
|
|
|
|
className="edu-default-btn edu-greenback-btn mr20 height40 yslwushiwidthbuton"
|
|
|
|
|
data-remote="true">
|
|
|
|
|
<span className={"line27"}>+ </span>添加合作者
|
|
|
|
|
</a>
|
|
|
|
|
<a onClick={() => this.showCollaboratorsvisible("admin")}
|
|
|
|
|
style={{display:this.props.identity===1?"flex":"none"}}
|
|
|
|
|
data-remote="true"
|
|
|
|
|
className="edu-default-btn edu-greenback-btn mr20 height40 yslwushiwidthbuton">
|
|
|
|
|
<p style={{
|
|
|
|
|
textAlign: "center",
|
|
|
|
|
width:'100%',
|
|
|
|
|
lineHeight: "29px",
|
|
|
|
|
}}>更换管理员</p>
|
|
|
|
|
</a>
|
|
|
|
|
<div className="yslwushiwidth xaxisreverseorder pt25">
|
|
|
|
|
{/*<a onClick={() => this.showCollaboratorsvisible("cooperation")}*/}
|
|
|
|
|
{/* className="edu-default-btn edu-greenback-btn mr20 height40 yslwushiwidthbuton"*/}
|
|
|
|
|
{/* data-remote="true">*/}
|
|
|
|
|
{/* <span className={"line27"}>+ </span>添加合作者*/}
|
|
|
|
|
{/*</a>*/}
|
|
|
|
|
{/*<a onClick={() => this.showCollaboratorsvisible("admin")}*/}
|
|
|
|
|
{/* style={{display:this.props.identity===1?"flex":"none"}}*/}
|
|
|
|
|
{/* data-remote="true"*/}
|
|
|
|
|
{/* className="edu-default-btn edu-greenback-btn mr20 height40 yslwushiwidthbuton">*/}
|
|
|
|
|
{/* <p style={{*/}
|
|
|
|
|
{/* textAlign: "center",*/}
|
|
|
|
|
{/* width:'100%',*/}
|
|
|
|
|
{/* lineHeight: "29px",*/}
|
|
|
|
|
{/* }}>更换管理员</p>*/}
|
|
|
|
|
{/*</a>*/}
|
|
|
|
|
<Button type="primary"
|
|
|
|
|
onClick={() => this.showCollaboratorsvisible("cooperation")}
|
|
|
|
|
className="edu-default-btn edu-greenback-btn mr20 heighthezuo34 yslwushiwidthbuton"
|
|
|
|
|
>添加合作者</Button>
|
|
|
|
|
<Button type="primary" ghost
|
|
|
|
|
style={{display: this.props.identity === 1 ? "flex" : "none"}}
|
|
|
|
|
onClick={() => this.showCollaboratorsvisible("admin")}
|
|
|
|
|
className="edu-default-btn mr20 heighthezuo34">
|
|
|
|
|
更换管理员
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -522,7 +552,7 @@ class Collaborators extends Component {
|
|
|
|
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
{Collaboratorsvisibleadmin===true?<Modal
|
|
|
|
|
{Collaboratorsvisibleadmin === true ? <Modal
|
|
|
|
|
keyboard={false}
|
|
|
|
|
title="添加合作者"
|
|
|
|
|
visible={Collaboratorsvisibleadmin}
|
|
|
|
@ -539,17 +569,21 @@ class Collaborators extends Component {
|
|
|
|
|
{/*/>*/}
|
|
|
|
|
<span className="mr10">姓名或手机号:</span>
|
|
|
|
|
|
|
|
|
|
<Input placeholder="请输入姓名或手机号码搜索" value={user_name} onInput={(e) => {this.setState({user_name: e.target.value})}}
|
|
|
|
|
style={{ width: '215px'}}
|
|
|
|
|
<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})}}
|
|
|
|
|
style={{ width: '215px'}}
|
|
|
|
|
<span className="label ml10 " style={{minWidth: '36px'}}>单位:</span>
|
|
|
|
|
<Input placeholder="请输入单位名称" className="ml10" value={school_name} onInput={(e) => {
|
|
|
|
|
this.setState({school_name: e.target.value})
|
|
|
|
|
}}
|
|
|
|
|
style={{width: '215px'}}
|
|
|
|
|
>
|
|
|
|
|
</Input>
|
|
|
|
|
|
|
|
|
|
<a className="task-btn task-btn-orange ml20" onClick={() => this.onSearchadmin()}
|
|
|
|
|
style={{ height: '30px', lineHeight: '30px', width: '70px'}}
|
|
|
|
|
style={{height: '30px', lineHeight: '30px', width: '70px'}}
|
|
|
|
|
>搜索</a>
|
|
|
|
|
<p className="clearfix pl35 mt20">
|
|
|
|
|
<span className="fl edu-txt-w100 task-hide font-bd ml10 edu-txt-left">姓名</span>
|
|
|
|
@ -561,10 +595,11 @@ 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) => {
|
|
|
|
|
</li> : Searchadmin.length === 0 ? <NoneData/> : Searchadmin.map((item, key) => {
|
|
|
|
|
return (
|
|
|
|
|
<li key={key} style={{display: item.identify === "专业人士" ? "none" : "block"}}>
|
|
|
|
|
<Checkbox className="fl mr20" checked={item.checked}
|
|
|
|
@ -575,7 +610,7 @@ class Collaborators extends Component {
|
|
|
|
|
<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>
|
|
|
|
|
className="span3 color-grey fl edu-txt-w260 task-hide ml50 task-hide">{item.school_name}</span>
|
|
|
|
|
</li>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
@ -597,14 +632,14 @@ class Collaborators extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
{useristrue===true?<span className={"color-red"}>请先选择用户</span>:""}
|
|
|
|
|
{useristrue === true ? <span className={"color-red"}>请先选择用户</span> : ""}
|
|
|
|
|
<div className="clearfix edu-txt-center mt20">
|
|
|
|
|
<a className="pop_close task-btn mb10 mr40 colorFFF"
|
|
|
|
|
onClick={() => this.CollaboratorsshowModal("cooperation")}>取消</a>
|
|
|
|
|
<a className="task-btn task-btn-orange"
|
|
|
|
|
onClick={() => this.submit_add_collaborators_form()}>确定</a>
|
|
|
|
|
</div>
|
|
|
|
|
</Modal>:""}
|
|
|
|
|
</Modal> : ""}
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
@ -617,36 +652,53 @@ class Collaborators extends Component {
|
|
|
|
|
</style>
|
|
|
|
|
<div className="pl20" id="collaborators_list_info">
|
|
|
|
|
{
|
|
|
|
|
collaboratorList===undefined?"":collaboratorList.map((item,key)=>{
|
|
|
|
|
if(key<collaboratorListsum){
|
|
|
|
|
return(
|
|
|
|
|
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&&this.props.power === 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 ">
|
|
|
|
|
<p className="mb10 sortinxdirection space-between hezuozhe634">
|
|
|
|
|
<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>
|
|
|
|
|
{item.user.shixun_manager === true ? "" : <span>
|
|
|
|
|
<i className={this.state.hovertype===true&&key===this.state.hoverkey?"fontnewreds iconfont icon-shanchu_Hover":"fontneweees iconfont icon-shanchu_moren"}
|
|
|
|
|
style={{display: this.props.power === false ? "none" : "block"}}
|
|
|
|
|
onClick={() => this.collaborators_delete(item.user.user_id)}
|
|
|
|
|
onMouseEnter={()=>this.toggleHover(true,key)}
|
|
|
|
|
onMouseLeave={()=>this.toggleHover(false,key)}
|
|
|
|
|
></i></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="yslwushiwidth90 sortinxdirection">
|
|
|
|
|
<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">发布实训项目 <span className="fabushixunwidthcolor ml2">{item.user.user_shixuns_count}</span></p>
|
|
|
|
|
<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 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 ? "" :
|
|
|
|
|
{/*删除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>
|
|
|
|
|
{/* <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">*/}
|
|
|
|
@ -659,9 +711,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
|
|
|
|
@ -683,23 +733,29 @@ 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>
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|