Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6775c240
authored
Mar 04, 2022
by
张杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化图片组件
1 parent
ffe5852d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
src/views/work/image.vue
src/views/work/image.vue
View file @
6775c24
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
class=
"img_cell"
v-for=
"(item,index) in imgList"
:key=
"index"
>
<div
class=
"img_cell"
v-for=
"(item,index) in imgList"
:key=
"index"
>
<div
class=
"el_img_box"
>
<div
class=
"el_img_box"
>
<i
class=
"el-icon-error el_icon"
@
click=
"removeImage(item)"
v-if=
"readStatus != 1"
></i>
<i
class=
"el-icon-error el_icon"
@
click=
"removeImage(item)"
v-if=
"readStatus != 1"
></i>
<el-image
class=
"el_img"
:src=
"item.path"
:preview-src-list=
"getPreViewList(item.path)"
></el-image>
<el-image
class=
"el_img"
:src=
"item.path"
:preview-src-list=
"getPreViewList(item.path
,imgList
)"
></el-image>
</div>
</div>
</div>
</div>
<!-- 图片列表 end -->
<!-- 图片列表 end -->
...
@@ -47,6 +47,7 @@ export default {
...
@@ -47,6 +47,7 @@ export default {
uploadUrl
:
""
,
uploadUrl
:
""
,
readStatus
:
""
,
readStatus
:
""
,
acceptFile
:
".jpg,.png"
,
acceptFile
:
".jpg,.png"
,
previewList
:
[],
};
};
},
},
watch
:
{
watch
:
{
...
@@ -126,6 +127,7 @@ export default {
...
@@ -126,6 +127,7 @@ export default {
let
response
=
res
.
data
;
let
response
=
res
.
data
;
if
(
response
.
returnCode
==
0
)
{
if
(
response
.
returnCode
==
0
)
{
_this
.
imgList
.
push
({
path
:
response
.
data
});
_this
.
imgList
.
push
({
path
:
response
.
data
});
_this
.
previewList
.
push
(
res
.
data
);
console
.
log
(
_this
.
imgList
);
console
.
log
(
_this
.
imgList
);
//
//
//this.$emit("change", response.data);
//this.$emit("change", response.data);
...
@@ -160,15 +162,16 @@ export default {
...
@@ -160,15 +162,16 @@ export default {
// 获取图片预览列表
// 获取图片预览列表
getPreViewList
(
url
)
{
getPreViewList
(
url
)
{
let
_this
=
this
;
let
list
=
this
.
imgList
||
[];
let
list
=
this
.
imgList
||
[];
let
arr
=
[];
let
arr
=
[];
list
.
map
((
k
)
=>
{
list
.
map
((
k
)
=>
{
if
(
k
.
path
!=
url
)
{
if
(
k
.
pah
==
url
)
{
arr
.
psuh
(
k
.
path
);
arr
.
unshift
(
k
.
path
);
}
else
{
arr
.
push
(
k
.
path
);
}
}
});
});
arr
.
unshift
(
url
);
console
.
log
(
arr
);
return
arr
;
return
arr
;
},
},
},
},
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment