|
@@ -109,15 +109,23 @@ export default defineComponent({
|
|
|
const cList = data || [];
|
|
|
const gradeList: any = [];
|
|
|
const popSelectOptions: any = [];
|
|
|
+ // getLastClassRecode()
|
|
|
cList.forEach((item: any, index: number) => {
|
|
|
- if (index === 0) {
|
|
|
- const temp = item.classGroupList[0];
|
|
|
- forms.classSelect = {
|
|
|
- currentGradeNum: item.currentGradeNum,
|
|
|
- currentClass: temp.id,
|
|
|
- name: temp.name
|
|
|
- };
|
|
|
- }
|
|
|
+ // if (index === 0) {
|
|
|
+ // const temp = item.classGroupList[0];
|
|
|
+
|
|
|
+ // if(forms.classSelect.currentClass){
|
|
|
+ // return
|
|
|
+ // }else{
|
|
|
+ // forms.classSelect = {
|
|
|
+ // currentGradeNum: item.currentGradeNum,
|
|
|
+ // currentClass: temp.id,
|
|
|
+ // name: temp.name
|
|
|
+ // };
|
|
|
+ // console.log(forms.classSelect.currentClass,'getClassList')
|
|
|
+ // }
|
|
|
+
|
|
|
+ // }
|
|
|
|
|
|
const classList: any = [];
|
|
|
item.classGroupList.forEach((i: any) => {
|
|
@@ -147,6 +155,18 @@ export default defineComponent({
|
|
|
//
|
|
|
}
|
|
|
};
|
|
|
+ const getLastClassRecode = async ()=>{
|
|
|
+ const { data } = await courseSchedulePage({
|
|
|
+ page: 1,
|
|
|
+ rows: 1,
|
|
|
+ teacherId: userStore.getUserInfo.id
|
|
|
+ });
|
|
|
+ if(data.rows.length >0 && data.rows[0]){
|
|
|
+ forms.classSelect.currentClass = data.rows[0].classGroupId;
|
|
|
+ forms.classSelect.name = data.rows[0].classGroupName;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
const getCourseSchedulePage = async () => {
|
|
|
forms.classLoading = true;
|
|
@@ -194,7 +214,7 @@ export default defineComponent({
|
|
|
|
|
|
onMounted(async () => {
|
|
|
await getClassList();
|
|
|
-
|
|
|
+ await getLastClassRecode()
|
|
|
await catchStore.getSubjects();
|
|
|
|
|
|
await getCourseSchedulePage();
|
|
@@ -399,7 +419,6 @@ export default defineComponent({
|
|
|
options={forms.popSelectOptions}
|
|
|
trigger="click"
|
|
|
onUpdate:value={(val: any) => {
|
|
|
- console.log(val, '1212');
|
|
|
forms.popSelectOptions.forEach((item: any) => {
|
|
|
if (item.value === val) {
|
|
|
forms.classSelect = {
|