表格示例完成

Former-commit-id: cb061e9cb3f1d290e3a776a8b88d834226d668be [formerly cb061e9cb3f1d290e3a776a8b88d834226d668be [formerly cb061e9cb3f1d290e3a776a8b88d834226d668be [formerly cb061e9cb3f1d290e3a776a8b88d834226d668be [formerly fcef20ff04bd08ab432bc47ac75fb4e6483c2851 [formerly fa46aa095a6a2e8317207d6ab9862cc7f4b56339]]]]]
Former-commit-id: 12745f3af51dabcf235c449e6f8b47ea0658b4c2
Former-commit-id: 020118a1c207454660f1e83e35dd834ac9493b74
Former-commit-id: d205e48a791b6afe1222c08943206ee238e92de8 [formerly dc747e67590f1042a5ac7b01ee86d4a9509cd920]
Former-commit-id: 867a148b7da027dc469ef8e1964f593e6abfe86b
Former-commit-id: d348819675978bf97305d79863fd72de108adad3
Former-commit-id: 8c8bcd05152b184547b8903de19a63ef262ed12c
Former-commit-id: 375bf4f1cbce6b86e82e86bedf7951d0d800f97f
Former-commit-id: 4b70e86cd638b19ed13371c86fa4b7be17528ae7
This commit is contained in:
liyang
2018-08-07 13:46:04 +08:00
parent cad41fd8af
commit e199d83c79
6 changed files with 191 additions and 107 deletions

View File

@@ -5,7 +5,8 @@
@submit="handleSubmit"
ref="header"/>
<demo-page-main
:table-data="table"/>
:table-data="table"
:loading="loading"/>
<demo-page-footer
slot="footer"
:current="page.current"
@@ -27,6 +28,7 @@ export default {
data () {
return {
table: [],
loading: false,
page: {
current: 1,
size: 100,
@@ -41,29 +43,32 @@ export default {
message: `当前第${val.current}页 共${val.total}条 每页${val.size}`
})
this.page = val
// nextTick 只是为了优化示例中 notify 的显示
this.$nextTick(() => {
this.$refs.header.submitForm()
this.$refs.header.handleFormSubmit()
})
},
handleSubmit (form) {
this.loading = true
this.$notify({
title: '开始请求表格数据'
title: '开始请求模拟表格数据'
})
this.$axios.post('/api/demo/business/table/1', {
...form,
page: this.page
})
.then(res => {
console.log('res', res)
this.loading = false
this.$notify({
title: '表格数据请求完毕'
title: '模拟表格数据请求完毕'
})
this.table = res.list
this.page = res.page
})
.catch(err => {
this.loading = false
this.$notify({
title: '表格数据请求异常'
title: '模拟表格数据请求异常'
})
console.log('err', err)
})