feat:新增全局接口配置,单个图表映射表,抽离柱状图数据格式,

This commit is contained in:
MTrun
2022-03-18 20:36:05 +08:00
parent 501dfdc223
commit c4ff0d24b7
20 changed files with 226 additions and 64 deletions
+15 -3
View File
@@ -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
}
+1
View File
@@ -17,6 +17,7 @@ export class publicConfig implements PublicConfigType {
opacity: 1,
animations: []
}
// 数据
public data = {
requestDataType: RequestDataTypeEnum.STATIC
}