index.html 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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:'address',index:'address',width:100,editable: false,sortable: false},
  54. ],
  55. rowNum:10,
  56. rowList:[10,20,30,50,100],
  57. pager: '#pager',
  58. sortname: 'id',
  59. viewrecords: true,
  60. autowidth:true,
  61. mtype: 'post',
  62. height: 'auto',
  63. emptyrecords: "暂无数据",
  64. sortorder: "desc",
  65. caption:"轨迹列表",
  66. loadComplete: function (xhr) {
  67. if(xhr.code==0){
  68. layer.msg(xhr.msg);
  69. return false;
  70. }
  71. },
  72. });
  73. });
  74. </script>
  75. {/block}