Procházet zdrojové kódy

fix: 应用幻灯片背景图

李志伟 před 2 měsíci
rodič
revize
9639a0a370

+ 17 - 1
src/components/view_file/components/vendors/pptx/PPT.vue

@@ -2,7 +2,7 @@
  * @Author: LiZhiWei
  * @Date: 2025-04-10 14:38:27
  * @LastEditors: LiZhiWei
- * @LastEditTime: 2025-04-17 12:30:01
+ * @LastEditTime: 2025-04-17 17:25:03
  * @Description:
 -->
 <template>
@@ -127,6 +127,22 @@ export default {
         }
       } else if (fill.type === "color") {
         slideElement.style.backgroundColor = fill.value || "#FFFFFF"
+      } else if (fill.type === "image" && fill.value.picBase64) {
+        // 设置背景图片
+        slideElement.style.backgroundImage = `url(${fill.value.picBase64})`
+        slideElement.style.backgroundSize = "cover"
+        slideElement.style.backgroundPosition = "center"
+        slideElement.style.backgroundRepeat = "no-repeat"
+
+        // 如果有背景图片的混合模式
+        if (fill.value.blendMode) {
+          slideElement.style.backgroundBlendMode = fill.value.blendMode
+        }
+
+        // 如果有透明度设置
+        if (fill.value.opacity !== undefined) {
+          slideElement.style.opacity = fill.value.opacity
+        }
       }
     },