article_log.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. {/block}
  21. {block name="script"}
  22. <script>
  23. $(function () {
  24. $(window).bind("resize",function(){
  25. var width=$(".jqGrid_wrapper").width();
  26. $("#table").setGridWidth(width);
  27. });
  28. $.jgrid.defaults.styleUI="Bootstrap";
  29. $("#table").jqGrid({
  30. url:"{:url('article_log',['id'=>$id])}",
  31. datatype: "json",
  32. colModel:[
  33. {label:'ID',name:'id',index:'id', width:30,sortable: false},
  34. {label:'试卷名称',name:'article_paper_name',index:'article_paper_name',width:80,editable: false,sortable: false},
  35. {label:'考生',name:'user_name',index:'user_name',width:60,sortable: true},
  36. {label:'得分',name:'score',index:'score',width:60,sortable: true},
  37. {label:'交卷时间',name:'create_time',index:'create_time',width:60,sortable: true},
  38. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  39. var info_url = "{:url('log_info',[],'')}/id/"+c.id;
  40. var del_url = "{:url('del_question',[],'')}/id/"+c.id;
  41. var btn = '<a url="'+info_url+'" href="javascript:;" data-title="作答详情" onclick="layer_open(this,1)"><span class="label label-primary" title="作答详情">作答详情</span></a>&nbsp;';
  42. // btn += '<a href="'+del_url+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
  43. return btn;
  44. }},
  45. ],
  46. rowNum:10,
  47. rowList:[10,20,30,50,100],
  48. pager: '#pager',
  49. sortname: 'id',
  50. viewrecords: true,
  51. autowidth:true,
  52. mtype: 'post',
  53. height: 'auto',
  54. emptyrecords: "暂无数据",
  55. sortorder: "asc",
  56. caption:"{$m_name}",
  57. loadComplete: function (xhr) {
  58. if(xhr.code==0){
  59. layer.msg(xhr.msg);
  60. return false;
  61. }
  62. },
  63. });
  64. });
  65. </script>
  66. {/block}