add batch delete for log

This commit is contained in:
ljw
2024-11-12 09:07:42 +08:00
parent 4d1da2e89e
commit cb1bf5307a
7 changed files with 149 additions and 13 deletions
+15 -4
View File
@@ -14,12 +14,13 @@
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handlerQuery">筛选</el-button>
<el-button type="danger" @click="toBatchDelete">{{ T('BatchDelete') }}</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="list-body" shadow="hover">
<!-- <el-tag type="danger" style="margin-bottom: 10px">不建议在此操作地址簿可能会造成数据不同步</el-tag>-->
<el-table :data="listRes.list" v-loading="listRes.loading" border>
<el-table :data="listRes.list" v-loading="listRes.loading" border @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="50"/>
<el-table-column prop="id" label="ID" align="center" width="100"/>
<el-table-column :label="T('Owner')" align="center" width="120">
<template #default="{row}">
@@ -53,7 +54,7 @@
</template>
<script setup>
import { onActivated, onMounted, watch } from 'vue'
import { onActivated, onMounted, ref, watch } from 'vue'
import { loadAllUsers } from '@/global'
import { useRepositories } from '@/views/login/log.js'
import { T } from '@/utils/i18n'
@@ -67,6 +68,7 @@
getList,
handlerQuery,
del,
batchdel,
} = useRepositories()
onMounted(getList)
@@ -75,7 +77,16 @@
watch(() => listQuery.page, getList)
watch(() => listQuery.page_size, handlerQuery)
const multipleSelection = ref([])
const handleSelectionChange = (val) => {
multipleSelection.value = val
}
const toBatchDelete = () => {
if (multipleSelection.value.length === 0) {
return
}
batchdel(multipleSelection.value)
}
</script>
<style scoped lang="scss">