From 5471f7a038ba581edf4b8f9b65554bebbf6fbb66 Mon Sep 17 00:00:00 2001 From: tikkhun Date: Mon, 5 Jan 2026 15:36:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B4=A6=E5=8D=95?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A1=A8=E6=A0=BC=E5=88=97=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复账单地址显示为仅state的问题,改为显示完整地址信息 优化多个页面的表格列配置和请求参数处理 移除Product列表页的展开行功能 添加批量操作按钮和错误处理逻辑 --- src/pages/Customer/List/index.tsx | 3 ++- src/pages/Customer/Statistic/index.tsx | 2 +- src/pages/Order/List/index.tsx | 20 +++++++++++++----- src/pages/Product/List/index.tsx | 29 ++++++++++++++------------ src/pages/Site/Shop/Orders/index.tsx | 7 +++---- 5 files changed, 37 insertions(+), 24 deletions(-) diff --git a/src/pages/Customer/List/index.tsx b/src/pages/Customer/List/index.tsx index d937a9d..77d8b5a 100644 --- a/src/pages/Customer/List/index.tsx +++ b/src/pages/Customer/List/index.tsx @@ -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, diff --git a/src/pages/Customer/Statistic/index.tsx b/src/pages/Customer/Statistic/index.tsx index 0f758b3..f16c106 100644 --- a/src/pages/Customer/Statistic/index.tsx +++ b/src/pages/Customer/Statistic/index.tsx @@ -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: '标签', diff --git a/src/pages/Order/List/index.tsx b/src/pages/Order/List/index.tsx index 3409ccf..454c799 100644 --- a/src/pages/Order/List/index.tsx +++ b/src/pages/Order/List/index.tsx @@ -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 []; + } }, }, { diff --git a/src/pages/Product/List/index.tsx b/src/pages/Product/List/index.tsx index 2d8e9c2..799017f 100644 --- a/src/pages/Product/List/index.tsx +++ b/src/pages/Product/List/index.tsx @@ -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) => ( - - ), - rowExpandable: (record) => - !!(record.siteSkus && record.siteSkus.length > 0), - }} + // expandable={{ + // expandedRowRender: (record) => ( + // + // ), + // rowExpandable: (record) => + // !!(record.siteSkus && record.siteSkus.length > 0), + // }} editable={{ type: 'single', onSave: async (key, record, originRow) => { diff --git a/src/pages/Site/Shop/Orders/index.tsx b/src/pages/Site/Shop/Orders/index.tsx index a949523..1ad74a3 100644 --- a/src/pages/Site/Shop/Orders/index.tsx +++ b/src/pages/Site/Shop/Orders/index.tsx @@ -62,11 +62,10 @@ const OrdersPage: React.FC = () => { return [{ key: 'all', label: `全部(${total})` }, ...tabs]; }, [count]); - const columns: ProColumns[] = [ + const columns: ProColumns[] = [ { 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} />, + + ,