123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <!DOCTYPE html>
- <html>
- <head>
- <jsp:include page="../common/common-meta-include.jsp"></jsp:include>
- <jsp:include page="../common/common-js-include.jsp"></jsp:include>
- <jsp:include page="../common/common-css-include.jsp"></jsp:include>
-
- </head>
- <body>
- <div id="app"></div>
- <template id="template">
- <div class="layui-layout layui-layout-admin pd0">
-
- <div class="right_title">
- <div class="txt">日志查询<div class="top-breadcrumb"></div></div>
- <%-- <button class="btn btn_add" @click="add"><i class="layui-icon layui-icon-add-circle"></i> 新增</button>--%>
- <div class="layui-collapse search_form">
- <div class="layui-colla-item">
- <%-- <h2 class="layui-colla-title">筛选</h2>--%>
- <div class="layui-colla-content layui-show">
- <form class="layui-form" lay-filter="searchForm">
- <div class="layui-row">
- <div class="layui-col-xs6 layui-col-sm6 layui-col-md4">
- <div class="layui-form-item">
- <label class="layui-form-label">登录名</label>
- <div class="layui-input-block">
- <input type="text" name="loginName" placeholder="请输入" autocomplete="off" class="layui-input">
- </div>
- </div>
- </div>
- </div>
- <div class="layui-row">
- <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
- <button type="button" class="layui-btn layui-btn-normal" @click="search">查询</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- <div class="table_box" style="padding-top: 0;">
- <div class="table_process">
- <table id="table1" lay-filter="test"></table>
- <div class="pagination-box" id="pagination"></div>
- </div>
- </div>
- <div style="height: 20px;"></div>
- </div>
- </template>
- <script type="text/html" id="statusTemplate">
- {{# if(d.status){ }}
- 成功
- {{# } else { }}
- 失败
- {{# } }}
- </script>
- <script>
- new Vue({
- el: "#app",
- template: "#template",
- data: {
- winH: 0,
- dataList : [],
- amtSum:"",
- tableName : 'test',
- pageNo : 1,
- indusKind : {},
- propKind : {},
- sortZje: '',
- sortCe: '',
- sortTime: '',
- sort: {
- field: 'amtTatol',
- type: null
- },
- kind: {},
- pageSize : 10
- },
- mounted : function() {
- this.init();
- },
- methods: {
- init : function() {
- this.winH = document.body.clientHeight
- this.getData();
-
- window.addEventListener('message', this.receiveMessage, false);
- window.parent.postMessage('init loaded')
- },
- getData : function(){
- var self = this;
- var param = layui.form.getValue("searchForm");
- param.pageNo = this.pageNo;
- param.pageSize = this.pageSize;
- App.postJson("/api/loginlog/list",param, function(res){
- self.dataList = res.rows;
- self.loadPage(res.total);
- self.loadTable();
- });
- },
- loadTable : function(){
- var self = this;
- layui.table.render({
- elem: '#table1',
- even: true,
- autoSort: false,
- initSort: self.sort,
- cols: [[
- {type: 'numbers', align: 'center',title:'序号',width:44},
- {field: 'loginname', title: '登录名', minWidth: 300},
- {field: 'ip', title: 'ip', minWidth: 100},
- {field: 'remark', title: '备注', minWidth: 100},
- {field: 'createTime', title: '登录时间', minWidth: 100},
- {field: 'status', title: '登录状态', minWidth: 300, templet:'#statusTemplate'},
- ]],
- fixed:true,
- data : self.dataList,
- done: function (res, curr, count) {
- res.data.forEach(function (item, index) {
- $(".layui-table-body tr").resize(function () {
- $(".layui-table-body tr").each(function (index, val) {
- $($(".layui-table-fixed .layui-table-body table tr")[index]).height($(val).height());
- });
- });
-
- $(".layui-table-body tr").each(function (index, val) {
- $($(".layui-table-fixed .layui-table-body table tr")[index]).height($(val).height());
- });
- });
- }
- });
- layui.table.on('tool('+this.tableName+')', function(obj){
- var event = obj.event;
- self[event].call(this, obj);
- });
- },
- loadPage : function(totalCount){
- var self = this;
- layui.laypage.render({
- elem: 'pagination',
- count: totalCount,
- curr : self.pageNo,
- limit : self.pageSize,
- layout: ['count', 'prev', 'page', 'next', 'skip'],
- jump: function(obj, first) {
-
- if(!first) {
- self.pageNo = obj.curr;
- self.getData();
- }
- }
- });
- },
- search : function(){
- this.pageNo = 1;
- this.getData();
- },
- receiveMessage (e) {
- console.log('cb receiveMessage: ', e.data)
- if (e.data.topBreadcrumb) {
- $(".top-breadcrumb").html(e.data.topBreadcrumb)
- }
- }
- }
- });
- </script>
- </body>
- </html>
|