Przeglądaj źródła

fix(order-management): 修复订单列表渠道列显示渠道名称问题

修复前:渠道列显示"渠道4"、"渠道3"等ID格式
修复后:渠道列正确显示渠道名称,如"石丁业"、"赵卫"、"测试渠道"

问题原因:原代码使用 || 运算符导致运算符优先级错误
  order.channel?.channelName || order.channelId ? `渠道${order.channelId}` : '-'
实际执行为:(order.channel?.channelName || order.channelId) ? `渠道${order.channelId}` : '-'

修复方案:使用 ?? (空值合并运算符) 修复优先级问题
  order.channel?.channelName ?? (order.channelId ? `渠道${order.channelId}` : '-')

Generated with [Claude Code](https://claude.com/claude-code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 9 godzin temu
rodzic
commit
071ce126fe

+ 1 - 1
allin-packages/order-management-ui/src/components/OrderManagement.tsx

@@ -494,7 +494,7 @@ export const OrderManagement: React.FC = () => {
                       <TableCell className="font-medium">{order.orderName}</TableCell>
                       <TableCell>{order.platform?.platformName || `平台${order.platformId}`}</TableCell>
                       <TableCell>{order.company?.companyName || `公司${order.companyId}`}</TableCell>
-                      <TableCell>{order.channel?.channelName || order.channelId ? `渠道${order.channelId}` : '-'}</TableCell>
+                      <TableCell>{order.channel?.channelName ?? (order.channelId ? `渠道${order.channelId}` : '-')}</TableCell>
                       <TableCell>
                         {order.expectedStartDate
                           ? new Date(order.expectedStartDate).toLocaleDateString()