Commit fce017221da4d3951af62541d37346f1ec8d61e9
1 parent
12ff398d
懒加载
Showing
1 changed file
with
27 additions
and
1 deletions
src/components/InfoForm/index.vue
| ... | ... | @@ -34,9 +34,13 @@ |
| 34 | 34 | clearable |
| 35 | 35 | style="width: 100%" |
| 36 | 36 | @change="companyChange" |
| 37 | + v-selectLoadMore="initCompanyList" | |
| 38 | + :loading="name_loading" | |
| 39 | + :teleported="false" | |
| 40 | + :filter-method="filterMethod" | |
| 37 | 41 | > |
| 38 | 42 | <el-option |
| 39 | - v-for="item in companyOptions" | |
| 43 | + v-for="item in companyOptions.slice(0, company_currentPage)" | |
| 40 | 44 | :key="item.id" |
| 41 | 45 | :label="item.companyName" |
| 42 | 46 | :value="item.id" |
| ... | ... | @@ -427,6 +431,8 @@ export default { |
| 427 | 431 | areaOptions: [], |
| 428 | 432 | btnLoading: false, |
| 429 | 433 | isFilings: false, |
| 434 | + company_currentPage: 20, | |
| 435 | + name_loading: false, | |
| 430 | 436 | }; |
| 431 | 437 | }, |
| 432 | 438 | computed: { |
| ... | ... | @@ -442,6 +448,24 @@ export default { |
| 442 | 448 | mounted() {}, |
| 443 | 449 | created() {}, |
| 444 | 450 | methods: { |
| 451 | + initCompanyList() { | |
| 452 | + if(this.company_currentPage > this.companyOptions.length) return | |
| 453 | + this.company_currentPage += 10; | |
| 454 | + }, | |
| 455 | + filterMethod(val) { | |
| 456 | + this.name_loading = true; | |
| 457 | + request({ | |
| 458 | + url: `/Extend/basecomapnyinfo/GetNoPagingList`, | |
| 459 | + method: "GET", | |
| 460 | + params: { | |
| 461 | + companyName: val, | |
| 462 | + } | |
| 463 | + }).then(({data}) => { | |
| 464 | + this.companyOptions = data; | |
| 465 | + this.name_loading = false; | |
| 466 | + | |
| 467 | + }) | |
| 468 | + }, | |
| 445 | 469 | handleAvatarSuccess(response, file, fileList) { |
| 446 | 470 | if(response.code != 200) return; |
| 447 | 471 | this.infoForm.systemIconModel = { |
| ... | ... | @@ -458,11 +482,13 @@ export default { |
| 458 | 482 | }, |
| 459 | 483 | // 请求公司列表 |
| 460 | 484 | async initCompanyList() { |
| 485 | + this.name_loading = true; | |
| 461 | 486 | request({ |
| 462 | 487 | url: `/Extend/basecomapnyinfo/GetNoPagingList`, |
| 463 | 488 | method: "GET", |
| 464 | 489 | }).then(({data}) => { |
| 465 | 490 | this.companyOptions = data; |
| 491 | + this.name_loading = false; | |
| 466 | 492 | }) |
| 467 | 493 | }, |
| 468 | 494 | async companyChange(val) { | ... | ... |