Browse Source

fix: change enter

DESKTOP-USV654P\pc 2 months ago
parent
commit
e371375806
2 changed files with 28 additions and 14 deletions
  1. 1 1
      Makefile
  2. 27 13
      src/views/educational/studentScore/enter/data.config.ts

+ 1 - 1
Makefile

@@ -12,7 +12,7 @@ build:
 
 commit:
 	git add . && \
-	git commit --no-verify -m "fix: change score "
+	git commit --no-verify -m "fix: change enter "
 
 checkPre:
 	git checkout pre

+ 27 - 13
src/views/educational/studentScore/enter/data.config.ts

@@ -116,19 +116,33 @@ export const formSchema: FormSchema[] = [
     field: 'semesterId',
     component: 'ApiSelect',
     required: true,
-    componentProps: {
-      getPopupContainer: () => document.body,
-      api: requestMagicApi,
-      params: {
-        url: '/baseData/semester/option',
-      },
-      showSearch: true,
-      filterOption: (input: string, option: any) => {
-        return (
-          option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
-          option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
-        );
-      },
+    componentProps: ({ formActionType }) => {
+      return {
+        getPopupContainer: () => document.body,
+        api: requestMagicApi,
+        params: {
+          url: '/baseData/semester/option',
+        },
+        showSearch: true,
+        filterOption: (input: string, option: any) => {
+          return (
+            option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
+            option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
+          );
+        },
+        onChange: async (value: any) => {
+          const { updateSchema } = formActionType;
+          const data = await getExamPlanPlanList({ semesterId: value });
+
+          updateSchema({
+            field: 'examPlanId',
+            component: 'Select',
+            componentProps: {
+              options: data.map((item) => ({ label: item.name, value: item.id })),
+            },
+          });
+        },
+      };
     },
     colProps: { span: 24 },
   },