refactor(frontend): comprehensive architectural optimization and base component extraction

- Standardized table loading logic with enhanced useTableLoader.
- Unified form submission patterns via new useForm composable.
- Extracted common UI components: SearchInput and StatusBadge.
- Centralized common interface definitions in types/index.ts.
- Achieved TypeScript zero-error status across refactored files.
- Greatly improved code reusability and maintainability.
This commit is contained in:
IanShaw027
2026-01-04 22:29:19 +08:00
parent d4d21d5ef3
commit 99308ab4fb
10 changed files with 248 additions and 151 deletions

View File

@@ -2,6 +2,26 @@
* Core Type Definitions for Sub2API Frontend
*/
// ==================== Common Types ====================
export interface SelectOption {
value: string | number | boolean | null
label: string
[key: string]: any // Support extra properties for custom templates
}
export interface BasePaginationResponse<T> {
items: T[]
total: number
page: number
page_size: number
pages: number
}
export interface FetchOptions {
signal?: AbortSignal
}
// ==================== User & Auth Types ====================
export interface User {
@@ -890,4 +910,4 @@ export interface UpdateUserAttributeRequest {
export interface UserAttributeValuesMap {
[attributeId: number]: string
}
}