feat: 初始化 VChart

This commit is contained in:
奔跑的面条
2024-12-15 00:45:49 +08:00
parent 8d3ff7cc26
commit 0972ea0e28
17 changed files with 291 additions and 6310 deletions
@@ -0,0 +1,15 @@
import { PublicConfigClass } from '@/packages/public'
import { VChartBarCommonConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import cloneDeep from 'lodash/cloneDeep'
export const option = {
}
export default class Config extends PublicConfigClass implements CreateComponentType {
public key = VChartBarCommonConfig.key
public chartConfig = cloneDeep(VChartBarCommonConfig)
// 图表配置项
public option = cloneDeep(option)
}
@@ -0,0 +1,3 @@
<template></template>
<script setup lang="ts"></script>
@@ -0,0 +1,14 @@
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
export const VChartBarCommonConfig: ConfigType = {
key: 'VChartBarCommon',
chartKey: 'VVChartBarCommon',
conKey: 'VCVChartBarCommon',
title: 'VChart柱状图',
category: ChatCategoryEnum.BAR,
categoryName: ChatCategoryEnumName.BAR,
package: PackagesCategoryEnum.VCHART,
chartFrame: ChartFrameEnum.VCHART,
image: 'vchart_bar_x.png'
}
@@ -0,0 +1,3 @@
import { VChartBarCommonConfig } from './VChartBarCommon/index'
export default [VChartBarCommonConfig]
+7
View File
@@ -0,0 +1,7 @@
export enum ChatCategoryEnum {
BAR = 'Bars',
}
export enum ChatCategoryEnumName {
BAR = '柱状图',
}
+3
View File
@@ -0,0 +1,3 @@
import Bars from './Bars'
export const VChartList = [...Bars]
+5
View File
@@ -5,6 +5,8 @@ import type { RequestConfigType } from '@/store/modules/chartEditStore/chartEdit
export enum ChartFrameEnum {
// 支持 dataset 的 echarts 框架
ECHARTS = 'echarts',
// VChart 框架
VCHART = 'VChart',
// UI 组件框架
NAIVE_UI = 'naiveUI',
// 自定义带数据组件
@@ -173,6 +175,7 @@ export type PickCreateComponentType<T extends keyof CreateComponentType> = Pick<
// 包分类枚举
export enum PackagesCategoryEnum {
CHARTS = 'Charts',
VCHART = 'VChart',
TABLES = 'Tables',
INFORMATIONS = 'Informations',
PHOTOS = 'Photos',
@@ -183,6 +186,7 @@ export enum PackagesCategoryEnum {
// 包分类名称
export enum PackagesCategoryName {
CHARTS = '图表',
VCHART = 'VChart',
TABLES = '列表',
INFORMATIONS = '信息',
PHOTOS = '图片',
@@ -199,6 +203,7 @@ export enum FetchComFlagType {
// 图表包类型
export type PackagesType = {
[PackagesCategoryEnum.CHARTS]: ConfigType[]
[PackagesCategoryEnum.VCHART]: ConfigType[]
[PackagesCategoryEnum.INFORMATIONS]: ConfigType[]
[PackagesCategoryEnum.TABLES]: ConfigType[]
[PackagesCategoryEnum.PHOTOS]: ConfigType[]
+2
View File
@@ -1,4 +1,5 @@
import { ChartList } from '@/packages/components/Charts/index'
import { VChartList } from '@/packages/components/VChart/index'
import { DecorateList } from '@/packages/components/Decorates/index'
import { InformationList } from '@/packages/components/Informations/index'
import { TableList } from '@/packages/components/Tables/index'
@@ -19,6 +20,7 @@ const imagesModules: Record<string, { default: string }> = import.meta.glob('../
// * 所有图表
export let packagesList: PackagesType = {
[PackagesCategoryEnum.CHARTS]: ChartList,
[PackagesCategoryEnum.VCHART]: VChartList,
[PackagesCategoryEnum.INFORMATIONS]: InformationList,
[PackagesCategoryEnum.TABLES]: TableList,
[PackagesCategoryEnum.DECORATES]: DecorateList,