<template>
  <div class="dashboard-container">
    <!-- <div class="dashboard-text">name: {{ name }}</div> -->
    <div class="bg-w p-20 br-10">
      <toolbar-container :fields="fields" @on-filter="eee" />
      <base-table
        :columns="columns"
        :items="items"
        :pagination="pagination"
        :page-change="pageChange"
      />
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex';
import mxFilterList from '@/mixins/filterList';

export default {
  name: 'Dashboard',

  mixins: [
    mxFilterList({
      fetchList: () => {}
    })
  ],

  computed: {
    ...mapGetters(['name'])
  },
  data() {
    return {
      fields: [
        {
          type: 'dateArray',
          name: 'paidTime',
          label: '收款时间',
          apiName: ['start', 'end'],
          defaultValue: [,]
        },

        {
          type: 'text',
          name: 'paidTime2',
          label: '收款时间',
          defaultValue: 'fick'
        },
        {
          type: 'text',
          name: 'paidTime3',
          label: '收款时间',
          defaultValue: 'fick'
        }
      ],
      columns: [
        {
          key: 'region',
          name: '大区',
          width: '120'
        },
        {
          key: 'province',
          name: '省',
          width: '120'
        },
        {
          key: 'city',
          name: '市',
          width: '150'
        },
        {
          key: 'area',
          name: '区',
          minWidth: '100'
        },
        {
          key: 'storeChain',
          name: '连锁',
          minWidth: '100'
        },
        {
          key: 'storeName',
          name: '门店',
          minWidth: '100'
        },
        {
          key: 'coupons',
          name: '发行码数',
          width: '100'
        },
        {
          key: 'writeoff',
          name: '核销数',
          width: '100'
        }
      ]
    };
  },
  methods: {
    eee() {
      console.warn('-------');
    }
  }
};
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
