From aa15f061ba185b05f22c98a0a979c72d08bcd974 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 11 二月 2025 09:42:38 +0800
Subject: [PATCH] 2025-02-11

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

diff --git a/src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx b/src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx
index afd1e2e..be87511 100644
--- a/src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx
+++ b/src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx
@@ -1,15 +1,15 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { fromJS } from 'immutable'
-import { Drawer, Form, Button, Col, Row, Select, Icon, Radio, Tooltip, Input, InputNumber, Cascader } from 'antd'
+import { Drawer, Form, Button, Col, Row, Select, Radio, Tooltip, Input, InputNumber, Cascader } from 'antd'
+import { QuestionCircleOutlined, RightOutlined, EditOutlined, LeftOutlined } from '@ant-design/icons'
 
-import { getChartOptionForm } from '@/templates/zshare/formconfig'
+import { getChartOptionForm } from './formconfig'
 import { minkeColorSystem, colorTransform } from '@/utils/option.js'
 import './index.scss'
 
 class LineChartDrawerForm extends Component {
   static propTpyes = {
-    dict: PropTypes.object,
     plot: PropTypes.object,
     config: PropTypes.object,
     plotchange: PropTypes.func
@@ -77,6 +77,11 @@
       }
     })
 
+    if (plot.correction) {
+      delete plot.correction // 鏁版嵁淇锛堝凡寮冪敤锛�
+      plot.barSize = 35
+    }
+
     this.setState({
       visible: true,
       view: 'normal',
@@ -124,7 +129,7 @@
           <Col span={12} key={index}>
             <Form.Item label={item.tooltip ?
               <Tooltip placement="topLeft" title={item.tooltip}>
-                <Icon type="question-circle" />
+                <QuestionCircleOutlined className="mk-form-tip" />
                 {item.label}
               </Tooltip> : item.label
             }>
@@ -133,7 +138,7 @@
                 rules: [
                   {
                     required: !!item.required,
-                    message: this.props.dict['form.required.input'] + item.label + '!'
+                    message: '璇疯緭鍏�' + item.label + '!'
                   }
                 ]
               })(<Input placeholder="" autoComplete="off" disabled={item.readonly}/>)}
@@ -145,7 +150,7 @@
           <Col span={12} key={index}>
             <Form.Item label={item.tooltip ?
               <Tooltip placement="topLeft" title={item.tooltip}>
-                <Icon type="question-circle" />
+                <QuestionCircleOutlined className="mk-form-tip" />
                 {item.label}
               </Tooltip> : item.label
             }>
@@ -154,7 +159,7 @@
                 rules: [
                   {
                     required: !!item.required,
-                    message: this.props.dict['form.required.input'] + item.label + '!'
+                    message: '璇疯緭鍏�' + item.label + '!'
                   }
                 ]
               })(<InputNumber min={item.min} max={item.max} precision={item.decimal} />)}
@@ -166,7 +171,7 @@
           <Col span={12} key={index}>
             <Form.Item label={item.tooltip ?
               <Tooltip placement="topLeft" title={item.tooltip}>
-                <Icon type="question-circle" />
+                <QuestionCircleOutlined className="mk-form-tip" />
                 {item.label}
               </Tooltip> : item.label
             }>
@@ -175,7 +180,7 @@
                 rules: [
                   {
                     required: !!item.required,
-                    message: this.props.dict['form.required.select'] + item.label + '!'
+                    message: '璇烽�夋嫨' + item.label + '!'
                   }
                 ]
               })(
@@ -195,7 +200,7 @@
           <Col span={12} key={index}>
             <Form.Item label={item.tooltip ?
               <Tooltip placement="topLeft" title={item.tooltip}>
-                <Icon type="question-circle" />
+                <QuestionCircleOutlined className="mk-form-tip" />
                 {item.label}
               </Tooltip> : item.label
             }>
@@ -204,7 +209,7 @@
                 rules: [
                   {
                     required: !!item.required,
-                    message: this.props.dict['form.required.select'] + item.label + '!'
+                    message: '璇烽�夋嫨' + item.label + '!'
                   }
                 ]
               })(
@@ -228,6 +233,8 @@
     const { getFieldDecorator } = this.props.form
     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}}>
@@ -253,7 +260,7 @@
             rules: [
               {
                 required: enabled === 'true',
-                message: this.props.dict['form.required.select'] + '褰㈢姸!'
+                message: '璇烽�夋嫨褰㈢姸!'
               }
             ]
           })(
@@ -273,7 +280,7 @@
             rules: [
               {
                 required: enabled === 'true',
-                message: this.props.dict['form.required.select'] + '棰滆壊!'
+                message: '璇烽�夋嫨棰滆壊!'
               }
             ]
           })(
@@ -412,7 +419,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 +433,7 @@
           }
           
           this.setState({
+            enabled: _plot.enabled || 'false',
             plot: _plot,
             view: _view
           })
@@ -486,7 +494,7 @@
 
     return (
       <div className="line-chart-drawer-form">
-        <Icon type="edit" onClick={this.showDrawer} />
+        <EditOutlined onClick={this.showDrawer} />
         <Drawer
           title="鍥捐〃缂栬緫"
           className="chart-drawer-form"
@@ -498,13 +506,13 @@
           {view !== 'custom' ? <Form {...formItemLayout} className="base-setting">
             <Row gutter={16}>{this.getFields()}</Row>
             {datatype === 'query' ? <Row gutter={16}>
-              <Button onClick={this.changeView} style={{border: 0, boxShadow: 'unset',float: 'right', color: '#1890ff', marginRight: 12, cursor: 'pointer'}}>鑷畾涔夎缃�<Icon style={{marginLeft: 5}} type="right" /></Button>
+              <Button onClick={this.changeView} style={{border: 0, boxShadow: 'unset',float: 'right', color: '#1890ff', marginRight: 12, cursor: 'pointer'}}>鑷畾涔夎缃�<RightOutlined style={{marginLeft: 5}} /></Button>
             </Row> : null}
           </Form> : null}
           {view === 'custom' ? <Form {...formItemLayout} id="chart-custom-drawer-form" className="mingke-table">
             <Row gutter={16} style={{minHeight: 'calc(100vh - 180px)'}}>{this.getCustomFields()}</Row>
             <Row gutter={16}>
-              <Button onClick={this.changeView} style={{border: 0, boxShadow: 'unset', color: '#1890ff', marginRight: 12, cursor: 'pointer'}}><Icon style={{marginRight: 5}} type="left" />鍩烘湰璁剧疆</Button>
+              <Button onClick={this.changeView} style={{border: 0, boxShadow: 'unset', color: '#1890ff', marginRight: 12, cursor: 'pointer'}}><LeftOutlined style={{marginRight: 5}} />鍩烘湰璁剧疆</Button>
             </Row>
           </Form> : null}
           <div

--
Gitblit v1.8.0