<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/common_header :: common_header"></head>
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a><cite>系统设置/权限管理</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so" onsubmit="return false;" id="formId">
            <input type="text" name="roleName" placeholder="角色名称" autocomplete="off" class="layui-input">
            <button class="layui-btn" onclick="to_page(0)"><i class="layui-icon">&#xe615;</i></button>
        </form>
    </div>
    <!--<xblock>-->
    <!--<button class="layui-btn layui-btn-danger" onclick="delById(0)"><i class="layui-icon"></i>批量删除</button>-->
    <!--<button class="layui-btn" onclick="addOrEdit(0)"><i class="layui-icon"></i>添加</button>-->
    <!--</xblock>-->
    <table class="layui-table">
        <thead>
        <tr>
            <!--<th>-->
            <!--<div class="layui-unselect header layui-form-checkbox" lay-skin="primary" id="check_all"><i class="layui-icon">&#xe605;</i></div>-->
            <!--</th>-->
            <th>角色名称</th>
            <th>创建时间</th>
            <th>编辑时间</th>
            <th>备注</th>
            <th>操作</th>
        </thead>
        <tbody id="tbodyId">
        </tbody>
    </table>
    <!-- 显示分页信息 -->
    <div id="laypage" style="text-align: center"></div>
</div>
<script type="text/javascript" th:src="@{/js/page.js}"></script>
<script>
    function build_info_table(list) {
        //清空table表格
        $("#tbodyId").empty();
        for (var i = 0; i < list.length; i++) {
            $("#tbodyId").append('<tr>'
                //  + '<td><div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id=' + list[i].roleId + '><i class="layui-icon">&#xe605;</i></div></td>'
                + '<td>' + list[i].roleName + '</td>'
                + '<td>' + list[i].createTime + '</td>'
                + '<td>' + list[i].modifiedTime + '</td>'
                + '<td>' + list[i].roleRemark + '</td>'
                + '<td class="td-manage">'
                + '<a title="查看/编辑" onclick="addOrEdit(' + list[i].roleId + ')">'
                + '<i class="layui-icon">&#xe642;</i>'
                // + '</a>'
                // + '&nbsp;&nbsp;<a title="删除" onclick="delById(' + list[i].roleId + ')">'
                // + '<i class="layui-icon">&#xe640;</i>'
                // + '</a>'
                + '</td>'
            );

        }
    }

    function addOrEdit(id) {
        var title = '';
        if (id == 0) {
            title = '新增角色';
        } else {
            title = '编辑角色';
        }
        var w = ($(window).width() * 0.8);
        var h = ($(window).height() * 0.9);
        layerOpen(w, h, title, id);
    }
</script>
</body>

</html>