| | |
| | | capacity: this.tableData.pagination.pageSize, |
| | | model: this.buildSearchModel() |
| | | }).then(data => { |
| | | this.tableData.list = data.records |
| | | this.tableData.pagination.total = data.total |
| | | }).catch(() => {}).finally(() => { this.isWorking.search = false }) |
| | | this.tableData.list = (data && data.records) || [] |
| | | this.tableData.pagination.total = (data && data.total) || 0 |
| | | }).catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }).finally(() => { this.isWorking.search = false }) |
| | | }, |
| | | search () { |
| | | this.tableData.pagination.pageIndex = 1 |
| | | this.loadList() |
| | | }, |
| | | handleSizeChange (size) { |
| | | this.tableData.pagination.pageSize = size |
| | | this.loadList() |
| | | }, |
| | | buildSearchModel () { |
| | | const model = {} |
| | | if (this.searchForm.nameKeyword) model.nameKeyword = this.searchForm.nameKeyword |