feat: 添加对订阅的支持

feat: 添加对订阅的支持

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

refactor(订单): 清理合并冲突并优化订单详情抽屉组件复用

移除合并冲突标记和重复代码,统一使用相对路径导入组件
简化订单详情逻辑,直接复用OrderDetailDrawer组件

style: 统一中文标点符号为英文格式并清理合并冲突标记
This commit is contained in:
tikkhun 2025-11-19 15:55:40 +08:00
parent a6e569c50b
commit 0c90b2ae8e
1 changed files with 11 additions and 11 deletions

View File

@ -27,21 +27,21 @@ import { formatShipmentState, formatSource } from '@/utils/format';
import RelatedOrders from './RelatedOrders';
import { ORDER_STATUS_ENUM } from '@/constants';
// 中文注释:为保持原文件结构简单,此处从 index.tsx 引入的子组件仍由原文件导出或保持原状
// 为保持原文件结构简单,此处从 index.tsx 引入的子组件仍由原文件导出或保持原状
// 若后续需要彻底解耦,可将 OrderNote / Shipping / SalesChange 也独立到文件
// 当前按你的要求仅抽离详情 Drawer
type OrderRecord = API.Order;
interface OrderDetailDrawerProps {
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>; // 中文注释:换货组件(从外部注入)
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> = ({
@ -57,7 +57,7 @@ const OrderDetailDrawer: React.FC<OrderDetailDrawerProps> = ({
const { message } = App.useApp();
const ref = useRef<ActionType>();
// 中文注释:加载详情数据(与 index.tsx 中完全保持一致)
// 加载详情数据(与 index.tsx 中完全保持一致)
const initRequest = async () => {
const { data, success }: API.OrderDetailRes = await ordercontrollerGetorderdetail({ orderId });
if (!success || !data) return { data: {} } as any;
@ -84,7 +84,7 @@ const OrderDetailDrawer: React.FC<OrderDetailDrawerProps> = ({
size="large"
onClose={onClose}
footer={[
// 中文注释:备注组件(外部传入以避免循环依赖)
// 备注组件(外部传入以避免循环依赖)
<OrderNoteComponent key="order-note" id={orderId} descRef={ref} />,
...(['after_sale_pending', 'pending_reshipment'].includes(
record.orderStatus,