/* 
 * 组件库配置文件
 */
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['chart/bar/basic']
            },
            {
              name: '堆积柱状图',
              componetName: 'StackBar',
              icon: compIcon['chart/bar/stack']
            },
            {
              name: '百分比堆积柱状图',
              componetName: 'PercentBar',
              icon: compIcon['chart/bar/percent']
            },
            {
              name: '弧形柱状图',
              componetName: 'PolarBar',
              icon: compIcon['chart/bar/camber']
            },
            {
              name: '特殊形状柱状图',
              componetName: 'SpecialBar',
              icon: compIcon['chart/bar/special-shape']
            },
            {
              name: '自定义柱状图',
              componetName: 'BasicBar',
              icon: compIcon['chart/bar/custom']
            },
          ]
        },
        {
          name: '折线图类',
          children: [
            {
              name: '折线图',
              componetName: 'BasicLine',
              icon: compIcon['chart/line/basic']
            },
            {
              name: '百分比面积图',
              componetName: 'BasicLine',
              icon: compIcon['chart/line/percent-area']
            },
            {
              name: '堆积面积图',
              componetName: 'BasicLine',
              icon: compIcon['chart/line/deposit-area']
            },
            {
              name: '堆积折线图',
              componetName: 'BasicLine',
              icon: compIcon['chart/line/deposit']
            },
            {
              name: '面积图',
              componetName: 'BasicLine',
              icon: compIcon['chart/line/area']
            },
            {
              name: '堆积雷达图',
              componetName: 'BasicLine',
              icon: compIcon['chart/line/deposit-radar']
            },
            {
              name: '雷达图',
              componetName: 'BasicLine',
              icon: compIcon['chart/line/radar']
            },
            {
              name: '自定义面积图',
              componetName: 'BasicLine',
              icon: compIcon['chart/line/custom-area']
            },
            {
              name: '自定义折线图',
              componetName: 'BasicLine',
              icon: compIcon['chart/line/custom']
            },
          ]
        },
        {
          name: '饼状图类',
          children: [
            {
              name: '饼状图',
              componetName: 'BasicPie',
              icon: compIcon['chart/pie/basic']
            },
            {
              name: '不等弧度玫瑰图',
              componetName: 'BasicPie',
              icon: compIcon['chart/pie/unequal-radians-rose']
            },
            {
              name: '等弧度玫瑰图',
              componetName: 'BasicPie',
              icon: compIcon['chart/pie/equal-radians-rose']
            },
            {
              name: '多层饼图',
              componetName: 'BasicPie',
              icon: compIcon['chart/pie/multilayer']
            },
            {
              name: '轮播饼图',
              componetName: 'BasicPie',
              icon: compIcon['chart/pie/carousel']
            },
          ]
        },
        {
          name: '条形图类',
          children: [
            {
              name: '条形图',
              componetName: 'BasicStrip',
              icon: compIcon['chart/strip/basic']
            },
            {
              name: '堆积条形图',
              componetName: 'BasicPie',
              icon: compIcon['chart/strip/percent']
            },
            {
              name: '百分比堆积条形图',
              componetName: 'BasicPie',
              icon: compIcon['chart/strip/stack']
            },
            {
              name: '自定义条形图',
              componetName: 'BasicPie',
              icon: compIcon['chart/strip/custom']
            },
            {
              name: '轮播条形图',
              componetName: 'BasicPie',
              icon: compIcon['chart/strip/carousel']
            },
          ]
        },
        {
          name: '仪表盘类',
          children: [
            {
              name: '360°多指针仪表盘',
              componetName: 'BasicPie',
              icon: compIcon['chart/gauge/360']
            },
            {
              name: '180°多指针仪表盘',
              componetName: 'BasicPie',
              icon: compIcon['chart/gauge/180']
            },
            {
              name: '百分比圆环仪表盘',
              componetName: 'BasicPie',
              icon: compIcon['chart/gauge/percent-circle']
            },
            {
              name: '百分比刻度槽仪表盘',
              componetName: 'BasicPie',
              icon: compIcon['chart/gauge/percent-slot']
            },
            {
              name: '试管型仪表盘',
              componetName: 'BasicPie',
              icon: compIcon['chart/gauge/test-tube']
            },
            {
              name: '轮播夜光仪表盘',
              componetName: 'BasicPie',
              icon: compIcon['chart/gauge/carousel']
            },
            {
              name: '水球图',
              componetName: 'BasicPie',
              icon: compIcon['chart/gauge/water']
            },
            {
              name: '像素点图',
              componetName: 'BasicPie',
              icon: compIcon['chart/gauge/pixel']
            },
          ]
        },
        {
          name: '指示卡类',
          children: [
            {
              name: '轮播闪烁指示卡',
              componetName: 'Title',
              icon: compIcon['chart/indicator/blink']
            },
            {
              name: '轮播电子指示卡',
              componetName: 'Title',
              icon: compIcon['chart/indicator/electron']
            },
            // {
            //   name: '粒子计数器',
            //   componetName: 'Title',
            //   icon: compIcon['chart/indicator/particle-counter']
            // }
          ]
        },
        {
          name: '地图类',
          children: [
            {
              name: '区域地图',
              componetName: 'Title',
              icon: compIcon['chart/map/area']
            },
            {
              name: '点地图',
              componetName: 'Title',
              icon: compIcon['chart/map/point']
            },
            {
              name: '流向地图',
              componetName: 'Title',
              icon: compIcon['chart/map/flow']
            },
            {
              name: '热力地图',
              componetName: 'Title',
              icon: compIcon['chart/map/hot']
            },
            {
              name: '组合地图',
              componetName: 'Title',
              icon: compIcon['chart/map/combine']
            },
          ]
        },
        {
          name: '地球类',
          children: [
            {
              name: '三维柱形地图',
              componetName: 'Title',
              icon: compIcon['chart/earth/bar']
            },
            {
              name: '三维点地图',
              componetName: 'Title',
              icon: compIcon['chart/earth/point']
            },
            {
              name: '三维流向地图',
              componetName: 'Title',
              icon: compIcon['chart/earth/flow']
            }
          ]
        },
        {
          name: '散点图类',
          children: [
            {
              name: '散点图',
              componetName: 'Title',
              icon: compIcon['chart/scatter/scatter']
            },
            {
              name: '气泡图',
              componetName: 'Title',
              icon: compIcon['chart/scatter/bubble']
            }
          ]
        },
        {
          name: '形状与文字类',
          children: [
            {
              name: '矩形树图',
              componetName: 'Title',
              icon: compIcon['chart/rectangle/rect']
            },
            {
              name: '词云',
              componetName: 'Title',
              icon: compIcon['chart/rectangle/word-cloud']
            },
            {
              name: '力学气泡图',
              componetName: 'Title',
              icon: compIcon['chart/rectangle/bubble']
            },
            {
              name: '漏斗图',
              componetName: 'Title',
              icon: compIcon['chart/rectangle/funnel']
            },
          ]
        },
        {
          name: '组合图类',
          children: [
            {
              name: '柱形图-折线图',
              componetName: 'Title',
              icon: compIcon['chart/combo/bar-line']
            },
            {
              name: '柱形图-面积图',
              componetName: 'Title',
              icon: compIcon['chart/combo/bar-area']
            },
            {
              name: '堆积柱形图-折线图',
              componetName: 'Title',
              icon: compIcon['chart/combo/combine-bar-line']
            },
            {
              name: '自定义组合图',
              componetName: 'Title',
              icon: compIcon['chart/combo/custom']
            },
          ]
        },
        {
          name: '时间类',
          children: [
            {
              name: '时间轮齿图',
              componetName: 'Title',
              icon: compIcon['chart/time/wheel']
            }
          ]
        },
        {
          name: '其他',
          children: [
            {
              name: '甘特图',
              componetName: 'Title',
              icon: compIcon['chart/other/gantt']
            },
            {
              name: '纵向框架图',
              componetName: 'Title',
              icon: compIcon['chart/other/column-frame']
            },
            {
              name: '横向框架图',
              componetName: 'Title',
              icon: compIcon['chart/other/row-frame']
            },
            {
              name: '发散框架图',
              componetName: 'Title',
              icon: compIcon['chart/other/divergence-frame']
            },
            {
              name: '箱形图',
              componetName: 'Title',
              icon: compIcon['chart/other/box']
            },
          ]
        },
      ]
    },
    {
      type: CompTypeEnum.TEXT,
      name: '文本',
      icon: () => h(FileTextOutlined),
      isGroup: false,
      children: [
        {
          name: '标题',
          componetName: 'Title',
          icon: compIcon['text/title']
        },
        {
          name: '富文本',
          componetName: 'Title',
          icon: compIcon['text/rich-text']
        },
        {
          name: '表格',
          componetName: 'Title',
          icon: compIcon['text/table']
        },
        {
          name: '时间',
          componetName: 'Title',
          icon: compIcon['text/time']
        },
      ]
    },
    {
      type: CompTypeEnum.MEDIA,
      name: '媒体',
      icon: () => h(PlaySquareOutlined),
      isGroup: false,
      children: [
        {
          name: '视频',
          componetName: 'Title',
          icon: compIcon['media/video']
        },
        {
          name: '流媒体',
          componetName: 'Title',
          icon: compIcon['media/stream']
        },
        {
          name: '图片',
          componetName: 'Title',
          icon: compIcon['media/image']
        }
      ]
    },
    {
      type: CompTypeEnum.INPUT_COMP,
      name: '控件',
      icon: () => h(AppstoreAddOutlined),
      isGroup: false,
      children: [
        {
          name: '文本框',
          componetName: 'Title',
          icon: compIcon['form/input']
        },
        {
          name: '日期时间',
          componetName: 'Title',
          icon: compIcon['form/date-time']
        },
        {
          name: '下拉框',
          componetName: 'Title',
          icon: compIcon['form/select']
        },
        {
          name: '下拉复选框',
          componetName: 'Title',
          icon: compIcon['form/select-multiple']
        },
        {
          name: '单选按钮组',
          componetName: 'Title',
          icon: compIcon['form/radio']
        },
        {
          name: '复选按钮组',
          componetName: 'Title',
          icon: compIcon['form/checkbox']
        },
        {
          name: '下拉树',
          componetName: 'Title',
          icon: compIcon['form/tree-select']
        },
        {
          name: '视图树',
          componetName: 'Title',
          icon: compIcon['form/tree']
        },
        {
          name: '查询',
          componetName: 'Title',
          icon: compIcon['form/query']
        },
      ]
    }
  ]
}