Jelajahi Sumber

修复流程管理抄送人部门传递的数据

pm 1 bulan lalu
induk
melakukan
fafc1331fa
1 mengubah file dengan 20 tambahan dan 0 penghapusan
  1. 20 0
      src/components/ProcessDesigner.tsx

+ 20 - 0
src/components/ProcessDesigner.tsx

@@ -179,6 +179,20 @@ function parseWorkflowCopyIds(multi: unknown, legacySingle: unknown): string[] {
   return [];
 }
 
+/** 流程保存到后端时,抄送部门/人员 ID 必须为逗号分隔字符串 */
+function toWorkflowCopyIdsCommaString(value: unknown): string {
+  if (Array.isArray(value)) {
+    return value
+      .map((item) => String(item).trim())
+      .filter((item) => item !== '')
+      .join(',');
+  }
+  if (value === undefined || value === null || value === '') {
+    return '';
+  }
+  return String(value).trim();
+}
+
 // 节点配置
 const nodeConfigs = [
   {
@@ -1195,6 +1209,8 @@ export default function ProcessDesigner() {
             workerUserId: responsible !== undefined && responsible !== null && responsible !== '' 
               ? String(responsible) 
               : '',
+            copyDeptIds: toWorkflowCopyIdsCommaString((restData as any).copyDeptIds),
+            copyUserIds: toWorkflowCopyIdsCommaString((restData as any).copyUserIds),
           };
           
           const nodeObj: any = {
@@ -2481,6 +2497,8 @@ export default function ProcessDesigner() {
             workerUserId: responsible !== undefined && responsible !== null && responsible !== '' 
               ? String(responsible) 
               : '',
+            copyDeptIds: toWorkflowCopyIdsCommaString((restData as any).copyDeptIds),
+            copyUserIds: toWorkflowCopyIdsCommaString((restData as any).copyUserIds),
           };
           
           const nodeObj: any = {
@@ -2733,6 +2751,8 @@ export default function ProcessDesigner() {
                   workerUserId: responsible !== undefined && responsible !== null && responsible !== '' 
                     ? String(responsible) 
                     : '',
+                  copyDeptIds: toWorkflowCopyIdsCommaString((restData as any).copyDeptIds),
+                  copyUserIds: toWorkflowCopyIdsCommaString((restData as any).copyUserIds),
                 };
                 
                 const nodeObj: any = {