|
@@ -17,6 +17,7 @@ import { useCatchStore } from '/src/store/modules/catchData';
|
|
|
import { getStudentList } from '/src/views/classList/api';
|
|
|
import { useThrottleFn } from '@vueuse/core';
|
|
|
import TheEmpty from '/src/components/TheEmpty';
|
|
|
+import { getGradeYearList } from '/src/views/home/api';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'assign-student',
|
|
@@ -26,6 +27,11 @@ export default defineComponent({
|
|
|
type: Array,
|
|
|
default: () => []
|
|
|
},
|
|
|
+ /** 学年 */
|
|
|
+ currentGradeNum: {
|
|
|
+ type: [String || Number],
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
selectIds: {
|
|
|
type: Array,
|
|
|
default: () => []
|
|
@@ -45,7 +51,8 @@ export default defineComponent({
|
|
|
checkAllStatus: false,
|
|
|
indeterminate: false,
|
|
|
searchFrom: {
|
|
|
- currentGradeNum: '',
|
|
|
+ currentGradeNum: props.currentGradeNum || '',
|
|
|
+ gradeYear: null,
|
|
|
classGroupId: props.classGroupId || '',
|
|
|
subjectId: '',
|
|
|
keyword: ''
|
|
@@ -58,9 +65,27 @@ export default defineComponent({
|
|
|
tableList: [] as any,
|
|
|
checkboxIds: [] as any,
|
|
|
selectStudents: [] as any,
|
|
|
- selectKeyword: ''
|
|
|
+ selectKeyword: '',
|
|
|
+ popSelectYearList: [] as any
|
|
|
});
|
|
|
|
|
|
+ // 获取学年
|
|
|
+ const getYearList = async () => {
|
|
|
+ try {
|
|
|
+ const { data } = await getGradeYearList();
|
|
|
+ const temp = data || [];
|
|
|
+ temp.forEach((i: any) => {
|
|
|
+ i.name = i.name + '学年';
|
|
|
+ });
|
|
|
+ state.popSelectYearList = temp || [];
|
|
|
+ if (temp.length > 0 && !state.searchFrom.gradeYear) {
|
|
|
+ state.searchFrom.gradeYear = temp[0].id;
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
const getStudentLists = async () => {
|
|
|
try {
|
|
|
if (state.pagination.page === 1) {
|
|
@@ -152,6 +177,7 @@ export default defineComponent({
|
|
|
state.checkboxIds = props.selectIds || [];
|
|
|
state.loading = true;
|
|
|
await catchStore.getSubjects();
|
|
|
+ await getYearList();
|
|
|
await getStudentLists();
|
|
|
onCheckStudents();
|
|
|
});
|