feat: 添加MSW模拟服务和数据源集成
refactor: 重构页面组件移除冗余Layout组件 feat: 实现WebSocket和事件总线系统 feat: 添加队列和调度系统 docs: 更新架构文档和服务映射 style: 清理重复接口定义使用数据源 chore: 更新依赖项配置 feat: 添加运行时系统和领域引导 ci: 配置ESLint边界检查规则 build: 添加Redis和WebSocket依赖 test: 添加MSW浏览器环境入口 perf: 优化数据获取逻辑使用统一数据源 fix: 修复类型定义和状态管理问题
This commit is contained in:
@@ -1,25 +1,11 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Table, Input, Button, Select, DatePicker, message, Card, Typography } from 'antd';
|
||||
import { SearchOutlined, PlusOutlined, EditOutlined, DeleteOutlined, EyeOutlined } from '@ant-design/icons';
|
||||
import { getMerchants, createMerchant, updateMerchant, deleteMerchant } from '../../services/merchantService';
|
||||
import { merchantDataSource, Merchant } from '@/services/merchantDataSource';
|
||||
|
||||
const { Option } = Select;
|
||||
const { Title, Text } = Typography;
|
||||
|
||||
interface Merchant {
|
||||
id: string;
|
||||
tenantId: string;
|
||||
companyName: string;
|
||||
businessLicense: string;
|
||||
contactEmail: string;
|
||||
contactPhone: string;
|
||||
status: 'PENDING' | 'ACTIVE' | 'SUSPENDED' | 'TERMINATED';
|
||||
tier: 'BASIC' | 'PRO' | 'ENTERPRISE';
|
||||
traceId: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
const MerchantManage: React.FC = () => {
|
||||
const [merchants, setMerchants] = useState<Merchant[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
@@ -1,24 +1,12 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Table, Input, Button, Select, DatePicker, message, Card, Typography, Tag } from 'antd';
|
||||
import { SearchOutlined, EyeOutlined, ReloadOutlined } from '@ant-design/icons';
|
||||
import { getMerchantOrders, updateOrderStatus } from '../../services/merchantOrderService';
|
||||
import { merchantDataSource, MerchantOrder } from '@/services/merchantDataSource';
|
||||
|
||||
const { Option } = Select;
|
||||
const { Title, Text } = Typography;
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
interface Order {
|
||||
id: string;
|
||||
merchantId: string;
|
||||
merchantName: string;
|
||||
orderId: string;
|
||||
platform: string;
|
||||
totalAmount: number;
|
||||
status: 'PENDING' | 'PROCESSING' | 'SHIPPED' | 'DELIVERED' | 'CANCELLED' | 'REFUNDED';
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
const MerchantOrderManage: React.FC = () => {
|
||||
const [orders, setOrders] = useState<Order[]>([]);
|
||||
const [merchants, setMerchants] = useState<{ id: string; companyName: string }[]>([]);
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Table, Input, Button, Select, DatePicker, message, Card, Typography, Tag, Modal, Form } from 'antd';
|
||||
import { SearchOutlined, EyeOutlined, DownloadOutlined, ReloadOutlined } from '@ant-design/icons';
|
||||
import { getMerchantSettlements, processSettlement } from '../../services/merchantSettlementService';
|
||||
import { merchantDataSource, Merchant, MerchantSettlement } from '@/services/merchantDataSource';
|
||||
|
||||
const { Option } = Select;
|
||||
const { Title, Text } = Typography;
|
||||
const { RangePicker } = DatePicker;
|
||||
const { Item } = Form;
|
||||
|
||||
interface Settlement {
|
||||
id: string;
|
||||
merchantId: string;
|
||||
merchantName: string;
|
||||
periodStart: string;
|
||||
periodEnd: string;
|
||||
totalAmount: number;
|
||||
status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED';
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
const MerchantSettlementManage: React.FC = () => {
|
||||
const [settlements, setSettlements] = useState<Settlement[]>([]);
|
||||
const [merchants, setMerchants] = useState<{ id: string; companyName: string }[]>([]);
|
||||
|
||||
@@ -1,23 +1,12 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Table, Input, Button, Select, message, Card, Typography, Form, Modal } from 'antd';
|
||||
import { SearchOutlined, PlusOutlined, EditOutlined, DeleteOutlined, EyeOutlined } from '@ant-design/icons';
|
||||
import { getMerchantShops, createMerchantShop, updateMerchantShop, deleteMerchantShop } from '../../services/merchantShopService';
|
||||
import { merchantDataSource, MerchantShop, Merchant } from '@/services/merchantDataSource';
|
||||
|
||||
const { Option } = Select;
|
||||
const { Title, Text } = Typography;
|
||||
const { Item } = Form;
|
||||
|
||||
interface Shop {
|
||||
id: string;
|
||||
merchantId: string;
|
||||
shopName: string;
|
||||
platform: string;
|
||||
shopUrl: string;
|
||||
status: 'ACTIVE' | 'INACTIVE' | 'SUSPENDED';
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
const MerchantShopManage: React.FC = () => {
|
||||
const [shops, setShops] = useState<Shop[]>([]);
|
||||
const [merchants, setMerchants] = useState<{ id: string; companyName: string }[]>([]);
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
import React from 'react';
|
||||
import { Card, Layout, Typography, Row, Col, Button } from 'antd';
|
||||
import { UserOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import { Card, Typography, Row, Col, Button } from 'antd';
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
|
||||
const { Content } = Layout;
|
||||
const { Title, Text } = Typography;
|
||||
|
||||
const MerchantManagement: React.FC = () => {
|
||||
return (
|
||||
<Content style={{ padding: 24, margin: 0, minHeight: 280, background: '#fff' }}>
|
||||
<div>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 24 }}>
|
||||
<Title level={4}>商户管理</Title>
|
||||
<Button type="primary" icon={<PlusOutlined />}>
|
||||
添加商户
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
|
||||
<Row gutter={[16, 16]}>
|
||||
<Col span={24}>
|
||||
<Card title="商户列表">
|
||||
@@ -22,8 +21,8 @@ const MerchantManagement: React.FC = () => {
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
</Content>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default MerchantManagement;
|
||||
export default MerchantManagement;
|
||||
|
||||
Reference in New Issue
Block a user