chore: 图标和图片动态组件设置成static静态资源

This commit is contained in:
tnt group 2023-05-24 11:49:24 +08:00
parent 8107ac3755
commit 430b2dedc5
7 changed files with 10 additions and 3 deletions

View File

@ -9,6 +9,6 @@ export const IconConfig: ConfigType = {
category: ChatCategoryEnum.COMMON,
categoryName: ChatCategoryEnumName.COMMON,
package: PackagesCategoryEnum.ICONS,
chartFrame: ChartFrameEnum.COMMON,
chartFrame: ChartFrameEnum.STATIC,
image: 'icon.png'
}

View File

@ -1,4 +1,4 @@
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChartFrameEnum, ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ImageConfig } from '@/packages/components/Informations/Mores/Image/index'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../index.d'
import { setLocalStorage, getLocalStorage, goDialog } from '@/utils'
@ -50,6 +50,7 @@ const addConfig = {
category: ChatCategoryEnum.PRIVATE,
categoryName: ChatCategoryEnumName.PRIVATE,
package: PackagesCategoryEnum.PHOTOS,
chartFrame: ChartFrameEnum.STATIC,
title: '点击上传图片',
image: 'upload.png',
redirectComponent: './components/Informations/Mores/Image', // 虚拟组件路径,尾部不跟 /’,相对于 /packages/index.ts 文件的位置
@ -67,6 +68,7 @@ const addConfig = {
category: ChatCategoryEnum.PRIVATE,
categoryName: ChatCategoryEnumName.PRIVATE,
package: PackagesCategoryEnum.PHOTOS,
chartFrame: ChartFrameEnum.STATIC,
title: e.fileName,
image: e.url,
dataset: e.url,

View File

@ -1,4 +1,4 @@
import { PackagesCategoryEnum } from '@/packages/index.d'
import { ChartFrameEnum, PackagesCategoryEnum } from '@/packages/index.d'
import { ImageConfig } from '@/packages/components/Informations/Mores/Image/index'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../index.d'
@ -13,6 +13,7 @@ const photoConfigList = imageList.map(i => ({
category: ChatCategoryEnum.SHARE,
categoryName: ChatCategoryEnumName.SHARE,
package: PackagesCategoryEnum.PHOTOS,
chartFrame: ChartFrameEnum.STATIC,
image: i.imageUrl,
dataset: i.imageUrl,
title: i.imageName,

View File

@ -100,6 +100,7 @@ const dblclickHandle = async (item: ConfigType) => {
if (item.redirectComponent) {
item.dataset && (newComponent.option.dataset = item.dataset)
newComponent.chartConfig.title = item.title
newComponent.chartConfig.chartFrame = item.chartFrame
}
//
chartEditStore.addComponentList(newComponent, false, true)

View File

@ -161,6 +161,7 @@ const selectChartHandle = async (item: ConfigType) => {
if (item.redirectComponent) {
item.dataset && (newComponent.option.dataset = item.dataset)
newComponent.chartConfig.title = item.title
newComponent.chartConfig.chartFrame = item.chartFrame
}
//
chartEditStore.addComponentList(newComponent, false, true)

View File

@ -36,6 +36,7 @@ export const dragHandle = async (e: DragEvent) => {
if (dropData.redirectComponent) {
dropData.dataset && (newComponent.option.dataset = dropData.dataset)
newComponent.chartConfig.title = dropData.title
newComponent.chartConfig.chartFrame = dropData.chartFrame
}
setComponentPosition(newComponent, e.offsetX - newComponent.attr.w / 2, e.offsetY - newComponent.attr.h / 2)

View File

@ -135,6 +135,7 @@ export const useSync = () => {
if (_componentInstance.chartConfig.redirectComponent) {
_componentInstance.chartConfig.dataset && (newComponent.option.dataset = _componentInstance.chartConfig.dataset)
newComponent.chartConfig.title = _componentInstance.chartConfig.title
newComponent.chartConfig.chartFrame = _componentInstance.chartConfig.chartFrame
}
if (callBack) {
if (changeId) {