列表综合筛选
This commit is contained in:
141
types/list/types.ts
Normal file
141
types/list/types.ts
Normal file
@@ -0,0 +1,141 @@
|
||||
// 网球比赛数据接口
|
||||
export interface TennisMatch {
|
||||
id: string
|
||||
title: string
|
||||
dateTime: string
|
||||
location: string
|
||||
distance: string
|
||||
registeredCount: number
|
||||
maxCount: number
|
||||
skillLevel: string
|
||||
matchType: string
|
||||
images: string[]
|
||||
}
|
||||
export interface IFilterOptions {
|
||||
location: string
|
||||
time: string
|
||||
ntrp: [number, number]
|
||||
site: string
|
||||
wanfa: string
|
||||
}
|
||||
export interface ListState {
|
||||
matches: TennisMatch[]
|
||||
loading: boolean
|
||||
error: string | null
|
||||
lastRefreshTime: string | null
|
||||
isShowFilterPopup: boolean
|
||||
filterOptions: IFilterOptions
|
||||
filterCount: number
|
||||
distance: string | number
|
||||
quickFilter: string | number
|
||||
distanceData: any[]
|
||||
quickFilterData: any[]
|
||||
distanceQuickFilter: {
|
||||
distance: string
|
||||
quick: string
|
||||
}
|
||||
timeBubbleData: BubbleOption[]
|
||||
locationOptions: BubbleOption[]
|
||||
}
|
||||
|
||||
export interface ListState {
|
||||
matches: TennisMatch[]
|
||||
loading: boolean
|
||||
error: string | null
|
||||
lastRefreshTime: string | null
|
||||
isShowFilterPopup: boolean
|
||||
filterOptions: IFilterOptions
|
||||
filterCount: number
|
||||
distance: string | number
|
||||
quickFilter: string | number
|
||||
distanceData: any[]
|
||||
quickFilterData: any[]
|
||||
distanceQuickFilter: {
|
||||
distance: string
|
||||
quick: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface ListActions {
|
||||
fetchMatches: (params?: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
location?: string
|
||||
skillLevel?: string
|
||||
}) => Promise<void>
|
||||
refreshMatches: () => Promise<void>
|
||||
clearError: () => void
|
||||
updateState: (payload: Record<string, any>) => void
|
||||
updateFilterOptions: (payload: Record<string, any>) => void
|
||||
clearFilterOptions: () => void
|
||||
}
|
||||
|
||||
// 快捷筛选
|
||||
export interface MenuFilterProps {
|
||||
options: { text: string; value: string }[];
|
||||
value: string;
|
||||
onChange: (name: string, value: string) => void;
|
||||
wrapperClassName?: string;
|
||||
itemClassName?: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
// 距离筛选
|
||||
export interface DistanceFilterProps {
|
||||
options: BubbleOption[];
|
||||
value: string;
|
||||
onChange: (name: string, value: string) => void;
|
||||
wrapperClassName?: string;
|
||||
itemClassName?: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
// bubble 组件
|
||||
export interface BubbleOption {
|
||||
id: string | number;
|
||||
label: string;
|
||||
value: string | number;
|
||||
disabled?: boolean;
|
||||
icon?: React.ReactNode;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface BubbleProps {
|
||||
options: BubbleOption[];
|
||||
value?: string | number | (string | number)[];
|
||||
onChange?: (
|
||||
name: string,
|
||||
value: string | number | (string | number)[],
|
||||
option: BubbleOption | BubbleOption[]
|
||||
) => void;
|
||||
multiple?: boolean;
|
||||
layout?: "horizontal" | "vertical" | "grid";
|
||||
columns?: number;
|
||||
size?: "small" | "medium" | "large";
|
||||
className?: string;
|
||||
itemClassName?: string;
|
||||
style?: React.CSSProperties;
|
||||
disabled?: boolean;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface BubbleItemProps {
|
||||
option: BubbleOption;
|
||||
isSelected: boolean;
|
||||
size: 'small' | 'medium' | 'large';
|
||||
disabled: boolean;
|
||||
onClick: (option: BubbleOption) => void;
|
||||
itemClassName?: string;
|
||||
}
|
||||
|
||||
// FilterPopup 组件
|
||||
export interface FilterPopupProps {
|
||||
onCancel: () => void;
|
||||
onConfirm: () => void;
|
||||
onChange: (params: Record<string, string>) => void;
|
||||
loading: boolean;
|
||||
filterOptions: Record<string, any>;
|
||||
onClear: () => void;
|
||||
visible: boolean;
|
||||
onClose: () => void;
|
||||
}
|
||||
Reference in New Issue
Block a user