|
@@ -106,7 +106,7 @@
|
|
|
<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) && currentSlideToolType !== 77" :roleType="props.type" :cid="props.cid" :workId="workId" :workUrl="workUrl" :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" :resultArray="currentIsResultArray" @setIsResultArray="setIsResultArray2" :isCreator="isCreator"/>
|
|
|
|
|
|
|
+ <choiceQuestionDetailDialog v-if="choiceQuestionDetailDialogOpenList.includes(slideIndex) && currentSlideToolType !== 77" :roleType="props.type" :cid="props.cid" :workId="workId" :workUrl="workUrl" :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" :resultArray="currentIsResultArray" @setIsResultArray="setIsResultArray2" :isCreator="isCreator" @successLike="successLike"/>
|
|
|
<SpeakingClassPanel
|
|
<SpeakingClassPanel
|
|
|
v-else-if="choiceQuestionDetailDialogOpenList.includes(slideIndex) && currentSlideToolType === 77"
|
|
v-else-if="choiceQuestionDetailDialogOpenList.includes(slideIndex) && currentSlideToolType === 77"
|
|
|
ref="speakingPanelRef"
|
|
ref="speakingPanelRef"
|
|
@@ -440,7 +440,7 @@ import SpeakingClassPanel from './components/SpeakingClassPanel/index.vue'
|
|
|
import aiChat from './components/aiChat.vue'
|
|
import aiChat from './components/aiChat.vue'
|
|
|
import messageInstruction from '@/utils/components/messageInstruction.vue'
|
|
import messageInstruction from '@/utils/components/messageInstruction.vue'
|
|
|
|
|
|
|
|
-const messageInstructionRef = ref(null)
|
|
|
|
|
|
|
+const messageInstructionRef = ref<typeof messageInstruction>()
|
|
|
|
|
|
|
|
// 生成标准 UUID v4 格式(36位,符合 [0-9a-fA-F-] 格式)
|
|
// 生成标准 UUID v4 格式(36位,符合 [0-9a-fA-F-] 格式)
|
|
|
const generateUUID = (): string => {
|
|
const generateUUID = (): string => {
|
|
@@ -2497,6 +2497,17 @@ const successSubmit = () => {
|
|
|
getWork(true)
|
|
getWork(true)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const successLike = () => {
|
|
|
|
|
+ messageInstructionRef.value.success(lang.ssLikeSucc)
|
|
|
|
|
+ sendMessage({
|
|
|
|
|
+ type: 'like_updated',
|
|
|
|
|
+ courseid: props.courseid,
|
|
|
|
|
+ slideIndex: slideIndex.value,
|
|
|
|
|
+ userid: props.userid
|
|
|
|
|
+ })
|
|
|
|
|
+ getWork(true)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 刷新iframe功能
|
|
// 刷新iframe功能
|
|
|
const handleRefreshPage = () => {
|
|
const handleRefreshPage = () => {
|
|
|
console.log('刷新iframe按钮被点击')
|
|
console.log('刷新iframe按钮被点击')
|
|
@@ -2888,12 +2899,35 @@ const getWork = async (isUpdate = false) => {
|
|
|
const frame = elementList.value.find(element => element.type === ElementTypes.FRAME)
|
|
const frame = elementList.value.find(element => element.type === ElementTypes.FRAME)
|
|
|
console.log('frame:', frame)
|
|
console.log('frame:', frame)
|
|
|
const toolType = frame?.toolType ?? ''
|
|
const toolType = frame?.toolType ?? ''
|
|
|
|
|
+ const likeArray = res[1]
|
|
|
|
|
+ console.log('likeArray', likeArray)
|
|
|
const newWorkArray = props.cid
|
|
const newWorkArray = props.cid
|
|
|
? res[0].filter((work: any) => {
|
|
? res[0].filter((work: any) => {
|
|
|
|
|
+
|
|
|
// console.log(work.ttype == '1' || (work.ttype == '2' && work.classid.includes(props.cid)) && (work.atool === toolType.value || !toolType.value))
|
|
// console.log(work.ttype == '1' || (work.ttype == '2' && work.classid.includes(props.cid)) && (work.atool === toolType.value || !toolType.value))
|
|
|
return work.ttype == '1' || (work.ttype == '2' && work.classid.includes(props.cid)) && (work.atool == toolType.value || !toolType.value)
|
|
return work.ttype == '1' || (work.ttype == '2' && work.classid.includes(props.cid)) && (work.atool == toolType.value || !toolType.value)
|
|
|
|
|
+ }).map((work: any) => {
|
|
|
|
|
+ // 计算点赞数量:likeArray中wid等于当前work.id的记录数
|
|
|
|
|
+ const likesCount = likeArray.filter((like: any) => like.workId == work.id).length
|
|
|
|
|
+ // 判断当前用户是否点赞:likeArray中wid等于当前work.id且likesId等于当前用户id
|
|
|
|
|
+ const isLikes = likeArray.some((like: any) => like.workId == work.id && like.likesId == props.userid)
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...work,
|
|
|
|
|
+ likesCount,
|
|
|
|
|
+ isLikes
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ : res[0].map((work: any) => {
|
|
|
|
|
+ // 计算点赞数量:likeArray中wid等于当前work.id的记录数
|
|
|
|
|
+ const likesCount = likeArray.filter((like: any) => like.workId == work.id).length
|
|
|
|
|
+ // 判断当前用户是否点赞:likeArray中wid等于当前work.id且likesId等于当前用户id
|
|
|
|
|
+ const isLikes = likeArray.some((like: any) => like.workId == work.id && like.likesId == props.userid)
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...work,
|
|
|
|
|
+ likesCount,
|
|
|
|
|
+ isLikes
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
- : res[0]
|
|
|
|
|
|
|
|
|
|
// 如果是更新模式,只有当数据真正变化时才更新
|
|
// 如果是更新模式,只有当数据真正变化时才更新
|
|
|
if (isUpdate) {
|
|
if (isUpdate) {
|
|
@@ -2960,7 +2994,7 @@ const checkWorkArrayChanged = (oldArray: WorkItem[], newArray: WorkItem[]): bool
|
|
|
const oldWork = oldArray[i]
|
|
const oldWork = oldArray[i]
|
|
|
const newWork = newArray[i]
|
|
const newWork = newArray[i]
|
|
|
|
|
|
|
|
- if (oldWork.id !== newWork.id || oldWork.name !== newWork.name || oldWork.content !== newWork.content) {
|
|
|
|
|
|
|
+ if (oldWork.id !== newWork.id || oldWork.name !== newWork.name || oldWork.content !== newWork.content || oldWork.isLikes !== newWork.isLikes || oldWork.likesCount !== newWork.likesCount) {
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -3538,6 +3572,17 @@ const getMessages = (msgObj: any) => {
|
|
|
}
|
|
}
|
|
|
}, 1000)
|
|
}, 1000)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 处理点赞消息 - 当有人点赞时,重新获取点赞数据
|
|
|
|
|
+ if (msgObj.type === 'like_updated' && msgObj.courseid === props.courseid) {
|
|
|
|
|
+ console.log('收到点赞消息,重新获取点赞数据')
|
|
|
|
|
+ // 延迟一点时间,确保后端数据已更新
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ if (currentSlideHasIframe.value) {
|
|
|
|
|
+ getWork(true) // 传入true表示是更新模式
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 处理英语口语状态更新 - 学生开始/完成对话时,刷新班级答题面板
|
|
// 处理英语口语状态更新 - 学生开始/完成对话时,刷新班级答题面板
|
|
|
if (props.type == '1' && msgObj.type === 'speaking_session_updated' && msgObj.courseid === props.courseid) {
|
|
if (props.type == '1' && msgObj.type === 'speaking_session_updated' && msgObj.courseid === props.courseid) {
|