|
@@ -1,4 +1,4 @@
|
|
|
-import { defineComponent, reactive } from 'vue';
|
|
|
+import { computed, defineComponent, reactive } from 'vue';
|
|
|
import styles from './index.module.less';
|
|
|
import {
|
|
|
NImage,
|
|
@@ -27,6 +27,9 @@ import t3 from './images/t3.png';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import { useUserStore } from '/src/store/modules/users';
|
|
|
import SelectClass from './modals/selectClass';
|
|
|
+import dayjs from 'dayjs';
|
|
|
+import { weekToCN } from '/src/utils/contants';
|
|
|
+import { getCLassStudent } from '../classList/api';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'home-page',
|
|
@@ -35,17 +38,55 @@ export default defineComponent({
|
|
|
const userStore = useUserStore();
|
|
|
const forms = reactive({
|
|
|
applyClass: null as any,
|
|
|
- applyStatus: false
|
|
|
+ applyClassItem: {} as any, // 选择的内容
|
|
|
+ applyStatus: false,
|
|
|
+ studentList: [] as any
|
|
|
});
|
|
|
|
|
|
+ // 显示选择的内容
|
|
|
+ const bookInfo = computed(() => {
|
|
|
+ return '';
|
|
|
+ });
|
|
|
+
|
|
|
+ // 学生列表
|
|
|
+ // 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
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ console.log(item, data);
|
|
|
+ forms.applyClass = item.currentGradeLabel + item.className;
|
|
|
+ forms.applyClassItem = item;
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ };
|
|
|
return () => (
|
|
|
<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,张老师 下午好~</div>
|
|
|
- <div class={styles.userTime}>7月4日,星期三</div>
|
|
|
+ <div class={styles.userName}>
|
|
|
+ Hi,{userStore.getUserInfo?.nickname} 下午好~
|
|
|
+ </div>
|
|
|
+ <div class={styles.userTime}>
|
|
|
+ {dayjs().format('MM月DD日')},{weekToCN[dayjs().day()]}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class={styles.userTips}>
|
|
|
<span>欢迎您使用酷乐秀课堂乐器数字化教学平台!</span>
|
|
@@ -71,43 +112,11 @@ export default defineComponent({
|
|
|
<span
|
|
|
class={styles.className}
|
|
|
onClick={() => (forms.applyStatus = true)}>
|
|
|
- 三年级2班
|
|
|
+ {forms.applyClass || '请选择班级'}
|
|
|
</span>
|
|
|
- <NAvatarGroup
|
|
|
- options={
|
|
|
- [
|
|
|
- {
|
|
|
- name: '张三',
|
|
|
- src: 'https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '李四',
|
|
|
- src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '王五',
|
|
|
- src: 'https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '赵六',
|
|
|
- src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '七仔',
|
|
|
- src: 'https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '七仔',
|
|
|
- src: 'https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg'
|
|
|
- }
|
|
|
- ] as any
|
|
|
- }
|
|
|
- max={5}
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class={styles.informations}>
|
|
|
- 人教版二年级上册 | 第1课 好朋友 |
|
|
|
+ <NAvatarGroup options={forms.studentList} max={5} />
|
|
|
</div>
|
|
|
+ <div class={styles.informations}>{bookInfo.value}</div>
|
|
|
|
|
|
<NForm showLabel={false}>
|
|
|
<NFormItem>
|
|
@@ -230,7 +239,10 @@ export default defineComponent({
|
|
|
class={['modalTitle background', styles.assignHomework]}
|
|
|
title={'选择年级'}
|
|
|
blockScroll={false}>
|
|
|
- <SelectClass onClose={() => (forms.applyStatus = false)} />
|
|
|
+ <SelectClass
|
|
|
+ onConfirm={(item: any) => onApplyConfirm(item)}
|
|
|
+ onClose={() => (forms.applyStatus = false)}
|
|
|
+ />
|
|
|
</NModal>
|
|
|
</div>
|
|
|
);
|