<template>
  <div>
    <head-todo
    @getList="getList">
    </head-todo>
    <center-list
    :tableData="tableList"
    :currentPage="currentPage"
    :pageSize="pageSize"
    :total="total"
    @getList="getList"
    >
    </center-list>
  </div>
</template>
<script>
import HeadTodo from './components/head-todo'
import CenterList from './components/center-list'
export default {
  name: 'Customer',
  components: {
    HeadTodo,
    CenterList
  },
  created () {
    this.getList()
  },
  data () {
    return {
      tableList: [],
      childrenList: [],
      total: 0,
      query: {
        'page.currentPage': 1,
        'page.limitCount': 10,
      },
      currentPage: 1,
      pageSize: 10
    }
  },
  methods: {
    getList (query) {
      const url = this.$API.charging.customer.getList
      const param = { ...this.query, ...query }
      this.$https.post(url, param).then(res => {
        // console.log(res)
        this.tableList = res.rows
        this.total = res.total
        this.currentPage = res.currentPage
        this.pageSize = res.limit
      })
    },
  }
}
</script>
