From 24e45df087aa0ae882b8a5c964fa12e056cb47c6 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 24 五月 2022 19:12:07 +0800
Subject: [PATCH] 2022-05-24

---
 src/menu/components/chart/antv-scatter/index.jsx |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/menu/components/chart/antv-scatter/index.jsx b/src/menu/components/chart/antv-scatter/index.jsx
index 30e9268..3c3885f 100644
--- a/src/menu/components/chart/antv-scatter/index.jsx
+++ b/src/menu/components/chart/antv-scatter/index.jsx
@@ -115,6 +115,7 @@
 
   componentDidMount () {
     MKEmitter.addListener('submitStyle', this.getStyle)
+    MKEmitter.addListener('plusSearch', this.plusSearch)
     MKEmitter.addListener('tabsChange', this.handleTabsChange)
     setTimeout(() => {
       this.ponitrender()
@@ -133,6 +134,7 @@
       return
     }
     MKEmitter.removeListener('submitStyle', this.getStyle)
+    MKEmitter.removeListener('plusSearch', this.plusSearch)
     MKEmitter.removeListener('tabsChange', this.handleTabsChange)
   }
 
@@ -263,7 +265,7 @@
 
     component.width = component.plot.width
     component.name = component.plot.name
-    
+
     this.setState({
       card: component
     })
@@ -287,6 +289,16 @@
 
     // 娉ㄥ唽浜嬩欢-娣诲姞鎼滅储
     MKEmitter.emit('addSearch', card.uuid, newcard)
+  }
+
+  plusSearch = (uuid, search, type) => {
+    const { card } = this.state
+    if (card.uuid !== uuid || type !== 'simple') return
+
+    search.uuid = Utils.getuuid()
+    search.focus = true
+
+    MKEmitter.emit('addSearch', card.uuid, search)
   }
 
   addButton = () => {
@@ -378,7 +390,7 @@
             {appType !== 'mob' ? <PlusSquareOutlined className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton}/> : null}
             <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/>
             <CopyComponent type="line" card={card}/>
-            <PasteComponent config={card} options={['action']} updateConfig={this.updateComponent}/>
+            <PasteComponent config={card} options={['action', 'search']} updateConfig={this.updateComponent}/>
             <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/>
             <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog}/>
             <ClockComponent config={card} updateConfig={this.updateComponent}/>

--
Gitblit v1.8.0