Browse Source

fix: 保存时DIYTable值被覆写问题

ZhaoJun 1 year ago
parent
commit
49e63aea0a
2 changed files with 6 additions and 2 deletions
  1. 5 2
      src/pages/Detail/CommitAuditModal.js
  2. 1 0
      src/pages/Detail/FormAndFilesNode.js

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

@@ -583,9 +583,13 @@ function CommitAuditModal(props) {
     const currentFieldID = Object.keys(changedFields)[0];
     const formItem = allFormItem.find(item => item.props.id === currentFieldID);
 
-    // 记录TextNote的值
+    // 记录TextNote 以及其他未填写的值
     for (let index = 0; index < allFormItem.length; index++) {
       const tempFormItem = allFormItem[index];
+      // 跳过DIYTable控件
+      if (tempFormItem.componentName === 'DIYTable') {
+        continue;
+      }
       // 没找到就给默认值
       if (!componentValue.find(item => item.id === tempFormItem.props.id)) {
         if (tempFormItem.componentName === 'TextNote') {
@@ -629,7 +633,6 @@ function CommitAuditModal(props) {
         value: [changedFields[currentFieldID]],
       });
     }
-    console.log(componentValue);
     setFormComponentValues({
       ...formComponentValues,
       [currentNodeID]: componentValue,

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

@@ -78,6 +78,7 @@ const renderFrom = data => {
                   backgroundColor: '#ececef',
                   border: '1px solid #bcb9b9',
                   borderRadius: '4px',
+                  minHeight: '40px',
                 }}
               >
                 {value}