index.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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('export')}" class="btn btn-sm btn-primary"><i class="fa fa-cloud-download"> 导出</i></a>-->
  8. <!---->
  9. </div>
  10. <div class="col-xs-9" style="text-align: right;">
  11. <form class="form-inline" id="form-search" action="{:url('index')}">
  12. <div class="input-group">
  13. <input type="text" class="form-control" style="width: 200px" name="title" placeholder="内容">
  14. </div>
  15. <div class="input-group">
  16. <span class="input-group-btn">
  17. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  18. </span>
  19. <span class="input-group-btn">
  20. <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  21. </span>
  22. </div>
  23. </form>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="ibox-content">
  28. <div class="jqGrid_wrapper">
  29. <table id="table" style="border-collapse: collapse"></table>
  30. <div id="pager"></div>
  31. </div>
  32. </div>
  33. </div>
  34. {/block}
  35. {block name="script"}
  36. <script>
  37. $(function () {
  38. $(window).bind("resize",function(){
  39. var width=$(".jqGrid_wrapper").width();
  40. $("#table").setGridWidth(width);
  41. });
  42. $.jgrid.defaults.styleUI="Bootstrap";
  43. $("#table").jqGrid({
  44. url:"{:url('index')}",
  45. datatype: "json",
  46. colModel:[
  47. {label:'编号',name:'id',index:'id', width:40,sortable: false},
  48. {label:'内容',name:'content',index:'content', width:60,sortable: false},
  49. {label:'检查人员',name:'user_name',index:'user_name', width:120,sortable: false},
  50. {label:'时间',name:'create_time',index:'create_time', width:60,sortable: false},
  51. {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
  52. var details = "{:url('details',[],'')}/id/"+c.id;
  53. var btn= '<a url="'+details+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  54. return btn;
  55. }},
  56. ],
  57. rowNum:10,
  58. rowList:[10,20,30,50,100],
  59. pager: '#pager',
  60. sortname: 'id',
  61. viewrecords: true,
  62. autowidth:true,
  63. mtype: 'post',
  64. height: 'auto',
  65. emptyrecords: "暂无数据",
  66. sortorder: "desc",
  67. caption:"{$meta_title}",
  68. loadComplete: function (xhr) {
  69. if(xhr.code==0){
  70. layer.msg(xhr.msg);
  71. return false;
  72. }
  73. },
  74. });
  75. });
  76. </script>
  77. {/block}