mirror of
https://github.com/YMFE/yapi.git
synced 2025-04-24 15:30:44 +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 React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { connect } from 'react-redux';
|
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 './MemberList.scss';
|
||||||
import { autobind } from 'core-decorators';
|
import { autobind } from 'core-decorators';
|
||||||
import { fetchGroupMemberList, fetchGroupMsg, addMember, delMember, changeMemberRole } from '../../../reducer/modules/group.js'
|
import { fetchGroupMemberList, fetchGroupMsg, addMember, delMember, changeMemberRole } from '../../../reducer/modules/group.js'
|
||||||
@ -181,8 +182,12 @@ class MemberList extends Component {
|
|||||||
key: 'username',
|
key: 'username',
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return (<div className="m-user">
|
return (<div className="m-user">
|
||||||
<img src={location.protocol + '//' + location.host + '/api/user/avatar?uid=' + record.uid} className="m-user-img" />
|
<Link to={`/user/profile/${record.uid}`}>
|
||||||
<p className="m-user-name">{text}</p>
|
<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>);
|
</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 (
|
return (
|
||||||
<div className="m-panel">
|
<div className="m-panel">
|
||||||
<Modal
|
<Modal
|
||||||
@ -238,7 +255,7 @@ class MemberList extends Component {
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Modal>
|
</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>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@ const TreeNode = Tree.TreeNode;
|
|||||||
@connect(
|
@connect(
|
||||||
|
|
||||||
state => {
|
state => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
list: state.inter.list,
|
list: state.inter.list,
|
||||||
inter: state.inter.curdata,
|
inter: state.inter.curdata,
|
||||||
@ -98,6 +97,14 @@ class InterfaceMenu extends Component {
|
|||||||
this.handleRequest()
|
this.handleRequest()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillReceiveProps(nextProps){
|
||||||
|
if (this.props.list !== nextProps.list) {
|
||||||
|
this.setState({
|
||||||
|
list: nextProps.list
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
onSelect = (selectedKeys) => {
|
onSelect = (selectedKeys) => {
|
||||||
const { history, match } = this.props;
|
const { history, match } = this.props;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user