Ver código fonte

fix: 企业名称组件修改

zhangying 11 meses atrás
pai
commit
a83820e5dc

+ 4 - 2
vue/src/plugins/antd.ts

@@ -21,7 +21,8 @@ import {
   Tree,
   Transfer, Image, Progress, List, Avatar, Badge, Spin, Pagination,
   Timeline,
-  Tag
+  Tag,
+  AutoComplete,
 } from 'ant-design-vue';
 import type { App } from 'vue';
 //导入组件库
@@ -72,5 +73,6 @@ export function setupAntd(app: App<Element>) {
     .use(Image)
     .use(Tree).use(Progress).use(List).use(Avatar).use(Badge).use(Spin).use(Pagination)
     .use(Timeline)
-    .use(Tag);
+    .use(Tag)
+    .use(AutoComplete);
 }

+ 9 - 18
vue/src/views/companyService/company/edit.vue

@@ -10,29 +10,20 @@
             name="companyName"
             :rules="[{ required: true, message: '请输入企业名称!' }]"
           >
-            <a-select
+            <a-auto-complete
               v-if="operationType == 'add'"
               v-model:value="dataModel.companyName"
-              :filter-option="false"
-              :not-found-content="firmNameFetching ? undefined : null"
-              show-search
-              :default-active-first-option="false"
-              :show-arrow="false"
-              :allow-clear="true"
-              placeholder="请输入企业名称"
               :options="firmList"
-              @search="likeFindFirm"
-              @change="normalFirm"
               :class="{'companyNameIpt': operationType == 'add'}"
+              placeholder="请输入企业名称"
               :field-names="{
-                label:'firmName',
-                value:'firmName',
-              }"
+                            label:'firmName',
+                            value:'firmName',
+                          }"
+              @select="normalFirm"
+              @search="likeFindFirm"
             >
-              <template v-if="firmNameFetching" #notFoundContent>
-                <a-spin size="small"/>
-              </template>
-            </a-select>
+            </a-auto-complete>
             <a-button v-if="operationType == 'add'" :loading="normalBtnLoading" style="margin-left: 10px"
                       :disabled="!dataModel.companyName"
                       @click="normalFirm">同步信息
@@ -733,7 +724,7 @@ export default defineComponent(
             }
           })
         }
-      }, 500)
+      }, 750)
 
       function workSituationChange() {
         if (formState.dataModel.workSituation) {