<title>管理组</title>
  
<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">主页</a>
    <a><cite>系统设置</cite></a>
    <a><cite>管理组</cite></a>
  </div>
</div>

<div class="layui-fluid">
  <div class="layui-card">
    <div class="layui-card-header">管理组</div>
    <div class="layui-card-body">
      <div style="padding-bottom: 10px;">
        <a lay-href="role/edit" class="layui-btn"><i class="layui-icon layui-icon-add-circle"></i>添加管理组</a>
      </div>
      
      <table id="J_table_list" lay-filter="J_table_list"></table>

    </div>
  </div>
</div>

<script type="text/html" id="J_table_tool">
  {{# if(d.type=='default'){ }}
  <a lay-href="role/edit?id={{d.id}}" class="layui-btn layui-btn-normal layui-btn-xs"><i class="layui-icon layui-icon-edit"></i>编辑</a>
  <a href="role/remove" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="req"title="确定要删除吗？"><i class="layui-icon layui-icon-delete"></i>删除</a>
  {{# }else{ }}
  <button type="button" class="layui-btn layui-btn-disabled layui-btn-xs"><i class="layui-icon layui-icon-edit"></i>编辑</a>
  <button type="button" class="layui-btn layui-btn-disabled layui-btn-xs"><i class="layui-icon layui-icon-delete"></i>删除</a>
  {{# } }}
</script>

<script>
;!function(){
  var $ = layui.$
  ,form = layui.form
  ,table = layui.table;

  //执行渲染
table.render({
  elem: '#J_table_list'
  ,url: '{:url('/role/list')}'
  ,cols: [[
      {field:'name',title:'组名',width:200}
      ,{title:'操作',minWidth:120,toolbar:'#J_table_tool'}
  ]]
  ,height: 'auto'
  ,text: {
    none: '暂无数据！'
  }
});

    //监听复选框选择
    form.on('checkbox(J_checkAll)', function(obj){
        $('.cityId').prop('checked', this.checked);
        form.render('checkbox');
    });


}();
</script>