2018-09-19 10:58:28 +08:00
|
|
|
export default `<template>
|
|
|
|
|
<div>
|
2018-12-24 11:18:55 +08:00
|
|
|
<d2-crud
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:data="data"
|
|
|
|
|
:loading="loading"
|
|
|
|
|
:pagination="pagination"
|
|
|
|
|
@pagination-current-change="paginationCurrentChange"/>
|
2018-09-19 10:58:28 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
2018-12-24 11:18:55 +08:00
|
|
|
title: '卡密',
|
|
|
|
|
key: 'key',
|
|
|
|
|
width: 320
|
2018-09-19 10:58:28 +08:00
|
|
|
},
|
|
|
|
|
{
|
2018-12-24 11:18:55 +08:00
|
|
|
title: '面值',
|
|
|
|
|
key: 'value'
|
2018-09-19 10:58:28 +08:00
|
|
|
},
|
|
|
|
|
{
|
2018-12-24 11:18:55 +08:00
|
|
|
title: '管理员',
|
|
|
|
|
key: 'admin'
|
2018-09-19 10:58:28 +08:00
|
|
|
},
|
|
|
|
|
{
|
2018-12-24 11:18:55 +08:00
|
|
|
title: '创建时间',
|
|
|
|
|
key: 'dateTimeCreat'
|
2018-09-19 10:58:28 +08:00
|
|
|
},
|
|
|
|
|
{
|
2018-12-24 11:18:55 +08:00
|
|
|
title: '使用时间',
|
|
|
|
|
key: 'dateTimeUse'
|
2018-09-19 10:58:28 +08:00
|
|
|
}
|
|
|
|
|
],
|
2018-12-24 11:18:55 +08:00
|
|
|
data: [],
|
|
|
|
|
loading: false,
|
2018-09-19 10:58:28 +08:00
|
|
|
pagination: {
|
2018-12-24 11:18:55 +08:00
|
|
|
currentPage: 1,
|
2018-09-19 10:58:28 +08:00
|
|
|
pageSize: 5,
|
2018-12-24 11:18:55 +08:00
|
|
|
total: 0
|
2018-09-19 10:58:28 +08:00
|
|
|
}
|
|
|
|
|
}
|
2018-12-24 11:18:55 +08:00
|
|
|
},
|
|
|
|
|
mounted () {
|
|
|
|
|
this.fetchData()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
paginationCurrentChange (currentPage) {
|
|
|
|
|
this.pagination.currentPage = currentPage
|
|
|
|
|
this.fetchData()
|
|
|
|
|
},
|
|
|
|
|
fetchData () {
|
|
|
|
|
this.loading = true
|
2020-05-07 15:49:28 +08:00
|
|
|
this.$api.DEMO_BUSINESS_TABLE_1_LIST({
|
2018-12-24 11:18:55 +08:00
|
|
|
...this.pagination
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.data = res.list
|
|
|
|
|
this.pagination.total = res.page.total
|
|
|
|
|
this.loading = false
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
console.log('err', err)
|
2018-12-24 14:06:02 +08:00
|
|
|
this.loading = false
|
2018-12-24 11:18:55 +08:00
|
|
|
})
|
|
|
|
|
}
|
2018-09-19 10:58:28 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>`
|