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-bar/index.jsx | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx index 21cae5e..53df3c8 100644 --- a/src/menu/components/chart/antv-bar/index.jsx +++ b/src/menu/components/chart/antv-bar/index.jsx @@ -127,6 +127,7 @@ componentDidMount () { MKEmitter.addListener('submitStyle', this.getStyle) + MKEmitter.addListener('plusSearch', this.plusSearch) MKEmitter.addListener('tabsChange', this.handleTabsChange) setTimeout(() => { this.viewrender() @@ -145,6 +146,7 @@ return } MKEmitter.removeListener('submitStyle', this.getStyle) + MKEmitter.removeListener('plusSearch', this.plusSearch) MKEmitter.removeListener('tabsChange', this.handleTabsChange) } @@ -1225,7 +1227,7 @@ component.width = component.plot.width component.name = component.plot.name - + this.setState({ card: component }) @@ -1249,6 +1251,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 = () => { @@ -1340,7 +1352,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