work_log.html 2.8 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-3">
  7. </div>
  8. <div class="col-xs-9" style="text-align: right;">
  9. <a href="{:url('index')}" class="btn btn-sm btn-primary">返回上一页</a>
  10. </div>
  11. </div>
  12. </div>
  13. <div class="ibox-content">
  14. <div class="jqGrid_wrapper">
  15. <table id="table" style="border-collapse: collapse"></table>
  16. <div id="pager"></div>
  17. </div>
  18. </div>
  19. </div>
  20. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  21. {/block}
  22. {block name="script"}
  23. <script>
  24. $(function () {
  25. // laydate.render({
  26. // elem: '#date',
  27. // //设置开始日期、日期日期的 input 选择器
  28. // //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
  29. // trigger: 'click' ,
  30. // theme: '#284a94'
  31. // });
  32. // laydate.render({
  33. // elem: '#date1',
  34. // //设置开始日期、日期日期的 input 选择器
  35. // //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
  36. // trigger: 'click' ,
  37. // theme: '#284a94'
  38. // });
  39. $(window).bind("resize",function(){
  40. var width=$(".jqGrid_wrapper").width();
  41. $("#table").setGridWidth(width);
  42. });
  43. $.jgrid.defaults.styleUI="Bootstrap";
  44. $("#table").jqGrid({
  45. url:"{:url('workLog',['id'=>$id])}",
  46. datatype: "json",
  47. colModel:[
  48. {label:'文档名称',name:'title',index:'title',width:100,editable: false,sortable: false},
  49. {label:'最低时长限制',name:'limit',index:'limit',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  50. if(a>0){
  51. return a+'分钟';
  52. } else{
  53. return '不限制';
  54. }
  55. }},
  56. {label:'实际学习时长',name:'times',index:'times',width:50,sortable: true},
  57. {label:'达标状态',name:'status',index:'status',width:40,sortable: true},
  58. ],
  59. rowNum:10,
  60. rowList:[10,20,30,50,100],
  61. pager: '#pager',
  62. sortname: 'id',
  63. viewrecords: true,
  64. autowidth:true,
  65. mtype: 'post',
  66. height: 'auto',
  67. emptyrecords: "暂无数据",
  68. sortorder: "asc",
  69. caption:"{$m_name}",
  70. loadComplete: function (xhr) {
  71. if(xhr.code==0){
  72. layer.msg(xhr.msg);
  73. return false;
  74. }
  75. },
  76. });
  77. });
  78. </script>
  79. {/block}