|
@@ -1,22 +1,10 @@
|
|
|
-import {
|
|
|
- defineComponent,
|
|
|
- onBeforeUnmount,
|
|
|
- onMounted,
|
|
|
- reactive,
|
|
|
- ref
|
|
|
-} from 'vue';
|
|
|
+import { defineComponent, onMounted, reactive, ref } from 'vue';
|
|
|
import styles from './index.module.less';
|
|
|
import {
|
|
|
NImage,
|
|
|
NButton,
|
|
|
- NAvatarGroup,
|
|
|
- NForm,
|
|
|
- NFormItem,
|
|
|
- NSelect,
|
|
|
NPopselect,
|
|
|
- NSpace,
|
|
|
NModal,
|
|
|
- NCascader,
|
|
|
useMessage,
|
|
|
NSpin
|
|
|
} from 'naive-ui';
|
|
@@ -25,10 +13,9 @@ import defultHeade from '@/components/layout/images/teacherIcon.png';
|
|
|
import blackBoardBg from './images/blackboard_bg.png';
|
|
|
import teacherMan from './images/teacher_man.png';
|
|
|
import teacherWoman from './images/teacher_woman.png';
|
|
|
-import iconLession from './images/icon-lession.png';
|
|
|
-import iconBook from './images/icon-book.png';
|
|
|
-import iconDetail from './images/icon-detail.png';
|
|
|
-import iconSubject from './images/icon-subject.png';
|
|
|
+
|
|
|
+import homeText1 from './images/home/home-text-1.png';
|
|
|
+import homeText2 from './images/home/home-text-2.png';
|
|
|
import iconTo from './images/icon-to.png';
|
|
|
import t1 from './images/t1.png';
|
|
|
import t2 from './images/t2.png';
|
|
@@ -38,31 +25,19 @@ import { useUserStore } from '/src/store/modules/users';
|
|
|
import SelectClass from './modals/selectClass';
|
|
|
import dayjs from 'dayjs';
|
|
|
import { gradeToCN, weekToCN } from '/src/utils/contants';
|
|
|
-import { getCLassStudent, getCourseChapter } from '../classList/api';
|
|
|
import { useCatchStore } from '/src/store/modules/catchData';
|
|
|
-import { useThrottleFn } from '@vueuse/core';
|
|
|
-import {
|
|
|
- bookVersionPage,
|
|
|
- courseScheduleStart,
|
|
|
- lessonCoursewarePage,
|
|
|
- queryCourseware
|
|
|
-} from '../prepare-lessons/api';
|
|
|
-import TheNoticeBar from '/src/components/TheNoticeBar';
|
|
|
import TeachGroup from './modals/teachGroup';
|
|
|
import { classGroupList, courseSchedulePage } from './api';
|
|
|
import TheEmpty from '/src/components/TheEmpty';
|
|
|
-import { setTabsCaches } from '/src/hooks/use-async';
|
|
|
import HomeGuide from '/src/custom-plugins/guide-page/home-guide';
|
|
|
import TimerMeter from '/src/components/timerMeter';
|
|
|
import { vaildUrl } from '/src/utils/urlUtils';
|
|
|
-import toneImage from '@/components/layout/images/toneImage.png';
|
|
|
import { px2vw } from '/src/utils';
|
|
|
import PlaceholderTone from '@/components/layout/modals/placeholderTone';
|
|
|
-import { state } from '/src/state';
|
|
|
-import { fscreen } from '@/utils/index';
|
|
|
import PreviewWindow from '../preview-window';
|
|
|
import UpdatePassword from '/src/components/layout/modals/update-password';
|
|
|
-import { state as globalState } from '/src/state';
|
|
|
+import AttendClass from '../prepare-lessons/model/attend-class';
|
|
|
+import { state } from '/src/state';
|
|
|
export const formatDateToDay = () => {
|
|
|
const hours = dayjs().hour();
|
|
|
if (hours < 12) {
|
|
@@ -86,8 +61,7 @@ export default defineComponent({
|
|
|
const showModalTone = ref(false);
|
|
|
const showModalTime = ref(false);
|
|
|
const forms = reactive({
|
|
|
- applyClassItem: {} as any, // 选择的内容
|
|
|
- applyStatus: false,
|
|
|
+ showAttendClass: false,
|
|
|
useStatus: false,
|
|
|
studentList: [] as any,
|
|
|
bookVersionId: null,
|
|
@@ -117,28 +91,6 @@ export default defineComponent({
|
|
|
|
|
|
// 学生列表
|
|
|
// getStdentList
|
|
|
- // 应用选择年级班级
|
|
|
- const onApplyConfirm = async (item: any) => {
|
|
|
- try {
|
|
|
- //
|
|
|
- const { data } = await getCLassStudent({
|
|
|
- page: 1,
|
|
|
- rows: 999,
|
|
|
- classGroupId: item.classGroupId
|
|
|
- });
|
|
|
-
|
|
|
- const temps = data.rows || [];
|
|
|
- temps.forEach((row: any) => {
|
|
|
- forms.studentList.push({
|
|
|
- name: row.nickname,
|
|
|
- src: row.avatar
|
|
|
- });
|
|
|
- });
|
|
|
- forms.applyClassItem = item;
|
|
|
- } catch {
|
|
|
- //
|
|
|
- }
|
|
|
- };
|
|
|
|
|
|
const onUseConfirm = (item: any) => {
|
|
|
forms.classSelect = {
|
|
@@ -149,71 +101,6 @@ export default defineComponent({
|
|
|
|
|
|
getCourseSchedulePage();
|
|
|
};
|
|
|
- const throttledFn = useThrottleFn(() => getLessonCourseware(), 500);
|
|
|
- const getLessonCourseware = async () => {
|
|
|
- forms.category = null;
|
|
|
- forms.unit = null;
|
|
|
- forms.category = null;
|
|
|
- forms.loading = true;
|
|
|
-
|
|
|
- try {
|
|
|
- const { data } = await lessonCoursewarePage({
|
|
|
- bookVersionId: forms.bookVersionId,
|
|
|
- enableFlag: 1,
|
|
|
- page: 1,
|
|
|
- rows: 99,
|
|
|
- type: 'COURSEWARE'
|
|
|
- // currentGradeNum: forms.applyClassItem.currentGradeNum
|
|
|
- });
|
|
|
-
|
|
|
- forms.list = data.rows.map((item: any) => {
|
|
|
- return {
|
|
|
- label: item.name,
|
|
|
- value: item.id
|
|
|
- };
|
|
|
- });
|
|
|
- } catch {
|
|
|
- //
|
|
|
- }
|
|
|
-
|
|
|
- forms.loading = false;
|
|
|
- };
|
|
|
-
|
|
|
- const getunitList = async () => {
|
|
|
- forms.unit = null;
|
|
|
- try {
|
|
|
- if (forms.category) {
|
|
|
- const res = await getCourseChapter(forms.category);
|
|
|
- forms.unitList = res.data.lessonList.map((item: any) => {
|
|
|
- return { ...item, label: item.name, value: item.id };
|
|
|
- });
|
|
|
- } else {
|
|
|
- forms.unitList = [];
|
|
|
- }
|
|
|
- } catch (e) {
|
|
|
- console.log(e);
|
|
|
- }
|
|
|
- };
|
|
|
- const getVersion = async () => {
|
|
|
- forms.unit = null;
|
|
|
-
|
|
|
- try {
|
|
|
- const { data } = await bookVersionPage({
|
|
|
- page: 1,
|
|
|
- rows: 99,
|
|
|
- type: 'COURSEWARE'
|
|
|
- });
|
|
|
- const temp = data.rows || [];
|
|
|
- temp.forEach((item: any) => {
|
|
|
- forms.musicTagList.push({
|
|
|
- id: item.id,
|
|
|
- name: item.name
|
|
|
- });
|
|
|
- });
|
|
|
- } catch {
|
|
|
- //
|
|
|
- }
|
|
|
- };
|
|
|
|
|
|
// 获取年级班级
|
|
|
const getClassList = async () => {
|
|
@@ -317,7 +204,6 @@ export default defineComponent({
|
|
|
value: item.id
|
|
|
};
|
|
|
});
|
|
|
- getVersion();
|
|
|
|
|
|
if (!userStore.getUserInfo.account.updatePasswordFlag) {
|
|
|
showUpdatePassword.value = true;
|
|
@@ -326,60 +212,56 @@ export default defineComponent({
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- const formsRef = ref();
|
|
|
- const gotoClassPage = () => {
|
|
|
- formsRef.value.validate(async (error: any) => {
|
|
|
- if (error) return;
|
|
|
- try {
|
|
|
- const { data } = await queryCourseware({
|
|
|
- coursewareDetailKnowledgeId: forms.unit,
|
|
|
- subjectId: forms.subjectId,
|
|
|
- page: 1,
|
|
|
- rows: 99
|
|
|
- });
|
|
|
- if (data.rows && data.rows.length > 0) {
|
|
|
- const res = await courseScheduleStart({
|
|
|
- lessonCoursewareKnowledgeDetailId: forms.unit,
|
|
|
- classGroupId: forms.applyClassItem?.classGroupId
|
|
|
- });
|
|
|
-
|
|
|
- if (window.matchMedia('(display-mode: standalone)').matches) {
|
|
|
- forms.showPreview = true;
|
|
|
- forms.itemPreview = {
|
|
|
- type: 'class',
|
|
|
- classId: res.data, // 上课编号
|
|
|
- lessonCourseId: forms.category,
|
|
|
- classGroupId: forms.applyClassItem?.classGroupId,
|
|
|
- subjectId: forms.subjectId,
|
|
|
- detailId: forms.unit
|
|
|
- };
|
|
|
- globalState.application = window.matchMedia(
|
|
|
- '(display-mode: standalone)'
|
|
|
- ).matches;
|
|
|
- // 加全屏
|
|
|
- fscreen();
|
|
|
- } else {
|
|
|
- const { href } = router.resolve({
|
|
|
- path: '/attend-class',
|
|
|
- query: {
|
|
|
- type: 'class',
|
|
|
- classId: res.data, // 上课编号
|
|
|
- lessonCourseId: forms.category,
|
|
|
- classGroupId: forms.applyClassItem?.classGroupId,
|
|
|
- subjectId: forms.subjectId,
|
|
|
- detailId: forms.unit
|
|
|
- }
|
|
|
- });
|
|
|
- window.open(href, +new Date() + '');
|
|
|
- }
|
|
|
- } else {
|
|
|
- message.error('当前章节暂无课件,请重新选择');
|
|
|
- }
|
|
|
- } catch {
|
|
|
- //
|
|
|
- }
|
|
|
- });
|
|
|
- };
|
|
|
+ // const formsRef = ref();
|
|
|
+ // const gotoClassPage = () => {
|
|
|
+ // formsRef.value.validate(async (error: any) => {
|
|
|
+ // if (error) return;
|
|
|
+ // try {
|
|
|
+ // const { data } = await queryCourseware({
|
|
|
+ // coursewareDetailKnowledgeId: forms.unit,
|
|
|
+ // subjectId: forms.subjectId,
|
|
|
+ // page: 1,
|
|
|
+ // rows: 99
|
|
|
+ // });
|
|
|
+ // if (data.rows && data.rows.length > 0) {
|
|
|
+ // await courseScheduleStart({
|
|
|
+ // lessonCoursewareKnowledgeDetailId: forms.unit,
|
|
|
+ // classGroupId: forms.applyClassItem?.classGroupId
|
|
|
+ // });
|
|
|
+
|
|
|
+ // if (window.matchMedia('(display-mode: standalone)').matches) {
|
|
|
+ // forms.showPreview = true;
|
|
|
+ // forms.itemPreview = {
|
|
|
+ // type: 'class',
|
|
|
+ // classGroupId: forms.applyClassItem?.classGroupId,
|
|
|
+ // subjectId: forms.subjectId,
|
|
|
+ // detailId: forms.unit
|
|
|
+ // };
|
|
|
+ // globalState.application = window.matchMedia(
|
|
|
+ // '(display-mode: standalone)'
|
|
|
+ // ).matches;
|
|
|
+ // // 加全屏
|
|
|
+ // fscreen();
|
|
|
+ // } else {
|
|
|
+ // const { href } = router.resolve({
|
|
|
+ // path: '/attend-class',
|
|
|
+ // query: {
|
|
|
+ // type: 'class',
|
|
|
+ // classGroupId: forms.applyClassItem?.classGroupId,
|
|
|
+ // subjectId: forms.subjectId,
|
|
|
+ // detailId: forms.unit
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // window.open(href, +new Date() + '');
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // message.error('当前章节暂无课件,请重新选择');
|
|
|
+ // }
|
|
|
+ // } catch {
|
|
|
+ // //
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // };
|
|
|
const clearStorng = () => {
|
|
|
localStorage.removeItem('teacher-guideInfo');
|
|
|
forms.showGuide = false;
|
|
@@ -392,24 +274,6 @@ export default defineComponent({
|
|
|
<div class={styles.homeWrap}>
|
|
|
<div class={styles.homeInfoLeft}>
|
|
|
<div class={styles.homeBanner}>
|
|
|
- {/* <div class={styles.welcomeInfo}>
|
|
|
- <div class={styles.userInfo}>
|
|
|
- <div class={styles.userName}>
|
|
|
- Hi,{userStore.getUserInfo?.nickname} {formatDateToDay()}~
|
|
|
- </div>
|
|
|
- <div class={styles.userTime}>
|
|
|
- {dayjs().format('MM月DD日')},{weekToCN[dayjs().day()]}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class={styles.userTips}>
|
|
|
- <span>欢迎您使用酷乐秀课堂乐器数字化教学平台!</span>
|
|
|
- <NButton color="#40A1FF" round class={styles.guide_btn} {...{id:'home-1'}} onClick={()=>clearStorng()}>
|
|
|
- 功能引导
|
|
|
- <i></i>
|
|
|
- </NButton>
|
|
|
- </div>
|
|
|
- </div> */}
|
|
|
- {/* <div class={styles.centerInfo}>11111</div> */}
|
|
|
<div class={styles.applyInfo} id="home-1">
|
|
|
<div class={styles.centerInfo} id="home-0"></div>
|
|
|
|
|
@@ -417,9 +281,6 @@ export default defineComponent({
|
|
|
<div class={styles.userName}>
|
|
|
Hi,{userStore.getUserInfo?.nickname} {formatDateToDay()}~
|
|
|
</div>
|
|
|
- {/* <div class={styles.userTime}>
|
|
|
- {dayjs().format('MM月DD日')},{weekToCN[dayjs().day()]}
|
|
|
- </div> */}
|
|
|
</div>
|
|
|
{userStore.getUserInfo.gender === 1 ? (
|
|
|
<img src={teacherMan} class={styles.teacherMan} />
|
|
@@ -431,154 +292,29 @@ export default defineComponent({
|
|
|
<img src={blackBoardBg} class={styles.blackBoardBg} />
|
|
|
</div>
|
|
|
<div class={styles.applyContainer}>
|
|
|
- <div class={styles.applyTitle}>
|
|
|
- <span
|
|
|
- class={styles.className}
|
|
|
- onClick={() => (forms.applyStatus = true)}>
|
|
|
- {forms.applyClassItem.name || '请选择班级'}
|
|
|
- </span>
|
|
|
- <NAvatarGroup options={forms.studentList} max={5} />
|
|
|
+ <div class={[styles.applyItem, styles.applyItem1]}>
|
|
|
+ <p>可根据声部进行备课,更好的规划教学哦~</p>
|
|
|
+ <div
|
|
|
+ class={[styles.applyBtn, styles.applyBtn1]}
|
|
|
+ onClick={() => {
|
|
|
+ // 备课
|
|
|
+ router.push({
|
|
|
+ path: '/prepare-lessons'
|
|
|
+ });
|
|
|
+ }}>
|
|
|
+ <img src={homeText1} />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class={styles.informations}>
|
|
|
- {forms.applyClassItem.lastStudy ? (
|
|
|
- <>
|
|
|
- <span style="flex-shrink: 0;">上次课程:</span>
|
|
|
- <TheNoticeBar text={forms.applyClassItem.lastStudy} />
|
|
|
- </>
|
|
|
- ) : (
|
|
|
- ''
|
|
|
- )}
|
|
|
+ <div class={[styles.applyItem, styles.applyItem2]}>
|
|
|
+ <p>点击这里,选择班级快速进入备课区域</p>
|
|
|
+ <div
|
|
|
+ class={[styles.applyBtn, styles.applyBtn2]}
|
|
|
+ onClick={() => {
|
|
|
+ forms.showAttendClass = true;
|
|
|
+ }}>
|
|
|
+ <img src={homeText2} />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
-
|
|
|
- <NForm showLabel={false} ref={formsRef} model={forms}>
|
|
|
- <NFormItem
|
|
|
- path="bookVersionId"
|
|
|
- rule={[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '',
|
|
|
- trigger: ['blur', 'change']
|
|
|
- }
|
|
|
- ]}>
|
|
|
- <div class={styles.selectContainer}>
|
|
|
- <img src={iconLession} />
|
|
|
- <NSelect
|
|
|
- placeholder="请选择教材版本"
|
|
|
- disabled={
|
|
|
- forms.applyClassItem?.currentGradeNum ? false : true
|
|
|
- }
|
|
|
- clearable
|
|
|
- options={[...forms.musicTagList]}
|
|
|
- labelField="name"
|
|
|
- valueField="id"
|
|
|
- v-model:value={forms.bookVersionId}
|
|
|
- onUpdate:value={() => throttledFn()}
|
|
|
- />
|
|
|
- </div>
|
|
|
- </NFormItem>
|
|
|
- <NFormItem
|
|
|
- path="category"
|
|
|
- rule={[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '',
|
|
|
- trigger: ['blur', 'change']
|
|
|
- }
|
|
|
- ]}>
|
|
|
- <div class={styles.selectContainer}>
|
|
|
- <img src={iconBook} />
|
|
|
- <NSelect
|
|
|
- placeholder="请选择册别"
|
|
|
- options={[...forms.list]}
|
|
|
- clearable
|
|
|
- disabled={!forms.bookVersionId}
|
|
|
- v-model:value={forms.category}
|
|
|
- onUpdate:value={() => getunitList()}
|
|
|
- />
|
|
|
- </div>
|
|
|
- </NFormItem>
|
|
|
- <NFormItem
|
|
|
- path="unit"
|
|
|
- rule={[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '',
|
|
|
- trigger: ['blur', 'change']
|
|
|
- }
|
|
|
- ]}>
|
|
|
- <div class={styles.selectContainer}>
|
|
|
- <img src={iconDetail} />
|
|
|
- <NCascader
|
|
|
- disabled={!forms.category}
|
|
|
- {...({
|
|
|
- options: [...forms.unitList],
|
|
|
- placeholder: '选择章节',
|
|
|
- clearable: true
|
|
|
- } as any)}
|
|
|
- childrenField="knowledgeList"
|
|
|
- valueField="id"
|
|
|
- labelField="name"
|
|
|
- v-model:value={forms.unit}
|
|
|
- checkStrategy="child"
|
|
|
- expandTrigger="hover"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </NFormItem>
|
|
|
- <NFormItem
|
|
|
- path="subjectId"
|
|
|
- rule={[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '',
|
|
|
- trigger: ['blur', 'change'],
|
|
|
- type: 'number'
|
|
|
- }
|
|
|
- ]}>
|
|
|
- <div class={styles.selectContainer}>
|
|
|
- <img src={iconSubject} />
|
|
|
- <NSelect
|
|
|
- {...({
|
|
|
- options: [...forms.subjectList],
|
|
|
- placeholder: '选择乐器',
|
|
|
- clearable: true
|
|
|
- } as any)}
|
|
|
- v-model:value={forms.subjectId}
|
|
|
- />
|
|
|
- </div>
|
|
|
- </NFormItem>
|
|
|
- <NSpace class={styles.btnGroup} justify="center">
|
|
|
- <NButton
|
|
|
- round
|
|
|
- block
|
|
|
- class={styles.startClass}
|
|
|
- color="#FF6E4C"
|
|
|
- onClick={gotoClassPage}>
|
|
|
- 开始上课
|
|
|
- </NButton>
|
|
|
- <NButton
|
|
|
- round
|
|
|
- block
|
|
|
- class={styles.beforClass}
|
|
|
- color="#5B64D1"
|
|
|
- onClick={() => {
|
|
|
- // 携带默认数据显示
|
|
|
- formsRef.value.validate(async (error: any) => {
|
|
|
- if (error) return;
|
|
|
-
|
|
|
- router.push({
|
|
|
- path: '/prepare-lessons',
|
|
|
- query: {
|
|
|
- lastUseCoursewareId: forms.category,
|
|
|
- unit: forms.unit,
|
|
|
- subjectId: forms.subjectId
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- }}>
|
|
|
- 去备课
|
|
|
- </NButton>
|
|
|
- </NSpace>
|
|
|
- </NForm>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -728,25 +464,6 @@ export default defineComponent({
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- {/* 添加自定义教材 */}
|
|
|
- <NModal
|
|
|
- v-model:show={forms.applyStatus}
|
|
|
- preset="card"
|
|
|
- showIcon={false}
|
|
|
- class={['modalTitle background', styles.assignHomework]}
|
|
|
- title={'选择班级'}
|
|
|
- blockScroll={false}>
|
|
|
- <SelectClass
|
|
|
- useDetail={{
|
|
|
- currentGradeNum: forms.applyClassItem.currentGradeNum,
|
|
|
- classGroupId: forms.applyClassItem.classGroupId
|
|
|
- }}
|
|
|
- gradeList={forms.gradeList}
|
|
|
- onConfirm={(item: any) => onApplyConfirm(item)}
|
|
|
- onClose={() => (forms.applyStatus = false)}
|
|
|
- />
|
|
|
- </NModal>
|
|
|
-
|
|
|
<NModal
|
|
|
v-model:show={forms.useStatus}
|
|
|
preset="card"
|
|
@@ -835,6 +552,27 @@ export default defineComponent({
|
|
|
}}
|
|
|
/>
|
|
|
</NModal>
|
|
|
+
|
|
|
+ <NModal
|
|
|
+ v-model:show={forms.showAttendClass}
|
|
|
+ preset="card"
|
|
|
+ showIcon={false}
|
|
|
+ class={['modalTitle background', styles.attendClassModal]}
|
|
|
+ title={'选择班级'}
|
|
|
+ blockScroll={false}>
|
|
|
+ <AttendClass
|
|
|
+ onClose={() => (forms.showAttendClass = false)}
|
|
|
+ type="change"
|
|
|
+ onConfirm={(item: any) => {
|
|
|
+ router.push({
|
|
|
+ path: '/prepare-lessons',
|
|
|
+ query: {
|
|
|
+ ...item
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </NModal>
|
|
|
</div>
|
|
|
);
|
|
|
}
|