自动化立体仓库 - WMS系统
lty
8 天以前 539a56279625242c497b4b4093f2defbb9d80334
src/main/webapp/static/js/apiLog/apiLog.js
@@ -9,7 +9,31 @@
    var form = layui.form;
    var admin = layui.admin;
    function getCols() {
        return [[
            {type: 'checkbox'}
            // ,{field: 'id', align: 'center',title: 'ID'}
            // ,{field: 'uuid', align: 'center',title: '日志编号'}
            ,{field: 'namespace', align: 'center',title: I18n.t('namespace')}
            ,{field: 'url', align: 'center',title: I18n.t('form_id')}
            ,{field: 'appkey', align: 'center',title: I18n.t('app_key'),hide: true}
            // ,{field: 'timestamp', align: 'center',title: '时间戳'}
            ,{field: 'clientIp', align: 'center',title: I18n.t('client_ip'),hide: true}
            ,{field: 'request', align: 'center',title: I18n.t('request_content')}
            ,{field: 'response', align: 'center',title: I18n.t('operation_content')}
            // ,{field: 'err', align: 'center',title: '异常内容'}
            ,{field: 'result$', align: 'center',title: I18n.t('result'), templet: '#resTpl', width: 80}
            // ,{field: 'status$', align: 'center',title: '状态'}
            ,{field: 'createTime$', align: 'center',title: I18n.t('add_time')}
            // ,{field: 'updateTime$', align: 'center',title: '修改时间'}
            ,{field: 'memo', align: 'center',title: I18n.t('memo'), hide: true}
            ,{fixed: 'right', title: I18n.t('operation'), align: 'center', toolbar: '#operate', width: 80}
        ]];
    }
    // 数据渲染
    var initTable = function() {
    tableIns = table.render({
        elem: '#apiLog',
        headers: {token: localStorage.getItem('token')},
@@ -20,26 +44,7 @@
        toolbar: '#toolbar',
        cellMinWidth: 50,
        height: 'full-120',
        cols: [[
            {type: 'checkbox'}
            // ,{field: 'id', align: 'center',title: 'ID'}
            // ,{field: 'uuid', align: 'center',title: '日志编号'}
            ,{field: 'namespace', align: 'center',title: '名称空间'}
            ,{field: 'url', align: 'center',title: '表单ID'}
            ,{field: 'appkey', align: 'center',title: '平台密钥',hide: true}
            // ,{field: 'timestamp', align: 'center',title: '时间戳'}
            ,{field: 'clientIp', align: 'center',title: 'URL',hide: true}
            ,{field: 'request', align: 'center',title: '请求内容'}
            ,{field: 'response', align: 'center',title: '操作内容'}
            // ,{field: 'err', align: 'center',title: '异常内容'}
            ,{field: 'result$', align: 'center',title: '结果', templet: '#resTpl', width: 80}
            // ,{field: 'status$', align: 'center',title: '状态'}
            ,{field: 'createTime$', align: 'center',title: '添加时间'}
            // ,{field: 'updateTime$', align: 'center',title: '修改时间'}
            ,{field: 'memo', align: 'center',title: '备注', hide: true}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 80}
        ]],
            cols: getCols(),
        request: {
            pageName: 'curr',
            pageSize: 'limit'
@@ -61,7 +66,36 @@
            }
            pageCurr=curr;
            limit();
                I18n.updatePage();
                setTimeout(function() {
                    I18n.updateLayuiPagination();
                }, 100);
        }
        });
    }
    if (typeof I18n !== 'undefined' && I18n.isReady()) {
        initTable();
    } else {
        $(document).on('i18n:ready', initTable);
    }
    $(document).on('i18n:languageChanged', function() {
        tableIns.reload({
            cols: getCols(),
            done: function(res, curr, count) {
                if (res.code === 403) {
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                limit();
                I18n.updatePage();
                setTimeout(function() {
                    I18n.updateLayuiPagination();
                }, 100);
            }
        });
        I18n.updatePage();
    });
    // 监听排序事件
@@ -74,7 +108,18 @@
        searchData['orderByType'] = obj.type;
        tableIns.reload({
            where: searchData,
            page: {curr: 1}
            page: {curr: 1},
            done: function(res, curr, count) {
                if (res.code === 403) {
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                limit();
                I18n.updatePage();
                setTimeout(function() {
                    I18n.updateLayuiPagination();
                }, 100);
            }
        });
    });
@@ -156,6 +201,7 @@
            title: (mData ? '修改' : '添加') + '订单状态',
            content: $('#editDialog').html(),
            success: function (layero, dIndex) {
                I18n.updatePage(layero);
                layDateRender(mData);
                form.val('detail', mData);
                form.on('submit(editSubmit)', function (data) {
@@ -259,6 +305,17 @@
    });
    tableIns.reload({
        where: searchData,
        page: {curr: pageCurr}
        page: {curr: pageCurr},
        done: function(res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            limit();
            I18n.updatePage();
            setTimeout(function() {
                I18n.updateLayuiPagination();
            }, 100);
        }
     });
}