Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev

This commit is contained in:
suxiaoxin 2017-09-15 21:43:49 +08:00
commit 79cd8f9d33
2 changed files with 29 additions and 5 deletions

View File

@ -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>
);
}

View File

@ -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;