<div class="app-content-body app-content-full fade-in-up" ng-class="{'h-full': app.hideFooter }">
<!-- hbox layout -->
<div class="hbox hbox-auto-xs hbox-auto-sm bg-light " ng-init="app.settings.asideFixed = true;app.settings.asideDock = false;app.settings.container = false;app.hideAside = false;app.hideFooter = true;">

    <div style="padding: 20px;" class="layui-anim layui-anim-up">
        <xblock>
            <button class="layui-btn" ng-click="addUser()"><i class="layui-icon"></i>添加</button>
        </xblock>
        <table class="layui-table">
            <thead>
            <tr>
                <th>ID</th>
                <th>用户名</th>
                <th>别名</th>
                <th>角色</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="user in userList | orderBy:id track by user.id">
                <td>{{user.id}}</td>
                <td>{{user.username}}</td>
                <td>{{user.name}}</td>
                <td>
                    <span ng-repeat="role in user.roleList">
                        <span ng-repeat="permission in role.permissions">
                            {{permission.name}},
                        </span>
                    </span>
                </td>
                <td class="td-status">
                    <span ng-if="user.state==1" class="layui-btn layui-btn-normal layui-btn-mini layui-btn-disabled">已停用</span>
                    <span ng-if="user.state==0" class="layui-btn layui-btn-normal layui-btn-mini">已启用</span>
                </td>
                <td>
                    <a class="layui-btn layui-btn" ng-click="updateUser(user.id)">修改</a>
                    <a class="layui-btn layui-btn-danger" ng-if="user.state==0&&user.username!='admin'" ng-click="delUser(user.id)">删除</a>
                    <a class="layui-btn layui-btn-danger layui-btn-disabled" ng-if="user.username=='admin'">删除</a>
                    <a class="layui-btn layui-btn-info" ng-if="user.state==1" ng-click="openUser(user.id)">启用</a>
                </td>
            </tr>
            </tbody>
        </table>

    </div>

</div>
<!-- /hbox layout -->
</div>