<title>登录记录</title>
  
<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">主页</a>
    <a><cite>ucentre</cite></a>
    <a><cite>登录记录</cite></a>
  </div>
</div>

<div class="layui-fluid">
  <div class="layui-card">
    <form class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="J_ajaxForm">
      <div class="layui-form-item">
        
        <div class="layui-inline">
          <label class="layui-form-label">用户名</label>
          <div class="layui-input-block">
            <input type="text" name="username" placeholder="请输入" autocomplete="off" class="layui-input">
          </div>
        </div>

            <div class="layui-inline">
            <label class="layui-form-label">时间</label>
            <div class="layui-input-inline" style="width: 100px;">
              <input type="text" name="time_min" placeholder="" autocomplete="off" class="layui-input J_dataTime">
            </div>
            <div class="layui-form-mid">-</div>
            <div class="layui-input-inline" style="width: 100px;">
              <input type="text" name="time_max" placeholder="" autocomplete="off" class="layui-input J_dataTime">
            </div>
          </div>
          
        <div class="layui-inline">
          <input type="button" class="layui-btn" lay-submit lay-filter="J_form_search" value="搜索">
        </div>
        
      </div>
    </form>
    
    <div class="layui-card-body">
      <div style="padding-bottom: 10px;">
        <a href="/user/del" class="layui-btn btn_action" data-type="del" role="button"><i class="layui-icon layui-icon-delete"></i>删除</a>
      </div>
      
      <table id="J_table_list" lay-filter="J_table_list"></table>

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

<script type="text/html" id="J_table_mode_tpl">
{{# if(d.mode=='username'){ }}
  <span>用户名</span>
{{# }else if(d.mode=='email'){ }}
  <span>邮箱</span>
{{# }else{ }}
  <span>手机号</span>
{{# } }}
</script>

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

	//时间同时绑定多个
    lay('.J_dataTime').each(function(){
      laydate.render({
        elem: this
      });
    });
    
  //执行渲染
table.render({
  elem: '#J_table_list'
  ,url: '{:url('ucentre/log/list')}'
  ,cols: [[
      {type: 'checkbox'}
      ,{field:'id',title:'ID',width:80,align:'center',sort: true}
      ,{field:'username',title:'用户名',minWidth:150}
      ,{field:'mode',title:'登录方式',minWidth:200,templet:'#J_table_mode_tpl'}
      ,{field:'client',title:'设备名称',minWidth:200}
      ,{field:'system',title:'系统',width:200}
      ,{field:'create_time',title:'登录时间',width:200}
  ]]
  ,page: true
  ,limit: 20
  ,height: 'auto'
  ,text: {
    none: '暂无数据！'
  }
});

}();
</script>