|
@@ -8,10 +8,12 @@
|
|
|
<div
|
|
<div
|
|
|
class="base-element-frame"
|
|
class="base-element-frame"
|
|
|
:style="{
|
|
:style="{
|
|
|
- top: elementInfo.top + 'px',
|
|
|
|
|
- left: elementInfo.left + 'px',
|
|
|
|
|
- width: elementInfo.width + 'px',
|
|
|
|
|
- height: elementInfo.height + 'px',
|
|
|
|
|
|
|
+ transform: isThumbnail ? 'scale(1)': `scale(${1 / props.scale})`,
|
|
|
|
|
+ transformOrigin: 'top left', // 关键点
|
|
|
|
|
+ top: props.elementInfo.top + 'px',
|
|
|
|
|
+ left: props.elementInfo.left + 'px',
|
|
|
|
|
+ width: (isThumbnail ? props.elementInfo.width : width) + 'px',
|
|
|
|
|
+ height: (isThumbnail ? props.elementInfo.height : height) + 'px',
|
|
|
overflow: 'hidden',
|
|
overflow: 'hidden',
|
|
|
}"
|
|
}"
|
|
|
>
|
|
>
|
|
@@ -25,8 +27,8 @@
|
|
|
v-if="elementInfo.toolType === 74 && !isThumbnail && isVisible"
|
|
v-if="elementInfo.toolType === 74 && !isThumbnail && isVisible"
|
|
|
:key="`video-${iframeKey}`"
|
|
:key="`video-${iframeKey}`"
|
|
|
:src="elementInfo.url"
|
|
:src="elementInfo.url"
|
|
|
- :width="elementInfo.width"
|
|
|
|
|
- :height="elementInfo.height"
|
|
|
|
|
|
|
+ :width="width"
|
|
|
|
|
+ :height="height"
|
|
|
controls
|
|
controls
|
|
|
:style="{ width: '100%', height: '100%', objectFit: 'contain' }"
|
|
:style="{ width: '100%', height: '100%', objectFit: 'contain' }"
|
|
|
></video>
|
|
></video>
|
|
@@ -35,8 +37,8 @@
|
|
|
v-else-if="elementInfo.toolType === 75 && !isThumbnail && isVisible"
|
|
v-else-if="elementInfo.toolType === 75 && !isThumbnail && isVisible"
|
|
|
:key="`bilibili-${iframeKey}`"
|
|
:key="`bilibili-${iframeKey}`"
|
|
|
:src="elementInfo.url"
|
|
:src="elementInfo.url"
|
|
|
- :width="elementInfo.width"
|
|
|
|
|
- :height="elementInfo.height"
|
|
|
|
|
|
|
+ :width="width"
|
|
|
|
|
+ :height="height"
|
|
|
:frameborder="0"
|
|
:frameborder="0"
|
|
|
:allowfullscreen="true"
|
|
:allowfullscreen="true"
|
|
|
allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
|
|
allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
|
|
@@ -47,8 +49,8 @@
|
|
|
:key="`html-${iframeKey}`"
|
|
:key="`html-${iframeKey}`"
|
|
|
:srcdoc="elementInfo.url"
|
|
:srcdoc="elementInfo.url"
|
|
|
v-else-if="elementInfo.isHTML && !isThumbnail && isVisible"
|
|
v-else-if="elementInfo.isHTML && !isThumbnail && isVisible"
|
|
|
- :width="elementInfo.width"
|
|
|
|
|
- :height="elementInfo.height"
|
|
|
|
|
|
|
+ :width="width"
|
|
|
|
|
+ :height="height"
|
|
|
:frameborder="0"
|
|
:frameborder="0"
|
|
|
:allowfullscreen="true"
|
|
:allowfullscreen="true"
|
|
|
allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
|
|
allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
|
|
@@ -58,8 +60,8 @@
|
|
|
:key="`src-${iframeKey}`"
|
|
:key="`src-${iframeKey}`"
|
|
|
v-else-if="!isThumbnail && isVisible"
|
|
v-else-if="!isThumbnail && isVisible"
|
|
|
:src="elementInfo.url"
|
|
:src="elementInfo.url"
|
|
|
- :width="elementInfo.width"
|
|
|
|
|
- :height="elementInfo.height"
|
|
|
|
|
|
|
+ :width="width"
|
|
|
|
|
+ :height="height"
|
|
|
:frameborder="0"
|
|
:frameborder="0"
|
|
|
:allowfullscreen="true"
|
|
:allowfullscreen="true"
|
|
|
allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
|
|
allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
|
|
@@ -94,6 +96,7 @@ import type { PropType } from "vue";
|
|
|
import type { PPTFrameElement } from "@/types/slides";
|
|
import type { PPTFrameElement } from "@/types/slides";
|
|
|
import { lang } from "@/main";
|
|
import { lang } from "@/main";
|
|
|
import { ref, watch, nextTick } from "vue";
|
|
import { ref, watch, nextTick } from "vue";
|
|
|
|
|
+import { computed } from 'vue'
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
elementInfo: {
|
|
elementInfo: {
|
|
@@ -104,6 +107,10 @@ const props = defineProps({
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
|
default: false,
|
|
default: false,
|
|
|
},
|
|
},
|
|
|
|
|
+ scale: {
|
|
|
|
|
+ type: Number,
|
|
|
|
|
+ default: 1
|
|
|
|
|
+ },
|
|
|
isVisible: {
|
|
isVisible: {
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
|
default: false,
|
|
default: false,
|
|
@@ -124,6 +131,25 @@ watch(
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+const width = computed(() => {
|
|
|
|
|
+ return props.elementInfo.width * props.scale;
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const height = computed(() => {
|
|
|
|
|
+ return props.elementInfo.height * props.scale;
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const left = computed(() => {
|
|
|
|
|
+ return props.elementInfo.left * props.scale;
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const top = computed(() => {
|
|
|
|
|
+ return props.elementInfo.top * props.scale;
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// 获取类型标签
|
|
// 获取类型标签
|
|
|
const getTypeLabel = (type: number): string => {
|
|
const getTypeLabel = (type: number): string => {
|
|
|
const typeMap: Record<number, keyof typeof lang> = {
|
|
const typeMap: Record<number, keyof typeof lang> = {
|