sysjoblog.js 2.27 KB
let action = null;

layui.config({
    base: "/js/",
    version: 111
}).use(['system'], function () {
    var form = layui.form,
        $ = layui.jquery,
        system = layui.system,
        table = layui.table,
        u = new system.u(),
        areaName = 'Log',
        tableName = 'Logs';

    action = {
        queryOptions: function () {
            var options = {
                resetFrom: "form[lay-filter=listForm]",
                fromId: "listForm",
                urlQuery: `/${areaName}/${tableName}/LoadJobLog`,
                mainTable: app.data.tableIns
            }
            return options;
        },

        //所有动作成功之后
        actionSuccess: (falg) => {
            app.data.tableIns.config.where = {};
            app.data.tableIns.config.page.curr = 1;
            app.data.tableIns.reload("mainList", {});
        }
    }

    var app = {
        data: {
            cols: [[
                { field: 'id', width: 80,  hide: true, title: 'Id' },
                { field: 'jobName', width: 150,   title: '任务名称' },
                { field: 'jobGroup', width: 150, hide: true, title: '任务组名' },

                { field: 'exceptionInfo', width: 400, title: '异常信息' },
                { field: 'methodName', width: 150,   title: '任务方法' },
                { field: 'methodParams', width: 150,   title: '参数' },

                { field: 'jobMessage', width: 180,   title: '日志信息' },
                { field: 'createTime', width: 150,   title: '创建时间' },
                { field: 'createBy', width: 150,   title: '创建用户' }
            ]],
            tableIns: null,
            tableElem: "mainList"
        },
        methods: {
            initTable: function () {
                let options = {
                    elem: "#" + app.data.tableElem,
                    url: `/${areaName}/${tableName}/LoadJobLog`,
                    cols: u.columnRecord(app.data.tableElem, app.data.cols),
                    toolbar: '#toolbarTable'
                }
                app.data.tableIns = u.initTable(options);
            }
        },
        registerEvent: function () {

        },
        init: function () {
            app.methods.initTable();
            app.registerEvent();
        }
    };
    app.init();
});