feat(creditMpCustomer): 添加导出和批量删除功能

- 在搜索组件中添加导出按钮和批量删除按钮
- 实现导出数据功能,支持导出小程序端客户列表
- 添加关键词搜索功能,支持按关键词过滤数据
- 实现批量删除功能,支持选择多个客户进行删除
- 更新表格配置,添加行选择和搜索参数传递
- 修改数据源查询逻辑,支持关键词和状态筛选
- 添加文件下载图标和删除图标依赖
This commit is contained in:
2026-03-16 21:39:57 +08:00
parent c79c68e7a1
commit 41a1fcb4ed
2 changed files with 113 additions and 12 deletions

View File

@@ -7,34 +7,87 @@
</template>
<span>添加</span>
</a-button>
<a-button class="ele-btn-icon" @click="exportData">
<template #icon>
<CloudDownloadOutlined />
</template>
<span>导出</span>
</a-button>
<a-button
danger
class="ele-btn-icon"
:disabled="!selection?.length"
@click="remove"
>
<template #icon>
<DeleteOutlined />
</template>
<span>批量删除</span>
</a-button>
<a-input-search
allow-clear
v-model:value="keywords"
placeholder="请输入关键词"
style="width: 220px"
@search="handleSearch"
@pressEnter="handleSearch"
/>
</a-space>
</template>
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import type { GradeParam } from '@/api/user/grade/model';
import { watch } from 'vue';
import { computed, ref, watch } from 'vue';
import {
PlusOutlined,
CloudDownloadOutlined,
DeleteOutlined
} from '@ant-design/icons-vue';
import type {
CreditMpCustomer,
CreditMpCustomerParam
} from '@/api/credit/creditMpCustomer/model';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
selection?: CreditMpCustomer[];
}>(),
{}
{
selection: () => []
}
);
const emit = defineEmits<{
(e: 'search', where?: GradeParam): void;
(e: 'search', where?: CreditMpCustomerParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
(e: 'exportData'): void;
}>();
const keywords = ref('');
const selection = computed(() => props.selection || []);
// 新增
const add = () => {
emit('add');
};
// 搜索
const handleSearch = () => {
emit('search', { keywords: keywords.value });
};
// 导出
const exportData = () => {
emit('exportData');
};
// 批量删除
const remove = () => {
emit('remove');
};
watch(
() => props.selection,
() => {}