From ca9aab3e3a773e55eec30c1d74ac5c1003361c3a Mon Sep 17 00:00:00 2001 From: ybc <2483488988@qq.com> Date: Fri, 12 Sep 2025 14:45:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Orders_sub.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/views/Orders_sub.jsx b/src/views/Orders_sub.jsx index fa07447..69c934a 100644 --- a/src/views/Orders_sub.jsx +++ b/src/views/Orders_sub.jsx @@ -171,6 +171,12 @@ const Orders_sub = () => { return result; }; + // 在逗号和分号处自动换行的函数 + const addLineBreaksAtCommas = (text) => { + if (!text) return ''; + return text.replace(/,/g, ',\n').replace(/,/g, ',\n').replace(/;/g, ';\n').replace(/;/g, ';\n'); + }; + const table_data = format_data_detail(orders_store.orderCountData_Form_sub.ordercount1); const table_data2 = format_data_detail(orders_store.orderCountData_Form_sub.ordercount2); const table_data_p = format_data(orders_store.orderCountData_Form_sub.ordercount1); @@ -192,7 +198,7 @@ const Orders_sub = () => { rowKey={record => record.key} expandable={{ expandedRowRender: record => ( -
+                
                   
                     客户需求
                   
@@ -200,7 +206,7 @@ const Orders_sub = () => {
                   
                     订单内容
                   
-                  {record.COLI_OrderDetailText}
+                  {addLineBreaksAtCommas(decodeURIComponent(record.COLI_OrderDetailText.replace(/&/g, "&")))}
                 
), }} @@ -224,7 +230,7 @@ const Orders_sub = () => { size="small" rowKey={record => record.key} expandable={{ - expandedRowRender: record =>
{record.COLI_OrderDetailText}
, + expandedRowRender: record =>
{record.COLI_OrderDetailText}
, }} />