mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-31 14:33:44 +00:00
fix some bugs
This commit is contained in:
@@ -51,8 +51,9 @@ class DataTable extends React.Component {
|
||||
sortOrder: sorter.order,
|
||||
...filters,
|
||||
},
|
||||
}, () => {
|
||||
this.fetch()
|
||||
})
|
||||
this.fetch()
|
||||
}
|
||||
|
||||
fetch = () => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import { Breadcrumb, Icon } from 'antd'
|
||||
import { Link } from 'dva/router'
|
||||
import styles from './Bread.less'
|
||||
import { menu } from '../../utils'
|
||||
|
||||
@@ -29,16 +30,21 @@ function Bread ({ location }) {
|
||||
pathNames.push((`-${item}`).hyphenToHump())
|
||||
}
|
||||
})
|
||||
const breads = pathNames.map((item, key) => {
|
||||
if (!(item in pathSet)) {
|
||||
item = 'Dashboard'
|
||||
}
|
||||
|
||||
const breadsArray = pathNames.filter(item => (item in pathSet))
|
||||
const breads = breadsArray.map((item, key) => {
|
||||
const content = (
|
||||
<span>{pathSet[item].icon
|
||||
? <Icon type={pathSet[item].icon} style={{ marginRight: 4 }} />
|
||||
: ''}{pathSet[item].name}</span>
|
||||
)
|
||||
return (
|
||||
<Breadcrumb.Item key={key} {...((pathNames.length - 1 === key) || !pathSet[item].clickable) ? '' : { href: `#${pathSet[item].path}` }}>
|
||||
{pathSet[item].icon
|
||||
? <Icon type={pathSet[item].icon} />
|
||||
: ''}
|
||||
<span>{pathSet[item].name}</span>
|
||||
<Breadcrumb.Item key={key}>
|
||||
{((breadsArray.length - 1) !== key && pathSet[item].clickable)
|
||||
? <Link to={pathSet[item].path}>
|
||||
{content}
|
||||
</Link>
|
||||
: content}
|
||||
</Breadcrumb.Item>
|
||||
)
|
||||
})
|
||||
@@ -46,8 +52,11 @@ function Bread ({ location }) {
|
||||
return (
|
||||
<div className={styles.bread}>
|
||||
<Breadcrumb>
|
||||
<Breadcrumb.Item href="/"><Icon type="home" />
|
||||
<span>主页</span>
|
||||
<Breadcrumb.Item >
|
||||
<Link to="/dashboard">
|
||||
<Icon type="home" />
|
||||
<span>Home</span>
|
||||
</Link>
|
||||
</Breadcrumb.Item>
|
||||
{breads}
|
||||
</Breadcrumb>
|
||||
|
||||
@@ -16,7 +16,6 @@ const getMenus = function (menuArray, siderFold, parentPath = '/') {
|
||||
}
|
||||
return (
|
||||
<Menu.Item key={linkTo}>
|
||||
|
||||
<Link to={linkTo}>
|
||||
{item.icon ? <Icon type={item.icon} /> : ''}
|
||||
{siderFold && topMenus.indexOf(item.key) >= 0 ? '' : item.name}
|
||||
@@ -48,7 +47,7 @@ function Menus ({ siderFold, darkTheme, location, handleClickNavMenu, navOpenKey
|
||||
}
|
||||
changeOpenKeys(nextOpenKeys)
|
||||
}
|
||||
// 菜单栏收起时,不能操作openKeys
|
||||
|
||||
let menuProps = !siderFold ? {
|
||||
onOpenChange,
|
||||
openKeys: navOpenKeys,
|
||||
|
||||
Reference in New Issue
Block a user