Commit f826f9c7a454e03161a0b09e22d7c46d6ff96117

Authored by ww
1 parent b4d090c7

perf: 修改拓展组件库配置

... ... @@ -2,11 +2,14 @@ import { ChartFrameEnum } from '@/packages/index.d'
2 2 import { ConfigType } from '@/packages/index.d'
3 3 import { EPackagesCategoryEnum } from '@/packages/components/external/types'
4 4 import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
  5 +import { useWidgetKey } from '@/packages/external/useWidgetKey'
  6 +
  7 +const { key, chartKey, conKey } = useWidgetKey('LeftCenterRightHead')
5 8
6 9 export const LeftCenterRightHeadConfig: ConfigType = {
7   - key: 'LeftCenterRightHead',
8   - chartKey: 'VLeftCenterRightHead',
9   - conKey: 'VCLeftCenterRightHead',
  10 + key,
  11 + chartKey,
  12 + conKey,
10 13 title: '通用头部',
11 14 category: ChatCategoryEnum.HEADCOMBINATION,
12 15 categoryName: ChatCategoryEnumName.HEADCOMBINATION,
... ...
1 1 import { ChartFrameEnum, ConfigType } from '@/packages/index.d'
2 2 import { EPackagesCategoryEnum } from '@/packages/components/external/types'
3 3 import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
  4 +import { useWidgetKey } from '@/packages/external/useWidgetKey'
4 5
  6 +const { key, chartKey, conKey } = useWidgetKey('LeftCenterRightHeadCommon')
5 7 export const LeftCenterRightHeadCommonConfig: ConfigType = {
6   - key: 'LeftCenterRightHeadCommon',
7   - chartKey: 'VLeftCenterRightHeadCommon',
8   - conKey: 'VCLeftCenterRightHeadCommon',
  8 + key,
  9 + chartKey,
  10 + conKey,
9 11 title: '头部',
10 12 category: ChatCategoryEnum.HEADCOMBINATION,
11 13 categoryName: ChatCategoryEnumName.HEADCOMBINATION,
... ...
1   -import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
  1 +import { useWidgetKey } from '@/packages/external/useWidgetKey'
  2 +import { ConfigType, ChartFrameEnum } from '@/packages/index.d'
  3 +import { EPackagesCategoryEnum } from '../../../types'
2 4 import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
3 5
  6 +const { key, conKey, chartKey } = useWidgetKey('WordCloud')
4 7 export const WordCloudConfig: ConfigType = {
5   - key: 'WordCloud',
6   - chartKey: 'VWordCloud',
7   - conKey: 'VCWordCloud',
  8 + key,
  9 + chartKey,
  10 + conKey,
8 11 title: '词云',
9 12 category: ChatCategoryEnum.MORE,
10 13 categoryName: ChatCategoryEnumName.MORE,
11   - package: PackagesCategoryEnum.INFORMATIONS,
  14 + package: EPackagesCategoryEnum.COMPOSES,
12 15 chartFrame: ChartFrameEnum.COMMON,
13 16 image: 'words_cloud.png'
14 17 }
... ...
... ... @@ -7,3 +7,7 @@ export enum ChatCategoryEnumName {
7 7 HEADCOMBINATION = '头部组合',
8 8 MORE = '更多'
9 9 }
  10 +
  11 +export enum PackagesCategoryEnum {
  12 + WORD_CLOUD = 'WordCloud'
  13 +}
... ...
... ... @@ -3,7 +3,7 @@ import { ConfigType } from "@/packages/index.d"
3 3
4 4 // 包分类枚举
5 5 export enum EPackagesCategoryEnum {
6   - COMPOSES = 'external/Composes',
  6 + COMPOSES = 'Composes',
7 7 }
8 8
9 9 // 图表包类型
... ...
... ... @@ -11,7 +11,7 @@ export const CONFIG_COMPONENT_PREFIX = 'VCC'
11 11 * @param scope directory name 目录名
12 12 * @returns
13 13 */
14   -export const useWidgetKey = (scope: string, extendPrimitiveCategory = false) => {
  14 +export const useWidgetKey = (scope: string, extendPrimitiveCategory = true) => {
15 15 const prefix = extendPrimitiveCategory ? EXTERNAL_WIDGET_PREFIX : ''
16 16 return {
17 17 key: scope,
... ...