From e2ac71fbc53b7119ae87c5a3b08cdcf830b497e2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 06 三月 2020 18:52:03 +0800
Subject: [PATCH] 2020-03-06

---
 src/templates/modalconfig/index.jsx |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx
index b655b80..4f50489 100644
--- a/src/templates/modalconfig/index.jsx
+++ b/src/templates/modalconfig/index.jsx
@@ -499,6 +499,8 @@
         })
       }
 
+      let fieldrepet = false // 瀛楁閲嶅
+
       if (modalType === 'copy' && card.originUuid) {
         if (_config.groups.length > 0) {
           _config.groups = _config.groups.map(group => {
@@ -506,6 +508,10 @@
             group.sublist.forEach((item, index) => {
               if (item.uuid === card.originUuid) {
                 _index = index
+              }
+
+              if (item.uuid !== res.uuid && item.field === res.field) {
+                fieldrepet = true
               }
             })
 
@@ -521,6 +527,10 @@
             if (item.uuid === card.originUuid) {
               _index = index
             }
+
+            if (item.uuid !== res.uuid && item.field === res.field) {
+              fieldrepet = true
+            }
           })
 
           _config.fields.splice(_index + 1, 0, res)
@@ -529,6 +539,10 @@
         if (_config.groups.length > 0) {
           _config.groups.forEach(group => {
             group.sublist = group.sublist.map(item => {
+              if (item.uuid !== res.uuid && item.field === res.field) {
+                fieldrepet = true
+              }
+
               if (item.uuid === res.uuid) {
                 return res
               } else {
@@ -538,6 +552,10 @@
           })
         } else {
           _config.fields = _config.fields.map(item => {
+            if (item.uuid !== res.uuid && item.field === res.field) {
+              fieldrepet = true
+            }
+
             if (item.uuid === res.uuid) {
               return res
             } else {
@@ -546,6 +564,15 @@
           })
         }
       }
+
+      if (fieldrepet) {
+        notification.warning({
+          top: 92,
+          message: '瀛楁鍚嶉噸澶嶏紒',
+          duration: 10
+        })
+        return
+      }
       
       _config.fields = _config.fields.filter(item => !item.origin)
 

--
Gitblit v1.8.0