diff --git a/src/components/Table/src/BasicTable.vue b/src/components/Table/src/BasicTable.vue index 3cee7705..ab2a8d52 100644 --- a/src/components/Table/src/BasicTable.vue +++ b/src/components/Table/src/BasicTable.vue @@ -4,7 +4,7 @@ ref="formRef" submitOnReset v-bind="getFormProps" - v-if="getBindValues.useSearchForm" + v-if="getShowForm() && getBindValues.useSearchForm" :tableAction="tableAction" @register="registerForm" @submit="handleSearchInfoChange" @@ -203,7 +203,12 @@ const { getHeaderProps } = useTableHeader(getProps, slots, handlers) const { getFooterProps } = useTableFooter(getProps, getScrollRef, tableElRef, getDataSourceRef) -const { getFormProps, replaceFormSlotKey, getFormSlotKeys, handleSearchInfoChange } = useTableForm(getProps, slots, fetch, getLoading) +const { getFormProps, replaceFormSlotKey, getFormSlotKeys, handleSearchInfoChange, getShowForm, setShowForm } = useTableForm( + getProps, + slots, + fetch, + getLoading +) const getBindValues = computed(() => { const dataSource = unref(getDataSourceRef) @@ -295,7 +300,9 @@ const tableAction: TableActionType = { getSize: () => { return unref(getBindValues).size as SizeType }, - setCacheColumns + setCacheColumns, + setShowForm, + getShowForm } createTableContext({ ...tableAction, wrapRef, getBindValues }) diff --git a/src/components/Table/src/components/settings/FormSetting.vue b/src/components/Table/src/components/settings/FormSetting.vue new file mode 100644 index 00000000..191f485b --- /dev/null +++ b/src/components/Table/src/components/settings/FormSetting.vue @@ -0,0 +1,24 @@ + + diff --git a/src/components/Table/src/components/settings/SizeSetting.vue b/src/components/Table/src/components/settings/SizeSetting.vue index 74f00b4f..b2f85e50 100644 --- a/src/components/Table/src/components/settings/SizeSetting.vue +++ b/src/components/Table/src/components/settings/SizeSetting.vue @@ -8,15 +8,15 @@ @@ -31,8 +31,6 @@ import { useI18n } from '@/hooks/web/useI18n' import { useTableContext } from '../../hooks/useTableContext' import { getPopupContainer } from '@/utils' -const MenuItem = Menu.Item - defineOptions({ name: 'SizeSetting' }) const table = useTableContext() diff --git a/src/components/Table/src/components/settings/index.vue b/src/components/Table/src/components/settings/index.vue index cbbcf5e5..d3909a53 100644 --- a/src/components/Table/src/components/settings/index.vue +++ b/src/components/Table/src/components/settings/index.vue @@ -1,6 +1,7 @@