index.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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" >
  7. <form class="form-inline" id="form-search" action="{:url('index')}">
  8. <div class="input-group">
  9. <input style="width: 200px;" value="{$id}" type="text" class="form-control" name="imei" placeholder="设备号">
  10. </div>
  11. <div class="input-group">
  12. <input type="text" style="width: 150px;" readonly id="time" class="form-control" name="riqi" >
  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 type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script>
  36. <script>
  37. $(function () {
  38. laydate.render({
  39. elem: '#time'
  40. ,format: 'yyyy-MM-dd',
  41. trigger: 'click' ,
  42. });
  43. $(window).bind("resize",function(){
  44. var width=$(".jqGrid_wrapper").width();
  45. $("#table").setGridWidth(width);
  46. });
  47. $.jgrid.defaults.styleUI="Bootstrap";
  48. $("#table").jqGrid({
  49. url:"{:url('index')}",
  50. datatype: "json",
  51. colModel:[
  52. {label:'时间',name:'created_at',index:'created_at',width:40,editable: false,sortable: false},
  53. {label:'舒张压',name:'dbp',index:'dbp',width:50,editable: false,sortable: false},
  54. {label:'收缩压',name:'sbp',index:'sbp',width:50,editable: false,sortable: false},
  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}