Procházet zdrojové kódy

feat(speaking): branch render to SpeakingClassPanel for toolType=77

jimmylee před 2 měsíci
rodič
revize
0506c3375a
1 změnil soubory, kde provedl 25 přidání a 1 odebrání
  1. 25 1
      src/views/Student/index.vue

+ 25 - 1
src/views/Student/index.vue

@@ -106,7 +106,18 @@
           <ScreenSlideList :style="{ width: isFullscreen ? '100%' : slideWidth2 * canvasScale + 'px', height: isFullscreen ? '100%' : slideHeight2 * canvasScale + 'px', margin: '0 auto' }" :slideWidth="isFullscreen ? slideWidth * canvasScale : slideWidth2 * canvasScale" :slideHeight="isFullscreen ? slideHeight * canvasScale : slideHeight2 * canvasScale"
           <ScreenSlideList :style="{ width: isFullscreen ? '100%' : slideWidth2 * canvasScale + 'px', height: isFullscreen ? '100%' : slideHeight2 * canvasScale + 'px', margin: '0 auto' }" :slideWidth="isFullscreen ? slideWidth * canvasScale : slideWidth2 * canvasScale" :slideHeight="isFullscreen ? slideHeight * canvasScale : slideHeight2 * canvasScale"
             :animationIndex="0" :turnSlideToId="() => { }" :manualExitFullscreen="() => { }"  :slideIndex="slideIndex" v-show="!choiceQuestionDetailDialogOpenList.includes(slideIndex)"/>
             :animationIndex="0" :turnSlideToId="() => { }" :manualExitFullscreen="() => { }"  :slideIndex="slideIndex" v-show="!choiceQuestionDetailDialogOpenList.includes(slideIndex)"/>
 
 
-          <choiceQuestionDetailDialog v-if="choiceQuestionDetailDialogOpenList.includes(slideIndex)" :workId="workId"  :userId="props.userid" :courseDetail="courseDetail" :workArray="workArray" @changeWorkIndex="changeWorkIndex" v-model:visible="choiceQuestionDetailDialogOpenList" :showData="answerTheResultRef" :slideIndex="slideIndex" :workIndex="0" :style="{ width: isFullscreen ? '100%' : slideWidth2 * canvasScale + 'px', height: isFullscreen ? '100%' : slideHeight2 * canvasScale + 'px', margin: '0 auto' }" :slideWidth="isFullscreen ? slideWidth * canvasScale : slideWidth2 * canvasScale" :slideHeight="isFullscreen ? slideHeight * canvasScale : slideHeight2 * canvasScale"/>
+          <choiceQuestionDetailDialog v-if="choiceQuestionDetailDialogOpenList.includes(slideIndex) && currentSlideToolType !== 77" :workId="workId"  :userId="props.userid" :courseDetail="courseDetail" :workArray="workArray" @changeWorkIndex="changeWorkIndex" v-model:visible="choiceQuestionDetailDialogOpenList" :showData="answerTheResultRef" :slideIndex="slideIndex" :workIndex="0" :style="{ width: isFullscreen ? '100%' : slideWidth2 * canvasScale + 'px', height: isFullscreen ? '100%' : slideHeight2 * canvasScale + 'px', margin: '0 auto' }" :slideWidth="isFullscreen ? slideWidth * canvasScale : slideWidth2 * canvasScale" :slideHeight="isFullscreen ? slideHeight * canvasScale : slideHeight2 * canvasScale"/>
+          <SpeakingClassPanel
+            v-else-if="choiceQuestionDetailDialogOpenList.includes(slideIndex) && currentSlideToolType === 77"
+            ref="speakingPanelRef"
+            :configId="currentSlideConfigId"
+            :slideIndex="slideIndex"
+            :studentArray="studentArray"
+            :courseId="props.courseid"
+            :slideWidth="isFullscreen ? slideWidth * canvasScale : slideWidth2 * canvasScale"
+            :slideHeight="isFullscreen ? slideHeight * canvasScale : slideHeight2 * canvasScale"
+            :style="{ margin: '0 auto' }"
+          />
 
 
 
 
           <div class="slide-bottom" v-if="!isFullscreen">
           <div class="slide-bottom" v-if="!isFullscreen">
@@ -548,6 +559,19 @@ const visibleQA = ref(false)
 const visibleChoice = ref(false)
 const visibleChoice = ref(false)
 const visibleAI = ref(false)
 const visibleAI = ref(false)
 const choiceQuestionDetailDialogOpenList = ref<number[]>([])
 const choiceQuestionDetailDialogOpenList = ref<number[]>([])
+const speakingPanelRef = ref<InstanceType<typeof SpeakingClassPanel> | null>(null)
+
+provide('notifySpeakingProgress', (status: 'active' | 'completed', payload: { configId: string; sessionId: string }) => {
+  if (props.type !== '2') return  // 只有学生客户端发广播
+  sendMessage({
+    type: 'speaking_session_updated',
+    courseid: props.courseid,
+    slideIndex: slideIndex.value,
+    userid: props.userid,
+    status,
+    ...payload,
+  })
+})
 
 
 // 提供给子组件使用
 // 提供给子组件使用
 provide('choiceQuestionDetailDialogOpenList', choiceQuestionDetailDialogOpenList)
 provide('choiceQuestionDetailDialogOpenList', choiceQuestionDetailDialogOpenList)