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