|
|
|
@ -43,7 +43,6 @@ class Collaborator extends Component{
|
|
|
|
|
// 获取项目协作者
|
|
|
|
|
getMember=(project_id)=>{
|
|
|
|
|
const { page } = this.state;
|
|
|
|
|
|
|
|
|
|
const url = `/projects/${project_id}/members.json`;
|
|
|
|
|
axios.get(url,{
|
|
|
|
|
params:{
|
|
|
|
@ -97,6 +96,9 @@ class Collaborator extends Component{
|
|
|
|
|
user_id
|
|
|
|
|
}).then(result=>{
|
|
|
|
|
if(result){
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:true
|
|
|
|
|
})
|
|
|
|
|
this.getMember(project_id);
|
|
|
|
|
}
|
|
|
|
|
}).catch(error=>{
|
|
|
|
@ -116,16 +118,40 @@ class Collaborator extends Component{
|
|
|
|
|
role:e.key
|
|
|
|
|
}).then(result=>{
|
|
|
|
|
if(result){
|
|
|
|
|
this.props.showNotification('权限修改成功!');
|
|
|
|
|
this.getMember(project_id);
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:false
|
|
|
|
|
isSpin:true
|
|
|
|
|
})
|
|
|
|
|
this.props.showNotification('权限修改成功!');
|
|
|
|
|
this.getMember(project_id);
|
|
|
|
|
}
|
|
|
|
|
}).catch(error=>{
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除协作者
|
|
|
|
|
deleteUser=(id)=>{
|
|
|
|
|
this.props.confirm({
|
|
|
|
|
content:"确认删除此成员?",
|
|
|
|
|
onOk:()=>{
|
|
|
|
|
const { project_id } = this.props;
|
|
|
|
|
const url = `/projects/${project_id}/members/remove.json`;
|
|
|
|
|
axios.delete(url,{
|
|
|
|
|
user_id:id
|
|
|
|
|
}).then(result=>{
|
|
|
|
|
if(result){
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:true
|
|
|
|
|
})
|
|
|
|
|
this.props.showNotification("成员删除成功!");
|
|
|
|
|
this.getMember(project_id);
|
|
|
|
|
}
|
|
|
|
|
}).catch(error=>{
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
render(){
|
|
|
|
|
const { user , userDataSource , listData , isSpin } = this.state;
|
|
|
|
|
|
|
|
|
@ -166,7 +192,7 @@ class Collaborator extends Component{
|
|
|
|
|
</Dropdown>
|
|
|
|
|
</span>
|
|
|
|
|
<span style={{justifyContent:"center"}}>
|
|
|
|
|
<a className="red_btn">删除</a>
|
|
|
|
|
<a className="red_btn" onClick={()=>this.deleteUser(item.id)}>删除</a>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|