Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
member
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
member
member
Commits
fe1362a5
Commit
fe1362a5
authored
Aug 19, 2019
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决图片被拉伸的bug
parent
f4ed5495
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
27 deletions
+52
-27
folder-item.vue
src/components/photo-album/folder-item.vue
+15
-9
img-item.vue
src/components/photo-album/img-item.vue
+37
-18
No files found.
src/components/photo-album/folder-item.vue
View file @
fe1362a5
...
...
@@ -17,26 +17,32 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.folder
{
width
:
160px
;
margin-right
:
10px
;
margin-bottom
:
15px
;
position
:
relative
;
margin
:
0
15px
15px
0
;
padding
:
10px
10px
47px
10px
;
width
:
120px
;
height
:
120px
;
border-radius
:
2px
;
border
:
1px
solid
#e4e7ed
;
.folder-icon
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
width
:
138
px
;
height
:
138
px
;
border
:
10px
solid
#fff
;
padding
:
10
px
;
width
:
100
px
;
height
:
100px
;
background-color
:
#f5f5f8
;
img
{
vertical-align
:
middle
;
width
:
80px
;
height
:
80px
;
max-width
:
100%
;
max-height
:
100%
;
}
}
.folder-name
{
position
:
absolute
;
right
:
0
;
bottom
:
0
;
left
:
0
;
z-index
:
1
;
margin
:
0
;
width
:
100%
;
height
:
37px
;
...
...
src/components/photo-album/img-item.vue
View file @
fe1362a5
<
template
>
<div>
<div
class=
"image"
@
dblclick=
"show
= tru
e"
>
<div
class=
"image"
@
dblclick=
"show
Imag
e"
>
<img
:src=
"img.url"
alt=
""
>
<p
class=
"image-name"
>
{{
img
.
name
}}
</p>
</div>
...
...
@@ -10,27 +10,27 @@
<i
class=
"el-icon-arrow-left"
@
click=
"lastImg"
></i>
<i
class=
"el-icon-arrow-right"
@
click=
"nextImg"
></i>
<div
class=
"big-img-box"
>
<img
:src=
"img.url"
alt=
""
/>
<img
:src=
"img
Detail
.url"
alt=
""
/>
</div>
</div>
<div
class=
"img-detail-right"
>
<h2>
{{
img
.
name
}}
</h2>
<h2>
{{
img
Detail
.
name
}}
</h2>
<div
class=
"img-info"
>
<h3>
图片属性
</h3>
<div
class=
"img-info-item"
>
<span>
编辑时间:
</span><span>
{{
img
.
time
|
formatDate
}}
{{
img
.
time
|
formatTime
}}
</span>
<span>
编辑时间:
</span><span>
{{
img
Detail
.
time
|
formatDate
}}
{{
imgDetail
.
time
|
formatTime
}}
</span>
</div>
<div
class=
"img-info-item"
>
<span>
图片大小:
</span><span>
{{
(
img
.
size
/
1024
).
toFixed
(
2
)
}}
KB
</span>
<span>
图片大小:
</span><span>
{{
(
img
Detail
.
size
/
1024
).
toFixed
(
2
)
}}
KB
</span>
</div>
<div
class=
"img-info-item"
>
<span>
图片尺寸:
</span><span>
{{
img
.
size1
}}
</span>
<span>
图片尺寸:
</span><span>
{{
img
Detail
.
size1
}}
</span>
</div>
<div
class=
"img-info-item"
>
<span>
图片类型:
</span><span>
{{
img
.
type
}}
</span>
<span>
图片类型:
</span><span>
{{
img
Detail
.
type
}}
</span>
</div>
<div
class=
"img-info-item"
>
<span>
添加人:
</span><span>
{{
img
.
shopper
}}
</span>
<span>
添加人:
</span><span>
{{
img
Detail
.
shopper
}}
</span>
</div>
</div>
</div>
...
...
@@ -56,6 +56,7 @@ export default {
},
filters
:
{
formatDate
(
ms
)
{
if
(
!
ms
)
return
'--'
;
let
date
=
new
Date
(
ms
);
let
dateArr
=
[];
dateArr
.
push
(
date
.
getFullYear
());
...
...
@@ -65,12 +66,13 @@ export default {
return
dateArr
.
join
(
'-'
);
},
formatTime
(
ms
)
{
if
(
!
ms
)
return
'--'
;
let
date
=
new
Date
(
ms
);
let
timeArr
=
[];
timeArr
.
push
(
date
.
getHours
());
timeArr
.
push
(
date
.
getMinutes
());
timeArr
.
push
(
date
.
getSeconds
());
timeArr
=
timeArr
.
map
(
item
=>
(
item
<
10
?
`
${
item
}
`
:
item
));
timeArr
=
timeArr
.
map
(
item
=>
(
item
<
10
?
`
0
${
item
}
`
:
item
));
return
timeArr
.
join
(
':'
);
}
},
...
...
@@ -98,6 +100,11 @@ export default {
},
onClosed
()
{
this
.
currentIndex
=
this
.
index
;
},
showImage
()
{
this
.
imgDetail
=
Object
.
assign
({},
this
.
img
);
this
.
currentIndex
=
this
.
index
;
this
.
show
=
true
;
}
}
}
...
...
@@ -105,17 +112,28 @@ export default {
<
style
lang=
"scss"
scoped
>
.image
{
margin-right
:
10px
;
margin-bottom
:
15px
;
width
:
160px
;
position
:
relative
;
margin
:
0
15px
15px
0
;
padding-bottom
:
37px
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
width
:
140px
;
height
:
140px
;
cursor
:
pointer
;
border
:
1px
solid
#e4e7ed
;
img
{
vertical-align
:
middle
;
width
:
158px
;
height
:
158px
;
max-width
:
100%
;
max-height
:
100%
;
border-radius
:
0
;
}
.image-name
{
position
:
absolute
;
right
:
0
;
bottom
:
0
;
left
:
0
;
z-index
:
1
;
margin
:
0
;
width
:
100%
;
height
:
37px
;
...
...
@@ -138,15 +156,15 @@ export default {
border-top
:
1px
solid
#e4e7eb
;
}
.img-detail-left
{
width
:
640px
;
display
:
inline-block
;
background
:
#fff
;
position
:
relative
;
width
:
640px
;
height
:
610px
;
font-size
:
14px
;
}
.big-img-box
{
width
:
348
px
;
width
:
492
px
;
height
:
492px
;
position
:
absolute
;
left
:
50%
;
...
...
@@ -155,11 +173,12 @@ export default {
}
.big-img-box
img
{
max-width
:
100%
;
height
:
100%
;
max-
height
:
100%
;
position
:
absolute
;
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
user-select
:
none
;
}
.el-icon-arrow-left
{
position
:
absolute
;
...
...
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