<template>
  <div>
    <mx-table :propDefines="propDefines" :rows="list" @selection-change="handleSelectionChange">
    </mx-table>
    <!-- 操作 确认和分页-->
    <div class="tmp">

    <!-- <el-button v-if="list.length > 0 && selected.length > 0" type="primary" @click="confirm">确认选择</el-button>-->
      <el-pagination
        layout="prev, pager, next"
        :total="10">
      </el-pagination>
    </div>
  </div>

</template>
<script>
export default {
  props: {
    type: {
      String: '',  //1 用于class-adjust 2 用于完成分班展示
      default: '1'
    },
    list: {
      required: true,
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      propDefines: {
        selection: {
          label: '选择',
          type:'selection',
          hidden: this.type == '2'
        },
        groupName: {
          label: '组合',
          hidden: this.type == '1'
        },
        className: {
          label: '班级'
        },
        name: {
          label: '姓名',
        },
        sex: {
          label: '性别',
        },
        rankInGroup: {
          label: '班级排名'
        },
        rankInGrade: {
          label: '年级排名',
          hidden: this.type == '1'
        }
      },
      selected: [],
    }
  },
  computed: {
  },
  methods: {
    handleSelectionChange(row) {
      this.selected = row
      this.$emit('confirm',this.selected)
    },
    confirm() {
    }
  }
}

</script>
<style scoped>
.tmp{
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 10px 0;
}
</style>
