|
@@ -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-29 10:28:45
|
|
|
|
|
|
+ * @LastEditTime: 2025-04-29 14:27:00
|
|
* @Description:
|
|
* @Description:
|
|
-->
|
|
-->
|
|
<template>
|
|
<template>
|
|
@@ -20,6 +20,7 @@ const pptxContainer = ref(null)
|
|
|
|
|
|
// 渲染幻灯片
|
|
// 渲染幻灯片
|
|
const renderSlides = () => {
|
|
const renderSlides = () => {
|
|
|
|
+ console.log("pptxJson", props.pptxJson)
|
|
if (!pptxContainer.value || !props.pptxJson) return
|
|
if (!pptxContainer.value || !props.pptxJson) return
|
|
|
|
|
|
pptxContainer.value.innerHTML = ""
|
|
pptxContainer.value.innerHTML = ""
|
|
@@ -1490,10 +1491,10 @@ const createShapeElement = (element) => {
|
|
"http://www.w3.org/2000/svg",
|
|
"http://www.w3.org/2000/svg",
|
|
"path"
|
|
"path"
|
|
)
|
|
)
|
|
-
|
|
|
|
- // 计算内框的边距
|
|
|
|
- const frameWidth2 = element.width / 9
|
|
|
|
-
|
|
|
|
|
|
+ const halfFrameFmlaTop = element.formulas[0].split(" ")[1]
|
|
|
|
+ const halfFrameFmlaLeft = element.formulas[1].split(" ")[1]
|
|
|
|
+ const frameWidthTop = element.height * (halfFrameFmlaTop/100000)
|
|
|
|
+ const frameWidthLeft = element.width * (halfFrameFmlaLeft/100000)
|
|
// 绘制外框的左边和上边
|
|
// 绘制外框的左边和上边
|
|
outerRect2.setAttribute(
|
|
outerRect2.setAttribute(
|
|
"d",
|
|
"d",
|
|
@@ -1503,9 +1504,9 @@ const createShapeElement = (element) => {
|
|
// 绘制内框的左边和上边,注意起点位置调整
|
|
// 绘制内框的左边和上边,注意起点位置调整
|
|
innerRect2.setAttribute(
|
|
innerRect2.setAttribute(
|
|
"d",
|
|
"d",
|
|
- `M${frameWidth2},${element.height - frameWidth2} ` +
|
|
|
|
- `L${frameWidth2},${frameWidth2} ` +
|
|
|
|
- `L${element.width - frameWidth2},${frameWidth2}`
|
|
|
|
|
|
+ `M${frameWidthLeft},${element.height - frameWidthLeft} ` +
|
|
|
|
+ `L${frameWidthLeft},${frameWidthTop} ` +
|
|
|
|
+ `L${element.width - frameWidthTop},${frameWidthTop}`
|
|
)
|
|
)
|
|
|
|
|
|
// 设置填充色
|
|
// 设置填充色
|
|
@@ -1517,12 +1518,12 @@ const createShapeElement = (element) => {
|
|
)
|
|
)
|
|
fillPath.setAttribute(
|
|
fillPath.setAttribute(
|
|
"d",
|
|
"d",
|
|
- `M${frameWidth2},${frameWidth2} ` +
|
|
|
|
- `L${element.width - frameWidth2},${frameWidth2} ` +
|
|
|
|
|
|
+ `M${frameWidthLeft},${frameWidthTop} ` +
|
|
|
|
+ `L${element.width - frameWidthTop},${frameWidthTop} ` +
|
|
`L${element.width},0 ` +
|
|
`L${element.width},0 ` +
|
|
`L0,0 ` +
|
|
`L0,0 ` +
|
|
`L0,${element.height} ` +
|
|
`L0,${element.height} ` +
|
|
- `L${frameWidth2},${element.height - frameWidth2} Z`
|
|
|
|
|
|
+ `L${frameWidthLeft},${element.height - frameWidthLeft} Z`
|
|
)
|
|
)
|
|
fillPath.setAttribute("fill", element.fill.value || "transparent")
|
|
fillPath.setAttribute("fill", element.fill.value || "transparent")
|
|
svg.appendChild(fillPath)
|
|
svg.appendChild(fillPath)
|
|
@@ -1998,7 +1999,11 @@ const createShapeElement = (element) => {
|
|
const fmla = element?.formulas[0].split(" ")[1]
|
|
const fmla = element?.formulas[0].split(" ")[1]
|
|
innerCircle.setAttribute("cx", element.width / 2)
|
|
innerCircle.setAttribute("cx", element.width / 2)
|
|
innerCircle.setAttribute("cy", element.height / 2)
|
|
innerCircle.setAttribute("cy", element.height / 2)
|
|
- innerCircle.setAttribute("r", Math.min(element.width, element.height)/2 * (1- Math.sqrt(fmla/100000)/2))
|
|
|
|
|
|
+ innerCircle.setAttribute(
|
|
|
|
+ "r",
|
|
|
|
+ (Math.min(element.width, element.height) / 2) *
|
|
|
|
+ (1 - Math.sqrt(fmla / 100000) / 2)
|
|
|
|
+ )
|
|
|
|
|
|
// 设置填充色
|
|
// 设置填充色
|
|
setBackground(element, outerCircle)
|
|
setBackground(element, outerCircle)
|