1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="ibox">
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-3">
- <a href="{:url('add_auth')}" class="btn btn-sm btn-primary">新增</a>
- </div>
- <div class="col-xs-9" style="text-align: right;">
- <form class="form-inline" id="form-search" action="{:url('auth')}">
- <div class="input-group">
- <input type="text" class="form-control" name="title" placeholder="设备名称">
- </div>
- <div class="input-group">
- <input type="text" class="form-control" name="name" placeholder="用户姓名">
- </div>
- <div class="input-group">
- <span class="input-group-btn">
- <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
- </span>
- <span class="input-group-btn">
- <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
- </span>
- </div>
- </form>
- </div>
- </div>
- </div>
- <div class="ibox-content">
- <div class="jqGrid_wrapper">
- <table id="table" style="border-collapse: collapse"></table>
- <div id="pager"></div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script>
- $(function () {
- $(window).bind("resize",function(){
- var width=$(".jqGrid_wrapper").width();
- $("#table").setGridWidth(width);
- });
- $.jgrid.defaults.styleUI="Bootstrap";
- $("#table").jqGrid({
- url:"{:url('auth')}",
- datatype: "json",
- colModel:[
- {label:'用户',name:'nickName',index:'nickName', width:30,sortable: false},
- {label:'绑定数量',name:'num',index:'num',width:40,editable: false,sortable: false},
- {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
- var editurl = "{:url('edit_auth',[],'')}/id/"+c.user_id;
- var delurl = "{:url('del_auth',[],'')}/id/"+c.user_id;
- var detail = "{:url('detail_auth',[],'')}/id/"+c.user_id;
- var btn = '<a href="'+editurl+'"><span class="label label-info" title="编辑">编辑</span></a> ';
- btn += '<a href="'+detail+'"><span class="label label-info" title="查看">查看</span></a> ';
- btn += '<a href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
- return btn;
- }},
- ],
- rowNum:10,
- rowList:[10,20,30,50,100],
- pager: '#pager',
- sortname: 'id',
- viewrecords: true,
- autowidth:true,
- mtype: 'post',
- height: 'desc',
- emptyrecords: "暂无数据",
- sortorder: "asc",
- caption:"权限列表",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- });
- </script>
- {/block}
|