record.html 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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-12" style="text-align: right;">
  7. <form class="form-inline" id="form-search" action="{:url('index')}">
  8. <div class="input-group">
  9. <input type="text" class="form-control" name="uname" placeholder="用户">
  10. </div>
  11. <div class="input-group">
  12. <input type="text" class="form-control" name="title" placeholder="事件名称">
  13. </div>
  14. <div class="input-group">
  15. <select name="status" class="form-control">
  16. <option value="">选择状态</option>
  17. <option value="1">任务开始</option>
  18. <option value="2">任务完成</option>
  19. <option value="3">任务超时</option>
  20. </select>
  21. </div>
  22. <div class="input-group">
  23. <span class="input-group-btn">
  24. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  25. </span> &nbsp;
  26. <span class="input-group-btn">
  27. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  28. </span>
  29. </div>
  30. </form>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="ibox-content">
  35. <div class="jqGrid_wrapper">
  36. <table id="table" style="border-collapse: collapse"></table>
  37. <div id="pager"></div>
  38. </div>
  39. </div>
  40. </div>
  41. {/block}
  42. {block name="script"}
  43. <script>
  44. $(function () {
  45. $(window).bind("resize",function(){
  46. var width=$(".jqGrid_wrapper").width();
  47. $("#table").setGridWidth(width);
  48. });
  49. $.jgrid.defaults.styleUI="Bootstrap";
  50. $("#table").jqGrid({
  51. url:"{:url('record')}",
  52. datatype: "json",
  53. colModel:[
  54. {label:'编号',name:'id',index:'id', width:30,sortable: false},
  55. {label:'用户',name:'real_name',index:'real_name', width:50,sortable: false},
  56. {label:'事件名称',name:'title',index:'title',width:150,editable: false,sortable: false},
  57. {label:'状态',name:'status',index:'status',width:40,editable: false,sortable: false,formatter:function (a,b,c){
  58. if(a == 1){
  59. return '<span class="label label-primary" title="进行中">进行中</span>';
  60. } else if(a == 2){
  61. return '<span class="label label-success" title="已完成">已完成</span>';
  62. }else{
  63. return '<span class="label label-danger" title="已完成">已完成</span>';
  64. }
  65. }},
  66. {label:'创建日期',name:'create_time',index:'create_time',width:60,editable: false,sortable: false},
  67. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  68. var editurl = "{:url('Bursting/detail',[],'')}/id/"+c.id;
  69. var btn = '<a url="'+editurl+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a>';
  70. return btn;
  71. }},
  72. ],
  73. rowNum:10,
  74. rowList:[10,20,30,50,100],
  75. pager: '#pager',
  76. sortname: 'id',
  77. viewrecords: true,
  78. autowidth:true,
  79. mtype: 'post',
  80. height: 'auto',
  81. emptyrecords: "暂无数据",
  82. sortorder: "desc",
  83. caption:"应急突发事件保障记录",
  84. loadComplete: function (xhr) {
  85. if(xhr.code==0){
  86. layer.msg(xhr.msg);
  87. return false;
  88. }
  89. },
  90. });
  91. });
  92. </script>
  93. {/block}