优化表格组件,新增过滤功能,调整数据获取逻辑,更新相关页面及路由
This commit is contained in:
@@ -14,16 +14,21 @@ import type { TableColumnCheck } from '~/packages/hooks/src';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
||||
const title = t(route.meta.i18nKey as string);
|
||||
const props = defineProps<{
|
||||
fetchData: TableFetchData;
|
||||
columns: TableBaseColumns;
|
||||
showHeaderOperation?: boolean;
|
||||
filterColumns?: TableFilterColumns;
|
||||
}>();
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
fetchData: TableFetchData;
|
||||
columns: TableBaseColumns;
|
||||
showHeaderOperation?: boolean;
|
||||
filterColumns?: TableFilterColumns;
|
||||
}>(),
|
||||
{
|
||||
filterColumns: () => []
|
||||
}
|
||||
);
|
||||
const emit = defineEmits<{
|
||||
(e: 'add'): void;
|
||||
(e: 'refresh'): void;
|
||||
(e: 'delete'): void;
|
||||
}>();
|
||||
|
||||
@@ -86,7 +91,7 @@ defineExpose({
|
||||
|
||||
<template>
|
||||
<div class="space-y-5">
|
||||
<TableFilter :columns="filterColumns" @confirm="handleSearch" />
|
||||
<TableFilter v-if="filterColumns.length > 0" :columns="filterColumns" @confirm="handleSearch" />
|
||||
|
||||
<div class="rounded-lg bg-white p-5 space-y-5">
|
||||
<TableHeaderOperation
|
||||
|
||||
Reference in New Issue
Block a user