From 1f5c6ac307a134dfa45b64c5723f2481ead9f213 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 16 七月 2023 16:23:09 +0800
Subject: [PATCH] 2023-07-16

---
 src/menu/components/form/tab-form/index.jsx |   38 +++++++++++++++++---------------------
 1 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/src/menu/components/form/tab-form/index.jsx b/src/menu/components/form/tab-form/index.jsx
index 5dff01a..f3dd1bd 100644
--- a/src/menu/components/form/tab-form/index.jsx
+++ b/src/menu/components/form/tab-form/index.jsx
@@ -9,7 +9,7 @@
 import asyncComponent from '@/utils/asyncComponent'
 import asyncIconComponent from '@/utils/asyncIconComponent'
 import { getModalForm } from '@/templates/zshare/formconfig'
-import { resetStyle, getTables } from '@/utils/utils-custom.js'
+import { resetStyle, getTables, checkComponent } from '@/utils/utils-custom.js'
 import MKEmitter from '@/utils/events.js'
 import Utils from '@/utils/utils.js'
 import getWrapForm from '../step-form/options'
@@ -151,19 +151,9 @@
       if (supModule === 'empty') {
         supModule = ''
       }
-      let columns = card.columns.map(c => c.field)
 
-      if (card.setting.interType === 'system' && card.setting.execute !== 'false' && !card.setting.dataresource) {
-        card.errors.push({ level: 0, detail: '鏈缃暟鎹簮锛�'})
-      } else if (card.setting.interType === 'system' && card.setting.execute === 'false' && card.scripts.filter(script => script.status !== 'false').length === 0) {
-        card.errors.push({ level: 0, detail: '鏁版嵁婧愪腑鏃犲彲鐢ㄨ剼鏈紒'})
-      } else if (!card.setting.primaryKey) {
-        card.errors.push({ level: 0, detail: '鏈缃富閿紒'})
-      } else if (!columns.includes(card.setting.primaryKey)) {
-        card.errors.push({ level: 0, detail: '涓婚敭宸插け鏁堬紒'})
-      } else if (!card.setting.supModule) {
-        card.errors.push({ level: 0, detail: '鏈缃笂绾х粍浠讹紒'})
-      }
+      card.$c_ds = true
+      card.errors = checkComponent(card)
 
       if (card.errors.length === 0) {
         card.$tables = getTables(card)
@@ -461,6 +451,8 @@
         index = i
       }
 
+      if (!item.field) return
+
       if (['text', 'number', 'textarea', 'color'].includes(item.type) && _item.field !== item.field) {
         _inputfields.push({
           field: item.field,
@@ -474,25 +466,28 @@
         })
       }
 
-      if (item.type === 'switch') {
+      if (item.type === 'switch' || item.type === 'check') {
         _linksupFields.push({
           field: item.field,
           label: item.label
         })
       }
       
-      if (!['select', 'link', 'radio', 'checkcard'].includes(item.type)) return
-      if (item.type === 'checkcard' && item.multiple === 'true') return // 閫夐」鍗″閫�
-      if (item.field && !uniq.has(item.field)) {
+      if (!['select', 'link', 'radio', 'checkcard', 'multiselect'].includes(item.type)) return
+
+      _linksupFields.push({
+        field: item.field,
+        label: item.label
+      })
+
+      if (item.type === 'multiselect' || (item.type === 'checkcard' && item.multiple === 'true')) return
+
+      if (!uniq.has(item.field)) {
         uniq.set(item.field, true)
 
         _linkableFields.push({
           field: item.field,
           label: item.label + '-琛ㄥ崟'
-        })
-        _linksupFields.push({
-          field: item.field,
-          label: item.label
         })
       }
     })
@@ -819,6 +814,7 @@
         </div>
         <Modal
           title="缂栬緫"
+          wrapClassName="mk-scroll-modal"
           visible={this.state.visible}
           width={950}
           maskClosable={false}

--
Gitblit v1.8.0