|
@@ -326,7 +326,10 @@ async function getLessCoursewareList(id?: string) {
|
|
|
searchObj.loading = true
|
|
|
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
|
|
@@ -384,6 +387,7 @@ function getCoursewareMenuList(id?: string) {
|
|
|
}
|
|
|
let flattenCoursewareListData: any = [] // 临时扁平化数据
|
|
|
function handlePointList(pointList: any[], isSearch?: boolean) {
|
|
|
+ flattenCoursewareListData = []
|
|
|
const list = filterPointList(pointList)
|
|
|
if (!isSearch) {
|
|
|
// 重置数据
|
|
@@ -432,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
|
|
|
}
|
|
@@ -457,9 +459,21 @@ function handleCourseClick(value: any) {
|
|
|
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) {
|