From cad41fd8af83399d4e1a45e1973ac2081f88d182 Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Tue, 7 Aug 2018 11:38:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=AD=98=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 478135c9cddd262cc43ea3c78e3b010140a70965 [formerly 478135c9cddd262cc43ea3c78e3b010140a70965 [formerly 478135c9cddd262cc43ea3c78e3b010140a70965 [formerly 478135c9cddd262cc43ea3c78e3b010140a70965 [formerly 8655f13a475ab0b87d8da714fbd5887fe25b7c19 [formerly c0fd05438c5c159c2e3a9cedcf31814a6ba5e02b]]]]] Former-commit-id: 7fb997158f60224f32cb323f1f3a853a5fec97cc Former-commit-id: 80be589dcd2d3fb67ee217844c7590671fdbbd6e Former-commit-id: 6930aaa344febf1efc9dd96488f5a8e1fdc3c00d [formerly 8109f02fa9ab2bf41a162778fdc48d638b852a6a] Former-commit-id: e95e8233a308a067c10222e2a277106be773ca63 Former-commit-id: 7ba6a415d53a8f83684608d89a47e35dec98f930 Former-commit-id: 3540b9a82e5ef79b8dfb18753a8a7d2a013aed94 Former-commit-id: 695315892575ac385338befe856980ba21401803 Former-commit-id: 6e91b18c7175df95f5398d7798146f8f74d2b437 --- src/mock/demo/business/table/1/index.js | 3 ++ .../table/1/componnets/PageFooter/index.vue | 37 +++++++++---------- .../table/1/componnets/PageHeader/index.vue | 16 +++++--- src/pages/demo/business/table/1/index.vue | 23 ++++++++++-- 4 files changed, 50 insertions(+), 29 deletions(-) diff --git a/src/mock/demo/business/table/1/index.js b/src/mock/demo/business/table/1/index.js index 88ad6d55..b5d9a37e 100644 --- a/src/mock/demo/business/table/1/index.js +++ b/src/mock/demo/business/table/1/index.js @@ -3,8 +3,11 @@ import Mock from 'mockjs' Mock.mock('/api/demo/business/table/1', ({ body }) => { // 这是通过 post 传来的参数 body = JSON.parse(body) + const { page } = body + page.total = 1000 return Mock.mock( { + page, 'list|30': [{ 'key': '@guid', 'value|1': [10, 100, 200, 500], diff --git a/src/pages/demo/business/table/1/componnets/PageFooter/index.vue b/src/pages/demo/business/table/1/componnets/PageFooter/index.vue index 75e5f573..46df4540 100644 --- a/src/pages/demo/business/table/1/componnets/PageFooter/index.vue +++ b/src/pages/demo/business/table/1/componnets/PageFooter/index.vue @@ -1,8 +1,8 @@ @@ -22,7 +26,12 @@ export default { }, data () { return { - table: [] + table: [], + page: { + current: 1, + size: 100, + total: 0 + } } }, methods: { @@ -31,20 +40,26 @@ export default { title: '分页变化', message: `当前第${val.current}页 共${val.total}条 每页${val.size}条` }) + this.page = val this.$nextTick(() => { - this.handleSubmit({}) + this.$refs.header.submitForm() }) }, handleSubmit (form) { this.$notify({ title: '开始请求表格数据' }) - this.$axios.post('/api/demo/business/table/1', form) + this.$axios.post('/api/demo/business/table/1', { + ...form, + page: this.page + }) .then(res => { + console.log('res', res) this.$notify({ title: '表格数据请求完毕' }) this.table = res.list + this.page = res.page }) .catch(err => { this.$notify({