|
@@ -10,6 +10,7 @@ import { defineComponent, onMounted, reactive, ref, watch } from 'vue';
|
|
import styles from '../index.module.less';
|
|
import styles from '../index.module.less';
|
|
import CSelect from '/src/components/CSelect';
|
|
import CSelect from '/src/components/CSelect';
|
|
import { addClass, getConfiguredSubjects } from '../api';
|
|
import { addClass, getConfiguredSubjects } from '../api';
|
|
|
|
+import { api_getCurrentGradeYear } from '../../studentList/api';
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
props: {
|
|
props: {
|
|
activeRow: {
|
|
activeRow: {
|
|
@@ -43,6 +44,7 @@ export default defineComponent({
|
|
currentClass: null,
|
|
currentClass: null,
|
|
subjectId: null
|
|
subjectId: null
|
|
});
|
|
});
|
|
|
|
+ const gradeYearList = ref([] as any);
|
|
const subjectList = ref([] as any);
|
|
const subjectList = ref([] as any);
|
|
const submitForms = () => {
|
|
const submitForms = () => {
|
|
foemsRef.value.validate(async (error: any) => {
|
|
foemsRef.value.validate(async (error: any) => {
|
|
@@ -63,6 +65,25 @@ export default defineComponent({
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ const getYearList = async () => {
|
|
|
|
+ try {
|
|
|
|
+ const { data } = await api_getCurrentGradeYear({});
|
|
|
|
+ const temp = [
|
|
|
|
+ {
|
|
|
|
+ label: data + 1,
|
|
|
|
+ value: data + 1
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: data,
|
|
|
|
+ value: data
|
|
|
|
+ }
|
|
|
|
+ ];
|
|
|
|
+ gradeYearList.value = temp;
|
|
|
|
+ } catch {
|
|
|
|
+ //
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
const getConfigSubject = async () => {
|
|
const getConfigSubject = async () => {
|
|
try {
|
|
try {
|
|
const { data } = await getConfiguredSubjects({
|
|
const { data } = await getConfiguredSubjects({
|
|
@@ -94,6 +115,10 @@ export default defineComponent({
|
|
}
|
|
}
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ onMounted(() => {
|
|
|
|
+ getYearList();
|
|
|
|
+ });
|
|
|
|
+
|
|
return () => (
|
|
return () => (
|
|
<div class={[styles.addClass]}>
|
|
<div class={[styles.addClass]}>
|
|
<NForm label-placement="left" model={createClassForm} ref={foemsRef}>
|
|
<NForm label-placement="left" model={createClassForm} ref={foemsRef}>
|
|
@@ -108,11 +133,9 @@ export default defineComponent({
|
|
<CSelect
|
|
<CSelect
|
|
{...({
|
|
{...({
|
|
style: { width: '400px' },
|
|
style: { width: '400px' },
|
|
- options: props.gradeYearList,
|
|
|
|
|
|
+ options: gradeYearList.value,
|
|
placeholder: '选择学年',
|
|
placeholder: '选择学年',
|
|
- clearable: true,
|
|
|
|
- labelField: 'name',
|
|
|
|
- valueField: 'id'
|
|
|
|
|
|
+ clearable: true
|
|
} as any)}
|
|
} as any)}
|
|
v-model:value={createClassForm.gradeYear}></CSelect>
|
|
v-model:value={createClassForm.gradeYear}></CSelect>
|
|
</NFormItem>
|
|
</NFormItem>
|