fix: 修复账单地址显示问题并优化表格列配置

修复账单地址显示为仅state的问题,改为显示完整地址信息
优化多个页面的表格列配置和请求参数处理
移除Product列表页的展开行功能
添加批量操作按钮和错误处理逻辑
This commit is contained in:
tikkhun 2026-01-05 15:36:35 +08:00
parent e23b0b3e39
commit 5471f7a038
5 changed files with 37 additions and 24 deletions

View File

@ -343,6 +343,7 @@ const CustomerList: React.FC = () => {
scroll={{ x: 'max-content' }}
headerTitle="查询表格"
actionRef={actionRef}
columns={columns}
rowKey="id"
request={async (params, sorter,filter) => {
console.log('custoemr request',params, sorter,filter)
@ -370,7 +371,7 @@ const CustomerList: React.FC = () => {
success: true,
};
}}
columns={columns}
search={{
labelWidth: 'auto',
span: 6,

View File

@ -137,7 +137,7 @@ const ListPage: React.FC = () => {
{
title: '账单地址',
dataIndex: 'billing',
render: (_, record) => record?.billing.state || record?.shipping.state,
render: (_, record) => JSON.stringify(record?.billing || record?.shipping),
},
{
title: '标签',

View File

@ -189,11 +189,21 @@ const ListPage: React.FC = () => {
dataIndex: 'siteId',
valueType: 'select',
request: async () => {
const { data = [] } = await sitecontrollerAll();
return data.map((item) => ({
label: item.name,
value: item.id,
}));
try {
const result = await sitecontrollerAll();
console.log('result',result)
const {success, data}= result
if (success && data) {
return data.map((site: API.SiteConfig) => ({
label: site.name,
value: site.id,
}));
}
return [];
} catch (error) {
console.error('获取站点列表失败:', error);
return [];
}
},
},
{

View File

@ -492,9 +492,12 @@ const List: React.FC = () => {
sortField = field;
sortOrder = sort[field];
}
const {current,pageSize,...where} = params
console.log(`params`,params)
const { data, success } = await productcontrollerGetproductlist({
...params,
where,
page: current || 1,
per_page: pageSize || 10,
sortField,
sortOrder,
} as any);
@ -505,17 +508,17 @@ const List: React.FC = () => {
};
}}
columns={columns}
expandable={{
expandedRowRender: (record) => (
<SiteProductInfo
skus={(record.siteSkus as string[]) || []}
record={record}
parentTableRef={actionRef}
/>
),
rowExpandable: (record) =>
!!(record.siteSkus && record.siteSkus.length > 0),
}}
// expandable={{
// expandedRowRender: (record) => (
// <SiteProductInfo
// skus={(record.siteSkus as string[]) || []}
// record={record}
// parentTableRef={actionRef}
// />
// ),
// rowExpandable: (record) =>
// !!(record.siteSkus && record.siteSkus.length > 0),
// }}
editable={{
type: 'single',
onSave: async (key, record, originRow) => {

View File

@ -62,11 +62,10 @@ const OrdersPage: React.FC = () => {
return [{ key: 'all', label: `全部(${total})` }, ...tabs];
}, [count]);
const columns: ProColumns<API.Order>[] = [
const columns: ProColumns<API.UnifiedOrderDTO>[] = [
{
title: '订单号',
dataIndex: 'id',
hideInSearch: true,
},
{
title: '状态',
@ -97,7 +96,6 @@ const OrdersPage: React.FC = () => {
{
title: '客户姓名',
dataIndex: 'customer_name',
hideInSearch: true,
},
{
title: '商品',
@ -129,7 +127,6 @@ const OrdersPage: React.FC = () => {
},
{
title: '联系电话',
hideInSearch: true,
render: (_, record) => record.shipping?.phone || record.billing?.phone,
},
{
@ -319,6 +316,8 @@ const OrdersPage: React.FC = () => {
setSelectedRowKeys={setSelectedRowKeys}
siteId={siteId}
/>,
<Button disabled></Button>
,
<Button
title="批量删除"
danger