index.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {% extends "base.html" %}
  2. {% block title %}
  3. {% endblock %}
  4. {% block head %}
  5. <script type="text/javascript">
  6. var exportFun = function () {
  7. var data = sy.serializeObject($('#searchForm'));
  8. //data.sort = 't.syuser.name';
  9. $.download(sy.contextPath + '/base/syonline!export.action', data);
  10. };
  11. var grid;
  12. $(function() {
  13. grid = $('#grid').datagrid({
  14. title : '',
  15. url : sy.contextPath + '/base/syonline!grid.action',
  16. striped : true,
  17. rownumbers : true,
  18. pagination : true,
  19. singleSelect : true,
  20. idField : 'id',
  21. sortName : 'createdatetime',
  22. sortOrder : 'desc',
  23. pageSize : 100,
  24. pageList : [ 10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 1000 ],
  25. frozenColumns : [ [ {
  26. width : '100',
  27. title : '登录名',
  28. field : 'loginname',
  29. sortable : true
  30. }, {
  31. width : '300',
  32. title : 'IP地址',
  33. field : 'ip',
  34. sortable : true
  35. } ] ],
  36. columns : [ [ {
  37. width : '150',
  38. title : '创建时间',
  39. field : 'createdatetime',
  40. sortable : true
  41. }, {
  42. width : '100',
  43. title : '类别',
  44. field : 'type',
  45. sortable : true,
  46. formatter : function(value, row, index) {
  47. switch (value) {
  48. case '0':
  49. return '注销系统';
  50. case '1':
  51. return '登录系统';
  52. }
  53. }
  54. } ] ],
  55. toolbar : '#toolbar',
  56. onBeforeLoad : function(param) {
  57. parent.$.messager.progress({
  58. text : '数据加载中....'
  59. });
  60. },
  61. onLoadSuccess : function(data) {
  62. $('.iconImg').attr('src', sy.pixel_0);
  63. parent.$.messager.progress('close');
  64. }
  65. });
  66. });
  67. </script>
  68. {% endblock %}
  69. {% block body %}
  70. <body class="easyui-layout" data-options="fit:true,border:false">
  71. <div id="toolbar" style="display: none;">
  72. <table>
  73. <tr>
  74. <td>
  75. <form id="searchForm">
  76. <table>
  77. <tr>
  78. <td>登录名</td>
  79. <td><input name="loginname" style="width: 80px;" /></td>
  80. <td>IP地址</td>
  81. <td><input name="ip" style="width: 80px;" /></td>
  82. <td>类别</td>
  83. <td><select name="type" class="easyui-combobox" data-options="panelHeight:'auto',editable:false"><option value="">请选择</option>
  84. <option value="1">登录系统</option>
  85. <option value="0">注销系统</option></select></td>
  86. <td>创建时间</td>
  87. <td><input name="createdatetime1" class="Wdate" onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="readonly" style="width: 120px;" />-<input name="createdatetime2" class="Wdate" onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="readonly" style="width: 120px;" /></td>
  88. <td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-zoom',plain:true" onclick="grid.datagrid('load',sy.serializeObject($('#searchForm')));">过滤</a><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-zoom_out',plain:true" onclick="$('#searchForm input').val('');grid.datagrid('load',{});">重置过滤</a></td>
  89. </tr>
  90. </table>
  91. </form>
  92. </td>
  93. </tr>
  94. <tr>
  95. <td>
  96. <table>
  97. <tr>
  98. <td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="exportFun()">导出</a></td>
  99. </tr>
  100. </table>
  101. </td>
  102. </tr>
  103. </table>
  104. </div>
  105. <div data-options="region:'center',fit:true,border:false">
  106. <table id="grid" data-options="fit:true,border:false"></table>
  107. </div>
  108. </body>
  109. {% endblock %}