fix: 处理组件图片路径会报错的问题

This commit is contained in:
奔跑的面条 2023-01-09 19:32:09 +08:00
parent 1b6c1a3530
commit 13467e569f
60 changed files with 128 additions and 129 deletions
src
packages
components
Charts
Bars
BarCommon
BarCrossrange
CapsuleChart
Lines
LineCommon
LineGradientSingle
LineGradients
LineLinearSingle
Maps
MapAmap
MapBase
Mores
Funnel
Heatmap
Process
Radar
TreeMap
WaterPolo
Pies
PieCircle
PieCommon
Scatters
ScatterCommon
ScatterLogarithmicRegression
Decorates
Borders
Border01
Border02
Border03
Border04
Border05
Border06
Border07
Border08
Border09
Border10
Border11
Border12
Border13
Decorates
Decorates01
Decorates02
Decorates03
Decorates04
Decorates05
Decorates06
Mores
Clock
CountDown
FlipperNumber
Number
TimeCommon
Three/ThreeEarth01
Informations
Mores
Iframe
Image
Video
WordCloud
Texts
TextBarrage
TextCommon
TextGradient
Tables/Tables
TableList
TableScrollBoard
index.d.tsindex.ts
views/chart
ContentCharts/components
ChartsItemBox
ChartsItemImage
ContentLayers/components/LayersListItem

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/bar_x.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const BarCommonConfig: ConfigType = {
categoryName: ChatCategoryEnumName.BAR, categoryName: ChatCategoryEnumName.BAR,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS, chartFrame: ChartFrameEnum.ECHARTS,
image image: 'bar_x.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/bar_y.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const BarCrossrangeConfig: ConfigType = {
categoryName: ChatCategoryEnumName.BAR, categoryName: ChatCategoryEnumName.BAR,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS, chartFrame: ChartFrameEnum.ECHARTS,
image image: 'bar_y.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/capsule.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const CapsuleChartConfig: ConfigType = {
categoryName: ChatCategoryEnumName.BAR, categoryName: ChatCategoryEnumName.BAR,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'capsule.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/line.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const LineCommonConfig: ConfigType = {
categoryName: ChatCategoryEnumName.LINE, categoryName: ChatCategoryEnumName.LINE,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS, chartFrame: ChartFrameEnum.ECHARTS,
image image: 'line.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/line_gradient_single.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const LineGradientSingleConfig: ConfigType = {
categoryName: ChatCategoryEnumName.LINE, categoryName: ChatCategoryEnumName.LINE,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS, chartFrame: ChartFrameEnum.ECHARTS,
image image: 'line_gradient_single.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/line_gradient.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const LineGradientsConfig: ConfigType = {
categoryName: ChatCategoryEnumName.LINE, categoryName: ChatCategoryEnumName.LINE,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS, chartFrame: ChartFrameEnum.ECHARTS,
image image: 'line_gradient.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/line_linear_single.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const LineLinearSingleConfig: ConfigType = {
categoryName: ChatCategoryEnumName.LINE, categoryName: ChatCategoryEnumName.LINE,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS, chartFrame: ChartFrameEnum.ECHARTS,
image image: 'line_linear_single.png'
} }

@ -1,5 +1,4 @@
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import image from '@/assets/images/chart/charts/map_amap.png'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
export const MapAmapConfig: ConfigType = { export const MapAmapConfig: ConfigType = {
@ -11,5 +10,5 @@ export const MapAmapConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MAP, categoryName: ChatCategoryEnumName.MAP,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'map_amap.png'
} }

@ -1,5 +1,4 @@
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import image from '@/assets/images/chart/charts/map.png'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
export const MapBaseConfig: ConfigType = { export const MapBaseConfig: ConfigType = {
@ -11,5 +10,5 @@ export const MapBaseConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MAP, categoryName: ChatCategoryEnumName.MAP,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'map.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/funnel.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const FunnelConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS, chartFrame: ChartFrameEnum.ECHARTS,
image image: 'funnel.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/heatmap.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const HeatmapConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'heatmap.png'
} }

@ -1,5 +1,3 @@
// 展示图片
import image from '@/assets/images/chart/charts/process.png'
// 公共类型声明 // 公共类型声明
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
// 当前[信息模块]分类声明 // 当前[信息模块]分类声明
@ -21,5 +19,5 @@ export const ProcessConfig: ConfigType = {
// 包分类 // 包分类
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
// 图片 // 图片
image: image image: 'process.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/radar.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const RadarConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'radar.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/tree_map.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const TreeMapConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'tree_map.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/water_WaterPolo.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const WaterPoloConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'water_WaterPolo.png'
} }

@ -11,5 +11,5 @@ export const PieCircleConfig: ConfigType = {
categoryName: ChatCategoryEnumName.PIE, categoryName: ChatCategoryEnumName.PIE,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS, chartFrame: ChartFrameEnum.ECHARTS,
image image: 'pie-circle.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/pie.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const PieCommonConfig: ConfigType = {
categoryName: ChatCategoryEnumName.PIE, categoryName: ChatCategoryEnumName.PIE,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS, chartFrame: ChartFrameEnum.ECHARTS,
image image: 'pie.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/scatter-multi.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const ScatterCommonConfig: ConfigType = {
categoryName: ChatCategoryEnumName.SCATTER, categoryName: ChatCategoryEnumName.SCATTER,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS, chartFrame: ChartFrameEnum.ECHARTS,
image image: 'scatter-multi.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/scatter-logarithmic-regression.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const ScatterLogarithmicRegressionConfig: ConfigType = {
categoryName: ChatCategoryEnumName.SCATTER, categoryName: ChatCategoryEnumName.SCATTER,
package: PackagesCategoryEnum.CHARTS, package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS, chartFrame: ChartFrameEnum.ECHARTS,
image image: 'scatter-logarithmic-regression.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/border01.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Border01Config: ConfigType = {
category: ChatCategoryEnum.BORDER, category: ChatCategoryEnum.BORDER,
categoryName: ChatCategoryEnumName.BORDER, categoryName: ChatCategoryEnumName.BORDER,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'border01.png'
} }

@ -10,5 +10,5 @@ export const Border02Config: ConfigType = {
category: ChatCategoryEnum.BORDER, category: ChatCategoryEnum.BORDER,
categoryName: ChatCategoryEnumName.BORDER, categoryName: ChatCategoryEnumName.BORDER,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'border02.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/border03.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Border03Config: ConfigType = {
category: ChatCategoryEnum.BORDER, category: ChatCategoryEnum.BORDER,
categoryName: ChatCategoryEnumName.BORDER, categoryName: ChatCategoryEnumName.BORDER,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'border03.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/border04.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Border04Config: ConfigType = {
category: ChatCategoryEnum.BORDER, category: ChatCategoryEnum.BORDER,
categoryName: ChatCategoryEnumName.BORDER, categoryName: ChatCategoryEnumName.BORDER,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'border04.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/border05.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Border05Config: ConfigType = {
category: ChatCategoryEnum.BORDER, category: ChatCategoryEnum.BORDER,
categoryName: ChatCategoryEnumName.BORDER, categoryName: ChatCategoryEnumName.BORDER,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'border05.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/border06.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Border06Config: ConfigType = {
category: ChatCategoryEnum.BORDER, category: ChatCategoryEnum.BORDER,
categoryName: ChatCategoryEnumName.BORDER, categoryName: ChatCategoryEnumName.BORDER,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'border06.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/border07.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Border07Config: ConfigType = {
category: ChatCategoryEnum.BORDER, category: ChatCategoryEnum.BORDER,
categoryName: ChatCategoryEnumName.BORDER, categoryName: ChatCategoryEnumName.BORDER,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'border07.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/border08.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Border08Config: ConfigType = {
category: ChatCategoryEnum.BORDER, category: ChatCategoryEnum.BORDER,
categoryName: ChatCategoryEnumName.BORDER, categoryName: ChatCategoryEnumName.BORDER,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'border08.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/border09.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Border09Config: ConfigType = {
category: ChatCategoryEnum.BORDER, category: ChatCategoryEnum.BORDER,
categoryName: ChatCategoryEnumName.BORDER, categoryName: ChatCategoryEnumName.BORDER,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'border09.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/border10.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Border10Config: ConfigType = {
category: ChatCategoryEnum.BORDER, category: ChatCategoryEnum.BORDER,
categoryName: ChatCategoryEnumName.BORDER, categoryName: ChatCategoryEnumName.BORDER,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'border10.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/border11.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Border11Config: ConfigType = {
category: ChatCategoryEnum.BORDER, category: ChatCategoryEnum.BORDER,
categoryName: ChatCategoryEnumName.BORDER, categoryName: ChatCategoryEnumName.BORDER,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'border11.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/border12.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Border12Config: ConfigType = {
category: ChatCategoryEnum.BORDER, category: ChatCategoryEnum.BORDER,
categoryName: ChatCategoryEnumName.BORDER, categoryName: ChatCategoryEnumName.BORDER,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'border12.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/border13.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Border13Config: ConfigType = {
category: ChatCategoryEnum.BORDER, category: ChatCategoryEnum.BORDER,
categoryName: ChatCategoryEnumName.BORDER, categoryName: ChatCategoryEnumName.BORDER,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'border13.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/decorates01.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Decorates01Config: ConfigType = {
category: ChatCategoryEnum.DECORATE, category: ChatCategoryEnum.DECORATE,
categoryName: ChatCategoryEnumName.DECORATE, categoryName: ChatCategoryEnumName.DECORATE,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'decorates01.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/decorates02.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Decorates02Config: ConfigType = {
category: ChatCategoryEnum.DECORATE, category: ChatCategoryEnum.DECORATE,
categoryName: ChatCategoryEnumName.DECORATE, categoryName: ChatCategoryEnumName.DECORATE,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'decorates02.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/decorates03.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Decorates03Config: ConfigType = {
category: ChatCategoryEnum.DECORATE, category: ChatCategoryEnum.DECORATE,
categoryName: ChatCategoryEnumName.DECORATE, categoryName: ChatCategoryEnumName.DECORATE,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'decorates01.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/decorates04.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const Decorates04Config: ConfigType = {
category: ChatCategoryEnum.DECORATE, category: ChatCategoryEnum.DECORATE,
categoryName: ChatCategoryEnumName.DECORATE, categoryName: ChatCategoryEnumName.DECORATE,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'decorates04.png'
} }

@ -10,5 +10,5 @@ export const Decorates05Config: ConfigType = {
category: ChatCategoryEnum.DECORATE, category: ChatCategoryEnum.DECORATE,
categoryName: ChatCategoryEnumName.DECORATE, categoryName: ChatCategoryEnumName.DECORATE,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'decorates05.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/decorates06.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const Decorates06Config: ConfigType = {
categoryName: ChatCategoryEnumName.DECORATE, categoryName: ChatCategoryEnumName.DECORATE,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'decorates06.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/clock.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const ClockConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
chartFrame: ChartFrameEnum.STATIC, chartFrame: ChartFrameEnum.STATIC,
image image: 'clock.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/countdown.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const CountDownConfig: ConfigType = {
category: ChatCategoryEnum.MORE, category: ChatCategoryEnum.MORE,
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'countdown.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/flipper-number.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const FlipperNumberConfig: ConfigType = {
category: ChatCategoryEnum.MORE, category: ChatCategoryEnum.MORE,
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'flipper-number.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/number.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const NumberConfig: ConfigType = {
category: ChatCategoryEnum.MORE, category: ChatCategoryEnum.MORE,
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'number.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/time.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const TimeCommonConfig: ConfigType = {
category: ChatCategoryEnum.MORE, category: ChatCategoryEnum.MORE,
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
image image: 'time.png'
} }

@ -26,7 +26,7 @@ let yearMonthDay = ref('2021-2-3')
let nowData = ref('08:00:00') let nowData = ref('08:00:00')
let newData = ref('2021-2-3 08:00:00') let newData = ref('2021-2-3 08:00:00')
let boxShadow = ref('none') let boxShadow = ref('none')
let timer: any = null
const { w, h } = toRefs(props.chartConfig.attr) const { w, h } = toRefs(props.chartConfig.attr)
let { let {
@ -60,7 +60,7 @@ watch(
} }
) )
onMounted(() => { onMounted(() => {
const timer = setInterval(() => { timer = setInterval(() => {
var datetime = new Date() var datetime = new Date()
var year = datetime.getFullYear() var year = datetime.getFullYear()
var month = datetime.getMonth() + 1 < 10 ? '0' + (datetime.getMonth() + 1) : datetime.getMonth() + 1 var month = datetime.getMonth() + 1 < 10 ? '0' + (datetime.getMonth() + 1) : datetime.getMonth() + 1
@ -81,7 +81,7 @@ onMounted(() => {
}, 500) }, 500)
}) })
onUnmounted(() => { onUnmounted(() => {
clearInterval() clearInterval(timer)
}) })
useChartDataFetch(props.chartConfig, useChartEditStore) useChartDataFetch(props.chartConfig, useChartEditStore)
</script> </script>

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/decorates/threeEarth01.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const ThreeEarth01Config: ConfigType = {
categoryName: ChatCategoryEnumName.THREE, categoryName: ChatCategoryEnumName.THREE,
package: PackagesCategoryEnum.DECORATES, package: PackagesCategoryEnum.DECORATES,
chartFrame: ChartFrameEnum.STATIC, chartFrame: ChartFrameEnum.STATIC,
image image: 'threeEarth01.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/informations/iframe.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const IframeConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.INFORMATIONS, package: PackagesCategoryEnum.INFORMATIONS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'iframe.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/informations/photo.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const ImageConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.INFORMATIONS, package: PackagesCategoryEnum.INFORMATIONS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'photo.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/informations/video.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const VideoConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.INFORMATIONS, package: PackagesCategoryEnum.INFORMATIONS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'video.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/informations/words_cloud.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const WordCloudConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.INFORMATIONS, package: PackagesCategoryEnum.INFORMATIONS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'words_cloud.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/informations/text_barrage.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const TextBarrageConfig: ConfigType = {
category: ChatCategoryEnum.TEXT, category: ChatCategoryEnum.TEXT,
categoryName: ChatCategoryEnumName.TEXT, categoryName: ChatCategoryEnumName.TEXT,
package: PackagesCategoryEnum.INFORMATIONS, package: PackagesCategoryEnum.INFORMATIONS,
image image: 'text_barrage.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/informations/text_static.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d'
@ -10,5 +9,5 @@ export const TextCommonConfig: ConfigType = {
category: ChatCategoryEnum.TEXT, category: ChatCategoryEnum.TEXT,
categoryName: ChatCategoryEnumName.TEXT, categoryName: ChatCategoryEnumName.TEXT,
package: PackagesCategoryEnum.INFORMATIONS, package: PackagesCategoryEnum.INFORMATIONS,
image image: 'text_static.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/informations/text_gradient.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const TextGradientConfig: ConfigType = {
categoryName: ChatCategoryEnumName.TEXT, categoryName: ChatCategoryEnumName.TEXT,
package: PackagesCategoryEnum.INFORMATIONS, package: PackagesCategoryEnum.INFORMATIONS,
chartFrame: ChartFrameEnum.NAIVE_UI, chartFrame: ChartFrameEnum.NAIVE_UI,
image image: 'text_gradient.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/tables/tables_list.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const TableListConfig: ConfigType = {
categoryName: ChatCategoryEnumName.TABLE, categoryName: ChatCategoryEnumName.TABLE,
package: PackagesCategoryEnum.TABLES, package: PackagesCategoryEnum.TABLES,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'tables_list.png'
} }

@ -1,4 +1,3 @@
import image from '@/assets/images/chart/tables/table_scrollboard.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@ -11,5 +10,5 @@ export const TableScrollBoardConfig: ConfigType = {
categoryName: ChatCategoryEnumName.TABLE, categoryName: ChatCategoryEnumName.TABLE,
package: PackagesCategoryEnum.TABLES, package: PackagesCategoryEnum.TABLES,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.COMMON,
image image: 'table_scrollboard.png'
} }

@ -22,7 +22,7 @@ export type ConfigType = {
categoryName: string categoryName: string
package: string package: string
chartFrame?: ChartFrameEnum chartFrame?: ChartFrameEnum
image: string | (() => Promise<typeof import('*.png')>) image: string
} }
// 数据请求 // 数据请求

@ -2,15 +2,11 @@ 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 { import { PackagesCategoryEnum, PackagesType, ConfigType, FetchComFlagType } from '@/packages/index.d'
PackagesCategoryEnum,
PackagesType,
ConfigType,
FetchComFlagType
} from '@/packages/index.d'
const configModules = import.meta.globEager("./components/**/config.vue") const configModules = import.meta.globEager('./components/**/config.vue')
const indexModules = import.meta.globEager("./components/**/index.vue") const indexModules = import.meta.globEager('./components/**/index.vue')
const imagesModules = import.meta.globEager('../assets/images/chart/**')
// * 所有图表 // * 所有图表
export let packagesList: PackagesType = { export let packagesList: PackagesType = {
@ -24,7 +20,7 @@ export let packagesList: PackagesType = {
* * * *
* @param targetData * @param targetData
*/ */
export const createComponent = async (targetData: ConfigType) => { export const createComponent = async (targetData: ConfigType) => {
const { category, key } = targetData const { category, key } = targetData
const chart = await import(`./components/${targetData.package}/${category}/${key}/config.ts`) const chart = await import(`./components/${targetData.package}/${category}/${key}/config.ts`)
return new chart.default() return new chart.default()
@ -36,10 +32,10 @@ export let packagesList: PackagesType = {
* @param {FetchComFlagType} flag 0, 1 * @param {FetchComFlagType} flag 0, 1
*/ */
const fetchComponent = (chartName: string, flag: FetchComFlagType) => { const fetchComponent = (chartName: string, flag: FetchComFlagType) => {
const module = flag === FetchComFlagType.VIEW ? indexModules: configModules const module = flag === FetchComFlagType.VIEW ? indexModules : configModules
for (const key in module) { for (const key in module) {
const urlSplit = key.split('/') const urlSplit = key.split('/')
if(urlSplit[urlSplit.length -2 ] === chartName) { if (urlSplit[urlSplit.length - 2] === chartName) {
return module[key] return module[key]
} }
} }
@ -49,7 +45,7 @@ const fetchComponent = (chartName: string, flag: FetchComFlagType) => {
* * * *
* @param {ConfigType} dropData * @param {ConfigType} dropData
*/ */
export const fetchChartComponent = (dropData: ConfigType) => { export const fetchChartComponent = (dropData: ConfigType) => {
const { key } = dropData const { key } = dropData
return fetchComponent(key, FetchComFlagType.VIEW)?.default return fetchComponent(key, FetchComFlagType.VIEW)?.default
} }
@ -58,7 +54,27 @@ const fetchComponent = (chartName: string, flag: FetchComFlagType) => {
* * * *
* @param {ConfigType} dropData * @param {ConfigType} dropData
*/ */
export const fetchConfigComponent = (dropData: ConfigType) => { export const fetchConfigComponent = (dropData: ConfigType) => {
const { key } = dropData const { key } = dropData
return fetchComponent(key, FetchComFlagType.CONFIG)?.default return fetchComponent(key, FetchComFlagType.CONFIG)?.default
} }
/**
* *
* @param {ConfigType} targetData
*/
export const fetchImages = async (targetData: ConfigType) => {
// 新数据动态处理
const { image, package: targetDataPackage } = targetData
// 兼容旧数据
if (image.includes('@') || image.includes('base64')) return image
const imageName = image.substring(image.lastIndexOf('/') + 1)
for (const key in imagesModules) {
const urlSplit = key.split('/')
if (urlSplit[urlSplit.length - 1] === imageName) {
return imagesModules[key]?.default
}
}
return ''
}

@ -22,7 +22,7 @@
</n-text> </n-text>
</div> </div>
<div class="list-center go-flex-center go-transition"> <div class="list-center go-flex-center go-transition">
<img class="list-img" v-lazy="item.image" alt="图表图片" /> <charts-item-image class="list-img" :chartConfig="item"></charts-item-image>
</div> </div>
<div class="list-bottom"> <div class="list-bottom">
<n-text class="list-bottom-text" depth="3"> <n-text class="list-bottom-text" depth="3">
@ -37,6 +37,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { PropType, watch, ref, Ref, computed, nextTick } from 'vue' import { PropType, watch, ref, Ref, computed, nextTick } from 'vue'
import { MacOsControlBtn } from '@/components/Tips/MacOsControlBtn/index' import { MacOsControlBtn } from '@/components/Tips/MacOsControlBtn/index'
import { ChartsItemImage } from '../ChartsItemImage'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { EditCanvasTypeEnum } from '@/store/modules/chartEditStore/chartEditStore.d' import { EditCanvasTypeEnum } from '@/store/modules/chartEditStore/chartEditStore.d'
import { ChartModeEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d' import { ChartModeEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'

@ -0,0 +1,3 @@
import ChartsItemImage from './index.vue'
export { ChartsItemImage }

@ -0,0 +1,24 @@
<template>
<img class="list-img" v-lazy="imageInfo" alt="图表图片" />
</template>
<script setup lang="ts">
import { ref, PropType } from 'vue'
import { fetchImages } from '@/packages'
import { ConfigType } from '@/packages/index.d'
const props = defineProps({
chartConfig: {
type: Object as PropType<ConfigType>,
required: true
},
})
const imageInfo = ref('')
//
const fetchImageUrl = async () => {
imageInfo.value = await fetchImages(props.chartConfig)
}
fetchImageUrl()
</script>

@ -5,7 +5,7 @@
class="list-img" class="list-img"
object-fit="contain" object-fit="contain"
preview-disabled preview-disabled
:src="image" :src="imageInfo"
:fallback-src="requireErrorImg()" :fallback-src="requireErrorImg()"
></n-image> ></n-image>
<n-ellipsis style="margin-right: auto"> <n-ellipsis style="margin-right: auto">
@ -20,16 +20,18 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, PropType } from 'vue' import { computed, PropType, ref, watch } from 'vue'
import { requireErrorImg } from '@/utils' import { requireErrorImg } from '@/utils'
import { useDesignStore } from '@/store/modules/designStore/designStore' import { useDesignStore } from '@/store/modules/designStore/designStore'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { LayerModeEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d' import { LayerModeEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'
import { fetchImages } from '@/packages'
import { CreateComponentType, CreateComponentGroupType } from '@/packages/index.d'
import { LayersStatus } from '../LayersStatus/index' import { LayersStatus } from '../LayersStatus/index'
const props = defineProps({ const props = defineProps({
componentData: { componentData: {
type: Object, type: Object as PropType<CreateComponentType | CreateComponentGroupType>,
required: true required: true
}, },
isGroup: { isGroup: {
@ -45,9 +47,13 @@ const props = defineProps({
// //
const designStore = useDesignStore() const designStore = useDesignStore()
const chartEditStore = useChartEditStore() const chartEditStore = useChartEditStore()
const imageInfo = ref('')
// eslint-disable-next-line vue/no-setup-props-destructure //
const { image } = props.componentData.chartConfig const fetchImageUrl = async () => {
imageInfo.value = await fetchImages(props.componentData.chartConfig)
}
fetchImageUrl()
// //
const themeColor = computed(() => { const themeColor = computed(() => {