|  | @@ -26,6 +26,8 @@ import TheEmpty from '/src/components/TheEmpty';
 | 
	
		
			
				|  |  |  import { useUserStore } from '/src/store/modules/users';
 | 
	
		
			
				|  |  |  import UpdateStudent from './modals/update-student';
 | 
	
		
			
				|  |  |  import { initCache, setCache } from '/src/hooks/use-async';
 | 
	
		
			
				|  |  | +import { classArray, getgradeNumList } from '../classList/contants';
 | 
	
		
			
				|  |  | +import { getGradeLevelList, getGradeYearList } from '../home/api';
 | 
	
		
			
				|  |  |  export default defineComponent({
 | 
	
		
			
				|  |  |    name: 'student-studentList',
 | 
	
		
			
				|  |  |    setup(props, { emit }) {
 | 
	
	
		
			
				|  | @@ -35,8 +37,13 @@ export default defineComponent({
 | 
	
		
			
				|  |  |          keyword: '',
 | 
	
		
			
				|  |  |          gender: '' as any,
 | 
	
		
			
				|  |  |          classGroupId: '' as any,
 | 
	
		
			
				|  |  | -        membership: '' as any
 | 
	
		
			
				|  |  | +        membership: '' as any,
 | 
	
		
			
				|  |  | +        currentClass: '' as any,
 | 
	
		
			
				|  |  | +        currentGradeNum: '' as any,
 | 
	
		
			
				|  |  | +        gradeYear: '' as any,
 | 
	
		
			
				|  |  | +        gradeLevel: ''
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | +      gradeNumList: [] as any,
 | 
	
		
			
				|  |  |        searchWord: '',
 | 
	
		
			
				|  |  |        orchestraType: null,
 | 
	
		
			
				|  |  |        courseTypeCode: null,
 | 
	
	
		
			
				|  | @@ -53,8 +60,11 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        classList: [],
 | 
	
		
			
				|  |  |        addStudentVisible: false,
 | 
	
		
			
				|  |  |        editStatus: false,
 | 
	
		
			
				|  |  | -      activeRow: {} as any
 | 
	
		
			
				|  |  | +      activeRow: {} as any,
 | 
	
		
			
				|  |  | +      popSelectYearList: [] as any,
 | 
	
		
			
				|  |  | +      popSelectLevelList: [] as any
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  | +    state.gradeNumList = getgradeNumList();
 | 
	
		
			
				|  |  |      const route = useRoute();
 | 
	
		
			
				|  |  |      const router = useRouter();
 | 
	
		
			
				|  |  |      const showGuide = ref(false);
 | 
	
	
		
			
				|  | @@ -93,8 +103,15 @@ export default defineComponent({
 | 
	
		
			
				|  |  |          keyword: '',
 | 
	
		
			
				|  |  |          gender: '' as any,
 | 
	
		
			
				|  |  |          classGroupId: '' as any,
 | 
	
		
			
				|  |  | -        membership: '' as any
 | 
	
		
			
				|  |  | +        membership: '' as any,
 | 
	
		
			
				|  |  | +        currentClass: '' as any,
 | 
	
		
			
				|  |  | +        currentGradeNum: '' as any,
 | 
	
		
			
				|  |  | +        gradeYear: '' as any,
 | 
	
		
			
				|  |  | +        gradeLevel: ''
 | 
	
		
			
				|  |  |        };
 | 
	
		
			
				|  |  | +      if (state.popSelectYearList.length > 0) {
 | 
	
		
			
				|  |  | +        state.searchForm.gradeYear = state.popSelectYearList[1].id;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |        search();
 | 
	
		
			
				|  |  |        setCache({ current: state.searchForm, saveKey: route.path });
 | 
	
		
			
				|  |  |      };
 | 
	
	
		
			
				|  | @@ -124,9 +141,54 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        console.log('getList');
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    onMounted(() => {
 | 
	
		
			
				|  |  | -      getList();
 | 
	
		
			
				|  |  | -      getClasslist();
 | 
	
		
			
				|  |  | +    // 获取学年
 | 
	
		
			
				|  |  | +    const getYearList = async () => {
 | 
	
		
			
				|  |  | +      try {
 | 
	
		
			
				|  |  | +        const { data } = await getGradeYearList();
 | 
	
		
			
				|  |  | +        const temp = data || [];
 | 
	
		
			
				|  |  | +        temp.forEach((i: any) => {
 | 
	
		
			
				|  |  | +          i.name = i.name + '学年';
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        temp.unshift({
 | 
	
		
			
				|  |  | +          id: '',
 | 
	
		
			
				|  |  | +          name: '全部学年'
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        state.popSelectYearList = temp || [];
 | 
	
		
			
				|  |  | +        if (temp.length > 0 && !state.searchForm.gradeYear) {
 | 
	
		
			
				|  |  | +          state.searchForm.gradeYear = temp[1].id;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      } catch {
 | 
	
		
			
				|  |  | +        //
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +    // 获取学级
 | 
	
		
			
				|  |  | +    const getLevelList = async () => {
 | 
	
		
			
				|  |  | +      try {
 | 
	
		
			
				|  |  | +        const { data } = await getGradeLevelList();
 | 
	
		
			
				|  |  | +        const temp = data || [];
 | 
	
		
			
				|  |  | +        temp.forEach((i: any) => {
 | 
	
		
			
				|  |  | +          i.name = i.name + '级';
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        temp.unshift({
 | 
	
		
			
				|  |  | +          id: '',
 | 
	
		
			
				|  |  | +          name: '全部学级'
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        state.popSelectLevelList = temp || [];
 | 
	
		
			
				|  |  | +        if (temp.length > 0 && !state.searchForm.gradeLevel) {
 | 
	
		
			
				|  |  | +          state.searchForm.gradeLevel = temp[0].id;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      } catch {
 | 
	
		
			
				|  |  | +        //
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    onMounted(async () => {
 | 
	
		
			
				|  |  | +      state.loading = true;
 | 
	
		
			
				|  |  | +      await getYearList();
 | 
	
		
			
				|  |  | +      await getLevelList();
 | 
	
		
			
				|  |  | +      await getList();
 | 
	
		
			
				|  |  | +      await getClasslist();
 | 
	
		
			
				|  |  | +      state.loading = false;
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |      const columns = () => {
 | 
	
		
			
				|  |  |        return [
 | 
	
	
		
			
				|  | @@ -247,6 +309,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |                <SearchInput
 | 
	
		
			
				|  |  |                  {...{ placeholder: '请输入学生姓名' }}
 | 
	
		
			
				|  |  |                  class={styles.searchInput}
 | 
	
		
			
				|  |  | +                style={{ width: '160px' }}
 | 
	
		
			
				|  |  |                  searchWord={state.searchForm.keyword}
 | 
	
		
			
				|  |  |                  onChangeValue={(val: string) =>
 | 
	
		
			
				|  |  |                    (state.searchForm.keyword = val)
 | 
	
	
		
			
				|  | @@ -279,6 +342,51 @@ export default defineComponent({
 | 
	
		
			
				|  |  |              <NFormItem>
 | 
	
		
			
				|  |  |                <CSelect
 | 
	
		
			
				|  |  |                  {...({
 | 
	
		
			
				|  |  | +                  options: state.popSelectYearList,
 | 
	
		
			
				|  |  | +                  placeholder: '选择学年',
 | 
	
		
			
				|  |  | +                  clearable: true,
 | 
	
		
			
				|  |  | +                  inline: true,
 | 
	
		
			
				|  |  | +                  labelField: 'name',
 | 
	
		
			
				|  |  | +                  valueField: 'id'
 | 
	
		
			
				|  |  | +                } as any)}
 | 
	
		
			
				|  |  | +                v-model:value={state.searchForm.gradeYear}></CSelect>
 | 
	
		
			
				|  |  | +            </NFormItem>
 | 
	
		
			
				|  |  | +            <NFormItem>
 | 
	
		
			
				|  |  | +              <CSelect
 | 
	
		
			
				|  |  | +                {...({
 | 
	
		
			
				|  |  | +                  options: state.popSelectLevelList,
 | 
	
		
			
				|  |  | +                  placeholder: '选择学级',
 | 
	
		
			
				|  |  | +                  clearable: true,
 | 
	
		
			
				|  |  | +                  inline: true,
 | 
	
		
			
				|  |  | +                  labelField: 'name',
 | 
	
		
			
				|  |  | +                  valueField: 'id'
 | 
	
		
			
				|  |  | +                } as any)}
 | 
	
		
			
				|  |  | +                v-model:value={state.searchForm.gradeLevel}></CSelect>
 | 
	
		
			
				|  |  | +            </NFormItem>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            <NFormItem>
 | 
	
		
			
				|  |  | +              <CSelect
 | 
	
		
			
				|  |  | +                {...({
 | 
	
		
			
				|  |  | +                  options: state.gradeNumList,
 | 
	
		
			
				|  |  | +                  placeholder: '选择年级',
 | 
	
		
			
				|  |  | +                  clearable: true,
 | 
	
		
			
				|  |  | +                  inline: true
 | 
	
		
			
				|  |  | +                } as any)}
 | 
	
		
			
				|  |  | +                v-model:value={state.searchForm.currentGradeNum}></CSelect>
 | 
	
		
			
				|  |  | +            </NFormItem>
 | 
	
		
			
				|  |  | +            <NFormItem>
 | 
	
		
			
				|  |  | +              <CSelect
 | 
	
		
			
				|  |  | +                {...({
 | 
	
		
			
				|  |  | +                  options: classArray,
 | 
	
		
			
				|  |  | +                  placeholder: '选择班级',
 | 
	
		
			
				|  |  | +                  clearable: true,
 | 
	
		
			
				|  |  | +                  inline: true
 | 
	
		
			
				|  |  | +                } as any)}
 | 
	
		
			
				|  |  | +                v-model:value={state.searchForm.currentClass}></CSelect>
 | 
	
		
			
				|  |  | +            </NFormItem>
 | 
	
		
			
				|  |  | +            {/* <NFormItem>
 | 
	
		
			
				|  |  | +              <CSelect
 | 
	
		
			
				|  |  | +                {...({
 | 
	
		
			
				|  |  |                    options: [
 | 
	
		
			
				|  |  |                      { label: '全部年级班级', value: '' },
 | 
	
		
			
				|  |  |                      ...state.classList
 | 
	
	
		
			
				|  | @@ -288,7 +396,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |                    inline: true
 | 
	
		
			
				|  |  |                  } as any)}
 | 
	
		
			
				|  |  |                  v-model:value={state.searchForm.classGroupId}></CSelect>
 | 
	
		
			
				|  |  | -            </NFormItem>
 | 
	
		
			
				|  |  | +            </NFormItem> */}
 | 
	
		
			
				|  |  |              <NFormItem>
 | 
	
		
			
				|  |  |                <CSelect
 | 
	
		
			
				|  |  |                  {...({
 |