feat: 修改组件展示,支持单个组件数据编辑

This commit is contained in:
MTrun
2022-02-24 17:23:20 +08:00
parent 2bdc489827
commit 14010cce8f
17 changed files with 219 additions and 175 deletions
+12 -11
View File
@@ -1,14 +1,6 @@
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
}
import { globalThemeJson } from '@/settings/chartThemes/index'
/**
* * 合并 color 和全局配置项
@@ -17,10 +9,19 @@ export const echartOptionProfixHandle = (option: any) => {
* @param excludes 排除元素
* @returns object
*/
export const mergeTheme = <T, U, E extends keyof U> (
export const mergeTheme = <T, U> (
option: T,
themeSetting: U,
includes: E[] = []
includes: string[]
) => {
return merge({}, pick(themeSetting, includes), option)
}
/**
* * ECharts option 统一前置处理
* @param option
*/
export const echartOptionProfixHandle = (option: any, includes: string[]) => {
option['backgroundColor'] = 'rgba(0,0,0,0)'
return mergeTheme(option, globalThemeJson, includes)
}