puzhibing
2023-11-28 7b726d5ff439e7b8bb66369ecc5881e370286bc8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/**
 * 角色管理的单例
 */
var SysOperationLog = {
    id: "SysOperationLogTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
 
/**
 * 初始化表格的列
 */
SysOperationLog.initColumn = function () {
    var columns = [
        {field: 'select_item', radio: true},
        {title: 'ID', field: 'id', align: 'center', valign: 'middle'},
        {title: '类型', field: 'menu', align: 'center', valign: 'middle'},
        {title: '配置人', field: 'name', align: 'center', valign: 'middle'},
        {title: '配置时间', field: 'createTime', align: 'center', valign: 'middle'},
        {title: '操作类型', field: 'operationType', align: 'center', valign: 'middle'},
        {title: '操作内容', field: 'content', align: 'center', valign: 'middle',
            formatter: function (value) {
                return '<span title="' + value + '">' + value + '</span>'
            }
        }
    ]
    return columns;
};
 
 
/**
 * 检查是否选中
 */
SysOperationLog.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if (selected.length == 0) {
        Feng.info("请先选中表格中的某一记录!");
        return false;
    } else {
        SysOperationLog.seItem = selected[0];
        return true;
    }
};
 
 
 
/**
 * 导出
 */
SysOperationLog.exportSysOperationLog = function () {
    let uri = Feng.ctxPath + "/sysOperationLog/exportSysOperationLog?";
    const menu = $("#menu").val();
    const user = $("#user").val();
    const createTime = $("#createTime").val();
    if(null != menu && '' != menu){
        uri += "menu=" + menu + "&";
    }
    if(null != user && '' != user){
        uri += "user=" + user + "&";
    }
    if(null != createTime && '' != createTime){
        uri += "createTime=" + createTime + "&";
    }
    window.location.href = uri;
};
 
/**
 * 删除
 */
SysOperationLog.delSysOperationLog = function () {
    if (this.check()) {
        var operation = function () {
            var ajax = new $ax(Feng.ctxPath + "/sysOperationLog/delSysOperationLog", function (data) {
                if(data.code == 200 ){
                    Feng.success("删除成功!");
                    SysOperationLog.table.refresh();
                }else{
                    Feng.error(data.msg);
                }
            }, function (data) {
                Feng.error("删除失败!" + data.responseJSON.message + "!");
            });
            ajax.set("id", SysOperationLog.seItem.id);
            ajax.start();
        };
 
        Feng.confirm("是否刪除该日志?", operation);
    }
};
 
 
/**
 * 搜索
 */
SysOperationLog.search = function () {
    var queryData = {};
    queryData['menu'] = $("#menu").val();
    queryData['user'] = $("#user").val();
    queryData['createTime'] = $("#createTime").val();
    SysOperationLog.table.setQueryParams({})
    SysOperationLog.table.refresh({query: queryData});
}
 
/**
 * 重置
 */
SysOperationLog.resetSearch = function(){
    var queryData = {};
    $("#menu").val('');
    $("#user").val('');
    $("#createTime").val('');
    SysOperationLog.table.setQueryParams({})
    SysOperationLog.table.refresh({query: queryData});
}
 
 
$(function () {
    var defaultColunms = SysOperationLog.initColumn();
    var table = new BSTable(SysOperationLog.id, "/sysOperationLog/querySysOperationLog", defaultColunms);
    table.setPaginationType("server");
    SysOperationLog.table = table.init();
 
});