<template>
  <div>
    <el-table
      tooltip-effect="dark"
      :data="tableData"
      v-loading="tableLoading"
      :header-cell-style="{ background: 'rgba(30,144,255,.1)' }"
      :max-height="tableHeigt"
      border
      @selection-change="handleSelectionChange"
    >
      <el-table-column
        show-overflow-tooltip
        align="center"
        prop="tableName"
        label="表名"
        width="300"
      >
      </el-table-column>
      <el-table-column
        show-overflow-tooltip
        align="center"
        prop="fileName"
        label="文件名"
        width="400"
      >
      </el-table-column>
      <el-table-column
        align="center"
        prop="statusType"
        label="状态"
        width="150"
      >
        <template slot-scope="scope">
          <el-tag :type="scope.row.statusType == '0' ? 'success' : 'danger'">{{
            scope.row.statusType == 0 ? "转换成功" : "转换失败"
          }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column
        show-overflow-tooltip
        align="center"
        prop="failureReason"
        label="失败原因"
      >
      </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 - 300
    };
  },
  methods: {
    handleSelectionChange(val) {
      this.$emit("handleSelectionChange", val);
    }
  }
};
</script>
<style lang="scss" scoped></style>
