From f3d4db769ba9b51b799d981511a710fd443d0e08 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 21 四月 2025 12:18:03 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/menu/components/search/main-search/index.jsx |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/menu/components/search/main-search/index.jsx b/src/menu/components/search/main-search/index.jsx
index ef3e3c1..c87bbd9 100644
--- a/src/menu/components/search/main-search/index.jsx
+++ b/src/menu/components/search/main-search/index.jsx
@@ -289,15 +289,15 @@
    * @description 鎼滅储鏉′欢鍒犻櫎
    */
   deleteElement = (cell) => {
-    let _this = this
+    let that = this
 
     confirm({
       content: `纭畾鍒犻櫎 - ${cell.label} 锛焋,
       onOk() {
-        let _card = fromJS(_this.state.card).toJS()
+        let _card = fromJS(that.state.card).toJS()
         _card.search = _card.search.filter(item => item.uuid !== cell.uuid)
 
-        _this.updateComponent(_card)
+        that.updateComponent(_card)
       },
       onCancel() {}
     })
@@ -315,6 +315,11 @@
       match: 'like',
       focus: true
     }
+
+    if (card.search.length) {
+      item.ratio = card.search[card.search.length - 1].ratio
+    }
+    
     card.search.push(item)
 
     this.setState({card}, () => {
@@ -342,6 +347,17 @@
 
       this.updateComponent(_card)
       this.handleSearch(item)
+    } else if (type === 'replace') {
+      delete item.focus
+      _card.search = _card.search.map(cell => {
+        if (cell.field && cell.field.toLowerCase() === item.field.toLowerCase()) {
+          return item
+        }
+        return cell
+      })
+
+      this.updateComponent(_card)
+      this.handleSearch(item)
     } else if (type === 'multil') {
       _card.search.push(...item)
 

--
Gitblit v1.8.0