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
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 source diff could not be displayed because it is too large. You can
view the blob
instead.
app/css/main.css
View file @
4b3c4b84
...
@@ -59,11 +59,12 @@ body{
...
@@ -59,11 +59,12 @@ body{
.logo
{
.logo
{
width
:
120px
;
width
:
120px
;
height
:
31px
;
height
:
31px
;
background
:
#333
;
border-radius
:
6px
;
margin
:
16px
24px
16px
0
;
float
:
left
;
float
:
left
;
}
}
.logo
span
{
color
:
#f04134
;
font-size
:
20px
;
}
.box
{
.box
{
box-shadow
:
0
0
1px
#ddd
;
box-shadow
:
0
0
1px
#ddd
;
background
:
#f7f7f7
;
background
:
#f7f7f7
;
...
...
app/js/actions/index.js
View file @
4b3c4b84
...
@@ -47,8 +47,11 @@ exports.getDetailData = (data) => {
...
@@ -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
)
=>
{
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
types
=
require
(
'../actions/actionTypes'
);
const
_
=
require
(
'lodash'
);
const
_
=
require
(
'lodash'
);
const
mapLocations
=
[
'/manage'
,
'/manage/statistics'
,
'/manage/setting'
];
const
key
=
mapLocations
.
indexOf
(
location
.
pathname
);
const
defaultData
=
{
const
defaultData
=
{
currentPage
:
'statistics'
currentPage
:
key
};
};
module
.
exports
=
function
menu
(
state
=
defaultData
,
action
)
{
module
.
exports
=
function
menu
(
state
=
defaultData
,
action
)
{
switch
(
action
.
type
)
{
switch
(
action
.
type
)
{
case
types
.
CURRENTPAGE
:
case
types
.
CURRENTPAGE
:
...
...
app/jsx/main.jsx
View file @
4b3c4b84
...
@@ -8,12 +8,12 @@ const MenuItemGroup = Menu.ItemGroup;
...
@@ -8,12 +8,12 @@ const MenuItemGroup = Menu.ItemGroup;
const
ButtonGroup
=
Button
.
Group
;
const
ButtonGroup
=
Button
.
Group
;
const
{
Header
,
Footer
,
Sider
,
Content
}
=
Layout
;
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
{
class
Main
extends
React
.
Component
{
constructor
(
props
){
constructor
(
props
){
super
(
props
);
super
(
props
);
this
.
map
=
[
'数据统计'
,
'
账户与
配置'
]
this
.
map
=
[
'数据统计'
,
'
数据统计'
,
'
配置'
]
this
.
state
=
{
this
.
state
=
{
current
:
'0'
,
current
:
'0'
,
openKeys
:
[],
openKeys
:
[],
...
@@ -22,8 +22,7 @@ class Main extends React.Component{
...
@@ -22,8 +22,7 @@ class Main extends React.Component{
}
}
handleClick
(
e
){
handleClick
(
e
){
console
.
dir
(
e
);
//this.props.dispatch(actions.getMenu());
this
.
props
.
dispatch
(
actions
.
getMenu
(
e
.
key
));
location
.
href
=
mapLocations
[
e
.
key
];
location
.
href
=
mapLocations
[
e
.
key
];
}
}
...
@@ -38,14 +37,17 @@ class Main extends React.Component{
...
@@ -38,14 +37,17 @@ class Main extends React.Component{
}
}
render
(){
render
(){
console
.
log
(
this
.
props
.
menu
.
currentPage
);
return
(
return
(
<
Layout
className=
"layout"
>
<
Layout
className=
"layout"
>
<
Header
>
<
Header
>
<
div
className=
"logo"
/>
<
div
className=
"logo"
>
<
span
>
蜂巢
</
span
>
</
div
>
<
Menu
<
Menu
theme=
"dark"
theme=
"dark"
mode=
"horizontal"
mode=
"horizontal"
defaultSelectedKeys
=
{
[
'0'
]
}
defaultSelectedKeys
=
{[
this
.
props
.
menu
.
currentPage
]}
onClick=
{
this
.
handleClick
.
bind
(
this
)
}
onClick=
{
this
.
handleClick
.
bind
(
this
)
}
style=
{
{
lineHeight
:
'64px'
}
}
style=
{
{
lineHeight
:
'64px'
}
}
>
>
...
@@ -53,13 +55,13 @@ class Main extends React.Component{
...
@@ -53,13 +55,13 @@ class Main extends React.Component{
<
Menu
.
Item
key=
"0"
>
基础数据
</
Menu
.
Item
>
<
Menu
.
Item
key=
"0"
>
基础数据
</
Menu
.
Item
>
<
Menu
.
Item
key=
"1"
>
详细数据
</
Menu
.
Item
>
<
Menu
.
Item
key=
"1"
>
详细数据
</
Menu
.
Item
>
</
SubMenu
>
</
SubMenu
>
<
Menu
.
Item
key=
"2"
>
账户与
配置
</
Menu
.
Item
>
<
Menu
.
Item
key=
"2"
>
配置
</
Menu
.
Item
>
</
Menu
>
</
Menu
>
</
Header
>
</
Header
>
<
Content
style=
{
{
padding
:
'0 50px'
}
}
>
<
Content
style=
{
{
padding
:
'0 50px'
}
}
>
<
Breadcrumb
style=
{
{
margin
:
'12px 0'
}
}
>
<
Breadcrumb
style=
{
{
margin
:
'12px 0'
}
}
>
<
Breadcrumb
.
Item
>
{
this
.
map
[
this
.
state
.
current
]
}
</
Breadcrumb
.
Item
>
<
Breadcrumb
.
Item
>
{
this
.
map
[
this
.
props
.
menu
.
currentPage
]
}
</
Breadcrumb
.
Item
>
<
Breadcrumb
.
Item
>
{
this
.
state
.
current
==
'0'
?
'基础数据'
:
(
this
.
state
.
current
==
'1'
?
'详细数据'
:
"详细
"
)
}
</
Breadcrumb
.
Item
>
<
Breadcrumb
.
Item
>
{
this
.
props
.
menu
.
currentPage
==
'0'
?
'基础数据'
:
(
this
.
props
.
menu
.
currentPage
==
'1'
?
'详细数据'
:
"账户与配置
"
)
}
</
Breadcrumb
.
Item
>
</
Breadcrumb
>
</
Breadcrumb
>
<
div
style=
{
{
background
:
'#fff'
,
padding
:
24
,
minHeight
:
280
}
}
>
{
<
div
style=
{
{
background
:
'#fff'
,
padding
:
24
,
minHeight
:
280
}
}
>
{
this
.
props
.
children
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