|
@@ -9,6 +9,7 @@ interface CRUD {
|
|
|
create: Function
|
|
|
update: Function
|
|
|
delete: Function
|
|
|
+ deleteBatch: Function
|
|
|
getList: Function
|
|
|
getRecord: Function
|
|
|
}
|
|
@@ -139,11 +140,11 @@ const handleDelete = (id: string | number) => {
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
-const handlePatchDelete = () => {
|
|
|
+const handleBatchDelete = () => {
|
|
|
ElMessageBox.confirm('您确定要删除吗', '提示', {
|
|
|
type: 'warning'
|
|
|
}).then(async () => {
|
|
|
- await props.crud?.delete({
|
|
|
+ await props.crud?.deleteBatch({
|
|
|
ids: multipleSelection.value.map(item => item.id).join(',')
|
|
|
})
|
|
|
ElMessage({
|
|
@@ -184,7 +185,7 @@ defineExpose({
|
|
|
<div class="flex justify-between mb-20px">
|
|
|
<div>
|
|
|
<el-button type="primary" @click="handleCreate">新增</el-button>
|
|
|
- <el-button type="danger" @click="handlePatchDelete" :disabled="!multipleSelection.length" v-if="selection">
|
|
|
+ <el-button type="danger" @click="handleBatchDelete" :disabled="!multipleSelection.length" v-if="selection">
|
|
|
删除
|
|
|
</el-button>
|
|
|
</div>
|