diff --git a/src/hooks/web/useTable.ts b/src/hooks/web/useTable.ts index fc2a96b37..fc1c5c185 100644 --- a/src/hooks/web/useTable.ts +++ b/src/hooks/web/useTable.ts @@ -24,7 +24,7 @@ interface TableObject { currentPage: number total: number tableList: K[] - parmasObj: L + paramsObj: L loading: boolean currentRow: Nullable } @@ -42,17 +42,17 @@ export const useTable = ( // 表格数据 tableList: [], // AxiosConfig 配置 - parmasObj: {} as L, + paramsObj: {} as L, // 加载中 loading: true, // 当前行的数据 currentRow: null }) - const parmasObj = computed(() => { + const paramsObj = computed(() => { return { params: { - ...tableObject.parmasObj.params, + ...tableObject.paramsObj.params, pageSize: tableObject.pageSize, pageIndex: tableObject.currentPage } @@ -116,14 +116,14 @@ export const useTable = ( setProps: (props: Recordable) => void getList: () => Promise setColumn: (columnProps: TableSetPropsType[]) => void - setSearchParmas: (data: Recordable) => void + setSearchParams: (data: Recordable) => void getSelections: () => Promise delList: (ids: string[] | number[], multiple: boolean, message?: boolean) => Promise } = { getList: async () => { tableObject.loading = true const res = await config - ?.getListApi(unref(parmasObj) as unknown as L) + ?.getListApi(unref(paramsObj) as unknown as L) .catch(() => {}) .finally(() => { tableObject.loading = false @@ -146,9 +146,9 @@ export const useTable = ( return (table?.selections || []) as K[] }, // 与Search组件结合 - setSearchParmas: (data: Recordable) => { + setSearchParams: (data: Recordable) => { tableObject.currentPage = 1 - tableObject.parmasObj = Object.assign(tableObject.parmasObj, { + tableObject.paramsObj = Object.assign(tableObject.paramsObj, { params: { pageSize: tableObject.pageSize, pageIndex: tableObject.currentPage, diff --git a/src/views/Example/Dialog/ExampleDialog.vue b/src/views/Example/Dialog/ExampleDialog.vue index fc22d3028..ab084ed30 100644 --- a/src/views/Example/Dialog/ExampleDialog.vue +++ b/src/views/Example/Dialog/ExampleDialog.vue @@ -27,7 +27,7 @@ const { register, tableObject, methods } = useTable< } }) -const { getList, setSearchParmas } = methods +const { getList, setSearchParams } = methods getList() @@ -152,7 +152,7 @@ const save = async () => {