refactor(credit): 更新搜索工具栏组件以支持动态模块配置
- 修改 CreditSearchToolbar 组件以接收 module 属性并传递给 RefreshCompanyIdButton - 在所有信用相关页面中添加对应的 module 属性配置 - 优化组件代码格式化和导入语句 - 添加 reload 方法以在刷新 companyId 后保持搜索条件 - 修复图标组件标签闭合格式问题
This commit is contained in:
@@ -9,17 +9,17 @@
|
||||
<!-- </a-button>-->
|
||||
<a-button class="ele-btn-icon" @click="openImport">
|
||||
<template #icon>
|
||||
<CloudUploadOutlined/>
|
||||
<CloudUploadOutlined />
|
||||
</template>
|
||||
<span>导入(多)</span>
|
||||
</a-button>
|
||||
<a-button class="ele-btn-icon" @click="exportData">
|
||||
<template #icon>
|
||||
<CloudDownloadOutlined/>
|
||||
<CloudDownloadOutlined />
|
||||
</template>
|
||||
<span>导出</span>
|
||||
</a-button>
|
||||
<RefreshCompanyIdButton module="credit-case-filing" @done="reload"/>
|
||||
<RefreshCompanyIdButton :module="props.module" @done="reload" />
|
||||
<a-button
|
||||
danger
|
||||
class="ele-btn-icon"
|
||||
@@ -27,7 +27,7 @@
|
||||
@click="remove"
|
||||
>
|
||||
<template #icon>
|
||||
<DeleteOutlined/>
|
||||
<DeleteOutlined />
|
||||
</template>
|
||||
<span>批量删除</span>
|
||||
</a-button>
|
||||
@@ -43,57 +43,64 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {computed, ref} from 'vue';
|
||||
import {
|
||||
CloudUploadOutlined,
|
||||
CloudDownloadOutlined,
|
||||
DeleteOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import RefreshCompanyIdButton from "@/views/credit/components/RefreshCompanyIdButton.vue";
|
||||
import { computed, ref } from 'vue';
|
||||
import {
|
||||
CloudUploadOutlined,
|
||||
CloudDownloadOutlined,
|
||||
DeleteOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import RefreshCompanyIdButton from '@/views/credit/components/RefreshCompanyIdButton.vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
selection?: any[];
|
||||
}>(),
|
||||
{
|
||||
selection: () => []
|
||||
}
|
||||
);
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
/** 后端模块路径片段,如: credit-breach-of-trust */
|
||||
module: string;
|
||||
selection?: any[];
|
||||
}>(),
|
||||
{
|
||||
selection: () => []
|
||||
}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: { keywords?: string }): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
(e: 'importData'): void;
|
||||
(e: 'exportData'): void;
|
||||
}>();
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: { keywords?: string }): 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 keywords = ref('');
|
||||
const selection = computed(() => props.selection || []);
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const handleSearch = () => {
|
||||
emit('search', {keywords: keywords.value});
|
||||
};
|
||||
// 搜索
|
||||
const handleSearch = () => {
|
||||
emit('search', { keywords: keywords.value });
|
||||
};
|
||||
|
||||
// 导入
|
||||
const openImport = () => {
|
||||
emit('importData');
|
||||
};
|
||||
// 刷新 companyId 后,保持当前条件并触发父级 reload
|
||||
const reload = () => {
|
||||
emit('search', { keywords: keywords.value });
|
||||
};
|
||||
|
||||
// 导出
|
||||
const exportData = () => {
|
||||
emit('exportData');
|
||||
};
|
||||
// 导入
|
||||
const openImport = () => {
|
||||
emit('importData');
|
||||
};
|
||||
|
||||
// 批量删除
|
||||
const remove = () => {
|
||||
emit('remove');
|
||||
};
|
||||
// 导出
|
||||
const exportData = () => {
|
||||
emit('exportData');
|
||||
};
|
||||
|
||||
// 批量删除
|
||||
const remove = () => {
|
||||
emit('remove');
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<a-space class="flex">
|
||||
<search
|
||||
@search="reload"
|
||||
module="credit-breach-of-trust"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<a-space class="flex">
|
||||
<search
|
||||
@search="reload"
|
||||
module="credit-case-filing"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<a-space class="flex">
|
||||
<search
|
||||
@search="reload"
|
||||
module="credit-court-announcement"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<a-space class="flex">
|
||||
<search
|
||||
@search="reload"
|
||||
module="credit-court-session"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<a-space class="flex">
|
||||
<search
|
||||
@search="reload"
|
||||
module="credit-delivery-notice"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<a-space class="flex">
|
||||
<search
|
||||
@search="reload"
|
||||
module="credit-final-version"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<a-space class="flex">
|
||||
<search
|
||||
@search="reload"
|
||||
module="credit-gqdj"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<a-space class="flex">
|
||||
<search
|
||||
@search="reload"
|
||||
module="credit-judgment-debtor"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<a-space class="flex">
|
||||
<search
|
||||
@search="reload"
|
||||
module="credit-judicial-document"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<a-space class="flex">
|
||||
<search
|
||||
@search="reload"
|
||||
module="credit-mediation"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
module="credit-project"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<a-space class="flex">
|
||||
<search
|
||||
@search="reload"
|
||||
module="credit-xgxf"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
|
||||
Reference in New Issue
Block a user