Commit cc5c8155 authored by 拷钉's avatar 拷钉 Committed by 陈帅

hiddenBreadcrumb && menu.disableLocal (#4009)

* menu.disableLocal

* hiddenBreadcrumb

* lint

* lint
parent edd2962e
import React from 'react'; import React from 'react';
// eslint-disable-next-line import/no-cycle
import PromiseRender from './PromiseRender'; import PromiseRender from './PromiseRender';
import { CURRENT } from './renderAuthorize'; import { CURRENT } from './renderAuthorize';
......
import { Spin } from 'antd'; import { Spin } from 'antd';
import isEqual from 'lodash/isEqual'; import isEqual from 'lodash/isEqual';
import React from 'react'; import React from 'react';
// eslint-disable-next-line import/no-cycle
import { isComponentClass } from './Secured'; import { isComponentClass } from './Secured';
export default class PromiseRender extends React.Component { export default class PromiseRender extends React.Component {
......
import React from 'react'; import React from 'react';
import Exception from '../Exception'; import Exception from '../Exception';
// eslint-disable-next-line import/no-cycle
import CheckPermissions from './CheckPermissions'; import CheckPermissions from './CheckPermissions';
/** /**
......
...@@ -3,6 +3,7 @@ import pathToRegexp from 'path-to-regexp'; ...@@ -3,6 +3,7 @@ import pathToRegexp from 'path-to-regexp';
import Link from 'umi/link'; import Link from 'umi/link';
import { formatMessage } from 'umi-plugin-react/locale'; import { formatMessage } from 'umi-plugin-react/locale';
import { urlToList } from '../_utils/pathTools'; import { urlToList } from '../_utils/pathTools';
import { menu } from '../../defaultSettings';
// 渲染Breadcrumb 子节点 // 渲染Breadcrumb 子节点
// Render the Breadcrumb child node // Render the Breadcrumb child node
...@@ -21,7 +22,10 @@ const itemRender = (route, params, routes, paths) => { ...@@ -21,7 +22,10 @@ const itemRender = (route, params, routes, paths) => {
const renderItemLocal = item => { const renderItemLocal = item => {
if (item.locale) { if (item.locale) {
return formatMessage({ id: item.locale, defaultMessage: item.name }); const name = menu.disableLocal
? item.name
: formatMessage({ id: item.locale, defaultMessage: item.name });
return name;
} }
return item.name; return item.name;
}; };
......
...@@ -44,6 +44,7 @@ const PageHeaderWrapper = ({ ...@@ -44,6 +44,7 @@ const PageHeaderWrapper = ({
content, content,
logo, logo,
extraContent, extraContent,
hiddenBreadcrumb,
...restProps ...restProps
}) => { }) => {
return ( return (
...@@ -66,11 +67,14 @@ const PageHeaderWrapper = ({ ...@@ -66,11 +67,14 @@ const PageHeaderWrapper = ({
} }
key="pageheader" key="pageheader"
{...restProps} {...restProps}
breadcrumb={conversionBreadcrumbList({ breadcrumb={
!hiddenBreadcrumb &&
conversionBreadcrumbList({
...value, ...value,
...restProps, ...restProps,
home: <FormattedMessage id="menu.home" defaultMessage="Home" />, home: <FormattedMessage id="menu.home" defaultMessage="Home" />,
})} })
}
className={styles.pageHeader} className={styles.pageHeader}
linkElement={Link} linkElement={Link}
footer={renderFooter(restProps)} footer={renderFooter(restProps)}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment