Browse Source

Merge branch 'feature-2025-1-10' into online

TIANYONG 4 days ago
parent
commit
98f98ace43
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/views/fill-questionnaire/index.tsx

+ 6 - 3
src/views/fill-questionnaire/index.tsx

@@ -469,7 +469,7 @@ export default defineComponent({
       // console.log(customText,999)
       return customText
     }
-    const getSchoolAreaList = async (name?: string) => {
+    const getSchoolAreaList = async (name?: string, isSearch?: boolean) => {
       forms.schoolLoading = true;
       try {
         const { data } = await request.post('/edu-app/open/schoolArea/list', {
@@ -481,6 +481,9 @@ export default defineComponent({
             regionCode: forms.districtCode
           }
         });
+        if (isSearch && data.length) {
+          forms.schoolPopupIndex = data[0].id ? [data[0].id] : [];
+        }
         forms.customSearchText = name || ''
         forms.schoolAreaList = data;
       } catch {
@@ -891,10 +894,10 @@ export default defineComponent({
                       <MSearch
                         placeholder="请输入学校名称"
                         onSearch={(val: any) => {
-                          getSchoolAreaList(val);
+                          getSchoolAreaList(val, true);
                         }}
                         onSearchUpdate={(val: any) => {
-                          getSchoolAreaList(val);
+                          getSchoolAreaList(val, true);
                         }}
                       />
                     </div>