user_work.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-content">
  5. <div class="row">
  6. <div class="col-xs-3">
  7. <!-- <a href="{:url('add')}" class="btn btn-sm btn-primary">新增</a>-->
  8. </div>
  9. <div class="col-xs-9" style="text-align: right;">
  10. <form class="form-inline" id="form-search" action="{:url('userWork')}">
  11. <div class="input-group">
  12. <input type="text" class="form-control" name="title" placeholder="用户名称">
  13. </div>
  14. <div class="input-group">
  15. <span class="input-group-btn">
  16. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  17. </span>
  18. <span class="input-group-btn">
  19. <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  20. </span>
  21. </div>
  22. </form>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="ibox-content">
  27. <div class="jqGrid_wrapper">
  28. <table id="table" style="border-collapse: collapse"></table>
  29. <div id="pager"></div>
  30. </div>
  31. </div>
  32. </div>
  33. {/block}
  34. {block name="script"}
  35. <script>
  36. $(function () {
  37. $(window).bind("resize",function(){
  38. var width=$(".jqGrid_wrapper").width();
  39. $("#table").setGridWidth(width);
  40. });
  41. $.jgrid.defaults.styleUI="Bootstrap";
  42. $("#table").jqGrid({
  43. url:"{:url('userWork')}",
  44. datatype: "json",
  45. colModel:[
  46. {label:'用户名称',name:'nickname',index:'nickname',width:80,editable: false,sortable: false},
  47. {label:'本月(时长秒)',name:'month',index:'month',width:80,editable: false,sortable: false},
  48. {label:'本周(时长秒)',name:'week',index:'week',width:80,editable: false,sortable: false},
  49. {label:'今天(时长秒)',name:'day',index:'day',width:80,editable: false,sortable: false},
  50. ],
  51. rowNum:10,
  52. rowList:[10,20,30,50,100],
  53. pager: '#pager',
  54. sortname: 'id',
  55. viewrecords: true,
  56. autowidth:true,
  57. mtype: 'post',
  58. height: 'auto',
  59. emptyrecords: "暂无数据",
  60. sortorder: "desc",
  61. caption:"{$meta_title}",
  62. loadComplete: function (xhr) {
  63. if(xhr.code==0){
  64. layer.msg(xhr.msg);
  65. return false;
  66. }
  67. },
  68. });
  69. });
  70. </script>
  71. {/block}