Files
mp-vue/src/views/credit/creditCompany/components/search.vue
赵忠林 ecd571c60b feat(credit): 新增客户导入与数据导出功能
- 在信用客户模块中添加了导入客户的功能,支持通过文件上传方式导入客户数据
- 实现了多个信用相关模块的数据导出功能,包括企业、司法案件、风险关系、供应商及用户模块
- 更新了搜索组件以支持导出事件,并在各模块中实现了具体的导出逻辑
- 简化了部分表单项的标签显示并移除了冗余字段,优化了用户体验
- 修复了一些潜在的代码格式问题和不必要的注释块
2025-12-22 10:00:49 +08:00

104 lines
2.2 KiB
Vue

<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined />
</template>
<span>添加</span>
</a-button>
<a-button class="ele-btn-icon" @click="openImport">
<template #icon>
<CloudUploadOutlined />
</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 { computed, ref } from 'vue';
import {
PlusOutlined,
CloudUploadOutlined,
CloudDownloadOutlined,
DeleteOutlined
} from '@ant-design/icons-vue';
import type {
CreditJudiciary,
CreditJudiciaryParam
} from '@/api/credit/creditJudiciary/model';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: CreditJudiciary[];
}>(),
{
selection: () => []
}
);
const emit = defineEmits<{
(e: 'search', where?: CreditJudiciaryParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
(e: 'importData'): void;
(e: 'exportData'): void;
}>();
const keywords = ref('');
const selection = computed(() => props.selection || []);
// 新增
const add = () => {
emit('add');
};
// 搜索
const handleSearch = () => {
emit('search', { keywords: keywords.value });
};
// 导入
const openImport = () => {
emit('importData');
};
// 导出
const exportData = () => {
emit('exportData');
};
// 批量删除
const remove = () => {
emit('remove');
};
</script>