Browse Source

fix: change studentbaseInfo

DESKTOP-USV654P\pc 1 week ago
parent
commit
b6b1108588

+ 1 - 1
Makefile

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

+ 19 - 0
src/views/educational/stdudentBaseManager/components/config.ts

@@ -1,3 +1,4 @@
+import { requestMagicApi } from '/@/api/magicApi';
 import { FormProps, FormSchema } from '/@/components/Form';
 import { BasicColumn } from '/@/components/Table';
 
@@ -20,6 +21,24 @@ export const searchFormSchema: FormSchema[] = [
     component: 'Input',
     colProps: { span: 8 },
   },
+  {
+    field: 'gradeId',
+    label: '年级',
+    component: 'ApiSelect',
+    componentProps: {
+      getPopupContainer: () => document.body,
+      api: requestMagicApi,
+      params: { url: 'baseData/grade/option' },
+      showSearch: true,
+      filterOption: (input: string, option: any) => {
+        return (
+          option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
+          option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
+        );
+      },
+    },
+    colProps: { span: 8 },
+  },
   {
     field: 'email',
     label: '邮箱',

+ 10 - 1
src/views/educational/stdudentBaseManager/index.vue

@@ -189,6 +189,13 @@
       fieldMapToTime: [],
     },
     beforeFetch: (params) => {
+      if (params['gradeId']) {
+        // console.log('params', params);
+        searchInfo.treeId = '';
+        searchInfo.treeType = '';
+        delete params['treeId'];
+        delete params['treeType'];
+      }
       return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
     },
     useSearchForm: true,
@@ -221,9 +228,11 @@
   function handleDelete(record: Recordable) {
     deleteList([record.id]);
   }
-  const handleChange = (data) => {
+  const handleChange = async (data) => {
     searchInfo.treeId = data.id;
     searchInfo.treeType = data.type;
+
+    await getForm().setFieldsValue({ gradeId: '' });
     reload();
   };
   function deleteList(ids) {