index.html 3.3 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" >
  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:'bloodoxygendata',index:'bloodoxygendata',width:50,editable: false,sortable: false},
  54. {label:'测量类型',name:'measure_type',index:'measure_type',width:50,editable: false,sortable: false,
  55. formatter:function (a,b,c){
  56. if(a===0){
  57. return '定时测量';
  58. }else if(a===1){
  59. return '硬件手动测量';
  60. }else {
  61. return '远程指令测量';
  62. }
  63. }},
  64. ],
  65. rowNum:10,
  66. rowList:[10,20,30,50,100],
  67. pager: '#pager',
  68. sortname: 'id',
  69. viewrecords: true,
  70. autowidth:true,
  71. mtype: 'post',
  72. height: 'auto',
  73. emptyrecords: "暂无数据",
  74. sortorder: "desc",
  75. caption:"血氧数据",
  76. loadComplete: function (xhr) {
  77. if(xhr.code==0){
  78. layer.msg(xhr.msg);
  79. return false;
  80. }
  81. },
  82. });
  83. });
  84. </script>
  85. {/block}