feat(user): added batch delete button for user management

pull/64/head
Angelo 2022-06-15 09:21:30 +08:00
parent ee43a2773c
commit afa5864717
3 changed files with 31 additions and 2 deletions

View File

@ -33,6 +33,14 @@ export function DelObj (id) {
})
}
export function BatchDel (keys) {
return request({
url: urlPrefix + 'multiple_delete/',
method: 'delete',
data: { keys }
})
}
/**
* 重置密码
* @param obj

View File

@ -9,7 +9,12 @@ export const crudOptions = (vm) => {
options: {
height: '100%',
tableType: 'vxe-table',
rowKey: true // 必须设置true or false
rowKey: true,
rowId: 'id'
},
selectionRow: {
align: 'center',
width: 46
},
rowHandle: {
width: 240,

View File

@ -21,9 +21,12 @@
>
<i class="el-icon-plus" /> 新增
</el-button>
<el-button size="small" type="danger" @click="batchDelete">
<i class="el-icon-delete"></i> 批量删除
</el-button>
<el-button
size="small"
type="danger"
type="warning"
@click="onExport"
v-permission="'Export'"
><i class="el-icon-download" /> 导出
@ -42,6 +45,16 @@
@columns-filter-changed="handleColumnsFilterChanged"
/>
</div>
<span slot="PaginationPrefixSlot" class="prefix">
<el-button
class="square"
size="mini"
title="批量删除"
@click="batchDelete"
icon="el-icon-delete"
:disabled="!multipleSelection || multipleSelection.length == 0"
/>
</span>
</d2-crud-x>
<el-dialog
title="密码重置"
@ -149,6 +162,9 @@ export default {
delRequest (row) {
return api.DelObj(row.id)
},
batchDelRequest (ids) {
return api.BatchDel(ids)
},
onExport () {
this.$confirm('是否确认导出所有数据项?', '警告', {
confirmButtonText: '确定',