style(订单详情): 统一中文标点符号为英文格式并清理合并冲突标记

This commit is contained in:
tikkhun 2025-11-25 10:58:55 +08:00
parent 9335ce205d
commit 9814eca928
1 changed files with 11 additions and 102 deletions

View File

@ -13,15 +13,7 @@ import {
import { ActionType, ProDescriptions } from '@ant-design/pro-components';
import { CopyOutlined, DeleteFilled } from '@ant-design/icons';
<<<<<<< HEAD
<<<<<<< HEAD
// 服务器 API 引用(保持与原 index.tsx 一致)
=======
// 服务器 API 引用(保持与原 index.tsx 一致)
>>>>>>> d98e843 (refactor(): )
=======
// 服务器 API 引用(保持与原 index.tsx 一致)
>>>>>>> 3ac2724 (style: 统一中文标点符号为英文格式)
import {
ordercontrollerChangestatus,
ordercontrollerGetorderdetail,
@ -35,46 +27,21 @@ import { formatShipmentState, formatSource } from '@/utils/format';
import RelatedOrders from './RelatedOrders';
import { ORDER_STATUS_ENUM } from '@/constants';
<<<<<<< HEAD
<<<<<<< HEAD
// 中文注释:为保持原文件结构简单,此处从 index.tsx 引入的子组件仍由原文件导出或保持原状
=======
// 中文注释:为保持原文件结构简单,此处从 index.tsx 引入的子组件仍由原文件导出或保持原状
>>>>>>> d98e843 (refactor(): )
=======
// 中文注释:为保持原文件结构简单,此处从 index.tsx 引入的子组件仍由原文件导出或保持原状
>>>>>>> 3ac2724 (style: 统一中文标点符号为英文格式)
// 为保持原文件结构简单,此处从 index.tsx 引入的子组件仍由原文件导出或保持原状
// 若后续需要彻底解耦,可将 OrderNote / Shipping / SalesChange 也独立到文件
// 当前按你的要求仅抽离详情 Drawer
type OrderRecord = API.Order;
interface OrderDetailDrawerProps {
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 3ac2724 (style: 统一中文标点符号为英文格式)
tableRef: React.MutableRefObject<ActionType | undefined>; // 中文注释:列表刷新引用
orderId: number; // 中文注释:订单主键 ID
record: OrderRecord; // 中文注释:订单行记录
open: boolean; // 中文注释:是否打开抽屉
onClose: () => void; // 中文注释:关闭抽屉回调
setActiveLine: (id: number) => void; // 中文注释:高亮当前行
OrderNoteComponent: React.ComponentType<any>; // 中文注释:备注组件(从外部注入)
SalesChangeComponent: React.ComponentType<any>; // 中文注释:换货组件(从外部注入)
<<<<<<< HEAD
=======
tableRef: React.MutableRefObject<ActionType | undefined>; // 中文注释:列表刷新引用
orderId: number; // 中文注释:订单主键 ID
record: OrderRecord; // 中文注释:订单行记录
open: boolean; // 中文注释:是否打开抽屉
onClose: () => void; // 中文注释:关闭抽屉回调
setActiveLine: (id: number) => void; // 中文注释:高亮当前行
OrderNoteComponent: React.ComponentType<any>; // 中文注释:备注组件(从外部注入)
SalesChangeComponent: React.ComponentType<any>; // 中文注释:换货组件(从外部注入)
>>>>>>> d98e843 (refactor(): )
=======
>>>>>>> 3ac2724 (style: 统一中文标点符号为英文格式)
tableRef: React.MutableRefObject<ActionType | undefined>; // 列表刷新引用
orderId: number; // 订单主键 ID
record: OrderRecord; // 订单行记录
open: boolean; // 是否打开抽屉
onClose: () => void; // 关闭抽屉回调
setActiveLine: (id: number) => void; // 高亮当前行
OrderNoteComponent: React.ComponentType<any>; // 备注组件(从外部注入)
SalesChangeComponent: React.ComponentType<any>; // 换货组件(从外部注入)
}
const OrderDetailDrawer: React.FC<OrderDetailDrawerProps> = ({
@ -90,15 +57,7 @@ const OrderDetailDrawer: React.FC<OrderDetailDrawerProps> = ({
const { message } = App.useApp();
const ref = useRef<ActionType>();
<<<<<<< HEAD
<<<<<<< HEAD
// 中文注释:加载详情数据(与 index.tsx 中完全保持一致)
=======
// 中文注释:加载详情数据(与 index.tsx 中完全保持一致)
>>>>>>> d98e843 (refactor(): )
=======
// 中文注释:加载详情数据(与 index.tsx 中完全保持一致)
>>>>>>> 3ac2724 (style: 统一中文标点符号为英文格式)
// 加载详情数据(与 index.tsx 中完全保持一致)
const initRequest = async () => {
const { data, success }: API.OrderDetailRes = await ordercontrollerGetorderdetail({ orderId });
if (!success || !data) return { data: {} } as any;
@ -125,15 +84,7 @@ const OrderDetailDrawer: React.FC<OrderDetailDrawerProps> = ({
size="large"
onClose={onClose}
footer={[
<<<<<<< HEAD
<<<<<<< HEAD
// 中文注释:备注组件(外部传入以避免循环依赖)
=======
// 中文注释:备注组件(外部传入以避免循环依赖)
>>>>>>> d98e843 (refactor(): )
=======
// 中文注释:备注组件(外部传入以避免循环依赖)
>>>>>>> 3ac2724 (style: 统一中文标点符号为英文格式)
// 备注组件(外部传入以避免循环依赖)
<OrderNoteComponent key="order-note" id={orderId} descRef={ref} />,
...(['after_sale_pending', 'pending_reshipment'].includes(
record.orderStatus,
@ -290,10 +241,6 @@ const OrderDetailDrawer: React.FC<OrderDetailDrawerProps> = ({
<ProDescriptions.Item label="客户备注" dataIndex="customer_note" span={3} />
<ProDescriptions.Item label="发货信息" span={3} render={(_, r: any) => (
<div>
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 3ac2724 (style: 统一中文标点符号为英文格式)
<div>company:<span>{r?.shipping?.company || r?.billing?.company || '-'}</span></div>
<div>first_name:<span>{r?.shipping?.first_name || r?.billing?.first_name || '-'}</span></div>
<div>last_name:<span>{r?.shipping?.last_name || r?.billing?.last_name || '-'}</span></div>
@ -303,34 +250,12 @@ const OrderDetailDrawer: React.FC<OrderDetailDrawerProps> = ({
<div>postcode:<span>{r?.shipping?.postcode || r?.billing?.postcode || '-'}</span></div>
<div>phone:<span>{r?.shipping?.phone || r?.billing?.phone || '-'}</span></div>
<div>address_1:<span>{r?.shipping?.address_1 || r?.billing?.address_1 || '-'}</span></div>
<<<<<<< HEAD
=======
<div>company<span>{r?.shipping?.company || r?.billing?.company || '-'}</span></div>
<div>first_name<span>{r?.shipping?.first_name || r?.billing?.first_name || '-'}</span></div>
<div>last_name<span>{r?.shipping?.last_name || r?.billing?.last_name || '-'}</span></div>
<div>country<span>{r?.shipping?.country || r?.billing?.country || '-'}</span></div>
<div>state<span>{r?.shipping?.state || r?.billing?.state || '-'}</span></div>
<div>city<span>{r?.shipping?.city || r?.billing?.city || '-'}</span></div>
<div>postcode<span>{r?.shipping?.postcode || r?.billing?.postcode || '-'}</span></div>
<div>phone<span>{r?.shipping?.phone || r?.billing?.phone || '-'}</span></div>
<div>address_1<span>{r?.shipping?.address_1 || r?.billing?.address_1 || '-'}</span></div>
>>>>>>> d98e843 (refactor(): )
=======
>>>>>>> 3ac2724 (style: 统一中文标点符号为英文格式)
</div>
)} />
<ProDescriptions.Item label="原始订单" span={3} render={(_, r: any) => (
<ul>
{(r?.items || []).map((item: any) => (
<<<<<<< HEAD
<<<<<<< HEAD
<li key={item.id}>{item.name}:{item.quantity}</li>
=======
<li key={item.id}>{item.name}{item.quantity}</li>
>>>>>>> d98e843 (refactor(): )
=======
<li key={item.id}>{item.name}:{item.quantity}</li>
>>>>>>> 3ac2724 (style: 统一中文标点符号为英文格式)
))}
</ul>
)} />
@ -340,15 +265,7 @@ const OrderDetailDrawer: React.FC<OrderDetailDrawerProps> = ({
<ProDescriptions.Item label="订单内容" span={3} render={(_, r: any) => (
<ul>
{(r?.sales || []).map((item: any) => (
<<<<<<< HEAD
<<<<<<< HEAD
<li key={item.id}>{item.name}:{item.quantity}</li>
=======
<li key={item.id}>{item.name}{item.quantity}</li>
>>>>>>> d98e843 (refactor(): )
=======
<li key={item.id}>{item.name}:{item.quantity}</li>
>>>>>>> 3ac2724 (style: 统一中文标点符号为英文格式)
))}
</ul>
)} />
@ -393,15 +310,7 @@ const OrderDetailDrawer: React.FC<OrderDetailDrawerProps> = ({
</Popconfirm>
] : [] }
>
<<<<<<< HEAD
<<<<<<< HEAD
<div>: {Array.isArray(v?.orderIds) ? v.orderIds.join(',') : '-'}</div>
=======
<div> {Array.isArray(v?.orderIds) ? v.orderIds.join(',') : '-'}</div>
>>>>>>> d98e843 (refactor(): )
=======
<div>: {Array.isArray(v?.orderIds) ? v.orderIds.join(',') : '-'}</div>
>>>>>>> 3ac2724 (style: 统一中文标点符号为英文格式)
{Array.isArray(v?.items) && v.items.map((item: any) => (
<div key={item.id}>{item.name}: {item.quantity}</div>
))}