| | |
| | | import { Modal, Form, Row, Col, Select, Icon, Radio, Tooltip, Input, InputNumber, Tabs, Button } from 'antd' |
| | | |
| | | 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' |
| | |
| | | { |
| | | title: '指标', |
| | | dataIndex: 'tick', |
| | | inputType: 'number', |
| | | inputType: this.props.config.subtype === 'ratioboard' ? 'text' : 'number', |
| | | editable: true, |
| | | width: '40%' |
| | | }, |
| | |
| | | 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() { |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <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> |
| | |
| | | ) |
| | | } 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" /> |