mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-26 19:36:35 +08:00
27 lines
572 B
TypeScript
27 lines
572 B
TypeScript
import merge from 'lodash/merge'
|
|
import pick from 'lodash/pick'
|
|
|
|
/**
|
|
* * ECharts option 统一前置处理
|
|
* @param option
|
|
*/
|
|
export const echartOptionProfixHandle = (option: any) => {
|
|
option['backgroundColor'] = 'rgba(0,0,0,0)'
|
|
return option
|
|
}
|
|
|
|
/**
|
|
* * 合并 color 和全局配置项
|
|
* @param option 配置
|
|
* @param themeSetting 设置
|
|
* @param excludes 排除元素
|
|
* @returns object
|
|
*/
|
|
export const mergeTheme = <T, U, E extends keyof U> (
|
|
option: T,
|
|
themeSetting: U,
|
|
includes: E[] = []
|
|
) => {
|
|
return merge(pick(themeSetting, includes), option)
|
|
}
|