From 0011ec870d3d1fe9d77a4941358c84acf8632e5e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 18 五月 2022 22:51:51 +0800
Subject: [PATCH] 2022-05-18

---
 src/menu/components/chart/antv-bar/chartcompile/index.jsx |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/src/menu/components/chart/antv-bar/chartcompile/index.jsx b/src/menu/components/chart/antv-bar/chartcompile/index.jsx
index accb869..b2d1d56 100644
--- a/src/menu/components/chart/antv-bar/chartcompile/index.jsx
+++ b/src/menu/components/chart/antv-bar/chartcompile/index.jsx
@@ -286,7 +286,7 @@
     if (key === 'datatype') {
       this.setState({
         datatype: val,
-        formlist: formlist.map(item => {
+        formlist: fromJS(formlist).toJS().map(item => {
           if (['Yaxis'].includes(item.key)) {
             item.hidden = val === 'statistics'
           } else if (['InfoType', 'InfoValue'].includes(item.key)) {
@@ -295,6 +295,26 @@
           return item
         })
       })
+    } else if (key === 'label') {
+      this.setState({formlist: fromJS(formlist).toJS().map(cell => {
+        if (!['labelColor', 'labelValue'].includes(cell.key)) return cell
+        
+        if (cell.key === 'labelColor') {
+          if (val !== 'true') {
+            cell.hidden = true
+          } else {
+            cell.hidden = false
+          }
+        } else {
+          if (val === 'false') {
+            cell.hidden = true
+          } else {
+            cell.hidden = false
+          }
+        }
+
+        return cell
+      })})
     }
   }
 

--
Gitblit v1.8.0