|
@@ -156,7 +156,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 拉取列表 |
|
|
// 拉取列表 |
|
|
async fetchList() { |
|
|
|
|
|
|
|
|
async fetchList(isConcat=true) { |
|
|
if (this.page > this.total) { return } |
|
|
if (this.page > this.total) { return } |
|
|
|
|
|
|
|
|
const result = await this.HTTP_GET( |
|
|
const result = await this.HTTP_GET( |
|
@@ -174,19 +174,19 @@ export default { |
|
|
|
|
|
|
|
|
this.total = result.total |
|
|
this.total = result.total |
|
|
this.page = result.page + 1 |
|
|
this.page = result.page + 1 |
|
|
this.list = this.list.concat(result.rows) |
|
|
|
|
|
|
|
|
this.list = isConcat?this.list.concat(result.rows):result.rows |
|
|
|
|
|
|
|
|
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项` |
|
|
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项` |
|
|
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多' |
|
|
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多' |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 刷新清空列表 |
|
|
// 刷新清空列表 |
|
|
async refreshList() { |
|
|
|
|
|
|
|
|
async refreshList(isConcat=true) { |
|
|
this.page = 1 |
|
|
this.page = 1 |
|
|
this.total = 2 |
|
|
this.total = 2 |
|
|
this.list = [] |
|
|
this.list = [] |
|
|
|
|
|
|
|
|
await this.fetchList() |
|
|
|
|
|
|
|
|
await this.fetchList(isConcat) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 列表下拉 |
|
|
// 列表下拉 |
|
@@ -211,7 +211,7 @@ export default { |
|
|
Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t))) |
|
|
Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t))) |
|
|
|
|
|
|
|
|
this.searchData = result |
|
|
this.searchData = result |
|
|
await this.refreshList() |
|
|
|
|
|
|
|
|
await this.refreshList(false) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 点击「清空查询条件」按钮 |
|
|
// 点击「清空查询条件」按钮 |
|
|