分销后台前端对接与结算明细接口

- 新增 GET /admin/distribution/settlement-batches/:id/items 明细查询
- distribution-admin 重构为 react-router 多页面:仪表盘/网站/规则(启停)/订单(筛选分页)/结算(创建/明细/结算)/支付通道(绑定解绑)/账号展示(上下架)
- axios 统一 401 提示,引导回主站后台登录;金额统一整数分格式化
- npm run build(tsc 严格模式) 通过
This commit is contained in:
yml2213
2026-09-05 11:17:43 +08:00
parent ac777f5b16
commit 3162d15425
15 changed files with 1006 additions and 38 deletions
+39
View File
@@ -0,0 +1,39 @@
import { useEffect, useState } from 'react'
import { Card, Table, Typography, Space, Tag, message } from 'antd'
import { listSites, type Site } from '../api'
export default function Sites() {
const [items, setItems] = useState<Site[]>([])
useEffect(() => {
listSites()
.then(setItems)
.catch(() => message.error('站点加载失败'))
}, [])
return (
<Space direction="vertical" className="page">
<Typography.Title level={3}>分销网站</Typography.Title>
<Card>
<Table
rowKey="id"
dataSource={items}
pagination={false}
columns={[
{ title: '名称', dataIndex: 'site_name' },
{ title: '编码', dataIndex: 'site_code' },
{ title: '域名', dataIndex: 'domain' },
{ title: '状态', dataIndex: 'status', render: (v: string) => <Tag color={v === 'active' ? 'green' : 'default'}>{v}</Tag> },
{
title: '账号展示',
dataIndex: 'display_account_enabled',
render: (v: boolean) => (v ? <Tag color="green">开启</Tag> : <Tag>关闭</Tag>),
},
{
title: '税费',
render: (_: unknown, row: Site) => (row.tax_enabled ? `${row.tax_rate_bps / 100}%` : '关闭'),
},
]}
/>
</Card>
</Space>
)
}