浏览代码

feat: 备课ppt播放修改

TIANYONG 1 年之前
父节点
当前提交
601b41ab9d

+ 15 - 0
src/views/attend-class/index.module.less

@@ -607,4 +607,19 @@
       }
     }
   }
+}
+
+.iframePpt {
+  width: 100%;
+  height: 100%;
+  position: relative;
+  .pptBox {
+    position: absolute;
+    width: 100%;
+    height: 80%;
+    left: 0;
+    top: 10%;
+    z-index: 9;
+    background: transparent;
+  }
 }

+ 20 - 1
src/views/attend-class/index.tsx

@@ -471,6 +471,19 @@ export default defineComponent({
       }
     };
 
+    // ppt iframe 点击事件
+    // const iframeClick = () => {
+		// 	if(document.all) {
+		// 		document.getElementById("iframe-ppt")?.attachEvent("click", () => {
+    //       activeData.model = !activeData.model
+    //     });
+		// 	} else {
+		// 		document.getElementById("iframe-ppt")?.contentWindow?.postMessage({
+    //       api: 'onAttendToggleMenu'
+    //     }, '*');
+		// 	}
+		// }
+
     // 切换播放
     // const togglePlay = (m: any, isPlay: boolean) => {
     //   if (isPlay) {
@@ -1095,6 +1108,9 @@ export default defineComponent({
                 {data.itemList.map((m: any, mIndex: number) => {
                   const isRender = Math.abs(popupData.activeIndex - mIndex) < 2;
                   const isEmtry = Math.abs(popupData.activeIndex - mIndex) > 4;
+                  // if (isRender && m.type === 'PPT') {
+                  //   setTimeout(() => iframeClick() ,500)
+                  // }
                   // if (isRender) {
                   //   m.isRender = true;
                   // }
@@ -1209,7 +1225,10 @@ export default defineComponent({
                           }}
                         />
                       ) 
-                      : m.type === 'PPT' ? <iframe src={`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(m.content)}`} width='100%' height='100%' frameborder='1'></iframe>
+                      : m.type === 'PPT' ? <div class={styles.iframePpt}>
+                        <div class={styles.pptBox}></div>
+                        <iframe src={`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(m.content)}`} width='100%' height='100%' frameborder='1'></iframe>
+                      </div>
                       : (
                         <MusicScore
                           activeModel={activeData.model}

+ 3 - 0
src/views/prepare-lessons/components/resource-main/components/resource-item/resource-search-group/index.module.less

@@ -18,6 +18,9 @@
       font-size: 15px;
       --n-height: 40px !important;
     }
+    .n-space {
+      flex-wrap: nowrap !important;
+    }
   }
 }
 

+ 2 - 2
vite.config.ts

@@ -23,8 +23,8 @@ function resolve(dir: string) {
 }
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
-const proxyUrl = 'https://dev.kt.colexiu.com/';
-// const proxyUrl = 'https://test.lexiaoya.cn';
+// const proxyUrl = 'https://dev.kt.colexiu.com/';
+const proxyUrl = 'https://test.lexiaoya.cn';
 export default defineConfig({
   base: './',
   plugins: [