feat: 侧边栏中加入图片类型选项卡

This commit is contained in:
tnt group 2023-05-17 20:30:50 +08:00
parent 0bd594afe8
commit 045e6c2e3c
2 changed files with 84 additions and 92 deletions

View File

@ -2,6 +2,7 @@ import { ChartList } from '@/packages/components/Charts/index'
import { DecorateList } from '@/packages/components/Decorates/index' import { DecorateList } from '@/packages/components/Decorates/index'
import { InformationList } from '@/packages/components/Informations/index' import { InformationList } from '@/packages/components/Informations/index'
import { TableList } from '@/packages/components/Tables/index' import { TableList } from '@/packages/components/Tables/index'
import { PhotoList } from '@/packages/components/Photos/index'
import { PackagesCategoryEnum, PackagesType, ConfigType, FetchComFlagType } from '@/packages/index.d' import { PackagesCategoryEnum, PackagesType, ConfigType, FetchComFlagType } from '@/packages/index.d'
const configModules: Record<string, { default: string }> = import.meta.glob('./components/**/config.vue', { const configModules: Record<string, { default: string }> = import.meta.glob('./components/**/config.vue', {
@ -19,6 +20,7 @@ export let packagesList: PackagesType = {
[PackagesCategoryEnum.CHARTS]: ChartList, [PackagesCategoryEnum.CHARTS]: ChartList,
[PackagesCategoryEnum.INFORMATIONS]: InformationList, [PackagesCategoryEnum.INFORMATIONS]: InformationList,
[PackagesCategoryEnum.TABLES]: TableList, [PackagesCategoryEnum.TABLES]: TableList,
[PackagesCategoryEnum.PHOTOS]: PhotoList,
[PackagesCategoryEnum.DECORATES]: DecorateList [PackagesCategoryEnum.DECORATES]: DecorateList
} }

View File

@ -7,14 +7,8 @@ import { PackagesCategoryEnum, PackagesCategoryName, PackagesType } from '@/pack
import { usePackagesStore } from '@/store/modules/packagesStore/packagesStore' import { usePackagesStore } from '@/store/modules/packagesStore/packagesStore'
import { ChartLayoutStoreEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d' import { ChartLayoutStoreEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'
// 图标 // 图标
const { BarChartIcon } = icon.ionicons5 const { ImageIcon, BarChartIcon } = icon.ionicons5
const { const { TableSplitIcon, RoadmapIcon, SpellCheckIcon, GraphicalDataFlowIcon } = icon.carbon
TableSplitIcon,
RoadmapIcon,
SpellCheckIcon,
GraphicalDataFlowIcon,
} = icon.carbon
// 图表 // 图表
export type MenuOptionsType = { export type MenuOptionsType = {
@ -30,20 +24,24 @@ const menuOptions: MenuOptionsType[] = []
const packagesListObj = { const packagesListObj = {
[PackagesCategoryEnum.CHARTS]: { [PackagesCategoryEnum.CHARTS]: {
icon: renderIcon(RoadmapIcon), icon: renderIcon(RoadmapIcon),
label: PackagesCategoryName.CHARTS, label: PackagesCategoryName.CHARTS
}, },
[PackagesCategoryEnum.INFORMATIONS]: { [PackagesCategoryEnum.INFORMATIONS]: {
icon: renderIcon(SpellCheckIcon), icon: renderIcon(SpellCheckIcon),
label: PackagesCategoryName.INFORMATIONS, label: PackagesCategoryName.INFORMATIONS
}, },
[PackagesCategoryEnum.TABLES]: { [PackagesCategoryEnum.TABLES]: {
icon: renderIcon(TableSplitIcon), icon: renderIcon(TableSplitIcon),
label: PackagesCategoryName.TABLES, label: PackagesCategoryName.TABLES
},
[PackagesCategoryEnum.PHOTOS]: {
icon: renderIcon(ImageIcon),
label: PackagesCategoryName.PHOTOS
}, },
[PackagesCategoryEnum.DECORATES]: { [PackagesCategoryEnum.DECORATES]: {
icon: renderIcon(GraphicalDataFlowIcon), icon: renderIcon(GraphicalDataFlowIcon),
label: PackagesCategoryName.DECORATES, label: PackagesCategoryName.DECORATES
}, }
} }
// 处理列表 // 处理列表
@ -56,7 +54,7 @@ const handlePackagesList = () => {
// @ts-ignore // @ts-ignore
label: packagesListObj[val].label, label: packagesListObj[val].label,
// @ts-ignore // @ts-ignore
list: getPackagesList[val], list: getPackagesList[val]
}) })
} }
} }
@ -81,12 +79,4 @@ const clickItemHandle = (key: string, item: any) => {
beforeSelect = key beforeSelect = key
} }
export { export { getCharts, BarChartIcon, themeColor, selectOptions, selectValue, clickItemHandle, menuOptions }
getCharts,
BarChartIcon,
themeColor,
selectOptions,
selectValue,
clickItemHandle,
menuOptions,
}