<template>
  <div class="role-container">
    <div class="header">
      <div class="btn">
        <el-button type="primary" @click="handleAdd">新增</el-button>
        <el-button type="primary" @click="handleEdit">修改</el-button>
        <el-button type="danger" @click="handleDelete">删除</el-button>
      </div>
    </div>

    <div class="body">
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column prop="id" label="序号" width="80" align="center" />
        <el-table-column prop="name" label="角色名" align="center" />
        <el-table-column prop="remark" label="备注" align="center" />
        <el-table-column prop="createTime" label="创建时间" width="180" align="center" />
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Role',
  data() {
    return {
      searchForm: {
        name: ''
      },
      tableData: [],
      page: 1,
      pageSize: 10,
      total: 0
    }
  },
  methods: {
    handleSearch() {
      // 实现查询逻辑
    },
    handleAdd() {
      // 实现新增逻辑
    },
    handleEdit(row) {
      // 实现编辑逻辑
    },
    handleDelete(row) {
      // 实现删除逻辑
    },
    handleSizeChange(val) {
      this.pageSize = val
      // 重新加载数据
    },
    handleCurrentChange(val) {
      this.page = val
      // 重新加载数据
    }
  }
}
</script>

<style lang="scss" scoped>
.role-container {
  padding: 20px;
  background: #fff;

  .header {
    margin-bottom: 20px;
  }

  .pagination {
    margin-top: 20px;
    text-align: right;
  }
}
</style>
