|
|
@@ -1,9 +1,10 @@
|
|
|
import React from 'react'
|
|
|
-import { Form, InputNumber, Select, Checkbox } from 'antd'
|
|
|
+import { Form, Select, Checkbox } from 'antd'
|
|
|
import { connect } from 'dva'
|
|
|
import XAxisItem from './xAxisItem';
|
|
|
import YAxisItem from './yAxisItem';
|
|
|
import DrillList from './drillList';
|
|
|
+import Threshold from './threshold';
|
|
|
import GRANULARITY from './granularity.json';
|
|
|
|
|
|
const { Option } = Select;
|
|
|
@@ -60,28 +61,19 @@ const PieConfigForm = ({ autoRefresh, chartDesigner, dispatch }) => {
|
|
|
<Option value='DESC'>降序</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <FormItem label='阈值' {...formItemLayout}>
|
|
|
- <InputNumber
|
|
|
- defaultValue={chartDesigner.pieConfig.threshold}
|
|
|
- placeholder={chartDesigner.defaultPieThreshold}
|
|
|
- onBlur={e => {
|
|
|
- let value = e.target.value;
|
|
|
- if(value !== chartDesigner.pieConfig.threshold) {
|
|
|
- let fields = [{ name: 'pieConfig', value: { ...pieConfig, threshold: value } }];
|
|
|
- dispatch({ type: 'chartDesigner/changeFields', fields, autoRefresh });
|
|
|
- }
|
|
|
- }}
|
|
|
- onKeyDown={e => {
|
|
|
- if(e.keyCode === 13) {
|
|
|
- let value = e.target.value;
|
|
|
- if(value !== chartDesigner.pieConfig.threshold) {
|
|
|
- let fields = [{ name: 'pieConfig', value: { ...pieConfig, threshold: value } }];
|
|
|
- dispatch({ type: 'chartDesigner/changeFields', fields, autoRefresh });
|
|
|
- }
|
|
|
- }
|
|
|
- }}
|
|
|
- />
|
|
|
- </FormItem>
|
|
|
+ <Threshold
|
|
|
+ other={true}
|
|
|
+ threshold={chartDesigner.pieConfig.threshold}
|
|
|
+ defaultThreshold={chartDesigner.defaultPieThreshold}
|
|
|
+ hiddenOverThreshold={!!pieConfig.hiddenOverThreshold}
|
|
|
+ onChange={value => {
|
|
|
+ let fields = [{ name: 'pieConfig', value: { ...pieConfig, threshold: value } }];
|
|
|
+ dispatch({ type: 'chartDesigner/changeFields', fields, autoRefresh });
|
|
|
+ }}
|
|
|
+ onCheckedChange={checked => {
|
|
|
+ dispatch({ type: 'chartDesigner/changeField', name: 'pieConfig', value: { ...pieConfig, hiddenOverThreshold: checked }, autoRefresh });
|
|
|
+ }}
|
|
|
+ />
|
|
|
{pieConfig.xAxis.column.value && <FormItem label='钻取' {...formItemLayout}>
|
|
|
<Checkbox
|
|
|
checked={!!pieConfig.drillable}
|