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

This commit is contained in:
sean 2017-08-28 19:50:11 +08:00
commit 2d85dfd5cb
6 changed files with 33 additions and 14 deletions

View File

@ -25,7 +25,7 @@ export default class BreadcrumbNavigation extends Component {
console.log(this.props.breadcrumb);
const getItem = this.props.breadcrumb.map((item, index) => {
console.log(item);
if (item.fref) {
if (item.href) {
return (<Breadcrumb.Item key={index}><Link to={item.href}>{item.name}</Link></Breadcrumb.Item>);
} else {
return (<Breadcrumb.Item key={index}>{item.name}</Breadcrumb.Item>);

View File

@ -7,6 +7,12 @@
color: #fff;
padding-left: 40px;
}
.ant-breadcrumb a {
color: #fff;
&:hover {
color: $color-blue
}
}
.ant-breadcrumb > span:last-child {
color: #fff;
font-weight: normal;

View File

@ -1,6 +1,6 @@
$imgUrl: "../../../static/image/";
$color-grey: #E5E5E5;
$color-blue : #108ee9;
$color-blue: #2395f1;
$color-white: #fff;
.intro-container{

View File

@ -82,7 +82,7 @@ export default class InterfaceColContent extends Component {
render: (path, record) => {
return (
<Tooltip title="跳转到对应接口">
<a href={`/project/2909/interface/api/${record.interface_id}`}>{path || 'fdsf'}</a>
<a href={`/project/${record.project_id}/interface/api/${record.interface_id}`}>{path || 'fdsf'}</a>
</Tooltip>
)
}

View File

@ -2,7 +2,9 @@ import React, { Component } from 'react'
import { connect } from 'react-redux';
import PropTypes from 'prop-types'
import { Route, Switch, Redirect, matchPath } from 'react-router-dom';
import { Subnav } from '../../components/index'
import { Subnav } from '../../components/index';
import { fetchGroupMsg } from '../../reducer/modules/group';
import { setBreadcrumb } from '../../reducer/modules/user';
import { getProject } from '../../reducer/modules/project';
import Interface from './Interface/Interface.js'
import Activity from './Activity/Activity.js'
@ -16,7 +18,9 @@ import Setting from './Setting/Setting.js'
}
},
{
getProject
getProject,
fetchGroupMsg,
setBreadcrumb
}
)
@ -26,15 +30,24 @@ export default class Project extends Component {
match: PropTypes.object,
curProject: PropTypes.object,
getProject: PropTypes.func,
location: PropTypes.object
location: PropTypes.object,
fetchGroupMsg: PropTypes.func,
setBreadcrumb: PropTypes.func
}
constructor(props) {
super(props)
}
componentWillMount() {
this.props.getProject(this.props.match.params.id)
async componentWillMount() {
await this.props.getProject(this.props.match.params.id);
const groupMsg = await this.props.fetchGroupMsg(this.props.curProject.group_id);
this.props.setBreadcrumb([{
name: groupMsg.payload.data.data.group_name,
href: '/group/'+groupMsg.payload.data.data._id
}, {
name: this.props.curProject.name
}]);
}
render() {

View File

@ -1,6 +1,6 @@
$color-white: #fff;
$color-bg-gray: #ececec;
$color-blue : #108ee9;
$color-blue: #2395f1;
$color-blue-deeper: #34495E;
$color-grey-deep: #929aac;
$color-black-light: #404040;