123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- /*
- * 组件库配置文件
- */
- import { h } from 'vue';
- import { CompTypeEnum } from "@/enum/compTypeEnum";
- import compIcon from "@/assets/comp-icon/index";
- import {
- AppstoreAddOutlined,
- FileTextOutlined,
- PieChartOutlined,
- PlaySquareOutlined,
- } from "@ant-design/icons-vue";
- export interface CompItem {
- // 名称
- name: string;
- // 渲染组件
- componetName: string;
- // 图标
- icon: string;
- }
- export interface CompGroup {
- // 名称
- name: string;
- // 子组件
- children: CompItem[];
- }
- export interface CompCategory {
- // 类型
- type: CompTypeEnum;
- // 名称
- name: string;
- // 图标
- icon: () => any;
- // 是否是组
- isGroup?: boolean;
- // 组件
- children?: CompGroup[] | CompItem[];
- }
- interface CompSetting {
- // 组件列表
- compList: CompCategory[];
- }
- /**
- * 组件库配置文件
- * */
- export const compSetting: CompSetting = {
- compList: [
- {
- type: CompTypeEnum.CHART,
- name: '图表',
- icon: () => h(PieChartOutlined),
- isGroup: true,
- children: [
- {
- name: '柱状图类',
- children: [
- {
- name: '柱状图',
- componetName: 'BasicBar',
- icon: compIcon['icon-1']
- }
- ]
- },
- {
- name: '折线图类',
- children: [
- {
- name: '折线图',
- componetName: 'BasicLine',
- icon: compIcon['icon-2']
- }
- ]
- },
- {
- name: '饼状图类',
- children: [
- {
- name: '饼状图',
- componetName: 'BasicPie',
- icon: compIcon['icon-4']
- }
- ]
- }
- ]
- },
- {
- type: CompTypeEnum.TEXT,
- name: '文本',
- icon: () => h(FileTextOutlined),
- isGroup: false,
- children: [
- {
- name: '标题',
- componetName: 'Title',
- icon: compIcon['icon-3']
- },
- ]
- },
- {
- type: CompTypeEnum.MEDIA,
- name: '媒体',
- icon: () => h(PlaySquareOutlined),
- isGroup: false,
- },
- {
- type: CompTypeEnum.INPUT_COMP,
- name: '控件',
- icon: () => h(AppstoreAddOutlined),
- isGroup: false,
- }
- ]
- }
|