2020-11-02 19:39:21 +08:00
|
|
|
/**
|
|
|
|
* @file 各种图表的配置
|
|
|
|
*/
|
|
|
|
|
|
|
|
import {buildOptions, select} from './Common';
|
|
|
|
|
|
|
|
//@ts-ignore
|
|
|
|
const lineOptions = __inline('./option-parts/option.series-line.json');
|
2020-12-17 19:56:53 +08:00
|
|
|
//@ts-ignore
|
|
|
|
const barOptions = __inline('./option-parts/option.series-bar.json');
|
|
|
|
//@ts-ignore
|
|
|
|
const pieOptions = __inline('./option-parts/option.series-pie.json');
|
|
|
|
//@ts-ignore
|
|
|
|
const gaugeOptions = __inline('./option-parts/option.series-gauge.json');
|
|
|
|
//@ts-ignore
|
|
|
|
const funnelOptions = __inline('./option-parts/option.series-funnel.json');
|
|
|
|
//@ts-ignore
|
|
|
|
const radarOptions = __inline('./option-parts/option.series-radar.json');
|
2020-11-02 19:39:21 +08:00
|
|
|
|
|
|
|
const buildSerieOptions = (type: string, options: any) => {
|
|
|
|
return {
|
|
|
|
type: 'container',
|
2020-11-03 11:34:23 +08:00
|
|
|
visibleOn: `this.type == "${type}"`,
|
2021-06-24 10:18:12 +08:00
|
|
|
body: buildOptions('', options)
|
2020-11-02 19:39:21 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
2020-12-17 18:16:29 +08:00
|
|
|
type: 'combo',
|
|
|
|
name: 'series',
|
|
|
|
tabsMode: true,
|
|
|
|
tabsLabelTpl: '系列${index|plus}',
|
|
|
|
lazyLoad: true,
|
|
|
|
label: '',
|
|
|
|
multiLine: true,
|
|
|
|
multiple: true,
|
|
|
|
addButtonText: '新增系列',
|
2021-06-24 10:18:12 +08:00
|
|
|
items: [
|
2020-12-17 19:56:53 +08:00
|
|
|
select('type', '图表类型', [
|
|
|
|
'line',
|
|
|
|
'bar',
|
|
|
|
'pie',
|
|
|
|
'radar',
|
|
|
|
'funnel',
|
|
|
|
'gauge'
|
|
|
|
]),
|
2020-11-02 19:39:21 +08:00
|
|
|
{
|
2021-06-24 10:18:12 +08:00
|
|
|
type: 'input-array',
|
2020-12-17 18:16:29 +08:00
|
|
|
name: 'data', //TODO: 目前只支持一维
|
|
|
|
label: '数据',
|
|
|
|
items: {
|
2021-06-24 10:18:12 +08:00
|
|
|
type: 'input-number'
|
2020-12-17 18:16:29 +08:00
|
|
|
}
|
2020-12-25 16:45:27 +08:00
|
|
|
},
|
|
|
|
buildSerieOptions('line', lineOptions),
|
|
|
|
buildSerieOptions('bar', barOptions),
|
|
|
|
buildSerieOptions('pie', pieOptions),
|
|
|
|
buildSerieOptions('funnel', funnelOptions),
|
|
|
|
buildSerieOptions('gauge', gaugeOptions),
|
|
|
|
buildSerieOptions('radar', radarOptions)
|
2020-11-02 19:39:21 +08:00
|
|
|
]
|
|
|
|
};
|