From 2b698813be826bbea8e2907181b9003e09f65a30 Mon Sep 17 00:00:00 2001 From: xialiang <1818147@qq.com> Date: Mon, 21 Feb 2022 09:17:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../analysis/components/IntroduceRow.tsx | 56 +++++++++++-------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/admin/src/pages/history/analysis/components/IntroduceRow.tsx b/admin/src/pages/history/analysis/components/IntroduceRow.tsx index a6b5e55..67f8748 100644 --- a/admin/src/pages/history/analysis/components/IntroduceRow.tsx +++ b/admin/src/pages/history/analysis/components/IntroduceRow.tsx @@ -92,29 +92,37 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat } + let timeout: NodeJS.Timeout | null; + + const getSchoolData = async (e, callback) => { + + // timeout = setTimeout(async () => { + try { + schoolData = await getEduUnitList({ + random_num: 277470, + area_id: provinceId, + edu_type: -1, + // main_school_id: 200125116, + org_name: e, + org_type: 2, + pageNumber: 1, + pageSize: 1000, + school_type: -1, + showPassWord: true, + }).then((e) => { + callback(e.table_List) + console.log(e.table_List); + setSchoolList(e.table_List || []) + + }); + } catch (error) { + // error.message; // "Oops!" + } + + // }, 500); + + // console.log(schoolList, 'schoolList 1'); - const getSchoolData = async (e) => { - console.log(e) - - - console.log(form.getFieldsValue('school'), 'school') - // try { - // schoolData = await getEduUnitList({ - // random_num: 277470, - // area_id: provinceId, - // edu_type: -1, - // // main_school_id: 200125116, - // org_name: e, - // org_type: 2, - // pageNumber: 1, - // pageSize: 1000, - // school_type: -1, - // showPassWord: true, - // }).then(); - // setSchoolList(schoolData || []) - // } catch (error) { - // // error.message; // "Oops!" - // } } @@ -186,14 +194,14 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat filterOption={true} // onSearch={this.handleSearch} // onChange={getSchoolData} - + fieldNames={{ value: "ORG_ID", label: "ORG_NAME" }} onSearch={(value) => getSchoolData(value)} notFoundContent={null} options={schoolList} /> - {console.log(schoolList, 'schoolList')} + {console.log(schoolList, 'schoolList111')}