Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
common-templete
Overview
Overview
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
汤强勇
common-templete
Commits
44c72322
Commit
44c72322
authored
Nov 02, 2018
by
汤强勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整
parent
1845613c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
391 additions
and
30 deletions
+391
-30
common.css
src/assets/styles/common.css
+13
-0
index.vue
src/components/Header/index.vue
+96
-25
edit.vue
src/components/menus/edit.vue
+78
-0
menusTemplete.vue
src/components/menus/menusTemplete.vue
+187
-0
index.vue
src/pages/home/index.vue
+17
-5
No files found.
src/assets/styles/common.css
View file @
44c72322
...
@@ -29,6 +29,19 @@
...
@@ -29,6 +29,19 @@
.fl
{
.fl
{
float
:
left
;
float
:
left
;
}
}
.clearfix
{
clear
:
both
;
overflow
:
auto
;
}
.clearfix
:before
{
content
:
""
;
clear
:
both
;
}
.clearfix
:after
{
content
:
""
;
clear
:
both
;
}
.step
{
.step
{
background-color
:
rgba
(
52
,
73
,
94
,
1
);
background-color
:
rgba
(
52
,
73
,
94
,
1
);
color
:
#fff
;
color
:
#fff
;
...
...
src/components/Header/index.vue
View file @
44c72322
<
template
lang=
"pug"
>
<
template
lang=
"pug"
>
el-container.header-container
el-container.header-container
nav.header-nav.clear
nav.header-nav.clear
ul.clear
ul.clear
fix
li.nav-item.fl('@click'="handleShowMe
m
us('show',$event)")
li.nav-item.fl('@click'="handleShowMe
n
us('show',$event)")
a.link
a.link
i.fa.fa-th-list
i.fa.fa-th-list
li.nav-item.fl
li.nav-item.fl
(@click="handleEditMenus()")
a.link
a.link
i.fa.fa-th-large
i.fa.fa-th-large
li.nav-item.fl
li.nav-item.fl
...
@@ -24,12 +24,14 @@
...
@@ -24,12 +24,14 @@
li.nav-item.fr
li.nav-item.fr
a.link
a.link
i.fa.fa-comments
i.fa.fa-comments
el-row.meuns-nav
el-row.meuns-nav
(v-show="showMenusPanel")
el-menu&attributes({
el-menu
(@click="toggleMenus($event)")
&attributes({
'default-active':"2",
'default-active':"2",
'class':"el-menu-vertical",
'class':"el-menu-vertical",
'@open':"handleOpen",
'@open':"handleOpen",
'@close':"handleClose",
'@close':"handleClose",
'text-color':'#2a3f54',
'active-text-color':'#fff'
})
})
el-submenu.menus-body.clear(index="1")
el-submenu.menus-body.clear(index="1")
el-menu-item-group.menus-groups.fl('v-for'="(item,index) in menus",':key'="index")
el-menu-item-group.menus-groups.fl('v-for'="(item,index) in menus",':key'="index")
...
@@ -38,32 +40,29 @@
...
@@ -38,32 +40,29 @@
i(class="fa",':class'="item.ico", style={'margin-right':'5px'})
i(class="fa",':class'="item.ico", style={'margin-right':'5px'})
span.main-menus-title
{{
item
.
name
}}
span.main-menus-title
{{
item
.
name
}}
el-menu-item&attributes({
el-menu-item&attributes({
':index':"
idx | pipeString(inde
x)",
':index':"
formatPathString(index,id
x)",
'v-for':'(it,idx) in item.children',
'v-for':'(it,idx) in item.children',
':key':"idx"
':key':"idx"
})
{{
it
.
name
}}
})
el-menu-item-group.menus-tags('v-for'="(i,inx) in it.children",':key'="inx")
el-menu-item-group.menus-tags
<!--template(slot="title")
{{
i
.
name
}}
-->
template(slot="title")
span
{{
it
.
name
}}
el-menu-item&attributes({
el-menu-item&attributes({
':index':"inx | pipeString(index,idx)",
'v-for':'(i,inx) in it.children',
':key':"inx"
':index':"formatPathString(index,idx,inx)",
':key':"inx",
'@click':'setActiveStyle(i,$event)',
':class':"{ active:formatPathString(index,idx,inx) === currentSelectIndex}"
})
{{
i
.
name
}}
})
{{
i
.
name
}}
</
template
>
</
template
>
<
style
lang=
"stylus"
>
<
style
lang=
"stylus"
>
.header-container
.header-container
position
fixed
position
fixed
left
0
right
0
right
0
top
0
top
0
left
70px
z-index
99
z-index
99
box-shadow
0
1px
1px
rgba
(
0
,
0
,
0
,
.2
)
box-shadow
0
1px
1px
rgba
(
0
,
0
,
0
,
.2
)
.header-nav
position
relative
background
#ededed
width
100
%
margin-left
70px
.el-submenu__title
display
none
.nav-item
.nav-item
display
inline-block
display
inline-block
position
relative
position
relative
...
@@ -82,19 +81,76 @@
...
@@ -82,19 +81,76 @@
.history-links-preview
.history-links-preview
margin-top
16px
margin-top
16px
margin-left
15px
margin-left
15px
.menus-body
.el-menu
margin-bottom
200px
.header-nav
position
relative
background
#ededed
width
100
%
.el-menu--inline
display
block
!
important
.menus-tags
.el-menu-item
background
#f5f5f5
line-height
30px
padding
0
10px
color
#2a3f54
min-width
120px
cursor
pointer
&
:hover
,
&
:focus
background
#f5f5f5
.menus-groups
&
>
.el-menu-item-group__title
&
:before
display
none
.el-submenu__title
display
none
.el-menu-item-group__title
position
relative
padding-left
10px
!
important
margin-left
10px
color
:
#2a3f54
;
font-size
:
14px
;
font-weight
:
bold
;
padding-left
:
10px
;
position
:
relative
;
&
::before
content
''
position
absolute
width
4px
height
4px
;
border-radius
50
%
left
0
top
50
%
margin-top
-2px
background
#2a3f54
.main-menus-title
font-size
15px
.el-menu-item
padding
0
10px
!
important
&
.active
background
:
#1ABB9C
!
important
color
:
#fff
!
important
</
style
>
</
style
>
<
style
lang=
"stylus"
scoped
>
<
style
lang=
"stylus"
scoped
>
.meuns-nav
.meuns-nav
position
absolute
position
absolute
left
0
left
0
right
0
right
0
bottom
0
height
1000px
box-sizing
border-box
top
70px
top
70px
z-index
9
z-index
9
overflow-y
scroll
.menus-body
.menus-body
display
flex
display
flex
.menus-groups
.menus-groups
width
200px
width
200px
border-right
:
1px
solid
#ddd
;
margin
:
15px
0
;
padding
1px
.main-menus
.main-menus
color
#2a3f54
color
#2a3f54
font-size
15px
font-size
15px
...
@@ -127,6 +183,11 @@
...
@@ -127,6 +183,11 @@
.el-menu-item
.el-menu-item
height
auto
height
auto
line-height
1
.5
line-height
1
.5
overflow
hidden
text-align
left
&
:hover
,
&
:focus
background
none
</
style
>
</
style
>
<
script
>
<
script
>
import
{
mapGetters
}
from
'vuex'
import
{
mapGetters
}
from
'vuex'
...
@@ -134,6 +195,8 @@ export default {
...
@@ -134,6 +195,8 @@ export default {
name
:
'headerNav'
,
name
:
'headerNav'
,
data
()
{
data
()
{
return
{
return
{
showMenusPanel
:
false
,
currentSelectIndex
:
-
1
,
user
:
{
user
:
{
headerImage
:
'http://photo.bigaka.com/photos//2132/201805/56741525659969939_144_144.jpg'
,
headerImage
:
'http://photo.bigaka.com/photos//2132/201805/56741525659969939_144_144.jpg'
,
name
:
'测试商户组'
name
:
'测试商户组'
...
@@ -170,11 +233,19 @@ export default {
...
@@ -170,11 +233,19 @@ export default {
},
},
handleOpen
()
{},
handleOpen
()
{},
handleClose
()
{},
handleClose
()
{},
handleShowMemus
(
type
)
{
handleShowMenus
()
{
this
.
$nextTick
(()
=>
{
this
.
showMenusPanel
=
!
this
.
showMenusPanel
let
dom
=
document
.
querySelector
(
'.el-submenu__title'
)
},
dom
.
click
()
toggleMenus
(...
args
)
{
})
console
.
log
(
args
)
},
handleEditMenus
()
{},
setActiveStyle
(
item
,
ev
)
{
this
.
currentSelectIndex
=
ev
.
index
console
.
log
(
item
)
},
formatPathString
(...
args
)
{
return
args
.
join
(
'-'
)
}
}
}
}
}
}
...
...
src/components/menus/edit.vue
0 → 100644
View file @
44c72322
<
template
>
<div
class=
"menus-edit--control"
>
<div
class=
"content"
>
<div
class=
"dropdown-menu quick-links-panel in"
>
<!-- 快捷入口 -->
<div
class=
"clearfix quick-links-container"
>
<a
class=
"fl"
><i
class=
"fa fa-thumb-tack"
></i></a>
<div
class=
"quick-links inline"
></div>
<span
class=
"tips inline"
>
Tips:快速触达,最多10个
</span>
<a
class=
"fr"
@
cilck=
"showEditMenus()"
><i
class=
"fa fa-times"
></i></a>
<a
class=
"fr"
@
cilck=
"hideEditMenus()"
><i
class=
"fa fa-ellipsis-h"
></i></a>
</div>
</div>
</div>
<div
class=
"warpper"
v-show=
"false"
>
<menusTemplete
/>
</div>
</div>
</
template
>
<
style
>
.dropdown-menu.quick-links-panel
,
.dropdown-menu.quick-links-panel
a
{
color
:
#73879c
;
margin-right
:
20px
;
}
.dropdown-menu.quick-links-panel
a
i
{
font-size
:
24px
;
line-height
:
42px
;
}
.dropdown-menu.quick-links-panel
.quick-links-container
{
padding-left
:
15px
;
}
.dropdown-menu.quick-links-panel
{
left
:
0
;
width
:
100%
;
line-height
:
42px
;
border-top
:
0
;
z-index
:
999
;
border
:
0
;
background
:
#f9f9f9
;
}
.dropdown-menu.menu-links-panel.in
,
.dropdown-menu.quick-links-panel.in
{
transform
:
translateY
(
0
);
-webkit-transform
:
translateY
(
0
);
opacity
:
1
;
}
.menus-edit--control
.warpper
{
position
:
fixed
;
top
:
58px
;
bottom
:
0
;
width
:
100%
;
z-index
:
9
;
background
:
rgba
(
0
,
0
,
0
,
.5
);
}
.menus-edit--control
.btns
{
bottom
:
20px
;
}
</
style
>
<
script
>
import
menusTemplete
from
'./menusTemplete'
export
default
{
components
:
{
menusTemplete
},
methods
:
{
hideEditMenus
()
{
},
showEditMenus
()
{
}
}
}
</
script
>
src/components/menus/menusTemplete.vue
0 → 100644
View file @
44c72322
<
template
lang=
"pug"
>
.menus-templete
el-row.meuns-nav
el-menu(@click="toggleMenus($event)")&attributes({
'default-active':"2",
'class':"el-menu-vertical",
'@open':"handleOpen",
'@close':"handleClose",
'text-color':'#2a3f54',
'active-text-color':'#fff'
})
el-submenu.menus-body.clear(index="1")
el-menu-item-group.menus-groups('v-for'="(item,index) in menus",':key'="index")
template(slot="title")
.main-menus
i(class="fa",':class'="item.ico", style={'margin-right':'5px'})
span.main-menus-title
{{
item
.
name
}}
el-menu-item&attributes({
':index':"formatPathString(index,idx)",
'v-for':'(it,idx) in item.children',
':key':"idx"
})
el-menu-item-group.menus-tags
template(slot="title")
span
{{
it
.
name
}}
el-menu-item&attributes({
'v-for':'(i,inx) in it.children',
':index':"formatPathString(index,idx,inx)",
':key':"inx",
'@click':'setActiveStyle(i,$event)',
':class':"{ active:formatPathString(index,idx,inx) === currentSelectIndex}"
})
{{
i
.
name
}}
el-row.fixed-footer
el-button(round) 取消
el-button(type="primary", round) 确定
span(style={'margin-left':'10px'}) 已选:
{{
num
}}
个快捷菜单,最多可选10个
</
template
>
<
style
lang=
"stylus"
>
.menus-templete
overflow
auto
padding-bottom
80px
height
700px
.el-menu--inline
display
block
.menus-body
&
>
ul
display
flex
!
important
flex-wrap
nowrap
flex
1
flex-direction
row
&
:before
,
&
:after
display
none
.menus-tags
.el-menu-item
background
#f5f5f5
line-height
30px
padding
0
10px
color
#2a3f54
min-width
120px
width
auto
cursor
pointer
&
:hover
,
&
:focus
background
#f5f5f5
.menus-groups
&
>
ul
display
flex
flex-wrap
wrap
&
>
.el-menu-item-group__title
&
:before
display
none
.el-submenu__title
display
none
.el-menu-item-group__title
position
relative
padding-left
10px
!
important
margin-left
10px
color
:
#2a3f54
;
font-size
:
14px
;
font-weight
:
bold
;
position
:
relative
;
&
::before
content
''
position
absolute
width
4px
height
4px
;
border-radius
50
%
left
0
top
50
%
margin-top
-2px
background
#2a3f54
.main-menus-title
font-size
15px
.el-menu-item
display
:
flex
padding
0
10px
!
important
&
.active
background
:
#1ABB9C
!
important
color
:
#fff
!
important
.fixed-footer
position
fixed
display
flex
justify-content
center
align-items
center
bottom
0
width
100
%
background
#fff
height
50px
</
style
>
<
style
lang=
"stylus"
scoped
>
.meuns-nav
position
relative
overflow
auto
.el-submenu
,
.el-menu-item
min-width
120px
.menus-body
display
flex
flex-direction
row
.menus-groups
border-right
:
1px
solid
#ddd
;
margin
:
15px
0
;
padding
1px
max-width
356px
.main-menus
color
#2a3f54
font-size
15px
font-weight
bold
text-align
left
.el-menu-item
height
auto
line-height
1
.5
overflow
hidden
text-align
left
&
:hover
,
&
:focus
background
none
</
style
>
<
script
>
export
default
{
name
:
'headerNav'
,
data
()
{
return
{
currentSelectIndex
:
-
1
,
num
:
3
}
},
filters
:
{
limit
(
array
,
num
)
{
if
(
num
)
{
return
array
}
return
array
.
slice
(
0
,
num
)
},
pipeString
(...
args
)
{
return
args
.
join
(
'-'
)
}
},
computed
:
{
menus
()
{
const
names
=
[
'会员中心'
,
'营销中心'
,
'销售中心'
,
'渠道中心'
,
'系统设置'
,
'平台管理'
,
'智能营销'
,
'分析师'
]
return
this
.
$store
.
state
.
global
.
menus
.
filter
(
item
=>
names
.
indexOf
(
item
.
name
)
>
-
1
)
}
},
methods
:
{
clickItem
()
{
console
.
log
(
this
)
},
handleOpen
()
{},
handleClose
()
{},
handleShowMenus
()
{
this
.
showMenusPanel
=
!
this
.
showMenusPanel
},
toggleMenus
(...
args
)
{
console
.
log
(
args
)
},
handleEditMenus
()
{},
setActiveStyle
(
item
,
ev
)
{
this
.
currentSelectIndex
=
ev
.
index
},
formatPathString
(...
args
)
{
return
args
.
join
(
'-'
)
}
}
}
</
script
>
src/pages/home/index.vue
View file @
44c72322
<
template
>
<
template
>
<div
class=
"wrapper"
>
<div
class=
"wrapper"
>
<home-header></home-header>
<home-sidebar></home-sidebar>
<home-sidebar></home-sidebar>
<section
class=
"main"
>
<home-header></home-header>
<div
class=
"content-box"
>
<div
class=
"content-box"
>
<menus-edit
/>
<div
class=
"content"
>
<div
class=
"content"
>
<transition
name=
"move"
mode=
"out-in"
>
<transition
name=
"move"
mode=
"out-in"
>
<!--
<keep-alive
exclude=
"prize"
>
-->
<!--
<keep-alive
exclude=
"prize"
>
-->
...
@@ -11,16 +13,19 @@
...
@@ -11,16 +13,19 @@
</transition>
</transition>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
mapActions
}
from
'vuex'
import
{
mapActions
}
from
'vuex'
import
HomeSidebar
from
'components/Sidebar'
import
HomeSidebar
from
'components/Sidebar'
import
HomeHeader
from
'components/Header'
import
HomeHeader
from
'components/Header'
import
menusEdit
from
'components/menus/edit'
export
default
{
export
default
{
components
:
{
components
:
{
HomeSidebar
,
HomeSidebar
,
HomeHeader
HomeHeader
,
menusEdit
},
},
created
()
{
created
()
{
this
.
getMenus
()
this
.
getMenus
()
...
@@ -34,14 +39,21 @@ export default {
...
@@ -34,14 +39,21 @@ export default {
</
script
>
</
script
>
<
style
lang=
"stylus"
scoped
>
<
style
lang=
"stylus"
scoped
>
.wrapper
.wrapper
display
flex
width
100
%
width
100
%
height
100
%
height
100
%
overflow
hidden
overflow
hidden
.main
flex
1
display
flex
position
relative
.content-box
.content-box
position
absolute
/*position absolute*/
display
inline-block
display
inline-block
top
58px
flex
1
bottom
0
margin-top
58px
/*top 58px*/
/*bottom 0*/
width
80
%
width
80
%
-webkit-transition
left
0
.3s
ease-in-out
-webkit-transition
left
0
.3s
ease-in-out
transition
left
0
.3s
ease-in-out
transition
left
0
.3s
ease-in-out
...
...
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