From ed1cc4adc145f8685d04763e19fbd6b0bd80c136 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 09 六月 2022 16:22:44 +0800 Subject: [PATCH] 2022-06-09 --- src/menu/components/chart/antv-dashboard/chartcompile/index.jsx | 50 +++++++++++++++----------------------------------- 1 files changed, 15 insertions(+), 35 deletions(-) diff --git a/src/menu/components/chart/antv-dashboard/chartcompile/index.jsx b/src/menu/components/chart/antv-dashboard/chartcompile/index.jsx index 051a639..09bf509 100644 --- a/src/menu/components/chart/antv-dashboard/chartcompile/index.jsx +++ b/src/menu/components/chart/antv-dashboard/chartcompile/index.jsx @@ -1,10 +1,11 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' -import { Modal, Form, Row, Col, Select, Icon, Radio, Tooltip, Input, InputNumber, Tabs, Button } from 'antd' +import { Modal, Form, Row, Col, Select, Radio, Tooltip, Input, InputNumber, Tabs, Button } from 'antd' +import { QuestionCircleOutlined, EditOutlined } from '@ant-design/icons' import Utils from '@/utils/utils.js' -import { getBaseForm, getOptionForm } from './formconfig' +import { getBaseForm, getOptionForm, getRadioOptionForm } from './formconfig' import asyncComponent from '@/utils/asyncComponent' import ColorSketch from '@/mob/colorsketch' import './index.scss' @@ -32,7 +33,7 @@ { title: '鎸囨爣', dataIndex: 'tick', - inputType: 'number', + inputType: this.props.config.subtype === 'ratioboard' ? 'text' : 'number', editable: true, width: '40%' }, @@ -57,30 +58,8 @@ view: 'normal', plot: fromJS(config.plot).toJS(), baseFormlist: getBaseForm(config.plot), - formlist: getOptionForm(config.plot, config.columns) + formlist: config.subtype === 'ratioboard' ? getRadioOptionForm(config.plot, config.columns) : getOptionForm(config.plot, config.columns) }) - } - - radioChange = (e, key) => { - const { formlist } = this.state - let val = e.target.value - - if (key === 'shape') { - this.setState({ - formlist: formlist.map(item => { - if (item.key === 'innerRadius') { - item.hidden = val === 'pie' - } - return item - }) - }, () => { - if (val === 'ring') { - this.props.form.setFieldsValue({innerRadius: 50}) - } else if (val === 'nightingale') { - this.props.form.setFieldsValue({innerRadius: 0}) - } - }) - } } getFields() { @@ -100,7 +79,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 }> @@ -121,7 +100,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 }> @@ -142,7 +121,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 }> @@ -171,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 }> @@ -184,7 +163,7 @@ } ] })( - <Radio.Group disabled={item.readonly} onChange={(e) => this.radioChange(e, item.key)}> + <Radio.Group disabled={item.readonly}> {item.options.map(option => { return ( <Radio key={option.value} value={option.value}>{option.text}</Radio> @@ -197,10 +176,10 @@ ) } else if (item.type === 'color') { fields.push( - <Col span={12} key={index}> + <Col span={12} key={index} className="color-col"> <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 }> @@ -304,6 +283,7 @@ } render() { + const { config } = this.props const { visible, plot, colorColumns, view, baseFormlist } = this.state const formItemLayout = { labelCol: { @@ -318,10 +298,10 @@ return ( <div className="line-chart-drawer-form"> - <Icon type="edit" title="缂栬緫" onClick={this.showDrawer} /> + <EditOutlined title="缂栬緫" onClick={this.showDrawer} /> <Modal wrapClassName="popview-modal menu-chart-edit-modal" - title="鍥捐〃缂栬緫" + title={config.subtype === 'ratioboard' ? '鍗犳瘮鍥剧紪杈�' : '浠〃鐩樼紪杈�'} visible={visible} width={850} maskClosable={false} -- Gitblit v1.8.0