|
@@ -2,7 +2,7 @@
|
|
* @Author: LiZhiWei
|
|
* @Author: LiZhiWei
|
|
* @Date: 2025-04-10 14:38:27
|
|
* @Date: 2025-04-10 14:38:27
|
|
* @LastEditors: LiZhiWei
|
|
* @LastEditors: LiZhiWei
|
|
- * @LastEditTime: 2025-04-17 17:28:59
|
|
|
|
|
|
+ * @LastEditTime: 2025-04-18 08:50:37
|
|
* @Description:
|
|
* @Description:
|
|
-->
|
|
-->
|
|
<template>
|
|
<template>
|
|
@@ -31,7 +31,6 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
renderSlides() {
|
|
renderSlides() {
|
|
- console.log("this.pptxJson", this.pptxJson)
|
|
|
|
if (!this.$refs.pptxContainer || !this.pptxJson) return
|
|
if (!this.$refs.pptxContainer || !this.pptxJson) return
|
|
|
|
|
|
this.$refs.pptxContainer.innerHTML = ""
|
|
this.$refs.pptxContainer.innerHTML = ""
|
|
@@ -437,7 +436,6 @@ export default {
|
|
// 应用图案填充
|
|
// 应用图案填充
|
|
rect.setAttribute("fill", `url(#${patternId})`)
|
|
rect.setAttribute("fill", `url(#${patternId})`)
|
|
} else {
|
|
} else {
|
|
- console.log("element.fill", element.fill)
|
|
|
|
rect.setAttribute("fill", "transparent")
|
|
rect.setAttribute("fill", "transparent")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -5116,18 +5114,14 @@ export default {
|
|
.toString(16)
|
|
.toString(16)
|
|
.padStart(2, "0")}${b.toString(16).padStart(2, "0")}`
|
|
.padStart(2, "0")}${b.toString(16).padStart(2, "0")}`
|
|
},
|
|
},
|
|
- // 新增函数:转换内容中的pt单位为px单位
|
|
|
|
convertPtToPxInContent(content) {
|
|
convertPtToPxInContent(content) {
|
|
if (!content) return content
|
|
if (!content) return content
|
|
// 使用正则表达式查找并替换
|
|
// 使用正则表达式查找并替换
|
|
- return content.replace(
|
|
|
|
- /font-size:\s*(\d+)(pt|PT)/g,
|
|
|
|
- (match, size, unit) => {
|
|
|
|
- // 将pt转换为px
|
|
|
|
- const pxSize = size
|
|
|
|
- return `font-size: ${pxSize}px`
|
|
|
|
- }
|
|
|
|
- )
|
|
|
|
|
|
+ return content.replace(/(\d+\.?\d*)(pt|PT)/g, (match, size) => {
|
|
|
|
+ // 将 pt 转换为 px(1pt ≈ 1.33333px)
|
|
|
|
+ const pxSize = size
|
|
|
|
+ return `${pxSize}px`
|
|
|
|
+ })
|
|
},
|
|
},
|
|
processElements(elements, slideIndex) {
|
|
processElements(elements, slideIndex) {
|
|
if (!elements || !Array.isArray(elements)) return
|
|
if (!elements || !Array.isArray(elements)) return
|