From 0e7c57bd5ecafd8283bcc950b24bb63b59b70e5a Mon Sep 17 00:00:00 2001 From: vben <anncwb@126.com> Date: 星期三, 06 一月 2021 20:10:16 +0800 Subject: [PATCH] feat(tabs): added tab folding --- src/components/Table/src/const.ts | 36 ++++++++++-------------------------- 1 files changed, 10 insertions(+), 26 deletions(-) diff --git a/src/components/Table/src/const.ts b/src/components/Table/src/const.ts index e1371a4..2352144 100644 --- a/src/components/Table/src/const.ts +++ b/src/components/Table/src/const.ts @@ -1,40 +1,24 @@ -import type { SorterResult } from './types/table'; +import componentSetting from '/@/settings/componentSetting'; + +const { table } = componentSetting; + +const { pageSizeOptions, defaultPageSize, fetchSetting, defaultSortFn, defaultFilterFn } = table; export const ROW_KEY = 'key'; // 鍙�夌殑姣忛〉鏄剧ず鏉℃暟; -export const PAGE_SIZE_OPTIONS = ['10', '50', '80', '100']; +export const PAGE_SIZE_OPTIONS = pageSizeOptions; // 姣忛〉鏄剧ず鏉℃暟 -export const PAGE_SIZE = ~~PAGE_SIZE_OPTIONS[0]; +export const PAGE_SIZE = defaultPageSize; // 閫氱敤鎺ュ彛瀛楁璁剧疆 -// 鏀寔 xxx.xxx.xxx鏍煎紡 -export const FETCH_SETTING = { - // 浼犵粰鍚庡彴鐨勫綋鍓嶉〉瀛楁鍚� - pageField: 'page', - // 浼犵粰鍚庡彴鐨勬瘡椤垫樉绀鸿褰曟暟瀛楁鍚� - sizeField: 'pageSize', - // 鎺ュ彛杩斿洖鐨勮〃鏍兼暟鎹瓧娈靛悕 - listField: 'items', - // 鎺ュ彛杩斿洖鐨勮〃鏍兼�绘暟瀛楁鍚� - totalField: 'total', -}; +export const FETCH_SETTING = fetchSetting; // 閰嶇疆閫氱敤鎺掑簭鍑芥暟 -export function DEFAULT_SORT_FN(sortInfo: SorterResult) { - const { field, order } = sortInfo; - return { - // 浼犵粰鍚庡彴鐨勬帓搴忓瓧娈典綘 - field, - // 浼犵粰鍚庡彴鐨勬帓搴忔柟寮� asc/desc - order, - }; -} +export const DEFAULT_SORT_FN = defaultSortFn; -export function DEFAULT_FILTER_FN(data: Partial<Recordable<string[]>>) { - return data; -} +export const DEFAULT_FILTER_FN = defaultFilterFn; // 琛ㄦ牸鍗曞厓鏍奸粯璁ゅ竷灞� export const DEFAULT_ALIGN = 'center'; -- Gitblit v1.8.0