Browse Source

fix: DIYTable 提交时的格式问题

ZhaoJun 1 năm trước cách đây
mục cha
commit
23eb691526
2 tập tin đã thay đổi với 12 bổ sung1 xóa
  1. 2 1
      src/pages/Detail/CommitAuditModal.js
  2. 10 0
      src/pages/Detail/FormAndFilesNode.js

+ 2 - 1
src/pages/Detail/CommitAuditModal.js

@@ -218,9 +218,10 @@ function CommitAuditModal(props) {
       let values = data[approvalNode.Id] || prevValues || [];
       values.forEach(tempValue => {
         if (tempValue.type === 'DIYTable') {
-          tempValue.value = [tempValue.value.map(item => JSON.stringify(item))];
+          tempValue.value = [...tempValue.value.map(item => JSON.stringify(item))];
         }
       });
+
       let audit_list = [],
         cc_list = [];
       approvalProcess[approvalNode.Id]?.forEach(item => {

+ 10 - 0
src/pages/Detail/FormAndFilesNode.js

@@ -46,6 +46,16 @@ const renderFrom = data => {
   try {
     const ding_schema = JSON.parse(data)[0];
     const formData = JSON.parse(ding_schema)?.formComponentValues;
+
+    formData.forEach(item => {
+      if (item.type === 'DIYTable') {
+        item.value = item.value.map(row => {
+          const sss = JSON.parse(row);
+          const s = JSON.parse(sss);
+          return s;
+        });
+      }
+    });
     if (formData.length == 0) return <Empty description="没有表单信息" />;
     return (
       <>