阶段七:完成OrderList React feature化与导入刷新边界

This commit is contained in:
Christ committed 2026-08-15 01:02:15 +08:00
1 parent 66ac84b32d
commit b128ce60db
20 files changed
+1454 -1366

No files matched your search

+8 -26
View File
@@ -1,26 +1,8 @@
export interface OrderImportRowResult {
order_id: string;
success: boolean;
message: string;
}
export interface OrderImportResult {
total: number;
success_count: number;
failed_count: number;
results: OrderImportRowResult[];
}
export const normalizeOrderImportResult = (value: any): OrderImportResult => ({
total: Number(value?.total || 0),
success_count: Number(value?.success_count || 0),
failed_count: Number(value?.failed_count || 0),
results: Array.isArray(value?.results) ? value.results.map((row: any) => ({
order_id: String(row?.order_id || 'unknown'),
success: row?.success === true,
message: String(row?.message || ''),
})) : [],
});
export const failedOrderImportRows = (result: OrderImportResult | null): OrderImportRowResult[] =>
result?.results.filter(row => !row.success) || [];
export {
failedOrderImportRows,
normalizeOrderImportResult,
} from '../app/features/orders/state';
export type {
OrderImportResult,
OrderImportRowResult,
} from '../app/features/orders/types';