diff --git a/src/forge/Settings/Collaborator.js b/src/forge/Settings/Collaborator.js index da0ae8b00..f3f4cb0a9 100644 --- a/src/forge/Settings/Collaborator.js +++ b/src/forge/Settings/Collaborator.js @@ -2,6 +2,7 @@ import React , { Component } from 'react'; import { Link } from 'react-router-dom'; import { Input , AutoComplete , Dropdown , Menu , Icon , Spin , Pagination } from 'antd'; import axios from 'axios'; +import { getImageUrl } from 'educoder'; const { Option } = AutoComplete; const MENU_LIST = [{ @@ -25,7 +26,8 @@ class Collaborator extends Component{ userDataSource:undefined, page:1, total_count:undefined, - isSpin:true + isSpin:true, + searchKey: undefined } } @@ -64,14 +66,18 @@ class Collaborator extends Component{ } // 输入用户 changeInputUser=(e)=>{ + this.setState({ + searchKey: e + }) this.getUserList(e); } // 选择用户 selectInputUser=(e,option)=>{ this.setState({ - user_id:e + user_id:e, + searchKey: option.props.searchValue }) - this.getUserList(option.props.children); + this.getUserList(option.props.searchValue); } getUserList=(e)=>{ const url = `/users/list.json`; @@ -165,7 +171,7 @@ class Collaborator extends Component{ this.getMember(project_id,page); } render(){ - const { userDataSource , listData , isSpin , page , total_count } = this.state; + const { userDataSource , listData , isSpin , page , total_count,searchKey } = this.state; // 获取当前项目的拥有者 const { author } = this.props; const menu =(id)=> ( @@ -182,7 +188,13 @@ class Collaborator extends Component{ const source = userDataSource && userDataSource.map((item,key)=>{ return( - + ) }) return( @@ -194,10 +206,11 @@ class Collaborator extends Component{
@@ -208,7 +221,16 @@ class Collaborator extends Component{ const operation = MENU_LIST.filter(i=>i.id === item.role); return(