<template>
  <!-- 数据接收table -->
  <div>
    <el-table
      v-loading="tableLoading"
      tooltip-effect="dark"
      :data="tableData"
      :max-height="tableHeigt"
      border
    >
      <!-- <el-table-column type="selection" width="55"></el-table-column> -->
      <el-table-column align="center" type="index" label="序号" width="100" />
      <el-table-column align="center" prop="batchNo" label="任务名称"  />
      <el-table-column align="center" prop="statisticsType" label="类型">
        <template slot-scope="scope">
          <span>{{ scope.row.statisticsType==0?'未入库':'已入库' }}</span>
        </template>
      </el-table-column>
      <el-table-column  align="center" prop="createTime" label="创建时间" ></el-table-column>
      <el-table-column  align="center" prop="statisticsState" label="统计状态">
        <template slot-scope="scope">
          <el-tag :type="scope.row.statisticsState==0?'warning':'success'">{{ scope.row.statisticsState==0?'统计中':'已完成' }}</el-tag>
        </template>
      </el-table-column>
    
      <el-table-column align="center" prop="operatorChn" label="操作">
        <template slot-scope="scope">
          <el-button :disabled="scope.row.statisticsState==0" type="text" size="mini"  @click="handleClickBtn(scope.row)">查看</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  props: {
    tableData: {
      type: Array,
      default: () => []
    },
    tableLoading: {
      type: Boolean,
      default: () => false
    }
  },
  data() {
    return {
      tableHeigt: window.innerHeight - 250
    }
  },
  methods: {
    handleClickBtn(row){
      this.$emit('clickBtn',row)
    }
  }
}

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