Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
exhibition_backstage
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
exhibition_backstage
Commits
a4ca61a5
提交
a4ca61a5
authored
11月 28, 2023
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复抠图详情页预览索引错误问题;增加多选抠图失败为不能下载
上级
2af1b167
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
166 行增加
和
113 行删除
+166
-113
PreviewDialog.vue
src/views/matting/components/PreviewDialog.vue
+156
-110
index.vue
src/views/matting/index.vue
+10
-3
没有找到文件。
src/views/matting/components/PreviewDialog.vue
浏览文件 @
a4ca61a5
<
template
>
<el-dialog
:visible
.
sync=
"visible"
top=
"3vh"
:before-close=
"handleClose"
lock-scroll
width=
"65vw"
title=
"抠图详情"
>
<div
class=
"dialog-content"
>
<el-descriptions
title=
"详细信息"
v-if=
"infoHasValue"
>
<el-descriptions-item
:label=
"item.label"
v-for=
"(item, index) in tableTitle"
:key=
"index"
>
<span
v-if=
"item.prop == 'status'"
>
<el-tag
size=
"mini"
:type=
"
$constantsTool.getTagTypeByValue('mattingStatus', detail.status)
"
>
{{
$constantsTool
.
getLabelByValue
(
"mattingStatus"
,
detail
.
status
)
}}
</el-tag>
</span>
<span
v-else
>
{{
detail
[
item
.
prop
]
}}
</span>
</el-descriptions-item>
</el-descriptions>
<div
class=
"imgs"
>
<div
class=
"imgs-title"
>
<h3>
图片列表
</h3>
<div
class=
"right"
v-if=
"isImgMultiple"
>
<el-button
type=
"text"
style=
"margin-right: 10px"
@
click=
"toggleShowCheckbox"
>
{{
getText
}}
</el-button
>
<el-checkbox
label=
"全选"
v-model=
"isAllChecked"
v-if=
"isShowCheckbox"
></el-checkbox>
</div>
</div>
<div
class=
"container"
:gutter=
"10"
>
<div
v-for=
"(item, index) in mattingImagesPage.records"
<div>
<el-dialog
:visible
.
sync=
"visible"
top=
"3vh"
:before-close=
"handleClose"
lock-scroll
width=
"65vw"
title=
"抠图详情"
>
<div
class=
"dialog-content"
>
<el-descriptions
title=
"详细信息"
v-if=
"infoHasValue"
>
<el-descriptions-item
:label=
"item.label"
v-for=
"(item, index) in tableTitle"
:key=
"index"
class=
"img-item"
>
<div
:class=
"['modal', item.checked ? 'active' : '']"
v-if=
"isShowCheckbox"
@
click
.
prevent=
"toggleItemCheckbox(item)"
>
<span
v-if=
"item.prop == 'status'"
>
<el-tag
size=
"mini"
:type=
"
$constantsTool.getTagTypeByValue(
'mattingStatus',
detail.status
)
"
>
{{
$constantsTool
.
getLabelByValue
(
"mattingStatus"
,
detail
.
status
)
}}
</el-tag>
</span>
<span
v-else
>
{{
detail
[
item
.
prop
]
}}
</span>
</el-descriptions-item>
</el-descriptions>
<div
class=
"imgs"
>
<div
class=
"imgs-title"
>
<h3>
图片列表
</h3>
<div
class=
"right"
v-if=
"isImgMultiple"
>
<el-button
type=
"text"
style=
"margin-right: 10px"
@
click=
"toggleShowCheckbox"
>
{{
getText
}}
</el-button
>
<el-checkbox
class=
"checkbox"
label=
"全选"
v-model=
"isAllChecked"
v-if=
"isShowCheckbox"
v-model=
"item.checked"
></el-checkbox>
</div>
<div
class=
"more"
@
click
.
prevent=
"toggleItemCheckbox(item)"
>
<el-button
title=
"下载"
style=
"margin-right: 12px"
type=
"text"
icon=
"el-icon-download"
@
click=
"handleDownloadRow(item)"
></el-button>
<el-dropdown>
<i
class=
"el-icon-more"
style=
"color: #409eff"
></i>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
@
click
.
native=
"handleDeleteRow(item)"
>
删除
</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</div>
<el-image
style=
"width: 200px; height: 150px; padding: 10px"
:src=
"item.pressUrl"
fit=
"contain"
:preview-src-list=
"srcList"
></el-image>
</div>
<div
class=
"container"
:gutter=
"10"
>
<div
v-for=
"(item, index) in mattingImagesPage.records"
:key=
"index"
class=
"img-item"
>
<div
:class=
"['modal', item.checked ? 'active' : '']"
v-if=
"isShowCheckbox"
@
click
.
prevent=
"toggleItemCheckbox(item)"
>
<el-checkbox
class=
"checkbox"
v-if=
"isShowCheckbox"
v-model=
"item.checked"
></el-checkbox>
</div>
<div
class=
"more"
@
click
.
prevent=
"toggleItemCheckbox(item)"
>
<el-tag
:type=
"
$constantsTool.getTagTypeByValue(
'mattingStatus',
item.status
)
"
size=
"mini"
style=
"margin-right: 6px"
>
{{
$constantsTool
.
getLabelByValue
(
"mattingStatus"
,
item
.
status
)
}}
</el-tag>
<el-button
title=
"下载"
style=
"margin-right: 16px"
type=
"text"
icon=
"el-icon-download"
@
click=
"handleDownloadRow(item)"
:disabled=
"isDisabledDownload(item)"
></el-button>
<el-dropdown>
<i
class=
"el-icon-more"
style=
"color: #409eff"
></i>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
@
click
.
native=
"handleDeleteRow(item)"
>
删除
</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</div>
<el-image
style=
"width: 200px; height: 230px; padding: 10px"
:src=
"item.pressUrl"
fit=
"contain"
@
click=
"openElImageViwer(index)"
></el-image>
<div
class=
"name"
>
{{
item
.
name
}}
</div>
<div
class=
"name"
>
{{
item
.
name
}}
</div>
</div>
</div>
<el-pagination
v-if=
"mattingImagesPage.records.length > 0"
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"Number(mattingImagesPage.current)"
:page-sizes=
"[10, 20, 40, 50]"
:page-size=
"Number(mattingImagesPage.size)"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"Number(mattingImagesPage.total)"
class=
"pagination"
/>
<div
class=
"button"
>
<PermissionButton
button
perms=
"bizMattingImages:download"
@
click=
"handleDownload"
:disabled=
"disabledButton"
plain
type=
"primary"
icon=
"el-icon-download"
style=
"width: 100%"
>
下载
</PermissionButton
>
</div>
</div>
<el-pagination
v-if=
"mattingImagesPage.records.length > 0"
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"Number(mattingImagesPage.current)"
:page-sizes=
"[10, 20, 40, 50]"
:page-size=
"Number(mattingImagesPage.size)"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"Number(mattingImagesPage.total)"
class=
"pagination"
/>
<div
class=
"button"
>
<PermissionButton
button
perms=
"bizMattingImages:download"
@
click=
"handleDownload"
:disabled=
"disabledButton"
plain
type=
"primary"
icon=
"el-icon-download"
style=
"width: 100%"
>
下载
</PermissionButton
>
</div>
</div>
</div>
</el-dialog>
</el-dialog>
<el-image-viewer
v-if=
"imgViewerVisible"
:on-close=
"closeImgViewer"
:url-list=
"srcList"
:initial-index=
"initialIndex"
/>
</div>
</
template
>
<
script
>
...
...
@@ -130,7 +156,10 @@ import {
import
{
Debounce
}
from
"@/utils/index"
;
export
default
{
name
:
"PreviewDialog"
,
components
:
{},
components
:
{
"el-image-viewer"
:
()
=>
import
(
"element-ui/packages/image/src/image-viewer"
),
},
props
:
{
detail
:
{
type
:
Object
,
...
...
@@ -150,6 +179,8 @@ export default {
current
:
1
,
total
:
0
,
},
imgViewerVisible
:
false
,
initialIndex
:
0
,
};
},
computed
:
{
...
...
@@ -193,6 +224,11 @@ export default {
}
return
this
.
mattingImagesPage
.
total
>
1
;
},
isDisabledDownload
(
item
)
{
return
(
item
)
=>
{
return
item
.
status
!=
1
;
};
},
},
watch
:
{
detail
(
value
)
{
...
...
@@ -321,6 +357,15 @@ export default {
this
.
mattingImagesPage
.
current
=
current
;
this
.
loadImgs
();
},
openElImageViwer
(
index
)
{
this
.
imgViewerVisible
=
true
;
this
.
initialIndex
=
index
;
},
closeImgViewer
()
{
this
.
imgViewerVisible
=
false
;
},
},
};
</
script
>
...
...
@@ -363,6 +408,7 @@ export default {
top
:
0
;
color
:
#409eff
;
cursor
:
pointer
;
margin-bottom
:
10px
;
}
.modal
{
position
:
absolute
;
...
...
src/views/matting/index.vue
浏览文件 @
a4ca61a5
...
...
@@ -260,10 +260,17 @@ export default {
},
handleMultiDownload
()
{
const
ids
=
this
.
multiSelection
.
map
((
item
)
=>
{
return
item
.
mattingId
;
const
hasError
=
this
.
multiSelection
.
some
((
item
)
=>
{
return
item
.
status
==
-
1
;
});
this
.
downloadByRecordId
(
ids
);
if
(
hasError
)
{
this
.
$message
.
warning
(
"当前只支持下载抠图成功的图片!"
);
}
else
{
const
ids
=
this
.
multiSelection
.
map
((
item
)
=>
{
return
item
.
mattingId
;
});
this
.
downloadByRecordId
(
ids
);
}
},
deleteByRecordsId
:
Debounce
(
async
function
(
ids
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论