index.html 3.3 KB

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