lsc 2 minggu lalu
induk
melakukan
9e51d22e46
1 mengubah file dengan 21 tambahan dan 8 penghapusan
  1. 21 8
      src/views/Student/index.vue

+ 21 - 8
src/views/Student/index.vue

@@ -101,10 +101,10 @@
                   <img src="@/assets/img/right-a.svg" alt="" @click="nextSlide">
                 </div>
               </div>
-              <div class="slide-bottom-right" v-if="!isFullscreen && (!isFollowModeActive || props.type == '1')">
-                <IconStopwatchStart class="tool-btn" v-tooltip="'计时器'" @click="timerlVisible = !timerlVisible" />
-                <IconWrite class="tool-btn" v-tooltip="'画笔工具'" @click="writingBoardToolVisible = true" />
-                <IconMagic class="tool-btn" v-tooltip="'激光笔'" :class="{ 'active': laserPen }" @click="toggleLaserPen" />
+              <div class="slide-bottom-right" v-if="!isFullscreen">
+                <IconStopwatchStart class="tool-btn" v-tooltip="'计时器'" @click="timerlVisible = !timerlVisible"  v-if="(props.type == '1' && courseDetail.userid == props.userid)"/>
+                <IconWrite class="tool-btn" v-tooltip="'画笔工具'" @click="writingBoardToolVisible = true"  v-if="(props.type == '1')"/>
+                <IconMagic class="tool-btn" v-tooltip="'激光笔'" :class="{ 'active': laserPen }" @click="toggleLaserPen"  v-if="(props.type == '1')"/>
                 <IconFullScreenOne class="tool-btn" v-tooltip="'打开全屏'" @click="enterFullscreen" />
               </div>
           </div>
@@ -982,7 +982,7 @@ const importJSON = (jsonData: any) => {
           if (currentSlideHasIframe.value && props.type == '1') {
             getWork()
           }
-          selectCourseSLook()
+          selectCourseSLook(1)
           console.log('组件重新渲染完成')
         }, 500)
       })
@@ -1843,7 +1843,7 @@ const checkWorkArrayChanged = (oldArray: WorkItem[], newArray: WorkItem[]): bool
 }
 
 // 查询课程跟随状态
-const selectCourseSLook = async () => {
+const selectCourseSLook = async (type = 2) => {
   const res = await api.selectCourseSLook(props.courseid as string)
   console.log('selectCourseSLook', res)
   if (res[0][0].follow == 2) {
@@ -1855,10 +1855,14 @@ const selectCourseSLook = async () => {
       await api.updateCourseFollowC(slideIndex.value, props.courseid as string)
       sendMessage({slideIndex: slideIndex.value, courseid: props.courseid, type: 'slideIndex'})
       console.log('设置当前幻灯片为跟随目标:', slideIndex.value)
+      checkParentMode()
     }
   }
   else {
     isFollowModeActive.value = false
+    if (type === 1 && props.userid == courseDetail.value.userid && props.type == '1') {
+      toggleFollowMode()
+    }
   }
 }
 
@@ -1886,6 +1890,7 @@ const toggleFollowMode = async () => {
     else {
       message.error('操作失败,请重试')
     }
+    checkParentMode()
   }
   catch (error) {
     console.error('切换跟随模式失败:', error)
@@ -1893,6 +1898,14 @@ const toggleFollowMode = async () => {
   }
 }
 
+const checkParentMode = () => {
+  // @ts-ignore
+  if (window.parent && typeof window.parent.onFreeBrowseChange === 'function') {
+    // @ts-ignore
+    window.parent.onFreeBrowseChange(!isFollowModeActive.value)
+  }
+}
+
 // 检查是否为创建人
 const checkIsCreator = () => {
   // 这里可以根据实际业务逻辑判断是否为创建人
@@ -2205,7 +2218,7 @@ const handleDisconnection = () => {
   border-radius: 0 5px 0 5px;
   overflow: hidden;
   transition: width .2s ease;
-  margin-left: 10px;
+  margin: 10px;
 }
 .layout-content-left.collapsed {
   width: 48px;
@@ -2230,7 +2243,7 @@ const handleDisconnection = () => {
   overflow: hidden;
   transition: width .2s ease;
   position: relative;
-  margin-right: 10px;
+  margin: 10px;
 }
 
 .panel-content {