/**
 * 表格分页混入文件
 * 该文件为公共组件，一律不允许添加非公共组件业务的东西。只能添加公共组件的东西。
 * 如果需要添加业务代码，请在业务方法进行重写。本组件不可轻易修改。
 */
export default {
  data () {
    return {
      currentPage: 1,
      pageSize: 10,
      total: 0,
      loading: false,
      // pageSizeOpts: [10, 20, 50, 100, 500],
        pageSizeOpts: [10, 50, 100, 500],
    }
  },
  methods: {
    handleCurrentChange (currentPage) {
      this.currentPage = currentPage
      // 缓存当前页码数
      localStorage.setItem('currentPage', currentPage)
      if (this.$route.query.id) {
        //this.getGroupNums()
        this.initData()
      } else if (this.$route.query.labelid) {
        this.getlabel(this.$route.query.labelid)
      } else if (this.$route.query.syt_label_id) {
        this.getlabel(this.$route.query.syt_label_id)
      } else {
        this.initData()
      }
    },
    handlePageSize (pageSize) {
      this.pageSize = pageSize
      if (this.$route.query.id) {
          this.initData()
      } else if (this.$route.query.labelid) {
        this.getlabel(this.$route.query.labelid)
      } else if (this.$route.query.syt_label_id) {
        this.getlabel(this.$route.query.syt_label_id)
      } else {
        this.initData()
      }
    },
    handleModalCurrentChange (currentPage) {
      this.currentPage = currentPage
      this.handleGetMemberWallet()
    },
    handleModalPageSize (pageSize) {
      this.pageSize = pageSize
      this.handleGetMemberWallet()
    }
  }
}
