<template>
  <div>
    <el-card style="height: 100%; overflow-y: auto">
      <el-col :span="24" class="elrow-main__col-top">
        <div>
          <slot name="headerLeft" />
        </div>
        <div class="top-left">
          <slot name="headerRight" />
          </div>
      </el-col>
      <el-col :span="24" class="elrow-main__col-bottom">
        <b-table
          ref="tableRef"
          :args="{ 'highlight-current-row': true }"
          :data="loadData"
          :columns="columns"
          isShowIndex
        >
          <template #operate="scope">
            <el-link
              size="small"
              :underline="false"
              type="primary"
              style="margin-right: 10px"
              @click="download(scope.row)"
              >下载</el-link
            >
            <el-link
            size="small"
            :underline="false"
            type="danger"
            style="margin-right: 10px"
            @click="download(scope.row)"
            >删除</el-link
          >
          </template>
        </b-table>
      </el-col>
    </el-card>
  </div>
</template>

<script>
import { getAreaList } from '@/api/statistics/index.js'
import BTable from '@/components/Table/index.vue';

export default {
  name:"report",
  props: {
    columns:{
      type: Array,
      default: []
    },
    currentClickId: {
      type: Number | String
    },
    currentYear: {
      type: Number | String
    }
  },
  components: { BTable },
  data() {
    return {
      loading: false,
      associationManageShow: false,
    };
  },
  methods: {
    addAssociation() {
      this.associationManageShow = true
    },
    loadData() {
      return this.getTableData();
    },
    getTableData() {
      return Promise.resolve({
        data: [{
          person:"王大虎",
          area: '2016-05-02',
          name: '王小虎',
          phone: 1588888888,
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          person:"王大虎",
          area: '2016-05-04',
          name: '王小虎',
          phone: 1588888888,
          address: '上海市普陀区金沙江路 1517 弄'
        }, {
          person:"王大虎",
          area: '2016-05-01',
          name: '王小虎',
          phone: 1588888888,
          address: '上海市普陀区金沙江路 1519 弄'
        }, {
          person:"王大虎",
          area: '2016-05-03',
          name: '王小虎',
          phone: 1588888888,
          address: '上海市普陀区金沙江路 1516 弄'
        }]
      })
    },
    handleSearch() {
      this.$refs.tableRef.refresh(true);
    },
    goDetail(row) {
      this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
    },
    download(row) {
    }
  }
};
</script>

<style lang="scss" scoped>
.elrow-main__col-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  .top-left {
    height: 100%;
    display: flex;
    align-items: center;
    i {
      background-color: #40d5ec;
      height: 45%;
      width: 5px;
      margin-right: 5px;
    }
  }
}
</style>
