From 14cba4afc291b81901437d88aefd1abeccbdf13d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E7=8F=91?= Date: Mon, 25 Aug 2025 15:10:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=A1=B5=EF=BC=8C=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E8=AF=A6=E6=83=85=E5=92=8C=E5=88=9B=E5=BB=BA=E8=BF=90?= =?UTF-8?q?=E5=8D=95=E5=A2=9E=E5=8A=A0=E9=AB=98=E4=BA=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Order/List/index.tsx | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/pages/Order/List/index.tsx b/src/pages/Order/List/index.tsx index 314f857..c44ca60 100644 --- a/src/pages/Order/List/index.tsx +++ b/src/pages/Order/List/index.tsx @@ -1,3 +1,5 @@ +import styles from '../../../style/order-list.css'; + import InternationalPhoneInput from '@/components/InternationalPhoneInput'; import { HistoryOrder } from '@/pages/Statistics/Order'; import { ORDER_STATUS_ENUM } from '@/constants'; @@ -84,6 +86,7 @@ const ListPage: React.FC = () => { const actionRef = useRef(); const [activeKey, setActiveKey] = useState('all'); const [count, setCount] = useState([]); + const [activeLine, setActiveLine] = useState(-1); const tabs: TabsProps['items'] = useMemo(() => { const total = count.reduce((acc, cur) => acc + Number(cur.count), 0); const tabs = [ @@ -265,7 +268,7 @@ const ListPage: React.FC = () => { record.orderStatus, ) ? ( <> - + ) : ( @@ -276,6 +279,7 @@ const ListPage: React.FC = () => { record={record} tableRef={actionRef} orderId={record.id as number} + setActiveLine={setActiveLine} /> { scroll={{ x: 'max-content' }} actionRef={actionRef} rowKey="id" + rowClassName={(record) => { + return record.id === activeLine ? styles['selected-line-order-protable']: ''; + }} toolBarRender={() => [ , , @@ -480,7 +487,8 @@ const Detail: React.FC<{ tableRef: React.MutableRefObject; orderId: number; record: API.Order; -}> = ({ tableRef, orderId, record }) => { + setActiveLine: Function +}> = ({ tableRef, orderId, record, setActiveLine }) => { const [visiable, setVisiable] = useState(false); const { message } = App.useApp(); const ref = useRef(); @@ -510,7 +518,10 @@ const Detail: React.FC<{ return ( <> - @@ -1049,7 +1060,8 @@ const Shipping: React.FC<{ tableRef?: React.MutableRefObject; descRef?: React.MutableRefObject; reShipping?: boolean; -}> = ({ id, tableRef, descRef, reShipping = false }) => { + setActiveLine: Function; +}> = ({ id, tableRef, descRef, reShipping = false, setActiveLine }) => { const [options, setOptions] = useState([]); const formRef = useRef(); @@ -1071,7 +1083,11 @@ const Shipping: React.FC<{ }, }} trigger={ -