refactor(credit): 更新搜索工具栏组件以支持动态模块配置

- 修改 CreditSearchToolbar 组件以接收 module 属性并传递给 RefreshCompanyIdButton
- 在所有信用相关页面中添加对应的 module 属性配置
- 优化组件代码格式化和导入语句
- 添加 reload 方法以在刷新 companyId 后保持搜索条件
- 修复图标组件标签闭合格式问题
This commit is contained in:
2026-02-06 13:20:52 +08:00
parent d97d279670
commit c16b857505
13 changed files with 68 additions and 49 deletions

View File

@@ -9,17 +9,17 @@
<!-- </a-button>--> <!-- </a-button>-->
<a-button class="ele-btn-icon" @click="openImport"> <a-button class="ele-btn-icon" @click="openImport">
<template #icon> <template #icon>
<CloudUploadOutlined/> <CloudUploadOutlined />
</template> </template>
<span>导入()</span> <span>导入()</span>
</a-button> </a-button>
<a-button class="ele-btn-icon" @click="exportData"> <a-button class="ele-btn-icon" @click="exportData">
<template #icon> <template #icon>
<CloudDownloadOutlined/> <CloudDownloadOutlined />
</template> </template>
<span>导出</span> <span>导出</span>
</a-button> </a-button>
<RefreshCompanyIdButton module="credit-case-filing" @done="reload"/> <RefreshCompanyIdButton :module="props.module" @done="reload" />
<a-button <a-button
danger danger
class="ele-btn-icon" class="ele-btn-icon"
@@ -27,7 +27,7 @@
@click="remove" @click="remove"
> >
<template #icon> <template #icon>
<DeleteOutlined/> <DeleteOutlined />
</template> </template>
<span>批量删除</span> <span>批量删除</span>
</a-button> </a-button>
@@ -43,57 +43,64 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {computed, ref} from 'vue'; import { computed, ref } from 'vue';
import { import {
CloudUploadOutlined, CloudUploadOutlined,
CloudDownloadOutlined, CloudDownloadOutlined,
DeleteOutlined DeleteOutlined
} from '@ant-design/icons-vue'; } from '@ant-design/icons-vue';
import RefreshCompanyIdButton from "@/views/credit/components/RefreshCompanyIdButton.vue"; import RefreshCompanyIdButton from '@/views/credit/components/RefreshCompanyIdButton.vue';
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
/** 后端模块路径片段,如: credit-breach-of-trust */
module: string;
selection?: any[]; selection?: any[];
}>(), }>(),
{ {
selection: () => [] selection: () => []
} }
); );
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'search', where?: { keywords?: string }): void; (e: 'search', where?: { keywords?: string }): void;
(e: 'add'): void; (e: 'add'): void;
(e: 'remove'): void; (e: 'remove'): void;
(e: 'batchMove'): void; (e: 'batchMove'): void;
(e: 'importData'): void; (e: 'importData'): void;
(e: 'exportData'): void; (e: 'exportData'): void;
}>(); }>();
const keywords = ref(''); const keywords = ref('');
const selection = computed(() => props.selection || []); const selection = computed(() => props.selection || []);
// 新增 // 新增
const add = () => { const add = () => {
emit('add'); emit('add');
}; };
// 搜索 // 搜索
const handleSearch = () => { const handleSearch = () => {
emit('search', {keywords: keywords.value}); emit('search', { keywords: keywords.value });
}; };
// 导入 // 刷新 companyId 后,保持当前条件并触发父级 reload
const openImport = () => { const reload = () => {
emit('search', { keywords: keywords.value });
};
// 导入
const openImport = () => {
emit('importData'); emit('importData');
}; };
// 导出 // 导出
const exportData = () => { const exportData = () => {
emit('exportData'); emit('exportData');
}; };
// 批量删除 // 批量删除
const remove = () => { const remove = () => {
emit('remove'); emit('remove');
}; };
</script> </script>

View File

@@ -15,6 +15,7 @@
<a-space class="flex"> <a-space class="flex">
<search <search
@search="reload" @search="reload"
module="credit-breach-of-trust"
:selection="selection" :selection="selection"
@add="openEdit" @add="openEdit"
@remove="removeBatch" @remove="removeBatch"

View File

@@ -15,6 +15,7 @@
<a-space class="flex"> <a-space class="flex">
<search <search
@search="reload" @search="reload"
module="credit-case-filing"
:selection="selection" :selection="selection"
@add="openEdit" @add="openEdit"
@remove="removeBatch" @remove="removeBatch"

View File

@@ -15,6 +15,7 @@
<a-space class="flex"> <a-space class="flex">
<search <search
@search="reload" @search="reload"
module="credit-court-announcement"
:selection="selection" :selection="selection"
@add="openEdit" @add="openEdit"
@remove="removeBatch" @remove="removeBatch"

View File

@@ -15,6 +15,7 @@
<a-space class="flex"> <a-space class="flex">
<search <search
@search="reload" @search="reload"
module="credit-court-session"
:selection="selection" :selection="selection"
@add="openEdit" @add="openEdit"
@remove="removeBatch" @remove="removeBatch"

View File

@@ -15,6 +15,7 @@
<a-space class="flex"> <a-space class="flex">
<search <search
@search="reload" @search="reload"
module="credit-delivery-notice"
:selection="selection" :selection="selection"
@add="openEdit" @add="openEdit"
@remove="removeBatch" @remove="removeBatch"

View File

@@ -15,6 +15,7 @@
<a-space class="flex"> <a-space class="flex">
<search <search
@search="reload" @search="reload"
module="credit-final-version"
:selection="selection" :selection="selection"
@add="openEdit" @add="openEdit"
@remove="removeBatch" @remove="removeBatch"

View File

@@ -16,6 +16,7 @@
<a-space class="flex"> <a-space class="flex">
<search <search
@search="reload" @search="reload"
module="credit-gqdj"
:selection="selection" :selection="selection"
@add="openEdit" @add="openEdit"
@remove="removeBatch" @remove="removeBatch"

View File

@@ -15,6 +15,7 @@
<a-space class="flex"> <a-space class="flex">
<search <search
@search="reload" @search="reload"
module="credit-judgment-debtor"
:selection="selection" :selection="selection"
@add="openEdit" @add="openEdit"
@remove="removeBatch" @remove="removeBatch"

View File

@@ -16,6 +16,7 @@
<a-space class="flex"> <a-space class="flex">
<search <search
@search="reload" @search="reload"
module="credit-judicial-document"
:selection="selection" :selection="selection"
@add="openEdit" @add="openEdit"
@remove="removeBatch" @remove="removeBatch"

View File

@@ -15,6 +15,7 @@
<a-space class="flex"> <a-space class="flex">
<search <search
@search="reload" @search="reload"
module="credit-mediation"
:selection="selection" :selection="selection"
@add="openEdit" @add="openEdit"
@remove="removeBatch" @remove="removeBatch"

View File

@@ -13,6 +13,7 @@
<template #toolbar> <template #toolbar>
<search <search
@search="reload" @search="reload"
module="credit-project"
:selection="selection" :selection="selection"
@add="openEdit" @add="openEdit"
@remove="removeBatch" @remove="removeBatch"

View File

@@ -15,6 +15,7 @@
<a-space class="flex"> <a-space class="flex">
<search <search
@search="reload" @search="reload"
module="credit-xgxf"
:selection="selection" :selection="selection"
@add="openEdit" @add="openEdit"
@remove="removeBatch" @remove="removeBatch"