Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-vue
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
tianzhuanghu
ant-design-pro-vue
Commits
36b3f2de
Commit
36b3f2de
authored
Sep 20, 2018
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: layout style
support mobile style
parent
e24bff54
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
299 additions
and
252 deletions
+299
-252
RankList.vue
src/components/chart/RankList.vue
+77
-72
LayoutMain.vue
src/components/layout/LayoutMain.vue
+26
-2
PageHeader.vue
src/components/layout/PageHeader.vue
+196
-178
Workplace.vue
src/views/dashboard/Workplace.vue
+0
-0
No files found.
src/components/chart/RankList.vue
View file @
36b3f2de
<
template
>
<div
class=
"rank"
>
<h4
class=
"title"
>
{{
title
}}
</h4>
<ul
class=
"list"
>
<li
:key=
"index"
v-for=
"(item, index) in list"
>
<span
:class=
"index
<
3
?
'
active
'
:
null
"
>
{{
index
+
1
}}
</span>
<span
>
{{
item
.
name
}}
</span>
<span
>
{{
item
.
total
}}
</span>
</li>
</ul>
</div>
</
template
>
<
script
>
export
default
{
name
:
"RankList"
,
// ['title', 'list']
props
:
{
title
:
{
type
:
String
,
default
:
''
},
list
:
{
type
:
Array
,
default
:
null
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.rank
{
padding
:
0
32px
32px
72px
;
.list
{
margin
:
25px
0
0
;
padding
:
0
;
list-style
:
none
;
li
{
margin-top
:
16px
;
span
{
color
:
rgba
(
0
,
0
,
0
,
.65
);
font-size
:
14px
;
line-height
:
22px
;
&:first-child
{
background-color
:
#f5f5f5
;
border-radius
:
20px
;
display
:
inline-block
;
font-size
:
12px
;
font-weight
:
600
;
margin-right
:
24px
;
height
:
20px
;
line-height
:
20px
;
width
:
20px
;
text-align
:
center
;
}
&
.active
{
background-color
:
#314659
;
color
:
#fff
;
}
&
:last-child
{
float
:
right
;
}
}
}
}
}
<
template
>
<div
class=
"rank"
>
<h4
class=
"title"
>
{{
title
}}
</h4>
<ul
class=
"list"
>
<li
:key=
"index"
v-for=
"(item, index) in list"
>
<span
:class=
"index
<
3
?
'
active
'
:
null
"
>
{{
index
+
1
}}
</span>
<span>
{{
item
.
name
}}
</span>
<span>
{{
item
.
total
}}
</span>
</li>
</ul>
</div>
</
template
>
<
script
>
export
default
{
name
:
"RankList"
,
// ['title', 'list']
props
:
{
title
:
{
type
:
String
,
default
:
''
},
list
:
{
type
:
Array
,
default
:
null
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.rank
{
padding
:
0
32px
32px
72px
;
.list
{
margin
:
25px
0
0
;
padding
:
0
;
list-style
:
none
;
li
{
margin-top
:
16px
;
span
{
color
:
rgba
(
0
,
0
,
0
,
.65
);
font-size
:
14px
;
line-height
:
22px
;
&:first-child
{
background-color
:
#f5f5f5
;
border-radius
:
20px
;
display
:
inline-block
;
font-size
:
12px
;
font-weight
:
600
;
margin-right
:
24px
;
height
:
20px
;
line-height
:
20px
;
width
:
20px
;
text-align
:
center
;
}
&
.active
{
background-color
:
#314659
;
color
:
#fff
;
}
&
:last-child
{
float
:
right
;
}
}
}
}
}
.mobile
.rank
{
padding
:
0
32px
32px
32px
;
}
</
style
>
\ No newline at end of file
src/components/layout/LayoutMain.vue
View file @
36b3f2de
<
template
>
<a-layout
class=
"layout"
>
<a-layout
class=
"layout"
:class=
"device"
>
<a-drawer
v-if=
"device === 'mobile'"
wrapClassName=
"drawer-sider
"
:wrapClassName=
"'drawer-sider ' + theme
"
placement=
"left"
@
close=
"() => this.collapsed = false"
:closable=
"false"
...
...
@@ -93,6 +93,14 @@
min-height
:
100vh
;
overflow-x
:
hidden
;
&.mobile
{
.ant-table-wrapper
{
.ant-table-body
{
overflow-y
:
auto
;
}
}
}
&
.ant-layout-has-sider
{
flex-direction
:
row
;
}
...
...
@@ -156,6 +164,22 @@
//
drawer-sider
自定义
.ant-drawer.drawer-sider
{
.sider
{
box-shadow
:
none
;
}
&
.dark
{
.ant-drawer-content
{
background-color
:
rgb
(
0
,
21
,
41
);
}
}
&
.light
{
box-shadow
:
none
;
.ant-drawer-content
{
background-color
:
#fff
;
}
}
.ant-drawer-body
{
padding
:
0
}
...
...
src/components/layout/PageHeader.vue
View file @
36b3f2de
<
template
>
<div
class=
"page-header"
>
<a-breadcrumb
class=
"breadcrumb"
>
<a-breadcrumb-item
v-for=
"(item, index) in breadList"
:key=
"index"
>
<router-link
v-if=
"item.name != name"
:to=
"
{ path: item.path }">
{{
item
.
meta
.
title
}}
</router-link>
<span
v-else
>
{{
item
.
meta
.
title
}}
</span>
</a-breadcrumb-item>
</a-breadcrumb>
<div
class=
"detail"
>
<div
class=
"main"
v-if=
"!$route.meta.hiddenPageHeader"
>
<div
class=
"row"
>
<img
v-if=
"logo"
:src=
"logo"
class=
"logo"
/>
<h1
v-if=
"title"
class=
"title"
>
{{
title
}}
</h1>
<div
class=
"action"
>
<slot
name=
"action"
></slot>
</div>
</div>
<div
class=
"row"
>
<div
v-if=
"avatar"
class=
"avatar"
>
<a-avatar
:src=
"avatar"
/>
</div>
<div
v-if=
"this.$slots.content"
class=
"content"
>
<slot
name=
"content"
></slot>
</div>
<div
v-if=
"this.$slots.extra"
class=
"extra"
>
<slot
name=
"extra"
></slot>
</div>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
Breadcrumb
from
'@/components/tools/Breadcrumb'
export
default
{
name
:
"PageHeader"
,
components
:
{
"s-breadcrumb"
:
Breadcrumb
},
props
:
{
title
:
{
type
:
String
,
default
:
''
,
required
:
false
},
breadcrumb
:
{
type
:
Array
,
default
:
null
,
required
:
false
},
logo
:
{
type
:
String
,
default
:
''
,
required
:
false
},
avatar
:
{
type
:
String
,
default
:
''
,
required
:
false
}
},
data
()
{
return
{
name
:
''
,
breadList
:
[],
}
},
created
()
{
this
.
getBreadcrumb
()
},
methods
:
{
getBreadcrumb
()
{
this
.
breadList
=
[]
this
.
breadList
.
push
({
name
:
'index'
,
path
:
'/dashboard/'
,
meta
:
{
title
:
'首页'
}})
this
.
name
=
this
.
$route
.
name
this
.
$route
.
matched
.
forEach
((
item
)
=>
{
// item.meta.name === 'dashboard' ? item.path = '/dashboard' : this.$route.path === item.path
this
.
breadList
.
push
(
item
)
})
}
},
watch
:
{
$route
()
{
this
.
getBreadcrumb
()
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.page-header
{
background
:
#fff
;
padding
:
16px
32px
0
;
border-bottom
:
1px
solid
#e8e8e8
;
.breadcrumb
{
margin-bottom
:
16px
;
}
.detail
{
display
:
flex
;
/*margin-bottom: 16px;*/
.avatar
{
flex
:
0
1
72px
;
margin
:
0
24px
8px
0
;
&
>
span
{
border-radius
:
72px
;
display
:
block
;
width
:
72px
;
height
:
72px
;
}
}
.main
{
width
:
100%
;
flex
:
0
1
auto
;
.row
{
display
:
flex
;
width
:
100%
;
.avatar
{
margin-bottom
:
16px
;
}
}
.title
{
font-size
:
20px
;
font-weight
:
500
;
font-size
:
20px
;
line-height
:
28px
;
font-weight
:
500
;
color
:
rgba
(
0
,
0
,
0
,
.85
);
margin-bottom
:
16px
;
flex
:
auto
;
}
.logo
{
width
:
28px
;
height
:
28px
;
border-radius
:
4px
;
margin-right
:
16px
;
}
.content
{
flex
:
auto
;
color
:
rgba
(
0
,
0
,
0
,
.45
);
line-height
:
22px
;
}
.extra
{
flex
:
0
1
auto
;
margin-left
:
88px
;
min-width
:
242px
;
text-align
:
right
;
}
.action
{
margin-left
:
56px
;
min-width
:
266px
;
flex
:
0
1
auto
;
text-align
:
right
;
&:empty
{
display
:
none
;
}
}
}
}
}
<
template
>
<div
class=
"page-header"
>
<a-breadcrumb
class=
"breadcrumb"
>
<a-breadcrumb-item
v-for=
"(item, index) in breadList"
:key=
"index"
>
<router-link
v-if=
"item.name != name"
:to=
"
{ path: item.path }">
{{
item
.
meta
.
title
}}
</router-link>
<span
v-else
>
{{
item
.
meta
.
title
}}
</span>
</a-breadcrumb-item>
</a-breadcrumb>
<div
class=
"detail"
>
<div
class=
"main"
v-if=
"!$route.meta.hiddenPageHeader"
>
<div
class=
"row"
>
<img
v-if=
"logo"
:src=
"logo"
class=
"logo"
/>
<h1
v-if=
"title"
class=
"title"
>
{{
title
}}
</h1>
<div
class=
"action"
>
<slot
name=
"action"
></slot>
</div>
</div>
<div
class=
"row"
>
<div
v-if=
"avatar"
class=
"avatar"
>
<a-avatar
:src=
"avatar"
/>
</div>
<div
v-if=
"this.$slots.content"
class=
"content"
>
<slot
name=
"content"
></slot>
</div>
<div
v-if=
"this.$slots.extra"
class=
"extra"
>
<slot
name=
"extra"
></slot>
</div>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
Breadcrumb
from
'@/components/tools/Breadcrumb'
export
default
{
name
:
"PageHeader"
,
components
:
{
"s-breadcrumb"
:
Breadcrumb
},
props
:
{
title
:
{
type
:
String
,
default
:
''
,
required
:
false
},
breadcrumb
:
{
type
:
Array
,
default
:
null
,
required
:
false
},
logo
:
{
type
:
String
,
default
:
''
,
required
:
false
},
avatar
:
{
type
:
String
,
default
:
''
,
required
:
false
}
},
data
()
{
return
{
name
:
''
,
breadList
:
[],
}
},
created
()
{
this
.
getBreadcrumb
()
},
methods
:
{
getBreadcrumb
()
{
this
.
breadList
=
[]
this
.
breadList
.
push
({
name
:
'index'
,
path
:
'/dashboard/'
,
meta
:
{
title
:
'首页'
}})
this
.
name
=
this
.
$route
.
name
this
.
$route
.
matched
.
forEach
((
item
)
=>
{
// item.meta.name === 'dashboard' ? item.path = '/dashboard' : this.$route.path === item.path
this
.
breadList
.
push
(
item
)
})
}
},
watch
:
{
$route
()
{
this
.
getBreadcrumb
()
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.page-header
{
background
:
#fff
;
padding
:
16px
32px
0
;
border-bottom
:
1px
solid
#e8e8e8
;
.breadcrumb
{
margin-bottom
:
16px
;
}
.detail
{
display
:
flex
;
/*margin-bottom: 16px;*/
.avatar
{
flex
:
0
1
72px
;
margin
:
0
24px
8px
0
;
&
>
span
{
border-radius
:
72px
;
display
:
block
;
width
:
72px
;
height
:
72px
;
}
}
.main
{
width
:
100%
;
flex
:
0
1
auto
;
.row
{
display
:
flex
;
width
:
100%
;
.avatar
{
margin-bottom
:
16px
;
}
}
.title
{
font-size
:
20px
;
font-weight
:
500
;
font-size
:
20px
;
line-height
:
28px
;
font-weight
:
500
;
color
:
rgba
(
0
,
0
,
0
,
.85
);
margin-bottom
:
16px
;
flex
:
auto
;
}
.logo
{
width
:
28px
;
height
:
28px
;
border-radius
:
4px
;
margin-right
:
16px
;
}
.content
{
flex
:
auto
;
color
:
rgba
(
0
,
0
,
0
,
.45
);
line-height
:
22px
;
}
.extra
{
flex
:
0
1
auto
;
margin-left
:
88px
;
min-width
:
242px
;
text-align
:
right
;
}
.action
{
margin-left
:
56px
;
min-width
:
266px
;
flex
:
0
1
auto
;
text-align
:
right
;
&:empty
{
display
:
none
;
}
}
}
}
}
.mobile
.page-header
{
.main
{
.row
{
flex-wrap
:
wrap
;
}
.extra
{
flex
:
1
1
auto
;
margin-left
:
0
;
min-width
:
0
;
text-align
:
right
;
}
}
}
</
style
>
\ No newline at end of file
src/views/dashboard/Workplace.vue
View file @
36b3f2de
This diff is collapsed.
Click to expand it.
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