feat: 框选移除文件夹

pull/49/head
lizijiee 1 year ago
parent 5fcbecc02e
commit ae974ae436

@ -261,22 +261,19 @@ function closeModal(event: MouseEvent) {
} }
async function remove() { async function remove() {
const arr = listData.value.filter((item) => { if ( !selectIds.value|| selectIds.value.length === 0) {
return item.checked
})
if (arr.length === 0) {
message.error('至少选中一个') message.error('至少选中一个')
return return
} }
const ids = arr.map(item => item.id).join(',') const ids = selectIds.value.join(',')
const res = await removeFiles({ pictureid: ids }) const res = await removeFiles({ pictureid: ids })
if (res.code === 'OK') { if (res.code === 'OK') {
message.success('移除成功') message.success('移除成功')
pagination.pageNo = 1 pagination.pageNo = 1
const list = await featchList() const list = await featchList()
listData.value = list listData.value = list
layout()
} }
} }
@ -311,10 +308,10 @@ function onCheckChange(val: any, item: any) {
v-model:show="show" :mask-closable="false" style="position: relative;" transform-origin="center" v-model:show="show" :mask-closable="false" style="position: relative;" transform-origin="center"
@after-enter="afterEnter" @after-leave="afterLeave" @after-enter="afterEnter" @after-leave="afterLeave"
> >
<n-card <n-card
:style="cardStyle" class="card card-1" style="position: fixed;top:64px" :bordered="false" size="huge" role="dialog" :style="cardStyle" class="card card-1" style="position: fixed;top:64px" :bordered="false" size="huge" role="dialog"
aria-modal="true" aria-modal="true"
> >
<div class="wrapper"> <div class="wrapper">
<div class="wrapper-m32"> <div class="wrapper-m32">
<SvgIcon name="recycle" size="16" /> <SvgIcon name="recycle" size="16" />

Loading…
Cancel
Save