feat: system 新增批量删除

This commit is contained in:
puhui999
2025-06-15 18:17:28 +08:00
parent cd78171106
commit 3a7fe42e8e
30 changed files with 545 additions and 38 deletions

View File

@ -14,6 +14,15 @@
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="danger"
plain
@click="handleDeleteBatch"
:disabled="!isSelected"
v-hasPermi="['system:mail-template:delete']"
>
<Icon icon="ep:delete" class="mr-5px" /> 批量删除
</el-button>
</template>
</Search>
</ContentWrap>
@ -29,6 +38,7 @@
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
:selection="true"
>
<template #action="{ row }">
<el-button
@ -94,6 +104,19 @@ const handleDelete = (id: number) => {
tableMethods.delList(id, false)
}
/** 是否有选中行 */
const isSelected = computed(() => {
return tableObject.selections && tableObject.selections.length > 0
})
/** 批量删除按钮操作 */
const handleDeleteBatch = async () => {
const ids = tableObject.selections.map(item => item.id)
if (ids.length === 0) return
await MailTemplateApi.deleteMailTemplateList(ids)
tableMethods.getList()
}
/** 发送测试操作 */
const sendFormRef = ref()
const openSendForm = (id: number) => {