From 76427d51a079a5fd1f45bf7188249e7a4647ae05 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 14 九月 2020 10:37:25 +0800
Subject: [PATCH] 2020-09-14

---
 src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx b/src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx
index afd1e2e..1ff3197 100644
--- a/src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx
+++ b/src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx
@@ -229,6 +229,8 @@
     const { plot, fieldName, enabled, colorOptions, shapeOptions } = this.state
     const fields = []
 
+    if (!plot.customs) return null
+
     fields.push(<Col span={12} key="enabled">
       <Form.Item label="鏄惁鍚敤" style={{marginBottom: 10}}>
         {getFieldDecorator('enabled', {
@@ -412,7 +414,7 @@
         if (!err) {
           let _plot = {...plot, ...values}
 
-          if (_plot.enabled !== 'true') {
+          if (_plot.enabled !== 'true' || _plot.customs.map(_cell => _cell.field).sort().toString() !== _plot.Yaxis.sort().toString()) {
             _plot.enabled = 'false'
             _plot.customs = _plot.Yaxis.map((field, i) => {
               let _item = {field: field}
@@ -426,6 +428,7 @@
           }
           
           this.setState({
+            enabled: _plot.enabled || 'false',
             plot: _plot,
             view: _view
           })

--
Gitblit v1.8.0