|
@@ -78,6 +78,7 @@ import { getStudentAfterWork, getStudentList } from '../studentList/api';
|
|
|
import TheNoticeBar from '/src/components/TheNoticeBar';
|
|
|
import ClassWork from './model/class-work';
|
|
|
import SelectClass from './model/select-class';
|
|
|
+import SourceList from './model/source-list';
|
|
|
|
|
|
export type ToolType = 'init' | 'pen' | 'whiteboard' | 'call';
|
|
|
export type ToolItem = {
|
|
@@ -156,10 +157,9 @@ export default defineComponent({
|
|
|
handleInit(1);
|
|
|
});
|
|
|
|
|
|
- const drawerCardRef = ref(); // 资源列表对象
|
|
|
const data = reactive({
|
|
|
type: 'class' as '' | 'preview' | 'class', // 预览类型
|
|
|
- courseId: '', // 课件编号
|
|
|
+ courseId: '' as any, // 课件编号
|
|
|
subjectId: '' as any, // 声部编号
|
|
|
lessonCourseId: '' as any, // 教材编号
|
|
|
lessonCoursewareDetailId: '' as any, // 章节
|
|
@@ -213,7 +213,8 @@ export default defineComponent({
|
|
|
|
|
|
const tempRows = res.data.chapterKnowledgeList || [];
|
|
|
const temp: any = [];
|
|
|
- tempRows.forEach((row: any) => {
|
|
|
+ const allItem: any = [];
|
|
|
+ tempRows.forEach((row: any, index: number) => {
|
|
|
if (!Array.isArray(row.chapterKnowledgeMaterialList)) {
|
|
|
return;
|
|
|
}
|
|
@@ -228,7 +229,8 @@ export default defineComponent({
|
|
|
title: child.bizInfo.name,
|
|
|
isCollect: !!child.favoriteFlag,
|
|
|
isSelected: child.source === 'PLATFORM' ? true : false,
|
|
|
- content: child.bizInfo.content
|
|
|
+ content: child.bizInfo.content,
|
|
|
+ parentIndex: index
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -236,10 +238,11 @@ export default defineComponent({
|
|
|
title: row.name,
|
|
|
list: childList
|
|
|
});
|
|
|
+ allItem.push(...childList);
|
|
|
});
|
|
|
|
|
|
data.knowledgePointList = temp;
|
|
|
- data.itemList = data.knowledgePointList[0].list?.map((m: any) => {
|
|
|
+ data.itemList = allItem?.map((m: any) => {
|
|
|
return {
|
|
|
...m,
|
|
|
iframeRef: null,
|
|
@@ -351,10 +354,11 @@ export default defineComponent({
|
|
|
const popupData = reactive({
|
|
|
open: false,
|
|
|
activeIndex: 0,
|
|
|
+ courseActiveIndex: 0, // 课件选择的第几个
|
|
|
toolOpen: false, // 工具弹窗控制
|
|
|
chapterOpen: false, // 切换章节
|
|
|
chapterDetails: [] as any,
|
|
|
- courseId: null, // 章节编号
|
|
|
+ courseId: null as any, // 章节编号
|
|
|
chapterLoading: false // 加载数据
|
|
|
});
|
|
|
|
|
@@ -669,11 +673,6 @@ export default defineComponent({
|
|
|
|
|
|
// 上一个知识点, 下一个知识点
|
|
|
const handlePreAndNext = async (type: string) => {
|
|
|
- // if (type === 'up') {
|
|
|
- // handleSwipeChange(popupData.activeIndex - 1);
|
|
|
- // } else {
|
|
|
- // handleSwipeChange(popupData.activeIndex + 1);
|
|
|
- // }
|
|
|
if (type === 'up') {
|
|
|
// 判断上面是否还有章节
|
|
|
if (popupData.activeIndex > 0) {
|
|
@@ -712,17 +711,8 @@ export default defineComponent({
|
|
|
}
|
|
|
// 判断当前章节下面课程是否有内容,否则往上一个章节走
|
|
|
if (lessonStatus) {
|
|
|
- popupData.chapterLoading = true;
|
|
|
- data.detailId = coursewareDetailKnowledgeId;
|
|
|
- data.lessonCoursewareDetailId = lessonCoursewareDetailId;
|
|
|
- // 更新上课记录 上课的时候才更新
|
|
|
- if (data.type !== 'preview') {
|
|
|
- await classCourseScheduleUpdate();
|
|
|
- }
|
|
|
- await getDetail();
|
|
|
- popupData.activeIndex = data.itemList.length - 1 || 0;
|
|
|
- popupData.chapterOpen = false;
|
|
|
- popupData.chapterLoading = false;
|
|
|
+ popupData.courseId = coursewareDetailKnowledgeId;
|
|
|
+ data.selectClassStatus = true;
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -752,12 +742,8 @@ export default defineComponent({
|
|
|
|
|
|
// 判断当前章节下面课程是否有内容,否则往上一个章节走
|
|
|
if (prevLessonStatus) {
|
|
|
- popupData.chapterLoading = true;
|
|
|
- data.detailId = coursewareDetailKnowledgeId;
|
|
|
- data.lessonCoursewareDetailId = lessonCoursewareDetailId;
|
|
|
- await getDetail();
|
|
|
- popupData.activeIndex = data.itemList.length - 1 || 0;
|
|
|
- popupData.chapterLoading = false;
|
|
|
+ popupData.courseId = coursewareDetailKnowledgeId;
|
|
|
+ data.selectClassStatus = true;
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
@@ -795,17 +781,8 @@ export default defineComponent({
|
|
|
}
|
|
|
// 判断当前章节下面课程是否有内容,否则往下一个章节走
|
|
|
if (lessonStatus) {
|
|
|
- popupData.chapterLoading = true;
|
|
|
- data.detailId = coursewareDetailKnowledgeId;
|
|
|
- data.lessonCoursewareDetailId = lessonCoursewareDetailId;
|
|
|
- // 更新上课记录 上课的时候才更新
|
|
|
- if (data.type !== 'preview') {
|
|
|
- await classCourseScheduleUpdate();
|
|
|
- }
|
|
|
- await getDetail();
|
|
|
- popupData.activeIndex = 0;
|
|
|
- popupData.chapterOpen = false;
|
|
|
- popupData.chapterLoading = false;
|
|
|
+ popupData.courseId = coursewareDetailKnowledgeId;
|
|
|
+ data.selectClassStatus = true;
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -835,17 +812,8 @@ export default defineComponent({
|
|
|
|
|
|
// 判断当前章节下面课程是否有内容,否则往上一个章节走
|
|
|
if (nextLessonStatus) {
|
|
|
- popupData.chapterLoading = true;
|
|
|
- data.detailId = coursewareDetailKnowledgeId;
|
|
|
- data.lessonCoursewareDetailId = lessonCoursewareDetailId;
|
|
|
- // 更新上课记录 上课的时候才更新
|
|
|
- if (data.type !== 'preview') {
|
|
|
- await classCourseScheduleUpdate();
|
|
|
- }
|
|
|
- await getDetail();
|
|
|
- popupData.activeIndex = 0;
|
|
|
- popupData.chapterOpen = false;
|
|
|
- popupData.chapterLoading = false;
|
|
|
+ popupData.courseId = coursewareDetailKnowledgeId;
|
|
|
+ data.selectClassStatus = true;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -921,6 +889,13 @@ export default defineComponent({
|
|
|
// !listenerKeyUpState.value && toggleListenerKeyUp('add')
|
|
|
// }
|
|
|
// })
|
|
|
+ watch(
|
|
|
+ () => popupData.activeIndex,
|
|
|
+ () => {
|
|
|
+ const item = data.itemList[popupData.activeIndex];
|
|
|
+ popupData.courseActiveIndex = item.parentIndex;
|
|
|
+ }
|
|
|
+ );
|
|
|
|
|
|
const setModalOpen = (status = true) => {
|
|
|
clearTimeout(activeData.timer);
|
|
@@ -1062,6 +1037,7 @@ export default defineComponent({
|
|
|
let detailIndex = popupData.chapterDetails.findIndex(
|
|
|
(item: any) => item.id == data.lessonCoursewareDetailId
|
|
|
);
|
|
|
+
|
|
|
const detailItem =
|
|
|
popupData.chapterDetails[detailIndex]?.knowledgeList || [];
|
|
|
let lessonIndex = detailItem.findIndex(
|
|
@@ -1434,7 +1410,6 @@ export default defineComponent({
|
|
|
// if (isRender) {
|
|
|
// m.isRender = true;
|
|
|
// }
|
|
|
- // console.log(isRender, 'isRender', mIndex);
|
|
|
return isRender ? (
|
|
|
<div
|
|
|
key={'index' + mIndex}
|
|
@@ -1650,50 +1625,15 @@ export default defineComponent({
|
|
|
<TheNoticeBar text={activeName.value || '资源列表'} />
|
|
|
),
|
|
|
default: () => (
|
|
|
- <div ref={drawerCardRef} id="drawerCardRef">
|
|
|
- {/* {data.knowledgePointList.map((item: any, index: number) => {
|
|
|
- return (
|
|
|
- <div class={[styles.cardContainer, 'drawerCardItemRef']}>
|
|
|
- <CardType
|
|
|
- item={item}
|
|
|
- isActive={popupData.activeIndex === index}
|
|
|
- isCollect={false}
|
|
|
- isShowCollect={false}
|
|
|
- onClick={(item: any) => {
|
|
|
- popupData.open = false;
|
|
|
- toggleMaterial(item.id);
|
|
|
- }}
|
|
|
- />
|
|
|
- </div>
|
|
|
- );
|
|
|
- })} */}
|
|
|
- <NCollapse displayDirective="show">
|
|
|
- {data.knowledgePointList.map((item: any, index: number) => {
|
|
|
- return (
|
|
|
- <NCollapseItem title={item.title}>
|
|
|
- {item.list.map((child: any) => (
|
|
|
- <div
|
|
|
- class={[
|
|
|
- styles.cardContainer,
|
|
|
- 'drawerCardItemRef'
|
|
|
- ]}>
|
|
|
- <CardType
|
|
|
- item={child}
|
|
|
- isActive={popupData.activeIndex === index}
|
|
|
- isCollect={false}
|
|
|
- isShowCollect={false}
|
|
|
- onClick={() => {
|
|
|
- popupData.open = false;
|
|
|
- toggleMaterial(item.id);
|
|
|
- }}
|
|
|
- />
|
|
|
- </div>
|
|
|
- ))}
|
|
|
- </NCollapseItem>
|
|
|
- );
|
|
|
- })}
|
|
|
- </NCollapse>
|
|
|
- </div>
|
|
|
+ <SourceList
|
|
|
+ knowledgePointList={data.knowledgePointList}
|
|
|
+ courseActiveIndex={popupData.courseActiveIndex}
|
|
|
+ activeItem={data.itemList[popupData.activeIndex]}
|
|
|
+ onConfirm={(item: any) => {
|
|
|
+ popupData.open = false;
|
|
|
+ toggleMaterial(item.id);
|
|
|
+ }}
|
|
|
+ />
|
|
|
)
|
|
|
}}
|
|
|
</NDrawerContent>
|
|
@@ -1747,7 +1687,7 @@ export default defineComponent({
|
|
|
/>
|
|
|
)}
|
|
|
|
|
|
- {/* 训练设置 */}
|
|
|
+ {/* 选择课件 */}
|
|
|
<NModal
|
|
|
transformOrigin="center"
|
|
|
v-model:show={data.selectClassStatus}
|
|
@@ -1765,7 +1705,7 @@ export default defineComponent({
|
|
|
popupData.chapterLoading = true;
|
|
|
try {
|
|
|
data.detailId = val.itemActive;
|
|
|
- data.courseId = val.courseId;
|
|
|
+ data.courseId = val.chapterId;
|
|
|
const ids = formatParentId(
|
|
|
val.itemActive,
|
|
|
popupData.chapterDetails
|