|
|
@@ -1,16 +1,17 @@
|
|
|
import React from 'react'
|
|
|
-import { Form, InputNumber, Checkbox } from 'antd'
|
|
|
+import { Form, InputNumber, Select, Checkbox } from 'antd'
|
|
|
import { connect } from 'dva'
|
|
|
import XAxisItem from './xAxisItem';
|
|
|
import YAxisItem from './yAxisItem';
|
|
|
import DrillList from './drillList';
|
|
|
import GRANULARITY from './granularity.json';
|
|
|
-import { deepAssign } from '../../../utils/baseUtils'
|
|
|
-const FormItem = Form.Item
|
|
|
+
|
|
|
+const { Option } = Select;
|
|
|
+const FormItem = Form.Item;
|
|
|
const formItemLayout = {
|
|
|
labelCol: { span: 8 },
|
|
|
wrapperCol: { span: 16 },
|
|
|
-}
|
|
|
+};
|
|
|
const PieConfigForm = ({ autoRefresh, chartDesigner, dispatch }) => {
|
|
|
const { columns, baseConfig, pieConfig } = chartDesigner;
|
|
|
|
|
|
@@ -33,6 +34,32 @@ const PieConfigForm = ({ autoRefresh, chartDesigner, dispatch }) => {
|
|
|
dispatch({ type: 'chartDesigner/changeField', name: 'pieConfig', value: { ...pieConfig, yAxis: { column, gauge } }, autoRefresh });
|
|
|
}}/>
|
|
|
</FormItem>
|
|
|
+ {/* <FormItem label='排序目标' {...formItemLayout}>
|
|
|
+ <Select
|
|
|
+ placeholder='扇区索引'
|
|
|
+ allowClear={true}
|
|
|
+ onChange={(value) => {
|
|
|
+ dispatch({ type: 'chartDesigner/changeField', name: 'pieConfig', value: { ...pieConfig, sortTarget: value }, autoRefresh });
|
|
|
+ }}
|
|
|
+ value={pieConfig.sortTarget}
|
|
|
+ >
|
|
|
+ <Option value='x'>扇区索引</Option>
|
|
|
+ <Option value='y'>值</Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label='排序方式' {...formItemLayout}>
|
|
|
+ <Select
|
|
|
+ placeholder='升序'
|
|
|
+ allowClear={true}
|
|
|
+ onChange={(value) => {
|
|
|
+ dispatch({ type: 'chartDesigner/changeField', name: 'pieConfig', value: { ...pieConfig, sortType: value }, autoRefresh });
|
|
|
+ }}
|
|
|
+ value={pieConfig.sortType}
|
|
|
+ >
|
|
|
+ <Option value='ASC'>升序</Option>
|
|
|
+ <Option value='DESC'>降序</Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem> */}
|
|
|
<FormItem label='阈值' {...formItemLayout}>
|
|
|
<InputNumber
|
|
|
defaultValue={chartDesigner.pieConfig.threshold}
|
|
|
@@ -40,16 +67,16 @@ const PieConfigForm = ({ autoRefresh, chartDesigner, dispatch }) => {
|
|
|
onBlur={e => {
|
|
|
let value = e.target.value;
|
|
|
if(value !== chartDesigner.pieConfig.threshold) {
|
|
|
- let fields = [{ name: 'pieConfig', value: deepAssign(chartDesigner.pieConfig, { threshold: value }) }];
|
|
|
- dispatch({ type: 'chartDesigner/changeFields', fields });
|
|
|
+ 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: deepAssign(chartDesigner.pieConfig, { threshold: value }) }];
|
|
|
- dispatch({ type: 'chartDesigner/changeFields', fields });
|
|
|
+ let fields = [{ name: 'pieConfig', value: { ...pieConfig, threshold: value } }];
|
|
|
+ dispatch({ type: 'chartDesigner/changeFields', fields, autoRefresh });
|
|
|
}
|
|
|
}
|
|
|
}}
|