소스 검색

fix: change studentbaseInfo

DESKTOP-USV654P\pc 1 주 전
부모
커밋
b6b1108588
3개의 변경된 파일30개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      Makefile
  2. 19 0
      src/views/educational/stdudentBaseManager/components/config.ts
  3. 10 1
      src/views/educational/stdudentBaseManager/index.vue

+ 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) {