<template>
  <div>
    <el-table
      v-loading="tableLoading"
      tooltip-effect="dark"
      :data="tableData"
      :header-cell-style="{ background: 'rgba(30,144,255,.1)' }"
      :max-height="tableHeigt"
      border
      @selection-change="handleSelectionChange"
    >
      <!-- <el-table-column type="selection" width="55"></el-table-column> -->
      <el-table-column  align="center" prop="tableChnName" label="移交去向" />
      <el-table-column show-overflow-tooltip align="center" prop="eepPath" label="路径" />
      <el-table-column width="200" align="center" prop="createDate" label="移交时间" />
      <el-table-column width="100"  align="center" prop="docSize" label="操作">
        <template slot-scope="scope">
          <el-button type="primary" size="mini" @click="downLoad(scope.row)">下载</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import localStronge from "@/api/localData";

export default {
  props: {
    tableData: {
      type: Array,
      default: () => []
    },
    tableLoading: {
      type: Boolean,
      default: () => false
    }
  },
  data() {
    return {
      prefix: process.env.NODE_ENV === 'development' ?
          ("http://" + localStronge.getServiceip().ip + ":" + localStronge.getServiceip().host) : 'http://' + window
          .location.host,
      tableHeigt: window.innerHeight - 250,
    }
  },
  methods: {
    handleSelectionChange(val) {
      this.$emit('handleSelectionChange', val)
    },
    downLoad(row){
      let str = this.prefix + "/point-strategy/v/eepLog/downloadEEP?path=" + encodeURIComponent(row.eepPath);
      window.location.href = str;
    }
  }
}

</script>
<style lang="scss" scoped>
</style>
