<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>
    <a><cite>权限管理</cite></a>
  </div>
</div>

  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-header">权限管理</div>
          
    <div class="layui-card-body">
      <div style="padding-bottom: 10px;">
        <a href="#J_view" class="layui-btn J_popup" title="添加权限"><i class="layui-icon layui-icon-add-circle"></i>添加</a>
        <a href="wendasns/rank/remove" class="layui-btn J_req" title="确定要删除吗？"><i class="layui-icon layui-icon-delete"></i>删除</a>
      </div>
      
      <table id="J_table_list" lay-filter="J_table_list" url="{:url('wendasns/rank/edit')}"></table>
    </div>
  </div>
</div>

<script type="text/html" id="J_table_tool">
  <a href="#J_view" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="popup" title="编辑权限"><i class="layui-icon layui-icon-edit"></i>编辑</a>
  <a href="wendasns/rank/remove" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="req" title="确实要删除吗？"><i class="layui-icon layui-icon-delete"></i>删除</a>
</script>

<script>
;!function(){
  var table = layui.table;
  
  //执行渲染
table.render({
  elem: '#J_table_list'
  ,url: '{:url('wendasns/rank/list')}'
  ,cols: [[
      {type: 'checkbox'}
      ,{field:'id',title:'ID',align:'center',width:80}
      ,{field:'name',title:'权限',minWidth:200}
      ,{field:'controller',title:'控制器',minWidth:170}
      ,{field:'content',title:'说明',minWidth:200}
      ,{title:'操作',width:150,align:'center',toolbar:'#J_table_tool'}
  ]]
  ,height: 'auto'
  ,page: true
  ,limit: 20
  ,text: {
    none: '暂无数据！'
  }
});

}();
</script>

<script type="text/html" id="J_view">
<form class="layui-form" action="{:url('wendasns/rank/dorun')}" method="post">
  <input type="hidden" name="id" value="{{d.id || 0}}">
  
            <div class="layui-form-item">
              <label class="layui-form-label">权限名称</label>
              <div class="layui-input-inline">
                <input type="text" name="name" value="{{d.name || ''}}" lay-verify="required" class="layui-input">
              </div>
            </div>
          
        <div class="layui-form-item">
          <label class="layui-form-label">控制器</label>
          <div class="layui-input-inline">
            <input type="text" name="controller" value="{{d.controller || ''}}" lay-verify="required" class="layui-input">
          </div>
          <div class="layui-form-mid layui-word-aux">格式：类名/方法名</div>
        </div>

        <div class="layui-form-item">
          <label class="layui-form-label">权限说明</label>
          <div class="layui-input-inline">
            <textarea name="content" class="layui-textarea">{{d.content || ''}}</textarea>
          </div>
        </div>

        <div class="layui-form-item">
          <label class="layui-form-label">启用</label>
          <div class="layui-input-inline">
            <input type="radio" name="status" value="1" title="是" {{typeof d.status=="undefined"?'checked':(d.status==1?'checked':'')}}>
            <input type="radio" name="status" value="0" title="否" {{typeof d.status=="undefined"?'':(d.status==0?'checked':'')}}>
          </div>
        </div>
        
            <div class="layui-form-item">
              <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="J_ajax_submit_btn"><i class="layui-icon layui-icon-ok-circle"></i>提交</button>
              </div>
            </div>
            
          </form>
</script>