+
@@ -10,6 +11,7 @@
import type { TableSetting, ColumnChangeParam } from '../../types/table'
import { computed, unref } from 'vue'
import ColumnSetting from './ColumnSetting.vue'
+import FormSetting from './FormSetting.vue'
import SizeSetting from './SizeSetting.vue'
import RedoSetting from './RedoSetting.vue'
import FullScreenSetting from './FullScreenSetting.vue'
@@ -29,6 +31,7 @@ const table = useTableContext()
const getSetting = computed((): TableSetting => {
return {
redo: true,
+ form: true,
size: true,
setting: true,
fullScreen: false,
diff --git a/src/components/Table/src/hooks/useTableForm.ts b/src/components/Table/src/hooks/useTableForm.ts
index 1af5b499..e5611000 100644
--- a/src/components/Table/src/hooks/useTableForm.ts
+++ b/src/components/Table/src/hooks/useTableForm.ts
@@ -1,6 +1,5 @@
-import type { ComputedRef, Slots } from 'vue'
+import { ComputedRef, Slots, ref, unref, computed } from 'vue'
import type { BasicTableProps, FetchParams } from '../types/table'
-import { unref, computed } from 'vue'
import type { FormProps } from '@/components/Form'
import { isFunction } from '@/utils/is'
@@ -10,6 +9,8 @@ export function useTableForm(
fetch: (opt?: FetchParams | undefined) => Promise,
getLoading: ComputedRef
) {
+ const show = ref(true)
+
const getFormProps = computed((): Partial => {
const { formConfig } = unref(propsRef)
const { submitButtonOptions } = formConfig || {}
@@ -39,10 +40,20 @@ export function useTableForm(
fetch({ searchInfo: info, page: 1 })
}
+ function getShowForm() {
+ return unref(show)
+ }
+
+ async function setShowForm(flag: boolean) {
+ show.value = flag
+ }
+
return {
getFormProps,
replaceFormSlotKey,
getFormSlotKeys,
- handleSearchInfoChange
+ handleSearchInfoChange,
+ getShowForm,
+ setShowForm
}
}
diff --git a/src/components/Table/src/types/table.ts b/src/components/Table/src/types/table.ts
index 6fc30ad1..085cdc29 100644
--- a/src/components/Table/src/types/table.ts
+++ b/src/components/Table/src/types/table.ts
@@ -117,6 +117,8 @@ export interface TableActionType {
getShowPagination: () => boolean
setCacheColumnsByField?: (dataIndex: string | undefined, value: BasicColumn) => void
setCacheColumns?: (columns: BasicColumn[]) => void
+ setShowForm: (show: boolean) => Promise
+ getShowForm: () => boolean
}
export interface FetchSetting {
@@ -132,6 +134,7 @@ export interface FetchSetting {
export interface TableSetting {
redo?: boolean
+ form?: boolean
size?: boolean
setting?: boolean
fullScreen?: boolean