|
@@ -62,17 +62,17 @@ import Chapter from './model/chapter';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import { useUserStore } from '@/store/modules/users';
|
|
|
|
|
|
-import iconBeatIcon from './new-image/icon-beatIcon.png';
|
|
|
-import iconChange from './new-image/icon-change.png';
|
|
|
-import iconDown from './new-image/icon-down.png';
|
|
|
-import iconMenu from './new-image/icon-menu.png';
|
|
|
+// import iconBeatIcon from './new-image/icon-beatIcon.png';
|
|
|
+// import iconChange from './new-image/icon-change.png';
|
|
|
+// import iconDown from './new-image/icon-down.png';
|
|
|
+// import iconMenu from './new-image/icon-menu.png';
|
|
|
import iconNote from './new-image/icon-note.png';
|
|
|
-import iconOverClass from './new-image/icon-overclass.png';
|
|
|
-import iconSetTime from './new-image/icon-setTime.png';
|
|
|
-import iconToneIcon from './new-image/icon-toneIcon.png';
|
|
|
-import iconUp from './new-image/icon-up.png';
|
|
|
+// import iconOverClass from './new-image/icon-overclass.png';
|
|
|
+// import iconSetTime from './new-image/icon-setTime.png';
|
|
|
+// import iconToneIcon from './new-image/icon-toneIcon.png';
|
|
|
+// import iconUp from './new-image/icon-up.png';
|
|
|
import iconWhite from './new-image/icon-white.png';
|
|
|
-import iconWork from './new-image/icon-work.png';
|
|
|
+// import iconWork from './new-image/icon-work.png';
|
|
|
|
|
|
import rightIconEnd from './image/right_icon1.png';
|
|
|
import rightIconArrange from './image/right_icon2.png';
|
|
@@ -82,11 +82,13 @@ import rightIconMetronome from './image/right_icon5.png';
|
|
|
import rightIconTuner from './image/right_icon6.png';
|
|
|
import rightIconTimer from './image/right_icon7.png';
|
|
|
import rightIconPackUp from './image/right_icon8.png';
|
|
|
+import rightIconMusic from './image/right_icon9.png';
|
|
|
import bottomIconSwitch from './image/bottom_icon1.png';
|
|
|
import bottomIconResource from './image/bottom_icon2.png';
|
|
|
import bottomIconPre from './image/bottom_icon3.png';
|
|
|
import bottomIconNext from './image/bottom_icon4.png';
|
|
|
import rightHideIcon from './image/right_hide_icon.png';
|
|
|
+import SelectResources from '../prepare-lessons/model/select-resources';
|
|
|
|
|
|
export type ToolType = 'init' | 'pen' | 'whiteboard';
|
|
|
export type ToolItem = {
|
|
@@ -186,6 +188,7 @@ export default defineComponent({
|
|
|
removeTitle: '',
|
|
|
removeContent: '',
|
|
|
|
|
|
+ selectResourceStatus: false,
|
|
|
videoState: 'init' as 'init' | 'play',
|
|
|
videoItemRef: null as any,
|
|
|
animationState: 'start' as 'start' | 'end'
|
|
@@ -317,19 +320,19 @@ export default defineComponent({
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- const onFullScreen = () => {
|
|
|
- if (data.type === 'preview') {
|
|
|
- const el: any = document.querySelector('#app');
|
|
|
-
|
|
|
- if (el.mozRequestFullScreen) {
|
|
|
- el.mozRequestFullScreen();
|
|
|
- } else if (el.webkitRequestFullscreen) {
|
|
|
- el.webkitRequestFullscreen();
|
|
|
- } else if (el.requestFullScreen) {
|
|
|
- el.requestFullscreen();
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
+ // const onFullScreen = () => {
|
|
|
+ // if (data.type === 'preview') {
|
|
|
+ // const el: any = document.querySelector('#app');
|
|
|
+
|
|
|
+ // if (el.mozRequestFullScreen) {
|
|
|
+ // el.mozRequestFullScreen();
|
|
|
+ // } else if (el.webkitRequestFullscreen) {
|
|
|
+ // el.webkitRequestFullscreen();
|
|
|
+ // } else if (el.requestFullScreen) {
|
|
|
+ // el.requestFullscreen();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // };
|
|
|
|
|
|
const popupData = reactive({
|
|
|
open: false,
|
|
@@ -387,25 +390,25 @@ export default defineComponent({
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- const activeName = computed(() => {
|
|
|
- let name = '';
|
|
|
- // data.knowledgePointList.forEach((item: any, index: number) => {
|
|
|
- // if (popupData.activeIndex === index) {
|
|
|
- // name = item.title;
|
|
|
- // }
|
|
|
- // });
|
|
|
- popupData.chapterDetails.forEach((chapter: any) => {
|
|
|
- if (chapter.id === data.lessonCoursewareDetailId) {
|
|
|
- name = chapter.name;
|
|
|
- chapter.knowledgeList?.forEach((know: any) => {
|
|
|
- if (know.id === data.detailId) {
|
|
|
- name += ' - ' + know.name;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- return name;
|
|
|
- });
|
|
|
+ // const activeName = computed(() => {
|
|
|
+ // let name = '';
|
|
|
+ // // data.knowledgePointList.forEach((item: any, index: number) => {
|
|
|
+ // // if (popupData.activeIndex === index) {
|
|
|
+ // // name = item.title;
|
|
|
+ // // }
|
|
|
+ // // });
|
|
|
+ // popupData.chapterDetails.forEach((chapter: any) => {
|
|
|
+ // if (chapter.id === data.lessonCoursewareDetailId) {
|
|
|
+ // name = chapter.name;
|
|
|
+ // chapter.knowledgeList?.forEach((know: any) => {
|
|
|
+ // if (know.id === data.detailId) {
|
|
|
+ // name += ' - ' + know.name;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // return name;
|
|
|
+ // });
|
|
|
|
|
|
/**停止所有的播放 */
|
|
|
const handleStop = () => {
|
|
@@ -857,28 +860,28 @@ export default defineComponent({
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- const toggleListenerKeyUp = (type: string) => {
|
|
|
- if (type === 'remove') {
|
|
|
- document.body.removeEventListener('keyup', () => {
|
|
|
- listenerKeyUpState.value = false;
|
|
|
- });
|
|
|
- } else {
|
|
|
- // 监听页面键盘事件 - 上下切换
|
|
|
- document.body.addEventListener('keyup', (e: KeyboardEvent) => {
|
|
|
- // console.log(e, 'e');
|
|
|
- if (e.code === 'ArrowLeft') {
|
|
|
- // if (popupData.activeIndex === 0) return;
|
|
|
- setModalOpen();
|
|
|
- handlePreAndNext('up');
|
|
|
- } else if (e.code === 'ArrowRight') {
|
|
|
- // if (popupData.activeIndex === data.itemList.length - 1) return;
|
|
|
- setModalOpen();
|
|
|
- handlePreAndNext('down');
|
|
|
- }
|
|
|
- });
|
|
|
- listenerKeyUpState.value = true;
|
|
|
- }
|
|
|
- };
|
|
|
+ // const toggleListenerKeyUp = (type: string) => {
|
|
|
+ // if (type === 'remove') {
|
|
|
+ // document.body.removeEventListener('keyup', () => {
|
|
|
+ // listenerKeyUpState.value = false;
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // // 监听页面键盘事件 - 上下切换
|
|
|
+ // document.body.addEventListener('keyup', (e: KeyboardEvent) => {
|
|
|
+ // // console.log(e, 'e');
|
|
|
+ // if (e.code === 'ArrowLeft') {
|
|
|
+ // // if (popupData.activeIndex === 0) return;
|
|
|
+ // setModalOpen();
|
|
|
+ // handlePreAndNext('up');
|
|
|
+ // } else if (e.code === 'ArrowRight') {
|
|
|
+ // // if (popupData.activeIndex === data.itemList.length - 1) return;
|
|
|
+ // setModalOpen();
|
|
|
+ // handlePreAndNext('down');
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // listenerKeyUpState.value = true;
|
|
|
+ // }
|
|
|
+ // };
|
|
|
|
|
|
// 监听切换到ppt课件时,手动移除键盘监听器
|
|
|
// watch(() => popupData.activeIndex, () => {
|
|
@@ -910,20 +913,21 @@ export default defineComponent({
|
|
|
|
|
|
/** 打开教学工具 */
|
|
|
const openStudyTool = (item: ToolItem) => {
|
|
|
- const activeItem = data.itemList[popupData.activeIndex];
|
|
|
- // 暂停视频和曲谱的播放
|
|
|
- if (activeItem.type === 'VIDEO' && activeItem.videoEle) {
|
|
|
- activeItem.videoEle?.pause();
|
|
|
- }
|
|
|
- if (activeItem.type === 'SONG' && activeItem.audioEle) {
|
|
|
- activeItem.audioEle?.stop();
|
|
|
- }
|
|
|
- if (activeItem.type === 'MUSIC') {
|
|
|
- activeItem.iframeRef?.contentWindow?.postMessage(
|
|
|
- { api: 'setPlayState' },
|
|
|
- '*'
|
|
|
- );
|
|
|
- }
|
|
|
+ // const activeItem = data.itemList[popupData.activeIndex];
|
|
|
+ // // 暂停视频和曲谱的播放
|
|
|
+ // if (activeItem.type === 'VIDEO' && activeItem.videoEle) {
|
|
|
+ // activeItem.videoEle?.pause();
|
|
|
+ // }
|
|
|
+ // if (activeItem.type === 'SONG' && activeItem.audioEle) {
|
|
|
+ // activeItem.audioEle?.stop();
|
|
|
+ // }
|
|
|
+ // if (activeItem.type === 'MUSIC') {
|
|
|
+ // activeItem.iframeRef?.contentWindow?.postMessage(
|
|
|
+ // { api: 'setPlayState' },
|
|
|
+ // '*'
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ handleStop();
|
|
|
clearModel();
|
|
|
popupData.toolOpen = false;
|
|
|
studyData.type = item.type;
|
|
@@ -956,12 +960,6 @@ export default defineComponent({
|
|
|
if (val == 'toneIcon') {
|
|
|
showModalTone.value = true;
|
|
|
}
|
|
|
- // if (val == 'iconNote2') {
|
|
|
- // if (NPopoverRef.value) {
|
|
|
- // NPopoverRef.value.setShow(false);
|
|
|
- // }
|
|
|
- // eventGlobal.emit('teacher-guideInfo-attend-class', 'attend-class');
|
|
|
- // }
|
|
|
};
|
|
|
|
|
|
// 是否允许上一页
|
|
@@ -973,7 +971,6 @@ export default defineComponent({
|
|
|
* 4,判断当前章节上面还没有其它章节;
|
|
|
* 5,判断上面章节里面课程是否有资源;
|
|
|
*/
|
|
|
-
|
|
|
if (popupData.activeIndex > 0) {
|
|
|
return true;
|
|
|
}
|
|
@@ -1119,6 +1116,11 @@ export default defineComponent({
|
|
|
id: 2
|
|
|
},
|
|
|
{
|
|
|
+ name: '曲目资源',
|
|
|
+ icon: rightIconMusic,
|
|
|
+ id: 9
|
|
|
+ },
|
|
|
+ {
|
|
|
name: '批注',
|
|
|
icon: rightIconPostil,
|
|
|
id: 3
|
|
@@ -1230,6 +1232,11 @@ export default defineComponent({
|
|
|
case 8:
|
|
|
rightColumnShow.value = false;
|
|
|
break;
|
|
|
+ case 9:
|
|
|
+ // 选择曲目时需要暂停所有播放
|
|
|
+ handleStop();
|
|
|
+ data.selectResourceStatus = true;
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
@@ -1462,150 +1469,6 @@ export default defineComponent({
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- {/* 头部样式 */}
|
|
|
- {/* <div
|
|
|
- style={{ transform: activeData.model ? '' : 'translateY(-100%)' }}
|
|
|
- class={styles.headerContainer}>
|
|
|
- <div class={styles.menu}>{activeName.value}</div>
|
|
|
- </div> */}
|
|
|
- {/* 布置作业按钮 */}
|
|
|
-
|
|
|
- {/* <div
|
|
|
- onClick={(e: any) => {
|
|
|
- e.stopPropagation();
|
|
|
- if (activeData.timer){
|
|
|
- setModelOpen();
|
|
|
- }
|
|
|
- }}
|
|
|
- class={[
|
|
|
- styles.switchDisplaySection,
|
|
|
- activeData.model ? '' : styles.sectionAnimate
|
|
|
- ]}>
|
|
|
- <NSpace class={styles.switchSpace}>
|
|
|
- <div
|
|
|
- class={styles.btnItem}
|
|
|
- onClick={async () => {
|
|
|
- if (data.type === 'preview') {
|
|
|
- handleStop();
|
|
|
- data.removeVisiable = true;
|
|
|
- data.removeTitle = '结束预览';
|
|
|
- data.removeContent = '请确认是否结束预览?';
|
|
|
- } else {
|
|
|
- data.removeVisiable = true;
|
|
|
- data.removeTitle = '结束课程';
|
|
|
- data.removeContent = '请确认是否结束课程?';
|
|
|
- }
|
|
|
- }}>
|
|
|
- <img src={iconOverClass} />
|
|
|
- <p>{data.type !== 'preview' ? '结束课程' : '结束预览'}</p>
|
|
|
- </div>
|
|
|
- {data.type !== 'preview' && (
|
|
|
- <div
|
|
|
- class={[
|
|
|
- styles.btnItem,
|
|
|
- data.preStudentNum <= 0 ? styles.btnsDisabled : ''
|
|
|
- ]}
|
|
|
- onClick={async () => {
|
|
|
- // 学生人数必须大于0,才可以布置作业
|
|
|
- if (data.preStudentNum <= 0) return;
|
|
|
- const res = await lessonPreTrainingPage({
|
|
|
- coursewareKnowledgeDetailId: data.detailId,
|
|
|
- subjectId: data.subjectId,
|
|
|
- page: 1,
|
|
|
- rows: 99
|
|
|
- });
|
|
|
- if (res.data.rows && res.data.rows.length) {
|
|
|
- data.modalAttendMessage =
|
|
|
- '本节课已设置课后作业,是否布置?';
|
|
|
- }
|
|
|
- data.modelAttendStatus = true;
|
|
|
- }}>
|
|
|
- <img src={iconWork} />
|
|
|
- <p>布置作业</p>
|
|
|
- </div>
|
|
|
- )}
|
|
|
-
|
|
|
- <div
|
|
|
- class={styles.btnItem}
|
|
|
- onClick={() =>
|
|
|
- openStudyTool({
|
|
|
- type: 'pen',
|
|
|
- icon: iconNote,
|
|
|
- name: '批注'
|
|
|
- })
|
|
|
- }>
|
|
|
- <img src={iconNote} />
|
|
|
- <p>批注</p>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class={styles.btnItem}
|
|
|
- onClick={() =>
|
|
|
- openStudyTool({
|
|
|
- type: 'whiteboard',
|
|
|
- icon: iconWhite,
|
|
|
- name: '白板'
|
|
|
- })
|
|
|
- }>
|
|
|
- <img src={iconWhite} />
|
|
|
- <p>白板</p>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class={styles.btnItem}
|
|
|
- onClick={() => startShowModal('beatIcon')}>
|
|
|
- <img src={iconToneIcon} />
|
|
|
- <p>节拍器</p>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class={styles.btnItem}
|
|
|
- onClick={() => startShowModal('toneIcon')}>
|
|
|
- <img src={iconSetTime} />
|
|
|
- <p>调音器</p>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class={styles.btnItem}
|
|
|
- onClick={() => startShowModal('setTimeIcon')}>
|
|
|
- <img src={iconBeatIcon} />
|
|
|
- <p>计时器</p>
|
|
|
- </div>
|
|
|
- </NSpace>
|
|
|
- <NSpace class={styles.switchSpace}>
|
|
|
- <div
|
|
|
- class={styles.btnItem}
|
|
|
- onClick={() => (popupData.chapterOpen = true)}>
|
|
|
- <img src={iconChange} />
|
|
|
- <p>切换章节</p>
|
|
|
- </div>
|
|
|
- <div class={styles.btnItem} onClick={() => (popupData.open = true)}>
|
|
|
- <img src={iconMenu} />
|
|
|
- <p>资源列表</p>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class={[
|
|
|
- styles.btnItem,
|
|
|
- !isUpArrow.value ? styles.btnsDisabled : ''
|
|
|
- ]}
|
|
|
- onClick={() => {
|
|
|
- if (!isUpArrow.value) return;
|
|
|
- handlePreAndNext('up');
|
|
|
- }}>
|
|
|
- <img src={iconUp} />
|
|
|
- <p>上一个</p>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class={[
|
|
|
- styles.btnItem,
|
|
|
- !isDownArrow.value ? styles.btnsDisabled : ''
|
|
|
- ]}
|
|
|
- onClick={() => {
|
|
|
- if (!isDownArrow.value) return;
|
|
|
- handlePreAndNext('down');
|
|
|
- }}>
|
|
|
- <img src={iconDown} />
|
|
|
- <p>下一个</p>
|
|
|
- </div>
|
|
|
- </NSpace>
|
|
|
- </div> */}
|
|
|
-
|
|
|
{/* 右边操作栏 */}
|
|
|
<div
|
|
|
class={[
|
|
@@ -1848,6 +1711,14 @@ export default defineComponent({
|
|
|
<TimerMeter></TimerMeter>
|
|
|
</div>
|
|
|
</NModal>
|
|
|
+
|
|
|
+ <NModal
|
|
|
+ v-model:show={data.selectResourceStatus}
|
|
|
+ class={['modalTitle', styles.selectMusicModal]}
|
|
|
+ preset="card"
|
|
|
+ title={'选择资源'}>
|
|
|
+ <SelectResources from="class" />
|
|
|
+ </NModal>
|
|
|
<NModal
|
|
|
transformOrigin="center"
|
|
|
v-model:show={data.removeVisiable}
|