Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
finance-oa
finance-manage
Commits
3cd88678
Commit
3cd88678
authored
Jan 05, 2021
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片组件添加预览功能
parent
ae5a0f97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
ruoyi-ui/src/components/ImageUpload/index.vue
ruoyi-ui/src/components/ImageUpload/index.vue
+8
-5
No files found.
ruoyi-ui/src/components/ImageUpload/index.vue
View file @
3cd88678
...
@@ -17,9 +17,12 @@
...
@@ -17,9 +17,12 @@
</div>
</div>
</el-image>
</el-image>
<div
v-else
class=
"image"
>
<div
v-else
class=
"image"
>
<el-image
:src=
"value"
/>
<el-image
:src=
"value"
:style=
"`width:150px;height:150px;`"
fit=
"fill"
/>
<div
class=
"mask"
>
<div
class=
"mask"
>
<div
class=
"actions"
>
<div
class=
"actions"
>
<span
title=
"预览"
@
click.stop=
"dialogVisible = true"
>
<i
class=
"el-icon-zoom-in"
/>
</span>
<span
title=
"移除"
@
click.stop=
"removeImage"
>
<span
title=
"移除"
@
click.stop=
"removeImage"
>
<i
class=
"el-icon-delete"
/>
<i
class=
"el-icon-delete"
/>
</span>
</span>
...
@@ -27,6 +30,9 @@
...
@@ -27,6 +30,9 @@
</div>
</div>
</div>
</div>
</el-upload>
</el-upload>
<el-dialog
:visible.sync=
"dialogVisible"
title=
"预览"
width=
"800"
append-to-body
>
<img
:src=
"value"
style=
"display: block; max-width: 100%; margin: 0 auto;"
>
</el-dialog>
</div>
</div>
</
template
>
</
template
>
...
@@ -36,6 +42,7 @@ import { getToken } from "@/utils/auth";
...
@@ -36,6 +42,7 @@ import { getToken } from "@/utils/auth";
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
dialogVisible
:
false
,
uploadImgUrl
:
process
.
env
.
VUE_APP_BASE_API
+
"
/common/upload
"
,
// 上传的图片服务器地址
uploadImgUrl
:
process
.
env
.
VUE_APP_BASE_API
+
"
/common/upload
"
,
// 上传的图片服务器地址
headers
:
{
headers
:
{
Authorization
:
"
Bearer
"
+
getToken
(),
Authorization
:
"
Bearer
"
+
getToken
(),
...
@@ -76,10 +83,6 @@ export default {
...
@@ -76,10 +83,6 @@ export default {
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.avatar
{
width
:
100%
;
height
:
100%
;
}
.image
{
.image
{
position
:
relative
;
position
:
relative
;
.mask
{
.mask
{
...
...
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