From 8bc1c1f8cf628efb149f0331ddd491b4c000009d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 02 七月 2023 22:43:15 +0800
Subject: [PATCH] 2023-07-02

---
 src/tabviews/zshare/mutilform/index.jsx |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index 067bfd2..7623755 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -467,6 +467,31 @@
           item.options = fromJS(item.oriOptions).toJS()
         }
         item.linkSubField = null
+      } else if (item.type === 'switch' && item.linkSubField) {
+        item.options = []
+        item.subFields = []
+        item.linkSubField.forEach(m => {
+          let n = fieldMap.get(m)
+          if (n && ['text', 'number', 'textarea'].includes(n.type)) {
+            item.subFields.push({
+              uuid: n.uuid,
+              field: m
+            })
+          }
+        })
+
+        if (item.subFields.length === 0) {
+          item.subFields = null
+        } else {
+          reFieldsVal = reFieldsVal || {}
+
+          let val = item.initval === item.openVal ? item.openText : item.closeText
+        
+          item.subFields.forEach(n => {
+            reFieldsVal[n.field] = val || ''
+          })
+        }
+        item.linkSubField = null
       }
 
       // if (item.type === 'link') {
@@ -1011,7 +1036,7 @@
           className = 'checkcard'
           content = (<MKCheckCard config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>)
         } else if (item.type === 'switch') {
-          content = (<MKSwitch config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>)
+          content = (<MKSwitch config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>)
         } else if (item.type === 'check') {
           content = (<MKCheck config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>)
         } else if (item.type === 'checkbox') {

--
Gitblit v1.8.0