index.html 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. </div>
  9. <div class="col-xs-9" style="text-align: right;">
  10. <form class="form-inline" id="form-search" action="{:url('')}">
  11. <div class="input-group">
  12. <input type="text" class="form-control" style="width: 200px" 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('index')}",
  44. datatype: "json",
  45. colModel:[
  46. {label:'编号',name:'id',index:'id', width:40,sortable: false},
  47. {label:'地点名称',name:'title',index:'title', width:80,sortable: false},
  48. {label:'执行人员',name:'user_name',index:'user_name', width:80,sortable: false},
  49. {label:'汇报内容',name:'content',index:'content', width:100,sortable: false},
  50. {label:'分类',name:'cate_name',index:'cate_name', width:100,sortable: false},
  51. {label:'时间',name:'create_time',index:'create_time', width:80,sortable: false},
  52. {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
  53. var details = "{:url('details',[],'')}/id/"+c.id;
  54. var btn = '<a href="'+details+'"><span class="label label-primary" title="详情">详情</span></a>';
  55. return btn;
  56. }},
  57. ],
  58. rowNum:10,
  59. rowList:[10,20,30,50,100],
  60. pager: '#pager',
  61. sortname: 'id',
  62. viewrecords: true,
  63. autowidth:true,
  64. mtype: 'post',
  65. height: 'auto',
  66. emptyrecords: "暂无数据",
  67. sortorder: "desc",
  68. caption:"{$meta_title}",
  69. loadComplete: function (xhr) {
  70. if(xhr.code==0){
  71. layer.msg(xhr.msg);
  72. return false;
  73. }
  74. },
  75. });
  76. });
  77. </script>
  78. {/block}