From da64ab0923bf8817fc8599a6e37b953ce38f64c8 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 27 八月 2023 18:37:36 +0800
Subject: [PATCH] 2023-08-27

---
 src/templates/modalconfig/index.jsx |   51 ++++++++++++++++++++++-----------------------------
 1 files changed, 22 insertions(+), 29 deletions(-)

diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx
index 5291743..0ce29b4 100644
--- a/src/templates/modalconfig/index.jsx
+++ b/src/templates/modalconfig/index.jsx
@@ -245,23 +245,22 @@
     let _linkableFields = []
     let _linksupFields = []
     let standardform = null
-
-    let uniq = new Map()
     let index = null
-    uniq.set(card.field, true)
 
     config.fields.forEach((item, i) => {
       if (card.uuid === item.uuid) {
         index = i
       }
 
-      if (['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) {
+      if (!item.field || card.field === item.field) return
+
+      if (['text', 'number', 'textarea', 'color'].includes(item.type)) {
         _inputfields.push({
           field: item.field,
           label: item.label
         })
       }
-      if (card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) {
+      if (item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) {
         _tabfields.push({
           field: item.field,
           label: item.label
@@ -275,20 +274,19 @@
         })
       }
 
-      if (!['select', 'link', 'radio', 'checkcard'].includes(item.type)) return
-      if (item.type === 'checkcard' && item.multiple === 'true') return // 閫夐」鍗″閫�
-      if (item.field && !uniq.has(item.field)) {
-        uniq.set(item.field, true)
+      if (!['select', 'link', 'radio', 'checkcard', 'multiselect'].includes(item.type)) return
 
-        _linkableFields.push({
-          field: item.field,
-          label: item.label + '-琛ㄥ崟'
-        })
-        _linksupFields.push({
-          field: item.field,
-          label: item.label
-        })
-      }
+      _linksupFields.push({
+        field: item.field,
+        label: item.label
+      })
+
+      if (item.type === 'multiselect' || (item.type === 'checkcard' && item.multiple === 'true')) return
+
+      _linkableFields.push({
+        field: item.field,
+        label: item.label + '-琛ㄥ崟'
+      })
     })
 
     if (index !== null) {
@@ -299,11 +297,10 @@
       }
     }
 
+    let _fields = _linkableFields.map(cell => cell.field)
     if (subTabConfig) {
       subTabConfig.columns.forEach(col => {
-        if (col.field && !uniq.has(col.field)) {
-          uniq.set(col.field, true)
-
+        if (col.field && !_fields.includes(col.field)) {
           _linkableFields.push({
             field: col.field,
             label: col.label + '-鏄剧ず鍒�'
@@ -312,9 +309,7 @@
       })
     } else if (tabConfig) {
       tabConfig.columns.forEach(col => {
-        if (col.field && !uniq.has(col.field)) {
-          uniq.set(col.field, true)
-
+        if (col.field && !_fields.includes(col.field)) {
           _linkableFields.push({
             field: col.field,
             label: col.label + '-鏄剧ず鍒�'
@@ -323,9 +318,7 @@
       })
     } else if (menu.LongParam) {
       menu.LongParam.columns.forEach(col => {
-        if (col.field && !uniq.has(col.field)) {
-          uniq.set(col.field, true)
-
+        if (col.field && !_fields.includes(col.field)) {
           _linkableFields.push({
             field: col.field,
             label: col.label + '-鏄剧ず鍒�'
@@ -515,7 +508,7 @@
       })
     }
 
-    Api.getSystemConfig(param).then(response => {
+    Api.getCloudConfig(param).then(response => {
       if (response.status) {
         this.setState({
           openEdition: response.open_edition || '',
@@ -662,7 +655,7 @@
       MenuID: editAction.uuid
     }
 
-    Api.getSystemConfig(param).then(res => {
+    Api.getCloudConfig(param).then(res => {
       if (res.status) {
         let _config = ''
         if (res.LongParam) {

--
Gitblit v1.8.0