Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fengchao-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tf-boys
fengchao-admin
Commits
4b3c4b84
Commit
4b3c4b84
authored
Aug 11, 2017
by
刘松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
界面 bug
parent
8c59f7a9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
16 deletions
+23
-16
app.bundle.js
app/built/app.bundle.js
+0
-0
main.css
app/css/main.css
+4
-3
index.js
app/js/actions/index.js
+5
-2
menuReducer.js
app/js/reducers/menuReducer.js
+3
-2
main.jsx
app/jsx/main.jsx
+11
-9
No files found.
app/built/app.bundle.js
View file @
4b3c4b84
This diff is collapsed.
Click to expand it.
app/css/main.css
View file @
4b3c4b84
...
...
@@ -59,11 +59,12 @@ body{
.logo
{
width
:
120px
;
height
:
31px
;
background
:
#333
;
border-radius
:
6px
;
margin
:
16px
24px
16px
0
;
float
:
left
;
}
.logo
span
{
color
:
#f04134
;
font-size
:
20px
;
}
.box
{
box-shadow
:
0
0
1px
#ddd
;
background
:
#f7f7f7
;
...
...
app/js/actions/index.js
View file @
4b3c4b84
...
...
@@ -47,8 +47,11 @@ exports.getDetailData = (data) => {
};
}
exports
.
getMenu
=
(
data
)
=>
{
exports
.
getMenu
=
()
=>
{
const
mapLocations
=
[
'/manage'
,
'/manage/statistics'
,
'/manage/setting'
];
let
key
=
mapLocations
.
indexOf
(
location
.
pathname
);
return
(
dispatch
)
=>
{
dispatch
({
data
,
type
:
types
.
CURRENTPAGE
});
dispatch
({
currentPage
:
key
,
type
:
types
.
CURRENTPAGE
})
//dispatch({ data, type: types.CURRENTPAGE});
};
}
app/js/reducers/menuReducer.js
View file @
4b3c4b84
const
types
=
require
(
'../actions/actionTypes'
);
const
_
=
require
(
'lodash'
);
const
mapLocations
=
[
'/manage'
,
'/manage/statistics'
,
'/manage/setting'
];
const
key
=
mapLocations
.
indexOf
(
location
.
pathname
);
const
defaultData
=
{
currentPage
:
'statistics'
currentPage
:
key
};
module
.
exports
=
function
menu
(
state
=
defaultData
,
action
)
{
switch
(
action
.
type
)
{
case
types
.
CURRENTPAGE
:
...
...
app/jsx/main.jsx
View file @
4b3c4b84
...
...
@@ -8,12 +8,12 @@ const MenuItemGroup = Menu.ItemGroup;
const
ButtonGroup
=
Button
.
Group
;
const
{
Header
,
Footer
,
Sider
,
Content
}
=
Layout
;
const
mapLocations
=
[
'/manage'
,
'/manage/statistics
/
'
,
'/manage/setting'
]
const
mapLocations
=
[
'/manage'
,
'/manage/statistics'
,
'/manage/setting'
]
class
Main
extends
React
.
Component
{
constructor
(
props
){
super
(
props
);
this
.
map
=
[
'数据统计'
,
'
账户与
配置'
]
this
.
map
=
[
'数据统计'
,
'
数据统计'
,
'
配置'
]
this
.
state
=
{
current
:
'0'
,
openKeys
:
[],
...
...
@@ -22,8 +22,7 @@ class Main extends React.Component{
}
handleClick
(
e
){
console
.
dir
(
e
);
this
.
props
.
dispatch
(
actions
.
getMenu
(
e
.
key
));
//this.props.dispatch(actions.getMenu());
location
.
href
=
mapLocations
[
e
.
key
];
}
...
...
@@ -38,14 +37,17 @@ class Main extends React.Component{
}
render
(){
console
.
log
(
this
.
props
.
menu
.
currentPage
);
return
(
<
Layout
className=
"layout"
>
<
Header
>
<
div
className=
"logo"
/>
<
div
className=
"logo"
>
<
span
>
蜂巢
</
span
>
</
div
>
<
Menu
theme=
"dark"
mode=
"horizontal"
defaultSelectedKeys
=
{
[
'0'
]
}
defaultSelectedKeys
=
{[
this
.
props
.
menu
.
currentPage
]}
onClick=
{
this
.
handleClick
.
bind
(
this
)
}
style=
{
{
lineHeight
:
'64px'
}
}
>
...
...
@@ -53,13 +55,13 @@ class Main extends React.Component{
<
Menu
.
Item
key=
"0"
>
基础数据
</
Menu
.
Item
>
<
Menu
.
Item
key=
"1"
>
详细数据
</
Menu
.
Item
>
</
SubMenu
>
<
Menu
.
Item
key=
"2"
>
账户与
配置
</
Menu
.
Item
>
<
Menu
.
Item
key=
"2"
>
配置
</
Menu
.
Item
>
</
Menu
>
</
Header
>
<
Content
style=
{
{
padding
:
'0 50px'
}
}
>
<
Breadcrumb
style=
{
{
margin
:
'12px 0'
}
}
>
<
Breadcrumb
.
Item
>
{
this
.
map
[
this
.
state
.
current
]
}
</
Breadcrumb
.
Item
>
<
Breadcrumb
.
Item
>
{
this
.
state
.
current
==
'0'
?
'基础数据'
:
(
this
.
state
.
current
==
'1'
?
'详细数据'
:
"详细
"
)
}
</
Breadcrumb
.
Item
>
<
Breadcrumb
.
Item
>
{
this
.
map
[
this
.
props
.
menu
.
currentPage
]
}
</
Breadcrumb
.
Item
>
<
Breadcrumb
.
Item
>
{
this
.
props
.
menu
.
currentPage
==
'0'
?
'基础数据'
:
(
this
.
props
.
menu
.
currentPage
==
'1'
?
'详细数据'
:
"账户与配置
"
)
}
</
Breadcrumb
.
Item
>
</
Breadcrumb
>
<
div
style=
{
{
background
:
'#fff'
,
padding
:
24
,
minHeight
:
280
}
}
>
{
this
.
props
.
children
...
...
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