From cd2b7d36f3610417c268d062454b7ec43e9ca937 Mon Sep 17 00:00:00 2001
From: wsj <593216709@qq.com>
Date: Wed, 28 Oct 2026 22:51:24 +0800
Subject: [PATCH] feat: 日志页面
---
src/pages/customers/list/index.tsx | 44 +++++++++++++++++++++++++++++++++++++++-----
1 files changed, 39 insertions(+), 5 deletions(-)
diff --git a/src/pages/customers/list/index.tsx b/src/pages/customers/list/index.tsx
index c236f68..c228154 100644
--- a/src/pages/customers/list/index.tsx
+++ b/src/pages/customers/list/index.tsx
@@ -1,20 +1,46 @@
-import { useMemo } from 'react';
+import { useCallback, useMemo, useState } from 'react';
import { ProTable } from '@ant-design/pro-components';
-import { customerColumns } from './columns';
+import { createCustomerColumns } from './columns';
+import CustomerDetailDrawer from './components/CustomerDetailDrawer';
+import FollowUpRecordsDrawer from './components/FollowUpRecordsDrawer';
import { getCustomerList } from './server';
import type { CustomerListQuery, CustomerVO } from './types';
const CustomerList = () => {
- const columns = useMemo(() => customerColumns, []);
+ const [detailId, setDetailId] = useState<number | null>(null);
+ const [followUpCustomer, setFollowUpCustomer] = useState<{ id: number; name: string } | null>(
+ null,
+ );
+
+ const openDetail = useCallback((record: CustomerVO) => {
+ setDetailId(record.id);
+ }, []);
+
+ const openFollowUps = useCallback((record: CustomerVO) => {
+ setFollowUpCustomer({ id: record.id, name: record.name });
+ }, []);
+
+ const closeDetail = useCallback(() => {
+ setDetailId(null);
+ }, []);
+
+ const closeFollowUps = useCallback(() => {
+ setFollowUpCustomer(null);
+ }, []);
+
+ const columns = useMemo(
+ () => createCustomerColumns({ onDetail: openDetail, onFollowUp: openFollowUps }),
+ [openDetail, openFollowUps],
+ );
return (
<div className="customer-list-page">
<ProTable<CustomerVO, CustomerListQuery>
rowKey="id"
columns={columns}
- cardProps={{ className: 'table-card' }}
+ cardProps={{ bodyStyle: { padding: 20 } }}
search={{ labelWidth: 'auto', defaultCollapsed: false }}
- scroll={{ x: 1510 }}
+ scroll={{ x: 1660 }}
options={false}
pagination={{
defaultPageSize: 10,
@@ -36,6 +62,14 @@
};
}}
/>
+
+ <CustomerDetailDrawer open={detailId !== null} customerId={detailId} onClose={closeDetail} />
+
+ <FollowUpRecordsDrawer
+ open={followUpCustomer !== null}
+ customer={followUpCustomer}
+ onClose={closeFollowUps}
+ />
</div>
);
};
--
Gitblit v1.9.3