From 53b9fb93d0376eb02bb996935f1720b4e95cd897 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 12 十月 2022 14:41:06 +0800
Subject: [PATCH] 2022-10-12

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

diff --git a/src/menu/components/chart/antv-bar/chartcompile/index.jsx b/src/menu/components/chart/antv-bar/chartcompile/index.jsx
index 61f053f..70b73e8 100644
--- a/src/menu/components/chart/antv-bar/chartcompile/index.jsx
+++ b/src/menu/components/chart/antv-bar/chartcompile/index.jsx
@@ -262,20 +262,41 @@
       }
     })
 
-    if (config.plot.correction) {
-      delete config.plot.correction // 鏁版嵁淇锛堝凡寮冪敤锛�
-      config.plot.barSize = 35
+    let plot = fromJS(config.plot).toJS()
+
+    if (plot.correction) {
+      delete plot.correction // 鏁版嵁淇锛堝凡寮冪敤锛�
+      plot.barSize = 35
+    }
+
+    if (plot.datatype !== 'statistics') {
+      if (plot.colors) {
+        plot.colors = plot.colors.map(item => {
+          if (fieldName[item.type]) {
+            item.label = fieldName[item.type]
+          }
+          return item
+        })
+      }
+      if (plot.customs) {
+        plot.customs = plot.customs.map(item => {
+          if (fieldName[item.type]) {
+            item.name = fieldName[item.type]
+          }
+          return item
+        })
+      }
     }
 
     this.setState({
       visible: true,
       view: 'normal',
-      ramp: config.plot.ramp || 'false',
-      datatype: config.plot.datatype || 'query',
+      ramp: plot.ramp || 'false',
+      datatype: plot.datatype || 'query',
       fieldName: fieldName,
-      plot: fromJS(config.plot).toJS(),
-      baseFormlist: getBaseForm(config.plot, config.columns),
-      formlist: getOptionForm(config.plot, config.columns)
+      plot: plot,
+      baseFormlist: getBaseForm(plot, config.columns),
+      formlist: getOptionForm(plot, config.columns)
     })
   }
 
@@ -755,8 +776,7 @@
       <div className="line-chart-drawer-form">
         <EditOutlined title="缂栬緫" onClick={this.showDrawer}/>
         <Modal
-          wrapClassName="popview-modal menu-chart-edit-modal"
-          title={config.type === 'bar' ? '鏌辩姸鍥剧紪杈�' : '鎶樼嚎鍥剧紪杈�'}
+          wrapClassName="mk-pop-modal"
           visible={visible}
           width={1000}
           maskClosable={false}
@@ -764,6 +784,7 @@
           onCancel={() => { this.setState({ visible: false }) }}
           destroyOnClose
         >
+          {config.name ? <div className="mk-com-name">{config.name} - 缂栬緫</div> : null}
           <Tabs activeKey={view} className="menu-chart-edit-box" onChange={this.changeTab}>
             <TabPane tab="缁勪欢璁剧疆" key="base">
               <NormalForm dict={this.props.dict} formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/>

--
Gitblit v1.8.0