2022-01-14 16:17:14 +08:00
|
|
|
import { Component } from '@/router/types'
|
|
|
|
|
2022-01-29 21:44:22 +08:00
|
|
|
// 组件配置
|
2022-01-14 16:17:14 +08:00
|
|
|
export type ConfigType = {
|
|
|
|
key: string
|
|
|
|
title: string
|
2022-01-14 22:07:02 +08:00
|
|
|
category: string
|
2022-01-18 21:41:52 +08:00
|
|
|
categoryName: string
|
2022-01-25 11:09:32 +08:00
|
|
|
package: string
|
2022-01-14 16:17:14 +08:00
|
|
|
node: Component
|
2022-01-15 21:54:04 +08:00
|
|
|
image: string | (() => Promise<typeof import('*.png')>)
|
2022-01-14 16:17:14 +08:00
|
|
|
}
|
|
|
|
|
2022-01-29 21:44:22 +08:00
|
|
|
// 组件实例类
|
2022-02-04 12:17:50 +08:00
|
|
|
export interface PublicConfigType {
|
2022-01-29 21:44:22 +08:00
|
|
|
id: string
|
2022-02-03 22:54:31 +08:00
|
|
|
rename?: string
|
2022-02-04 12:17:50 +08:00
|
|
|
attr: { x: number; y: number; w: number; h: number; zIndex: number }
|
|
|
|
setPosition: Function
|
|
|
|
}
|
|
|
|
export interface CreateComponentType extends PublicConfigType {
|
|
|
|
key: string
|
2022-02-24 10:21:33 +08:00
|
|
|
chartData: Omit<ConfigType, 'node'>
|
2022-02-02 18:17:45 +08:00
|
|
|
option: object
|
2022-01-29 21:44:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 包分类枚举
|
2022-01-14 22:07:02 +08:00
|
|
|
export enum PackagesCategoryEnum {
|
2022-01-25 11:09:32 +08:00
|
|
|
CHARTS = 'Charts',
|
|
|
|
TABLES = 'Tables',
|
|
|
|
INFORMATION = 'Informations',
|
2022-01-27 23:16:51 +08:00
|
|
|
DECORATES = 'Decorates'
|
2022-01-15 21:54:04 +08:00
|
|
|
}
|
|
|
|
|
2022-01-29 21:44:22 +08:00
|
|
|
// 包分类名称
|
2022-01-15 21:54:04 +08:00
|
|
|
export enum PackagesCategoryName {
|
|
|
|
CHARTS = '图表',
|
|
|
|
TABLES = '表格',
|
|
|
|
INFORMATION = '信息',
|
2022-01-27 23:16:51 +08:00
|
|
|
DECORATES = '小组件'
|
2022-01-14 16:17:14 +08:00
|
|
|
}
|
2022-01-14 22:07:02 +08:00
|
|
|
|
2022-01-29 21:44:22 +08:00
|
|
|
// 图表包类型
|
2022-01-14 22:07:02 +08:00
|
|
|
export type PackagesType = {
|
|
|
|
[PackagesCategoryEnum.CHARTS]: ConfigType[]
|
2022-01-15 12:50:00 +08:00
|
|
|
[PackagesCategoryEnum.INFORMATION]: ConfigType[]
|
2022-01-14 22:07:02 +08:00
|
|
|
[PackagesCategoryEnum.TABLES]: ConfigType[]
|
|
|
|
[PackagesCategoryEnum.DECORATES]: ConfigType[]
|
2022-01-15 21:54:04 +08:00
|
|
|
}
|