|
@@ -24,7 +24,15 @@
|
|
|
<ElImage :hide-on-click-modal="true" fit="contain" :src="activeCourseware?.content" class="imgPlay" />
|
|
|
</div>
|
|
|
<div class="songPlayBox" v-if="fileType === 'SONG'">
|
|
|
- <iframe ref="songPlayDom" class="songIframe" @mousemove="handleMousemove" :src="songPlaySrc" frameborder="0"></iframe>
|
|
|
+ <iframe
|
|
|
+ ref="songPlayDom"
|
|
|
+ :key="activeCourseware?.content"
|
|
|
+ class="songIframe"
|
|
|
+ @mousemove="handleMousemove"
|
|
|
+ :src="songPlaySrc"
|
|
|
+ frameborder="0"
|
|
|
+ ></iframe>
|
|
|
+ <!-- <span></span> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="leftTools posTools">
|
|
@@ -130,8 +138,8 @@
|
|
|
description="暂无搜索结果"
|
|
|
/>
|
|
|
<courseCollapse
|
|
|
- :activeCollapse="activeCourseware"
|
|
|
- :search="searchObj.search"
|
|
|
+ :activeCollapse="tempActiveCourseware || activeCourseware"
|
|
|
+ :search="searchObj.tempSearch || searchObj.search"
|
|
|
:courseList="tempCoursewareList"
|
|
|
@handleClick="handleCourseClick"
|
|
|
/>
|
|
@@ -157,7 +165,9 @@ import {
|
|
|
getLessonCourseDetail_gym,
|
|
|
getLessonCoursewareDetail_gyt,
|
|
|
getLessonCourseDetail_klx,
|
|
|
- getLessonCoursewareCourseList_gym
|
|
|
+ getLessonCoursewareCourseList_gym,
|
|
|
+ getMyCoursewareDetail_gyt,
|
|
|
+ getLessonCoursewareCourseList_klx
|
|
|
} from "@/api/cloudTextbooks.api"
|
|
|
import myInput from "@/components/myInput"
|
|
|
import { checkWebCourse_gyt, refLevel_gym, refLevel_gyt, refLevel_klx } from "@/api/coursewarePlay.api"
|
|
@@ -202,10 +212,12 @@ const searchObj = reactive({
|
|
|
isSearch: false, // 是否搜索 标识
|
|
|
queryStr: route.query.search as any,
|
|
|
source: route.query.source as any, // 从哪里来的
|
|
|
- search: route.query.search as any // 默认的搜索条件 -
|
|
|
+ search: route.query.search as any, // 默认的搜索条件 -
|
|
|
+ tempSearch: route.query.search as any
|
|
|
})
|
|
|
|
|
|
// 选中的知识点
|
|
|
+const tempActiveCourseware: any = ref() // 临时数据
|
|
|
const activeCourseware = computed<undefined | Record<string, any>>(() => {
|
|
|
return flattenCoursewareList.value[activeCoursewareIndex.value]
|
|
|
})
|
|
@@ -227,6 +239,11 @@ const songPlaySrc = computed<string>(() => {
|
|
|
activeCourseware.value?.content
|
|
|
}&Authorization=${getToken()}&platform=pc&isHideBack=true&isHideMusicList=true&isYjt=1&systemType=teacher`
|
|
|
}
|
|
|
+
|
|
|
+ // const iframeRef = document.querySelector("#songPlayDom") as any
|
|
|
+ // iframeRef?.contentWindow.location.replace(urlObj[userStoreHook.roles!])
|
|
|
+ // console.log(iframeRef, "iframeRef")
|
|
|
+
|
|
|
return urlObj[userStoreHook.roles!]
|
|
|
})
|
|
|
// 视频是否自动播放
|
|
@@ -298,18 +315,21 @@ async function getCoursewareList(id?: string) {
|
|
|
async function getLessCoursewareList(id?: string) {
|
|
|
// GYM,GYT,KLX 区分 查询接口
|
|
|
const LessonCoursewareDetailApi = {
|
|
|
- // GYT: getLessonCoursewareCourseList_gym
|
|
|
- GYM: getLessonCoursewareCourseList_gym
|
|
|
- // KLX: getLessonCourseDetail_klx
|
|
|
+ GYT: getMyCoursewareDetail_gyt,
|
|
|
+ GYM: getLessonCoursewareCourseList_gym,
|
|
|
+ KLX: getLessonCoursewareCourseList_klx
|
|
|
}
|
|
|
if (coursewareDetailController) {
|
|
|
coursewareDetailController.abort()
|
|
|
}
|
|
|
coursewareDetailController = new AbortController()
|
|
|
searchObj.loading = true
|
|
|
- await httpAjax(LessonCoursewareDetailApi["GYM"], {
|
|
|
+ await httpAjax(LessonCoursewareDetailApi[userStoreHook.roles!], {
|
|
|
id: id || (route.params.id as string),
|
|
|
- search: searchObj.queryStr,
|
|
|
+ data: {
|
|
|
+ search: searchObj.queryStr,
|
|
|
+ detailFlag: "1"
|
|
|
+ },
|
|
|
abortController: coursewareDetailController
|
|
|
}).then(res => {
|
|
|
searchObj.loading = false
|
|
@@ -367,6 +387,7 @@ function getCoursewareMenuList(id?: string) {
|
|
|
}
|
|
|
let flattenCoursewareListData: any = [] // 临时扁平化数据
|
|
|
function handlePointList(pointList: any[], isSearch?: boolean) {
|
|
|
+ flattenCoursewareListData = []
|
|
|
const list = filterPointList(pointList)
|
|
|
if (!isSearch) {
|
|
|
// 重置数据
|
|
@@ -380,6 +401,14 @@ function handlePointList(pointList: any[], isSearch?: boolean) {
|
|
|
index > -1 && (activeCoursewareIndex.value = index)
|
|
|
}
|
|
|
flattenCoursewareList.value = deepCopy(flattenCoursewareListData)
|
|
|
+ } else {
|
|
|
+ if (flattenCoursewareListData[0]) {
|
|
|
+ // 默认展开第一个
|
|
|
+ tempActiveCourseware.value = {
|
|
|
+ ...flattenCoursewareListData[0],
|
|
|
+ id: null
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
tempCoursewareList.value = list
|
|
|
tempFlattenCoursewareList.value = deepCopy(flattenCoursewareListData)
|
|
@@ -407,19 +436,17 @@ function filterPointList(pointList: any[], parentData?: { ids: string[]; name: s
|
|
|
})
|
|
|
}
|
|
|
function handleChangeCourseware(index: -1 | 1) {
|
|
|
+ console.log("parentId parentId parentId")
|
|
|
handleVideoPause()
|
|
|
handleSongPause()
|
|
|
const newIndex = index + activeCoursewareIndex.value
|
|
|
if (newIndex < 0 || newIndex > flattenCoursewareList.value.length - 1) {
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- const item = flattenCoursewareList.value[activeCoursewareIndex.value]
|
|
|
const newItem = flattenCoursewareList.value[newIndex]
|
|
|
- const parentId = item ? item.parentData.ids[0] : ""
|
|
|
- const newParentId = newItem ? newItem.parentData.ids[0] : ""
|
|
|
- if (parentId !== newParentId) {
|
|
|
- const parentItem = coursewareList.value.find((item: any) => item.id === parentId)
|
|
|
+ const newParentId = newItem ? newItem.parentData?.ids[0] : ""
|
|
|
+ if (newParentId) {
|
|
|
+ const parentItem = coursewareList.value.find((item: any) => item.id === newParentId)
|
|
|
if (parentItem) {
|
|
|
lessonTargetDetail.value = parentItem.lessonTargetDesc
|
|
|
}
|
|
@@ -429,12 +456,24 @@ function handleChangeCourseware(index: -1 | 1) {
|
|
|
}
|
|
|
function handleCourseClick(value: any) {
|
|
|
// 选择之后初始化数据
|
|
|
- searchObj.search = JSON.parse(JSON.stringify(searchObj.queryStr))
|
|
|
+ searchObj.search = searchObj.tempSearch ? JSON.parse(JSON.stringify(searchObj.tempSearch)) : ""
|
|
|
coursewareList.value = deepCopy(tempCoursewareList.value)
|
|
|
flattenCoursewareList.value = deepCopy(tempFlattenCoursewareList.value)
|
|
|
- activeCoursewareIndex.value = flattenCoursewareList.value.findIndex((item: any) => {
|
|
|
+
|
|
|
+ const newIndex = flattenCoursewareList.value.findIndex((item: any) => {
|
|
|
return value.id === item.id && value.knowledgePointId === item.knowledgePointId
|
|
|
})
|
|
|
+
|
|
|
+ const newItem = flattenCoursewareList.value[newIndex]
|
|
|
+ const newParentId = newItem ? newItem.parentData?.ids[0] : ""
|
|
|
+
|
|
|
+ if (newParentId) {
|
|
|
+ const parentItem = coursewareList.value.find((item: any) => item.id === newParentId)
|
|
|
+ if (parentItem) {
|
|
|
+ lessonTargetDetail.value = parentItem.lessonTargetDesc
|
|
|
+ }
|
|
|
+ }
|
|
|
+ activeCoursewareIndex.value = newIndex
|
|
|
drawerShow.value = false
|
|
|
}
|
|
|
async function handleCourseMenuClick(value: any) {
|
|
@@ -509,7 +548,10 @@ function preventDefaultContextmenu(event: MouseEvent) {
|
|
|
}
|
|
|
function handleKeydown(e: KeyboardEvent) {
|
|
|
const key = e.key
|
|
|
-
|
|
|
+ // 打开弹窗之后快捷键失效
|
|
|
+ if (drawerShow.value || drawerMenuShow.value) {
|
|
|
+ return
|
|
|
+ }
|
|
|
if (key === " ") {
|
|
|
closeAllModalFrame()
|
|
|
drawerShow.value = false
|
|
@@ -541,7 +583,9 @@ function handleToolClick(type: string) {
|
|
|
drawerMenuShow.value = true
|
|
|
} else if (type === "point") {
|
|
|
tempCoursewareList.value = deepCopy(coursewareList.value)
|
|
|
- searchObj.queryStr = JSON.parse(JSON.stringify(searchObj.search))
|
|
|
+ searchObj.queryStr = searchObj.search ? JSON.parse(JSON.stringify(searchObj.search)) : ""
|
|
|
+
|
|
|
+ tempActiveCourseware.value = null
|
|
|
drawerShow.value = true
|
|
|
}
|
|
|
}
|
|
@@ -671,6 +715,7 @@ function onTitleTip(type: "phaseGoals" | "checkItem", text: string) {
|
|
|
function handleQuery() {
|
|
|
//
|
|
|
searchObj.isSearch = true
|
|
|
+ searchObj.tempSearch = searchObj.queryStr ? JSON.parse(JSON.stringify(searchObj.queryStr)) : ""
|
|
|
getLessCoursewareList()
|
|
|
}
|
|
|
</script>
|
|
@@ -933,12 +978,14 @@ function handleQuery() {
|
|
|
.empty {
|
|
|
height: calc(100vh - 54px);
|
|
|
:deep(.el-empty__image) {
|
|
|
- width: 238px;
|
|
|
+ width: 228px;
|
|
|
}
|
|
|
|
|
|
:deep(.el-empty__description) {
|
|
|
- font-size: 18px;
|
|
|
color: #aaa;
|
|
|
+ p {
|
|
|
+ font-size: 18px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|