forked from yoone/WEB
1
0
Fork 0

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

View File

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

View File

@ -189,11 +189,21 @@ const ListPage: React.FC = () => {
dataIndex: 'siteId', dataIndex: 'siteId',
valueType: 'select', valueType: 'select',
request: async () => { request: async () => {
const { data = [] } = await sitecontrollerAll(); try {
return data.map((item) => ({ const result = await sitecontrollerAll();
label: item.name, console.log('result',result)
value: item.id, 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; sortField = field;
sortOrder = sort[field]; sortOrder = sort[field];
} }
const {current,pageSize,...where} = params
console.log(`params`,params)
const { data, success } = await productcontrollerGetproductlist({ const { data, success } = await productcontrollerGetproductlist({
...params, where,
page: current || 1,
per_page: pageSize || 10,
sortField, sortField,
sortOrder, sortOrder,
} as any); } as any);
@ -505,17 +508,17 @@ const List: React.FC = () => {
}; };
}} }}
columns={columns} columns={columns}
expandable={{ // expandable={{
expandedRowRender: (record) => ( // expandedRowRender: (record) => (
<SiteProductInfo // <SiteProductInfo
skus={(record.siteSkus as string[]) || []} // skus={(record.siteSkus as string[]) || []}
record={record} // record={record}
parentTableRef={actionRef} // parentTableRef={actionRef}
/> // />
), // ),
rowExpandable: (record) => // rowExpandable: (record) =>
!!(record.siteSkus && record.siteSkus.length > 0), // !!(record.siteSkus && record.siteSkus.length > 0),
}} // }}
editable={{ editable={{
type: 'single', type: 'single',
onSave: async (key, record, originRow) => { onSave: async (key, record, originRow) => {

View File

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