mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-09 05:00:30 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
79cd8f9d33
@ -1,7 +1,8 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { Table, Select, Button, Modal, Row, Col, message, Popconfirm } from 'antd';
|
||||
import {Table, Select, Button, Modal, Row, Col, message, Popconfirm } from 'antd';
|
||||
import { Link } from 'react-router-dom'
|
||||
import './MemberList.scss';
|
||||
import { autobind } from 'core-decorators';
|
||||
import { fetchGroupMemberList, fetchGroupMsg, addMember, delMember, changeMemberRole } from '../../../reducer/modules/group.js'
|
||||
@ -181,8 +182,12 @@ class MemberList extends Component {
|
||||
key: 'username',
|
||||
render: (text, record) => {
|
||||
return (<div className="m-user">
|
||||
<Link to={`/user/profile/${record.uid}`}>
|
||||
<img src={location.protocol + '//' + location.host + '/api/user/avatar?uid=' + record.uid} className="m-user-img" />
|
||||
</Link>
|
||||
<Link to={`/user/profile/${record.uid}`}>
|
||||
<p className="m-user-name">{text}</p>
|
||||
</Link>
|
||||
</div>);
|
||||
}
|
||||
}, {
|
||||
@ -214,6 +219,18 @@ class MemberList extends Component {
|
||||
}
|
||||
}
|
||||
}];
|
||||
let userinfo = this.state.userInfo;
|
||||
let ownerinfo = [];
|
||||
let devinfo = [];
|
||||
for(let i = 0;i<userinfo.length;i++){
|
||||
if(userinfo[i].role === "owner"){
|
||||
ownerinfo.push(userinfo[i]);
|
||||
}
|
||||
if(userinfo[i].role === "dev"){
|
||||
devinfo.push(userinfo[i]);
|
||||
}
|
||||
}
|
||||
userinfo = [...ownerinfo,...devinfo];
|
||||
return (
|
||||
<div className="m-panel">
|
||||
<Modal
|
||||
@ -238,7 +255,7 @@ class MemberList extends Component {
|
||||
</Col>
|
||||
</Row>
|
||||
</Modal>
|
||||
<Table columns={columns} dataSource={this.state.userInfo} pagination={false} locale={{emptyText: <ErrMsg type="noMemberInGroup"/>}} />
|
||||
<Table columns={columns} dataSource={userinfo} pagination={false} locale={{emptyText: <ErrMsg type="noMemberInGroup"/>}} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ const TreeNode = Tree.TreeNode;
|
||||
@connect(
|
||||
|
||||
state => {
|
||||
|
||||
return {
|
||||
list: state.inter.list,
|
||||
inter: state.inter.curdata,
|
||||
@ -98,6 +97,14 @@ class InterfaceMenu extends Component {
|
||||
this.handleRequest()
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps){
|
||||
if (this.props.list !== nextProps.list) {
|
||||
this.setState({
|
||||
list: nextProps.list
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onSelect = (selectedKeys) => {
|
||||
const { history, match } = this.props;
|
||||
|
Loading…
Reference in New Issue
Block a user