| | |
| | | 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')}, |
| | |
| | | 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' |
| | |
| | | } |
| | | 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(); |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | |
| | | 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); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | I18n.updatePage(layero); |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | |
| | | }); |
| | | 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); |
| | | } |
| | | }); |
| | | } |