Brak opisu

caoZuoRiZhi.html 9.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../Script/Common/huayi.load.js"></script>
  6. <script src="../Script/Common/huayi.config.js"></script>
  7. <link href="../css/Table/table1.css" rel="stylesheet" />
  8. <link href="../css/init.css" rel="stylesheet" />
  9. <link rel="stylesheet" href="../css/laydate/need/laydate.css" />
  10. <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
  11. <title>系统管理-->登录日志</title>
  12. <style>
  13. .clearfix:after {
  14. content: "";
  15. display: block;
  16. clear: both;
  17. }
  18. .toolBar {
  19. padding: 15px 0;
  20. border-bottom: 1px solid #ccc;
  21. margin-bottom: 25px;
  22. padding-right: 45px;
  23. }
  24. .toolBar input {
  25. width: 128px;
  26. padding: 2px 2PX 2PX 10PX;
  27. height: 28px;
  28. border: 1px solid #ebebeb;
  29. outline: none;
  30. vertical-align: middle;
  31. }
  32. .model {
  33. position: fixed;
  34. top: 0;
  35. right: 0;
  36. bottom: 0;
  37. left: 0;
  38. height: 100%;
  39. width: 100%;
  40. background: rgba(0, 0, 0, 0.48);
  41. z-index: 100;
  42. display: none;
  43. }
  44. .box {
  45. width: 30%;
  46. margin: 0 auto;
  47. margin-top: 5%;
  48. }
  49. .box .btop {
  50. height: 35px;
  51. background: #1ab394;
  52. color: #fff;
  53. line-height: 35px;
  54. padding: 0 15px;
  55. /*margin-bottom: 15px;*/
  56. }
  57. .box .btop p.btl {
  58. float: left;
  59. margin: 0;
  60. }
  61. .box .btop p.btr {
  62. float: right;
  63. cursor: pointer;
  64. margin: 0;
  65. font-size: 20px;
  66. }
  67. .box>input {
  68. display: block;
  69. height: 34px;
  70. padding: 6px 12px;
  71. font-size: 14px;
  72. line-height: 1.42857143;
  73. color: #555;
  74. background-color: #fff;
  75. background-image: none;
  76. border: 1px solid #ccc;
  77. border-radius: 4px;
  78. margin: 35px auto;
  79. }
  80. .boxCon {
  81. width: 100%;
  82. background: #fff;
  83. text-align: center;
  84. padding: 10px 15px;
  85. height: auto;
  86. overflow-y: auto;
  87. }
  88. .boxCon>div {
  89. padding: 15px 0;
  90. }
  91. </style>
  92. </head>
  93. <body class="gray-bg">
  94. <div class="wrapper wrapper-content animated fadeInRight">
  95. <div class="daoHang clearfix">
  96. <div class="dhLeft">
  97. <sapn>
  98. <i class="syIcon"></i>位置:
  99. <a href="javaScript:;" id="ReIndex" class="indexreturn">首页</a>&gt;
  100. <a href="javaScript:;">系统管理</a>&gt;
  101. <a href="" class="nowPosition">登录日志</a>
  102. </sapn>
  103. </div>
  104. <div class="dhRight"><a href="" title="刷新"><i class="fa fa-refresh"></i></a></div>
  105. </div>
  106. <div class="th-box">
  107. <div class="th-bar">
  108. <a class="btns sc_btn del">删除</a>
  109. <div class="seach-box fr">
  110. <ul>
  111. <!--<li>单位名称:<input class="photo x-color czName" type="text" id="tel" /></li>-->
  112. <li>单位名称:
  113. <select id="testInput1" class="photo czName"></select>
  114. </li>
  115. <li>登录时间:<input class="laydate-icon photo x-color loginTime" type="text" id="startTime" /></li>
  116. <li>
  117. <a class="btns sc_btn search" id="sc_btns" style="display: inline-block;">搜索</a>
  118. </li>
  119. </ul>
  120. </div>
  121. </div>
  122. </div>
  123. <div style="width: 100%;padding: 10px;">
  124. <table id="table1" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true" >
  125. <thead>
  126. <tr>
  127. <th data-field="state" data-checkbox="true" data-align="center"></th>
  128. <th data-width="150" data-align="center" data-formatter="setCode">编号</th>
  129. <th data-field="deptname" data-align="center" >单位名称</th>
  130. <th data-field="logindate" data-align="center">登录时间</th>
  131. <th data-field="num" data-align="center">登录次数</th>
  132. <!--<th data-field="F_LoginId" data-align="center" >操作人编号</th>-->
  133. <!-- <th data-field="F_LoginOutDate" data-align="center">退出时间</th>-->
  134. <!--<th data-field="F_LoginName" data-align="center">操作人名称</th>-->
  135. <!--<th data-field="F_Result" data-align="center">操作内容</th>-->
  136. </tr>
  137. </thead>
  138. </table>
  139. </div>
  140. </div>
  141. <!--<script src="../css/laydate/laydate.js"></script>-->
  142. <script src="../js/laydate/laydate.js"></script>
  143. <script>
  144. var table = $('#table1');
  145. var token = $.cookie("token");
  146. // laydate.skin('blue');
  147. laydate.render({
  148. elem: '#startTime',
  149. range : '~',
  150. });
  151. $('.search').click(function(){
  152. initTable(token);
  153. })
  154. //==================删除功能开始================================
  155. //删除按钮
  156. $('.del').click(function() {
  157. var ids = $.map(table.bootstrapTable('getSelections'),
  158. function (row) {
  159. return row.F_Id;
  160. });
  161. /*判断长度*/
  162. if (ids.length <= 0) {
  163. layer.confirm('没有可删除的选项?', {
  164. btn: ['确定'] //按钮
  165. });
  166. return;
  167. }
  168. del();
  169. })
  170. //*****************删除功能结束****************************
  171. initTable(token);
  172. function initTable(token) {
  173. console.log($('.loginTime').val())
  174. //先销毁表格
  175. table.bootstrapTable('destroy');
  176. //初始化表格,动态从服务器加载数据
  177. table.bootstrapTable({
  178. method: "get", //使用get请求到服务器获取数据
  179. url: huayi.config.callcenter_url+"Log/GetList", //获取数据的Servlet地址
  180. contentType: "application/x-www-form-urlencoded",striped: true, //表格显示条纹
  181. pagination: true, //启动分页
  182. sortable: true, //是否启用排序
  183. pageSize: 10, //每页显示的记录数
  184. pageNumber: 1, //当前第几页
  185. pageList: [10, 20, 50, 100], //记录数可选列表
  186. search: false, //是否启用查询
  187. showColumns: false, //显示下拉框勾选要显示的列
  188. showRefresh: false, //显示刷新按钮
  189. sidePagination: "server", //表示服务端请求
  190. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  191. //设置为limit可以获取limit, offset, search, sort, order
  192. queryParamsType: "undefined",
  193. queryParams: function queryParams(params) { //设置查询参数
  194. var param = {
  195. page: params.pageNumber,
  196. pagesize: params.pageSize,
  197. token: token,
  198. deptid:$('.czName').val(),//单位名称
  199. logindate: $('.loginTime').val() && $('.loginTime').val().split(' ~ ')[0] ,
  200. endlogindate : $('.loginTime').val() && $('.loginTime').val().split(' ~ ')[1],
  201. };
  202. return param;
  203. },
  204. onLoadSuccess: function(data) { //加载成功时执行
  205. //layer.msg("加载成功");
  206. },
  207. onLoadError: function() { //加载失败时执行
  208. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  209. }
  210. });
  211. }
  212. /*选中行添加背景颜色*/
  213. table.on("click-row.bs.table", function(e, row, ele) {
  214. $('.success').removeClass('success'); //去除之前选中的行的,选中样式
  215. $(ele).addClass('success'); //添加当前选中的 success样式用于区别
  216. });
  217. function setCode(val, row, index) {
  218. return index + 1;
  219. }
  220. function del() {
  221. layer.confirm('确定删除当前记录?', {
  222. btn: ['是', '否'] //按钮
  223. }, function () {
  224. /*执行删除*/
  225. var ids = $.map(table.bootstrapTable('getSelections'),
  226. function (row) {
  227. return row.F_Id;
  228. });
  229. /*发送请求*/
  230. $.post(huayi.config.callcenter_url + "Log/Delete", {
  231. ids: ids,
  232. token: $.cookie("token")
  233. }, function (result) {
  234. result = JSON.parse(result);
  235. if (result.state.toLowerCase() == "success") {
  236. layer.msg("删除成功");
  237. initTable(token);
  238. }
  239. })
  240. });
  241. }
  242. // 用户部门
  243. function bumen() {
  244. $("#testInput1").empty();
  245. $("<option value=''>请选择</option>").appendTo("#testInput1");
  246. $.getJSON(
  247. huayi.config.callcenter_url + "Department/GetDeptList",
  248. {
  249. iscbdw: -1,
  250. token: $.cookie("token"),
  251. },
  252. function (data) {
  253. if (data.state.toLowerCase() == "success") {
  254. var content = data.data;
  255. $(content).each(function (i, n) {
  256. $(
  257. "<option value='" +
  258. n.F_DeptId +
  259. "'>" +
  260. n.F_DeptName +
  261. "</option>"
  262. ).appendTo("#testInput1");
  263. });
  264. $("#testInput1").comboSelect();
  265. }
  266. }
  267. );
  268. }
  269. bumen()
  270. </script>
  271. </body>
  272. </html>