mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-15 05:10:47 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
2d85dfd5cb
@ -25,7 +25,7 @@ export default class BreadcrumbNavigation extends Component {
|
|||||||
console.log(this.props.breadcrumb);
|
console.log(this.props.breadcrumb);
|
||||||
const getItem = this.props.breadcrumb.map((item, index) => {
|
const getItem = this.props.breadcrumb.map((item, index) => {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
if (item.fref) {
|
if (item.href) {
|
||||||
return (<Breadcrumb.Item key={index}><Link to={item.href}>{item.name}</Link></Breadcrumb.Item>);
|
return (<Breadcrumb.Item key={index}><Link to={item.href}>{item.name}</Link></Breadcrumb.Item>);
|
||||||
} else {
|
} else {
|
||||||
return (<Breadcrumb.Item key={index}>{item.name}</Breadcrumb.Item>);
|
return (<Breadcrumb.Item key={index}>{item.name}</Breadcrumb.Item>);
|
||||||
|
@ -7,6 +7,12 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
padding-left: 40px;
|
padding-left: 40px;
|
||||||
}
|
}
|
||||||
|
.ant-breadcrumb a {
|
||||||
|
color: #fff;
|
||||||
|
&:hover {
|
||||||
|
color: $color-blue
|
||||||
|
}
|
||||||
|
}
|
||||||
.ant-breadcrumb > span:last-child {
|
.ant-breadcrumb > span:last-child {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
$imgUrl: "../../../static/image/";
|
$imgUrl: "../../../static/image/";
|
||||||
$color-grey: #E5E5E5;
|
$color-grey: #E5E5E5;
|
||||||
$color-blue : #108ee9;
|
$color-blue: #2395f1;
|
||||||
$color-white: #fff;
|
$color-white: #fff;
|
||||||
|
|
||||||
.intro-container{
|
.intro-container{
|
||||||
|
@ -82,7 +82,7 @@ export default class InterfaceColContent extends Component {
|
|||||||
render: (path, record) => {
|
render: (path, record) => {
|
||||||
return (
|
return (
|
||||||
<Tooltip title="跳转到对应接口">
|
<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>
|
</Tooltip>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,9 @@ import React, { Component } from 'react'
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { Route, Switch, Redirect, matchPath } from 'react-router-dom';
|
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 { getProject } from '../../reducer/modules/project';
|
||||||
import Interface from './Interface/Interface.js'
|
import Interface from './Interface/Interface.js'
|
||||||
import Activity from './Activity/Activity.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,
|
match: PropTypes.object,
|
||||||
curProject: PropTypes.object,
|
curProject: PropTypes.object,
|
||||||
getProject: PropTypes.func,
|
getProject: PropTypes.func,
|
||||||
location: PropTypes.object
|
location: PropTypes.object,
|
||||||
|
fetchGroupMsg: PropTypes.func,
|
||||||
|
setBreadcrumb: PropTypes.func
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
async componentWillMount() {
|
||||||
this.props.getProject(this.props.match.params.id)
|
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() {
|
render() {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
$color-white: #fff;
|
$color-white: #fff;
|
||||||
$color-bg-gray: #ececec;
|
$color-bg-gray: #ececec;
|
||||||
$color-blue : #108ee9;
|
$color-blue: #2395f1;
|
||||||
$color-blue-deeper: #34495E;
|
$color-blue-deeper: #34495E;
|
||||||
$color-grey-deep: #929aac;
|
$color-grey-deep: #929aac;
|
||||||
$color-black-light: #404040;
|
$color-black-light: #404040;
|
||||||
|
Loading…
Reference in New Issue
Block a user