diff --git a/src/hooks/useAIPPT.ts b/src/hooks/useAIPPT.ts index 0cc5e18f..7518edf6 100644 --- a/src/hooks/useAIPPT.ts +++ b/src/hooks/useAIPPT.ts @@ -299,7 +299,7 @@ export default () => { for (const item of AISlides) { if (item.type === 'cover') { const elements = coverTemplate.elements.map(el => { - if (el.type === 'image' && !el.lock && imgPool.value.length) return getNewImgElement(el) + if (el.type === 'image' && el.imageType && imgPool.value.length) return getNewImgElement(el) if (el.type !== 'text' && el.type !== 'shape') return el if (checkTextType(el, 'title') && item.data.title) { return getNewTextElement({ el, text: item.data.title, maxLine: 1 }) @@ -334,7 +334,7 @@ export default () => { const longestText = item.data.items.reduce((longest, current) => current.length > longest.length ? current : longest, '') const elements = contentsTemplate.elements.map(el => { - if (el.type === 'image' && !el.lock && imgPool.value.length) return getNewImgElement(el) + if (el.type === 'image' && el.imageType && imgPool.value.length) return getNewImgElement(el) if (el.type !== 'text' && el.type !== 'shape') return el if (checkTextType(el, 'item')) { const index = sortedItemIds.findIndex(id => id === el.id) @@ -357,7 +357,7 @@ export default () => { else if (item.type === 'transition') { transitionIndex++ const elements = transitionTemplate.elements.map(el => { - if (el.type === 'image' && !el.lock && imgPool.value.length) return getNewImgElement(el) + if (el.type === 'image' && el.imageType && imgPool.value.length) return getNewImgElement(el) if (el.type !== 'text' && el.type !== 'shape') return el if (checkTextType(el, 'title') && item.data.title) { return getNewTextElement({ el, text: item.data.title, maxLine: 1 }) @@ -409,7 +409,7 @@ export default () => { const longestText = itemTexts.reduce((longest, current) => current.length > longest.length ? current : longest, '') const elements = contentTemplate.elements.map(el => { - if (el.type === 'image' && !el.lock && imgPool.value.length) return getNewImgElement(el) + if (el.type === 'image' && el.imageType && imgPool.value.length) return getNewImgElement(el) if (el.type !== 'text' && el.type !== 'shape') return el if (item.data.items.length === 1) { const contentItem = item.data.items[0] @@ -451,7 +451,7 @@ export default () => { } else if (item.type === 'end') { const elements = endTemplate.elements.map(el => { - if (el.type === 'image' && !el.lock && imgPool.value.length) return getNewImgElement(el) + if (el.type === 'image' && el.imageType && imgPool.value.length) return getNewImgElement(el) return el }) slides.push({ diff --git a/src/types/slides.ts b/src/types/slides.ts index 3aa618a6..33e5eb49 100644 --- a/src/types/slides.ts +++ b/src/types/slides.ts @@ -245,6 +245,8 @@ export interface ImageElementClip { shape: string } +export type ImageType = 'pageFigure' | 'itemFigure' | 'background' + /** * 图片元素 * @@ -269,6 +271,8 @@ export interface ImageElementClip { * radius?: 圆角半径 * * colorMask?: 颜色蒙版 + * + * imageType?: 图片类型 */ export interface PPTImageElement extends PPTBaseElement { type: 'image' @@ -282,6 +286,7 @@ export interface PPTImageElement extends PPTBaseElement { shadow?: PPTElementShadow radius?: number colorMask?: string + imageType?: ImageType } export type ShapeTextAlign = 'top' | 'middle' | 'bottom' diff --git a/src/views/Editor/MarkupPanel.vue b/src/views/Editor/MarkupPanel.vue index 394ca8d9..9f6a9e89 100644 --- a/src/views/Editor/MarkupPanel.vue +++ b/src/views/Editor/MarkupPanel.vue @@ -27,7 +27,16 @@ :options="textTypeOptions" /> -
选中文本框或带文本的形状,标记文本类型
+
+
当前图片类型:
+