mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
feat:新增全局接口配置,单个图表映射表,抽离柱状图数据格式,
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import merge from 'lodash/merge'
|
||||
import pick from 'lodash/pick'
|
||||
import { EchartsDataType } from '../index.d'
|
||||
import { globalThemeJson } from '@/settings/chartThemes/index'
|
||||
|
||||
/**
|
||||
@@ -9,7 +10,7 @@ import { globalThemeJson } from '@/settings/chartThemes/index'
|
||||
* @param excludes 排除元素
|
||||
* @returns object
|
||||
*/
|
||||
export const mergeTheme = <T, U> (
|
||||
export const mergeTheme = <T, U>(
|
||||
option: T,
|
||||
themeSetting: U,
|
||||
includes: string[]
|
||||
@@ -20,8 +21,19 @@ export const mergeTheme = <T, U> (
|
||||
/**
|
||||
* * ECharts option 统一前置处理
|
||||
* @param option
|
||||
* @return option
|
||||
*/
|
||||
export const echartOptionProfixHandle = (option: any, includes: string[]) => {
|
||||
export const echartOptionProfixHandle = (option: any, includes: string[]) => {
|
||||
option['backgroundColor'] = 'rgba(0,0,0,0)'
|
||||
return mergeTheme(option, globalThemeJson, includes)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* * 设置数据
|
||||
* @param option
|
||||
* @return option
|
||||
*/
|
||||
export const setData = (option: any, data: EchartsDataType) => {
|
||||
option.dataset = data
|
||||
return option
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ export class publicConfig implements PublicConfigType {
|
||||
opacity: 1,
|
||||
animations: []
|
||||
}
|
||||
// 数据
|
||||
public data = {
|
||||
requestDataType: RequestDataTypeEnum.STATIC
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user