From 45224a77b80aa6bbd905d91f19d7b0d9dd6d6f05 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 15 一月 2024 14:22:47 +0800
Subject: [PATCH] 2024-01-15

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

diff --git a/src/components/normalform/modalform/mkTable/index.jsx b/src/components/normalform/modalform/mkTable/index.jsx
index 1baf22f..341e32a 100644
--- a/src/components/normalform/modalform/mkTable/index.jsx
+++ b/src/components/normalform/modalform/mkTable/index.jsx
@@ -276,7 +276,18 @@
     columns.forEach(col => {
       if (col.unique !== true || !unique) return
 
-      let _index = newData.findIndex(item => record.uuid !== item.uuid && record[col.dataIndex] === item[col.dataIndex])
+      let _index = newData.findIndex(item => {
+        if (record.uuid === item.uuid) return false
+
+        if (col.inputType === 'cascader') {
+          if (!Array.isArray(record[col.dataIndex]) || !Array.isArray(item[col.dataIndex])) {
+            return false
+          }
+          return record[col.dataIndex].toString() === item[col.dataIndex].toString()
+        }
+
+        return record[col.dataIndex] === item[col.dataIndex]
+      })
 
       if (_index > -1) {
         notification.warning({

--
Gitblit v1.8.0