From 8aef701cff785fbc13da30067cd41b6214e56b11 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 24 十二月 2020 15:24:19 +0800
Subject: [PATCH] 2020-12-24

---
 src/menu/components/chart/antv-pie/index.jsx |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/src/menu/components/chart/antv-pie/index.jsx b/src/menu/components/chart/antv-pie/index.jsx
index 11dd20f..704e5e9 100644
--- a/src/menu/components/chart/antv-pie/index.jsx
+++ b/src/menu/components/chart/antv-pie/index.jsx
@@ -2,7 +2,7 @@
 import PropTypes from 'prop-types'
 import {connect} from 'react-redux'
 import { is, fromJS } from 'immutable'
-import { Icon, Popover } from 'antd'
+import { Icon, Popover, notification } from 'antd'
 import { Chart } from '@antv/g2'
 import DataSet from '@antv/data-set'
 
@@ -17,6 +17,7 @@
 
 const SettingComponent = asyncIconComponent(() => import('@/menu/datasource'))
 const ChartCompileForm = asyncIconComponent(() => import('./chartcompile'))
+const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent'))
 const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader'))
 
 class antvBarLineChart extends Component {
@@ -395,6 +396,30 @@
     this.props.updateConfig(_card)
   }
 
+  handleLog = (type, logs, item) => {
+    let card = fromJS(this.state.card).toJS()
+
+    if (type === 'revert') {
+      card.action = card.action ? [...card.action, item] : [item]
+      card.btnlog = logs
+
+      this.setState({ card })
+      notification.success({
+        top: 92,
+        message: '鎭㈠鎴愬姛锛�',
+        duration: 2
+      })
+    } else {
+      card.btnlog = logs
+      this.setState({ card })
+      notification.success({
+        top: 92,
+        message: '娓呴櫎鎴愬姛锛�',
+        duration: 2
+      })
+    }
+  }
+
   render() {
     const { card } = this.state
 
@@ -406,6 +431,7 @@
             <Icon className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch} type="plus-circle" />
             <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/>
             <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" />
+            <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} />
             <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} />
             <SettingComponent config={card} updateConfig={this.updateComponent}/>
           </div>

--
Gitblit v1.8.0