From 2245384d97d69e36d09cd6baa877e50a81d9aff9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 29 十二月 2021 21:59:09 +0800
Subject: [PATCH] 2021-12-29

---
 src/tabviews/zshare/mutilform/index.jsx |   34 +++++++++++++++++++++-------------
 1 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index cafbcdf..6ee4ff0 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -56,18 +56,23 @@
     let check = action.setting.formType === 'check'
 
     formlist = formlist.filter(item => {
-      if (item.supField && item.supvalue) { // 澶氬眰琛ㄥ崟鎺у埗
+      if (item.supField) { // 澶氬眰琛ㄥ崟鎺у埗
         let supvals = []
-        item.supvalue.split(',').forEach(val => {
-          supvals.push(val)
-          if (/^([-]?(0|[1-9][0-9]*)(\.[0-9]+)?)$/.test(val)) {
-            supvals.push(+val)
-          }
-        })
+        if (item.supvalue) {
+          item.supvalue.split(',').forEach(val => {
+            supvals.push(val)
+            if (/^([-]?(0|[1-9][0-9]*)(\.[0-9]+)?)$/.test(val)) {
+              supvals.push(+val)
+            }
+          })
+        } else {
+          supvals.push('')
+        }
         controlFields[item.supField] = controlFields[item.supField] || []
         controlFields[item.supField].push({field: item.field, values: supvals})
       }
-      if (item.type === 'link') {
+      // if (item.type === 'link') {
+      if (item.linkField) {
         linkFields[item.linkField] = linkFields[item.linkField] || []
         linkFields[item.linkField].push({field: item.field, uuid: item.uuid})
       }
@@ -317,7 +322,8 @@
       if (!cell.field || !fieldMap.has(cell.field)) return cell
       let item = fieldMap.get(cell.field)
 
-      if (item.type === 'link') {
+      // if (item.type === 'link') {
+      if (item.linkField) {
         item.supInitVal = ''
 
         if (fieldMap.has(item.linkField)) {
@@ -585,7 +591,7 @@
             _cell = {..._cell, ...cell}
           }
   
-          if (item.type === 'link') {
+          if (item.linkField) {
             _cell.ParentID = cell[item.linkField] === undefined ? '' : cell[item.linkField]
           }
           if (item.subFields) {
@@ -603,9 +609,11 @@
 
         item.oriOptions = [...item.oriOptions, ...options]
 
-        if (item.type === 'link') {
+        // if (item.type === 'link') {
+        if (item.linkField) {
           item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.value === '')
-        } else if (['select', 'radio', 'checkbox', 'checkcard', 'multiselect'].includes(item.type)) {
+        // } else if (['select', 'radio', 'checkbox', 'checkcard', 'multiselect'].includes(item.type)) {
+        } else {
           item.options = item.oriOptions
         }
       }
@@ -722,7 +730,7 @@
         } else if (item.type === 'checkbox') {
           content = (<MKCheckbox config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>)
         } else if (item.type === 'radio') {
-          content = (<MKRadio config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>)
+          content = (<MKRadio config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>)
         } else if (item.type === 'date' || item.type === 'datemonth' || item.type === 'datetime') {
           content = (<MKDatePicker config={item} onChange={(val) => this.recordChange({[item.field]: val})} />)
         } else if (item.type === 'fileupload') {

--
Gitblit v1.8.0