<template>
  <div id="list">
    <el-row>
      <el-col :span="24">
        <el-col :span="24">
          <el-table
            ref="multipleTable"
            :data="tableData"
            tooltip-effect="dark"
            :default-sort="{ prop: 'date', order: 'descending' }"
            style="width: 100%"
            @selection-change="handleSelectionChange"
          >
            <el-table-column type="selection" align="center"> </el-table-column>
            <el-table-column prop="list" label="列表" align="center"> </el-table-column>
            <el-table-column prop="list" label="列表" align="center"> </el-table-column>
            <el-table-column prop="list" label="列表" align="center"> </el-table-column>
            <el-table-column prop="status" label="状态" align="center"> </el-table-column>
            <el-table-column prop="list" label="列表" align="center"> </el-table-column>
            <el-table-column prop="list" label="列表" align="center"> </el-table-column>
            <el-table-column prop="date" label="时间排序" sortable align="center"> </el-table-column>
            <el-table-column label="操作" align="center" width="300px">
              <template slot-scope="">
                <el-button size="mini" type="text" class="other">其他操作</el-button>
                <el-button size="mini" type="text" class="other">其他操作</el-button>
                <el-button size="mini" type="text" class="view" icon="el-icon-view"></el-button>
                <el-button size="mini" type="text" class="edit" icon="el-icon-edit"></el-button>
                <el-button size="mini" type="text" class="delete" icon="el-icon-delete"></el-button>
              </template>
            </el-table-column>
          </el-table>
          <el-row>
            <el-pagination
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage"
              :page-sizes="[10, 20, 30, 40]"
              :page-size="10"
              background
              layout="total, sizes, prev, pager, next, jumper"
              :total="total"
            >
            </el-pagination>
          </el-row>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'list',
  props: {
    tableData: null,
    total: null,
  },
  components: {},
  data: () => ({
    currentPage: 0,
  }),
  created() {},
  computed: {},
  methods: {
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
  },
};
</script>

<style lang="less" scoped>
/deep/.el-checkbox__input.is-checked .el-checkbox__inner {
  background-color: red;
  border-color: red;
}
/deep/.el-checkbox__input.is-indeterminate .el-checkbox__inner {
  background-color: red;
  border-color: red;
}
/deep/.el-table th {
  background-color: #f5f6fa;
  padding: 8px 0;
}
/deep/.el-table td {
  padding: 11px 0;
}
.other {
  color: #f36302;
}
.view {
  color: #f36302;
}
.edit {
  color: #2ccc02;
}
.delete {
  color: #e9021d;
}
/deep/.el-pagination {
  padding: 26px 20px;
}
/deep/.el-pagination.is-background .el-pager li:not(.disabled).active {
  background-color: red;
}
</style>
