fix: 修改引入方式,去除config文件上的node指向

This commit is contained in:
MTrun
2022-03-10 14:12:26 +08:00
parent 06caa046fa
commit 87b033c633
18 changed files with 37 additions and 69 deletions
@@ -1,7 +1,6 @@
import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
import { BarCommonConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import omit from 'lodash/omit'
import cloneDeep from 'lodash/cloneDeep'
export const includes = ['legend', 'xAxis', 'yAxis']
@@ -54,7 +53,7 @@ export const option = {
export default class Config extends publicConfig
implements CreateComponentType {
public key = BarCommonConfig.key
public chartConfig = omit(cloneDeep(BarCommonConfig), ['node', 'conNode'])
public chartConfig = cloneDeep(BarCommonConfig)
// 图表配置项
public option = echartOptionProfixHandle(option, includes)
}
@@ -1,17 +1,14 @@
import BarCommon from './index.vue'
import Configuration from './config.vue'
import image from '@/assets/images/chart/charts/bar_x.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
export const BarCommonConfig: ConfigType = {
key: 'VBarCommon',
key: 'BarCommon',
chartKey: 'VBarCommon',
conKey: 'VCBarCommon',
title: '柱状图',
category: ChatCategoryEnum.BAR,
categoryName: ChatCategoryEnumName.BAR,
package: PackagesCategoryEnum.CHARTS,
node: () => BarCommon,
conNode: () => Configuration,
image: image,
image
}
@@ -1,7 +1,6 @@
import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
import { BarCrossrangefig } from './index'
import { BarCrossrangeConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import omit from 'lodash/omit'
import cloneDeep from 'lodash/cloneDeep'
export const includes = ['legend', 'xAxis', 'yAxis']
@@ -53,8 +52,8 @@ export const option = {
export default class Config extends publicConfig
implements CreateComponentType {
public key: string = BarCrossrangefig.key
public chartConfig = omit(cloneDeep(BarCrossrangefig), ['node', 'conNode'])
public key: string = BarCrossrangeConfig.key
public chartConfig = cloneDeep(BarCrossrangeConfig)
// 图表配置项
public option = echartOptionProfixHandle(option, includes)
}
@@ -1,17 +1,14 @@
import BarCrossrange from './index.vue'
import Configuration from './config.vue'
import image from '@/assets/images/chart/charts/bar_y.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
export const BarCrossrangefig: ConfigType = {
key: 'VBarCrossrange',
export const BarCrossrangeConfig: ConfigType = {
key: 'BarCrossrange',
chartKey: 'VBarCrossrange',
conKey: 'VCBarCrossrange',
title: '横向柱状图',
category: ChatCategoryEnum.BAR,
categoryName: ChatCategoryEnumName.BAR,
package: PackagesCategoryEnum.CHARTS,
node: () => BarCrossrange,
conNode: () => Configuration,
image: image
image
}
+2 -2
View File
@@ -1,4 +1,4 @@
import { BarCommonConfig } from './BarCommon/index'
import { BarCrossrangefig } from './BarCrossrange/index'
import { BarCrossrangeConfig } from './BarCrossrange/index'
export default [BarCommonConfig, BarCrossrangefig]
export default [BarCommonConfig, BarCrossrangeConfig]
@@ -1,7 +1,6 @@
import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
import { LineCommonConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import omit from 'lodash/omit'
export const includes = ['legend', 'xAxis', 'yAxis']
@@ -58,7 +57,7 @@ export const option = {
export default class Config extends publicConfig
implements CreateComponentType {
public key: string = LineCommonConfig.key
public chartConfig = omit(LineCommonConfig, ['node', 'conNode'])
public chartConfig = LineCommonConfig
// 图表配置项
public option = echartOptionProfixHandle(option, includes)
}
@@ -1,17 +1,14 @@
import LineCommon from './index.vue'
import Configuration from './config.vue'
import image from '@/assets/images/chart/charts/line.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
export const LineCommonConfig: ConfigType = {
key: 'VLineCommon',
key: 'LineCommon',
chartKey: 'VLineCommon',
conKey: 'VCLineCommon',
title: '折线图',
category: ChatCategoryEnum.LINE,
categoryName: ChatCategoryEnumName.LINE,
package: PackagesCategoryEnum.CHARTS,
node: () => LineCommon,
conNode: () => Configuration,
image: image
image
}
@@ -2,7 +2,6 @@ import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
import { LineGradientSingleConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import { graphic } from 'echarts/core'
import omit from 'lodash/omit'
export const includes = ['legend', 'xAxis', 'yAxis']
@@ -57,7 +56,7 @@ const options = {
export default class Config extends publicConfig
implements CreateComponentType {
public key: string = LineGradientSingleConfig.key
public chartConfig = omit(LineGradientSingleConfig, ['node', 'conNode'])
public chartConfig = LineGradientSingleConfig
// 图表配置项
public option = echartOptionProfixHandle(options, includes)
}
@@ -1,17 +1,14 @@
import LineGradientSingle from './index.vue'
import Configuration from './config.vue'
import image from '@/assets/images/chart/charts/line_gradient_single.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
export const LineGradientSingleConfig: ConfigType = {
key: 'VLineGradientSingle',
key: 'LineGradientSingle',
chartKey: 'VLineGradientSingle',
conKey: 'VCLineGradientSingle',
title: '折线面积图',
category: ChatCategoryEnum.LINE,
categoryName: ChatCategoryEnumName.LINE,
package: PackagesCategoryEnum.CHARTS,
node: () => LineGradientSingle,
conNode: () => Configuration,
image: image
image
}
@@ -2,7 +2,6 @@ import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
import { LineGradientsConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import { graphic } from 'echarts/core'
import omit from 'lodash/omit'
export const includes = ['legend', 'xAxis', 'yAxis']
@@ -85,7 +84,7 @@ const option = {
export default class Config extends publicConfig
implements CreateComponentType {
public key: string = LineGradientsConfig.key
public chartConfig = omit(LineGradientsConfig, ['node', 'conNode'])
public chartConfig = LineGradientsConfig
// 图表配置项
public option = echartOptionProfixHandle(option, includes)
}
@@ -1,17 +1,14 @@
import LineGradients from './index.vue'
import Configuration from './config.vue'
import image from '@/assets/images/chart/charts/line_gradient2.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
export const LineGradientsConfig: ConfigType = {
key: 'VLineGradients',
key: 'LineGradients',
chartKey: 'VLineGradients',
conKey: 'VCLineGradients',
title: '折线面积图',
category: ChatCategoryEnum.LINE,
categoryName: ChatCategoryEnumName.LINE,
package: PackagesCategoryEnum.CHARTS,
node: () => LineGradients,
conNode: () => Configuration,
image: image
image
}
@@ -1,7 +1,6 @@
import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
import { PieCommonConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import omit from 'lodash/omit'
export const includes = ['legend']
@@ -54,7 +53,7 @@ const option = {
export default class Config extends publicConfig implements CreateComponentType {
public key: string = PieCommonConfig.key
public chartConfig = omit(PieCommonConfig, ['node', 'conNode'])
public chartConfig = PieCommonConfig
// 图表配置项
public option = echartOptionProfixHandle(option, includes)
@@ -1,17 +1,14 @@
import PieCommon from './index.vue'
import Configuration from './config.vue'
import image from '@/assets/images/chart/charts/pie.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
export const PieCommonConfig: ConfigType = {
key: 'VPieCommon',
key: 'PieCommon',
chartKey: 'VPieCommon',
conKey: 'VCPieCommon',
title: '饼图',
category: ChatCategoryEnum.PIE,
categoryName: ChatCategoryEnumName.PIE,
package: PackagesCategoryEnum.CHARTS,
node: () => PieCommon,
conNode: () => Configuration,
image
}