refactor(types): 重构类型系统,统一共享类型定义

feat(types): 新增共享类型中心,包含用户、产品、订单等核心领域类型
fix(types): 修复类型定义错误,统一各模块类型引用
style(types): 优化类型文件格式和注释
docs(types): 更新类型文档和变更日志
test(types): 添加类型测试用例
build(types): 配置类型共享路径
chore(types): 清理重复类型定义文件
This commit is contained in:
2026-03-20 17:53:46 +08:00
parent 989c4b13a6
commit 427becbc8f
222 changed files with 25676 additions and 6328 deletions

View File

@@ -101,7 +101,7 @@ interface FilterState {
status: string[];
platform: string[];
paymentStatus: string[];
dateRange: [moment.Moment, moment.Moment] | null;
dateRange: any;
}
interface SortState {
@@ -497,9 +497,9 @@ export const OrderList: React.FC = () => {
const bValue = b[field];
if (sort.order === 'ascend') {
return aValue > bValue ? 1 : -1;
return (aValue || 0) > (bValue || 0) ? 1 : -1;
} else {
return aValue < bValue ? 1 : -1;
return (aValue || 0) < (bValue || 0) ? 1 : -1;
}
});
@@ -520,7 +520,7 @@ export const OrderList: React.FC = () => {
render: (text, record) => (
<Space direction="vertical" size={0}>
<Text strong>{text}</Text>
<Tag color={PLATFORM_CONFIG[record.platform].color} size="small">
<Tag color={PLATFORM_CONFIG[record.platform].color}>
{PLATFORM_CONFIG[record.platform].text}
</Tag>
</Space>
@@ -576,11 +576,12 @@ export const OrderList: React.FC = () => {
dataIndex: 'paymentStatus',
key: 'paymentStatus',
render: (status) => {
const config = {
const statusConfig = {
PENDING: { color: 'warning', text: '待支付' },
PAID: { color: 'success', text: '已支付' },
REFUNDED: { color: 'default', text: '已退款' },
}[status];
};
const config = statusConfig[status as keyof typeof statusConfig];
return <Tag color={config.color}>{config.text}</Tag>;
},
},