From 31ec63f0419895876cbaba99637a884a32d33d0d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 01 九月 2021 10:31:45 +0800
Subject: [PATCH] 2021-09-01

---
 src/tabviews/zshare/mutilform/index.jsx |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index 0a74b45..fd2798c 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -160,6 +160,9 @@
       }
 
       if (item.type === 'text') {
+        if (typeof(item.initval) === 'number') {
+          item.initval = item.initval + ''
+        }
         let _rules = [{
           pattern: /^[^']*$/ig,
           message: formRule.input.quotemsg
@@ -321,7 +324,7 @@
       }
 
       // 涓嬬骇琛ㄥ崟鎺у埗-瀛楁鍐欏叆
-      if ((['select', 'radio'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true')) && item.linkSubField) {
+      if ((['select', 'radio', 'link'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true')) && item.linkSubField) {
         item.subFields = []
         item.linkSubField.forEach(m => {
           let n = fieldMap.get(m)
@@ -546,9 +549,10 @@
   
           if (item.type === 'link') {
             _cell.ParentID = cell[item.linkField] === undefined ? '' : cell[item.linkField]
-          } else if (item.subFields) {
+          }
+          if (item.subFields) {
             item.subFields.forEach(m => {
-              _cell[m.field] = (cell[m.field] || cell[m.field] === 0) ? cell[m.field] : ''
+              _cell[m.field] = cell[m.field] === undefined ? '' : cell[m.field]
             })
           }
   
@@ -661,9 +665,9 @@
         let label = item.tooltip ? <Tooltip placement="topLeft" title={item.tooltip}><Icon type="question-circle" />{item.label}</Tooltip> : item.label
       
         if (item.type === 'text' || item.type === 'linkMain') {
-          content = (<MKInput config={item} onChange={(val) => this.recordChange({[item.field]: val})} onSubmit={this.props.inputSubmit} />)
+          content = (<MKInput config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})} onSubmit={this.props.inputSubmit} />)
         } else if (item.type === 'number') {
-          content = (<MKNumberInput config={item} onChange={(val) => this.recordChange({[item.field]: val})} onSubmit={this.props.inputSubmit} />)
+          content = (<MKNumberInput config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})} onSubmit={this.props.inputSubmit} />)
         } else if (item.type === 'select' || item.type === 'link' || item.type === 'multiselect') {
           content = (<MKSelect config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)} onSubmit={this.props.inputSubmit} />)
         } else if (item.type === 'color') {
@@ -682,7 +686,7 @@
         } else if (item.type === 'fileupload') {
           content = (<MKFileUpload config={item} onChange={(val) => this.recordChange({[item.field]: val})} />)
         } else if (item.type === 'textarea') {
-          content = (<MKTextArea config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>)
+          content = (<MKTextArea config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})}/>)
         } else if (item.type === 'brafteditor') {
           content = (<MKEditor config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>)
           label = item.hidelabel !== 'true' ? label : ''
@@ -775,7 +779,7 @@
     }
 
     return (
-      <Form className={'main-form-field ' + _align} id="main-form-box">
+      <Form className={'main-form-field ' + _align}>
         <Row gutter={24}>{this.getFields()}</Row>
       </Form>
     )

--
Gitblit v1.8.0