jack 2 周之前
父節點
當前提交
6140b86fd6

+ 2 - 0
src/views/Screen/ScreenElement.vue

@@ -15,6 +15,7 @@
     <component
     <component
       :is="currentElementComponent"
       :is="currentElementComponent"
       :elementInfo="elementInfo"
       :elementInfo="elementInfo"
+      :scale="scale"
       :is-visible="isVisible"
       :is-visible="isVisible"
     ></component>
     ></component>
   </div>
   </div>
@@ -39,6 +40,7 @@ import BaseFrameElement from '@/views/components/element/FrameElement/BaseFrameE
 
 
 const props = defineProps<{
 const props = defineProps<{
   elementInfo: PPTElement
   elementInfo: PPTElement
+  scale: number
   elementIndex: number
   elementIndex: number
   animationIndex: number
   animationIndex: number
   turnSlideToId: (id: string) => void
   turnSlideToId: (id: string) => void

+ 1 - 0
src/views/Screen/ScreenSlide.vue

@@ -17,6 +17,7 @@
       :animationIndex="animationIndex"
       :animationIndex="animationIndex"
       :turnSlideToId="turnSlideToId"
       :turnSlideToId="turnSlideToId"
       :manualExitFullscreen="manualExitFullscreen"
       :manualExitFullscreen="manualExitFullscreen"
+      :scale="scale"
       :is-visible="isVisible"
       :is-visible="isVisible"
     />
     />
   </div>
   </div>

+ 3 - 0
src/views/components/ThumbnailSlide/ThumbnailElement.vue

@@ -10,6 +10,7 @@
       :is="currentElementComponent"
       :is="currentElementComponent"
       :elementInfo="elementInfo"
       :elementInfo="elementInfo"
       :is-thumbnail="true"
       :is-thumbnail="true"
+      :scale="scale"
       target="thumbnail"
       target="thumbnail"
     ></component>
     ></component>
   </div>
   </div>
@@ -33,6 +34,8 @@ import BaseFrameElement from '@/views/components/element/FrameElement/BaseFrameE
 const props = defineProps<{
 const props = defineProps<{
   elementInfo: PPTElement
   elementInfo: PPTElement
   elementIndex: number
   elementIndex: number
+  scale: number
+  slide: number
 }>()
 }>()
 
 
 const currentElementComponent = computed<unknown>(() => {
 const currentElementComponent = computed<unknown>(() => {

+ 2 - 0
src/views/components/ThumbnailSlide/index.vue

@@ -20,6 +20,8 @@
       <ThumbnailElement
       <ThumbnailElement
         v-for="(element, index) in slide.elements"
         v-for="(element, index) in slide.elements"
         :key="element.id"
         :key="element.id"
+        :scale="scale"
+        :slide="slide"
         :elementInfo="element"
         :elementInfo="element"
         :elementIndex="index + 1"
         :elementIndex="index + 1"
       />
       />

+ 38 - 12
src/views/components/element/FrameElement/BaseFrameElement.vue

@@ -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> = {