<template>
  <div>
    <el-dialog
      v-loading="loading"
      :show-close="false"
      :close-on-click-modal="false"
      :visible.sync="isShow"
      :title="`总成长值(${total})-明细列表`"
      :fullscreen="false"
      width="600px"
      custom-class="xl-dialog"
      center
    >
      <table-list
        :list-loading="listLoading"
        :data="tableData"
        :columns="listConfig"
        :current-page="currentPage"
        :page-size="pageSize"
        :total-records="totalRecords"
        @currentChange="pageHandle"
      />
      <div class="xl-form">
        <div class="xl-form-footer">
          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import baseTable from '_m/baseTable.js'
export default {
  components: {},
  mixins: [baseTable],
  props: {
    isShow: Boolean,
    curObj: Object
  },
  inject: ['parentData'],
  data() {
    return {
      apiStr: 'user.admwechatuserintegrallist',
      searchForm: {},
      noCreated: true,
      total: 0,
      formData: [],
      loading: true,
      cObj: {},
    }
  },
  watch: {
    isShow: function(val) {
      if (val) {
        this.searchForm = {
          id: this.curObj.id
        }
        this.fetchData()
      }
    },
  },
  mounted() {
    this.listConfig = {
      rows: [
        { label: '成长值变动', prop: 'total_point' },
        { label: '类型', prop: 'target_type' },
        { label: '备注', prop: 'remark'},
        { label: '时间', prop: 'create_at'},
      ]
    }
  },
  methods: {
    getMoreData (res) {
      this.total = res.surplus_point
    },
    close(str) {
      this.$emit('close')
    },
  }
}
</script>
<style lang="scss" scoped>
</style>
