diff --git a/src/packages/components/Informations/Texts/TextBarrage/config.ts b/src/packages/components/Informations/Texts/TextBarrage/config.ts index eb04f096..aefc4331 100644 --- a/src/packages/components/Informations/Texts/TextBarrage/config.ts +++ b/src/packages/components/Informations/Texts/TextBarrage/config.ts @@ -15,7 +15,6 @@ export const FontWeightObject = { } export const option = { - dataset: '让数字化看得见', fontSize: 32, fontColor: '#ffffff', @@ -39,4 +38,5 @@ export default class Config extends PublicConfigClass implements CreateComponent public attr = { ...chartInitConfig, w: 500, h: 70, zIndex: -1 } public chartConfig = cloneDeep(TextBarrageConfig) public option = cloneDeep(option) + public preview = { overFlowHidden: true } } diff --git a/src/packages/index.d.ts b/src/packages/index.d.ts index e1f626b3..d8ef0bdd 100644 --- a/src/packages/index.d.ts +++ b/src/packages/index.d.ts @@ -114,6 +114,10 @@ export interface PublicConfigType { // 动画 animations: string[] } + preview?: { + // 预览超出隐藏 + overFlowHidden?: boolean + } filter?: string status: StatusType events: { diff --git a/src/packages/public/publicConfig.ts b/src/packages/public/publicConfig.ts index c4288638..10b3a10b 100644 --- a/src/packages/public/publicConfig.ts +++ b/src/packages/public/publicConfig.ts @@ -78,6 +78,10 @@ export class PublicConfigClass implements PublicConfigType { // 动画 animations: [] } + // 预览 + public preview = { + overFlowHidden: false + } // 状态 public status = { lock: false, diff --git a/src/views/preview/components/PreviewRenderGroup/index.vue b/src/views/preview/components/PreviewRenderGroup/index.vue index e6e22d92..354fa29c 100644 --- a/src/views/preview/components/PreviewRenderGroup/index.vue +++ b/src/views/preview/components/PreviewRenderGroup/index.vue @@ -9,6 +9,7 @@ ...getFilterStyle(item.styles), ...getTransformStyle(item.styles), ...getStatusStyle(item.status), + ...getPreviewConfigStyle(item.preview), ...getBlendModeStyle(item.styles) as any }" > @@ -28,7 +29,7 @@ import { PropType } from 'vue' import { CreateComponentGroupType } from '@/packages/index.d' import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle } from '@/utils' -import { getSizeStyle, getComponentAttrStyle, getStatusStyle } from '../../utils' +import { getSizeStyle, getComponentAttrStyle, getStatusStyle, getPreviewConfigStyle } from '../../utils' import { useLifeHandler } from '@/hooks' const props = defineProps({ @@ -54,6 +55,5 @@ const props = defineProps({ diff --git a/src/views/preview/components/PreviewRenderList/index.vue b/src/views/preview/components/PreviewRenderList/index.vue index ee5ea39c..eca587aa 100644 --- a/src/views/preview/components/PreviewRenderList/index.vue +++ b/src/views/preview/components/PreviewRenderList/index.vue @@ -2,13 +2,14 @@
@@ -43,7 +44,7 @@ import { PreviewRenderGroup } from '../PreviewRenderGroup/index' import { CreateComponentGroupType } from '@/packages/index.d' import { chartColors } from '@/settings/chartThemes/index' import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle } from '@/utils' -import { getSizeStyle, getComponentAttrStyle, getStatusStyle } from '../../utils' +import { getSizeStyle, getComponentAttrStyle, getStatusStyle, getPreviewConfigStyle } from '../../utils' import { useLifeHandler } from '@/hooks' // 初始化数据池 @@ -78,8 +79,5 @@ onMounted(() => { diff --git a/src/views/preview/utils/style.ts b/src/views/preview/utils/style.ts index 6cd25cba..945aa8c0 100644 --- a/src/views/preview/utils/style.ts +++ b/src/views/preview/utils/style.ts @@ -3,6 +3,7 @@ import { EditCanvasConfigType } from '@/store/modules/chartEditStore/chartEditSt type AttrType = PickCreateComponentType<'attr'> type StatusType = PickCreateComponentType<'status'> +type PreviewConfig = PickCreateComponentType<'preview'> // 设置位置 export const getComponentAttrStyle = (attr: AttrType, index: number) => { @@ -29,6 +30,17 @@ export const getStatusStyle = (attr: StatusType) => { } } +// 设置预览配置样式 +export const getPreviewConfigStyle = (previewConfig: PreviewConfig) => { + const previewStyle: Partial = {} + if (previewConfig) { + if (previewConfig.overFlowHidden) { + previewStyle.overflow = 'hidden' + } + } + return previewStyle +} + // 全局样式 export const getEditCanvasConfigStyle = (canvas: EditCanvasConfigType) => { // 背景