Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
8045b844
Commit
8045b844
authored
Apr 09, 2019
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix types error
parent
56a5bcf5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
77 additions
and
84 deletions
+77
-84
src/components/GlobalFooter/index.less
src/components/GlobalFooter/index.less
+29
-0
src/components/GlobalFooter/index.tsx
src/components/GlobalFooter/index.tsx
+40
-0
src/components/HeaderSearch/demo/basic.md
src/components/HeaderSearch/demo/basic.md
+0
-34
src/components/HeaderSearch/index.en-US.md
src/components/HeaderSearch/index.en-US.md
+0
-22
src/components/HeaderSearch/index.zh-CN.md
src/components/HeaderSearch/index.zh-CN.md
+0
-22
src/layouts/UserLayout.tsx
src/layouts/UserLayout.tsx
+3
-3
src/models/global.ts
src/models/global.ts
+3
-1
src/models/menu.ts
src/models/menu.ts
+2
-2
No files found.
src/components/GlobalFooter/index.less
0 → 100644
View file @
8045b844
@import '~antd/lib/style/themes/default.less';
.globalFooter {
margin: 48px 0 24px 0;
padding: 0 16px;
text-align: center;
.links {
margin-bottom: 8px;
a {
color: @text-color-secondary;
transition: all 0.3s;
&:not(:last-child) {
margin-right: 40px;
}
&:hover {
color: @text-color;
}
}
}
.copyright {
color: @text-color-secondary;
font-size: @font-size-base;
}
}
src/components/GlobalFooter/index.tsx
0 → 100644
View file @
8045b844
import
React
from
'
react
'
;
import
classNames
from
'
classnames
'
;
import
styles
from
'
./index.less
'
;
export
interface
GlobalFooterProps
{
links
?:
Array
<
{
key
?:
string
;
title
:
React
.
ReactNode
;
href
:
string
;
blankTarget
?:
boolean
;
}
>
;
copyright
?:
React
.
ReactNode
;
style
?:
React
.
CSSProperties
;
className
?:
string
;
}
const
GlobalFooter
:
React
.
SFC
<
GlobalFooterProps
>
=
({
className
,
links
,
copyright
})
=>
{
const
clsString
=
classNames
(
styles
.
globalFooter
,
className
);
return
(
<
footer
className
=
{
clsString
}
>
{
links
&&
(
<
div
className
=
{
styles
.
links
}
>
{
links
.
map
(
link
=>
(
<
a
key
=
{
link
.
key
}
title
=
{
link
.
key
}
target
=
{
link
.
blankTarget
?
'
_blank
'
:
'
_self
'
}
href
=
{
link
.
href
}
>
{
link
.
title
}
</
a
>
))
}
</
div
>
)
}
{
copyright
&&
<
div
className
=
{
styles
.
copyright
}
>
{
copyright
}
</
div
>
}
</
footer
>
);
};
export
default
GlobalFooter
;
src/components/HeaderSearch/demo/basic.md
deleted
100644 → 0
View file @
56a5bcf5
---
order
:
0
title
:
全局搜索
---
通常放置在导航工具条右侧。(点击搜索图标预览效果)
````
jsx
import
HeaderSearch
from
'
ant-design-pro/lib/HeaderSearch
'
;
ReactDOM
.
render
(
<
div
style
=
{
{
textAlign
:
'
right
'
,
height
:
'
64px
'
,
lineHeight
:
'
64px
'
,
boxShadow
:
'
0 1px 4px rgba(0,21,41,.12)
'
,
padding
:
'
0 32px
'
,
width
:
'
400px
'
,
}
}
>
<
HeaderSearch
placeholder
=
"站内搜索"
dataSource
=
{
[
'
搜索提示一
'
,
'
搜索提示二
'
,
'
搜索提示三
'
]
}
onSearch
=
{
(
value
)
=>
{
console
.
log
(
'
input
'
,
value
);
// eslint-disable-line
}
}
onPressEnter
=
{
(
value
)
=>
{
console
.
log
(
'
enter
'
,
value
);
// eslint-disable-line
}
}
/>
</
div
>
,
mountNode
);
````
src/components/HeaderSearch/index.en-US.md
deleted
100644 → 0
View file @
56a5bcf5
---
title
:
HeaderSearch
subtitle
:
cols
:
1
order
:
8
---
Usually placed as an entry to the global search, placed on the right side of the navigation toolbar.
## API
参数 | 说明 | 类型 | 默认值
----|------|-----|------
placeholder | placeholder text | string | -
dataSource | current list of prompts | string[] | -
onSearch | Called when searching items. | function(value) | -
onChange | Called when select an option or input value change, or value of input is changed | function(value) | -
onSelect | Called when a option is selected. param is option's value and option instance. | function(value) | -
onPressEnter | Callback when pressing Enter | function(value) | -
onVisibleChange | Show or hide the callback of the text box | function(value) |-
defaultOpen | The input box is displayed for the first time. | boolean | false
open | The input box is displayed | boolean |false
\ No newline at end of file
src/components/HeaderSearch/index.zh-CN.md
deleted
100644 → 0
View file @
56a5bcf5
---
title
:
HeaderSearch
subtitle
:
顶部搜索框
cols
:
1
order
:
8
---
通常作为全局搜索的入口,放置在导航工具条右侧。
## API
参数 | 说明 | 类型 | 默认值
----|------|-----|------
placeholder | 占位文字 | string | -
dataSource | 当前提示内容列表 | string[] | -
onSearch | 搜索补全项的时候调用 | function(value) | -
onChange | 选中 option,或 input 的 value 变化时,调用此函数 | function(value) | -
onSelect | 被选中时调用,参数为选中项的 value 值 | function(value) | -
onPressEnter | 按下回车时的回调 | function(value) | -
onVisibleChange | 显示或隐藏文本框的回调 | function(value) |-
defaultOpen | 输入框首次显示是否显示 | boolean | false
open | 控制输入框是否显示 | boolean |false
\ No newline at end of file
src/layouts/UserLayout.tsx
View file @
8045b844
import
SelectLang
from
'
@/components/SelectLang
'
;
import
{
MenuDataItem
}
from
'
@/components/SiderMenu
'
;
import
GlobalFooter
from
'
@/components/GlobalFooter
'
;
import
{
ConnectProps
,
ConnectState
}
from
'
@/models/connect
'
;
import
getPageTitle
from
'
@/utils/getPageTitle
'
;
import
{
GlobalFooter
}
from
'
ant-design-pro
'
;
import
{
Icon
}
from
'
antd
'
;
import
{
connect
}
from
'
dva
'
;
import
React
,
{
Component
,
Fragment
}
from
'
react
'
;
...
...
@@ -11,6 +10,7 @@ import { formatMessage } from 'umi-plugin-locale';
import
Link
from
'
umi/link
'
;
import
logo
from
'
../assets/logo.svg
'
;
import
styles
from
'
./UserLayout.less
'
;
import
{
MenuDataItem
}
from
'
@ant-design/pro-layout
'
;
const
links
=
[
{
...
...
@@ -79,6 +79,6 @@ class UserLayout extends Component<UserLayoutProps> {
}
export
default
connect
(({
menu
:
menuModel
}:
ConnectState
)
=>
({
menuData
:
menuModel
.
menuData
,
menuDa
DocumentTitle
ta
:
menuModel
.
menuData
,
breadcrumbNameMap
:
menuModel
.
breadcrumbNameMap
,
}))(
UserLayout
);
src/models/global.ts
View file @
8045b844
...
...
@@ -2,7 +2,7 @@ import { queryNotices } from '@/services/user';
import
{
Subscription
}
from
'
dva
'
;
import
{
Reducer
}
from
'
redux
'
;
import
{
Effect
}
from
'
./connect
'
;
import
{
NoticeIconData
}
from
'
ant-design-pro/lib/NoticeIcon/NoticeIconTab
'
;
import
{
NoticeIconData
}
from
'
@/components/NoticeIcon
'
;
export
interface
NoticeItem
extends
NoticeIconData
{
id
:
string
;
...
...
@@ -107,12 +107,14 @@ const GlobalModel: GlobalModelType = {
},
saveNotices
(
state
,
{
payload
})
{
return
{
collapsed
:
false
,
...
state
,
notices
:
payload
,
};
},
saveClearedNotices
(
state
,
{
payload
})
{
return
{
collapsed
:
false
,
...
state
,
notices
:
state
.
notices
.
filter
(
item
=>
item
.
type
!==
payload
),
};
...
...
src/models/menu.ts
View file @
8045b844
import
{
MenuDataItem
,
Route
}
from
'
@/components/SiderMenu
'
;
import
{
MenuDataItem
}
from
'
@ant-design/pro-layout
'
;
import
Authorized
from
'
@/utils/Authorized
'
;
import
{
Effect
}
from
'
dva
'
;
import
isEqual
from
'
lodash/isEqual
'
;
...
...
@@ -10,7 +10,7 @@ import defaultSettings from '../../config/defaultSettings';
// Conversion router to menu.
function
formatter
(
data
:
Route
[],
data
:
MenuDataItem
[],
parentAuthority
?:
string
[]
|
string
,
parentName
?:
string
,
):
MenuDataItem
[]
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment