From 432b788acf901b0720184b8ee8bc81a2e6fa47e0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 28 九月 2021 18:22:02 +0800
Subject: [PATCH] 2021-09-28

---
 src/components/normalform/modalform/index.jsx |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/components/normalform/modalform/index.jsx b/src/components/normalform/modalform/index.jsx
index 99658a4..b8d4c89 100644
--- a/src/components/normalform/modalform/index.jsx
+++ b/src/components/normalform/modalform/index.jsx
@@ -101,10 +101,17 @@
 
         if (cell.hidden) return
 
-        if (supItem.hidden || !item.values.includes(supItem.initval)) {
+        if (supItem.hidden) {
           cell.hidden = true
-          fieldMap.set(item.field, cell)
+        } else if (supItem.type === 'checkbox') {
+          let vals = [...supItem.initval, ...item.values]
+          if (vals.length === new Set(vals).size) {
+            cell.hidden = true
+          }
+        } else if (!item.values.includes(supItem.initval)) {
+          cell.hidden = true
         }
+        fieldMap.set(item.field, cell)
 
         fields.push(item)
       })
@@ -227,7 +234,7 @@
       } else if (item.type === 'fileupload') {
         content = (<MKFileUpload config={item} onChange={(val) => this.recordChange({[item.field]: val})} />)
       } else if (item.type === 'cascader') {
-        content = (<Cascader options={item.options} expandTrigger="hover" placeholder="" />)
+        content = (<Cascader allowClear={!!item.allowClear} options={item.options} expandTrigger="hover" placeholder="" />)
       } else if (item.type === 'textarea') {
         content = (<TextArea rows={item.rows || 2} placeholder=""/>)
       } else if (item.type === 'mkicon') {

--
Gitblit v1.8.0