实现view的扩展架构;调整think-view依赖;发布新版本

This commit is contained in:
2023-09-25 10:35:03 +08:00
parent 9f43e11f81
commit 5955a03d2c
94 changed files with 244 additions and 48 deletions

View File

@@ -0,0 +1,25 @@
<div class="layuimini-container">
<div class="layuimini-main">
<table id="currentTable" class="layui-table layui-hide" data-auth-add="{:auth('debug.log/add')}" data-auth-edit="{:auth('debug.log/edit')}" data-auth-delete="{:auth('debug.log/delete')}" lay-filter="currentTable">
</table>
</div>
</div>
<style>
[data-field="content"] .layui-table-cell {
white-space: normal !important;
height: auto !important;
color: #333;
}
.log-group-0 {
background-color: #e6e6e6;
}
.log-group-1 {
background-color: #f9f9f9;
}
.layui-table-view .layui-table td {
padding: 0
}
</style>

View File

@@ -0,0 +1,51 @@
$(function () {
var init = {
table_elem: '#currentTable',
table_render_id: 'currentTableRenderId',
index_url: 'debug.log/index',
add_url: 'debug.log/add',
edit_url: 'debug.log/edit',
delete_url: 'debug.log/delete',
export_url: 'debug.log/export',
modify_url: 'debug.log/modify',
};
var uidList = [];
ua.table.render({
init: init,
size: 'sm',
limit: 50,
cols: [[
{ type: 'checkbox' },
{ field: 'id', title: 'id', search: 'number_limit' },
{ field: 'id', title: 'id模糊匹配', trueHide: true, fieldAlias: '[id]like' },
{ field: 'id', title: '最大id', trueHide: true, fieldAlias: '[id]max', searchOp: 'max' },
{
field: 'uid', title: 'uid', minWidth: 120,
},
{ field: 'level', title: 'level', minWidth: 70 },
{
field: 'content', title: '日志内容', minWidth: 450, align: 'left', templet: function (data) {
if (uidList.indexOf(data.uid) < 0) {
uidList.push(data.uid);
}
var currentUidIndex = uidList.indexOf(data.uid);
var className = 'log-group log-group-' + (currentUidIndex % 2);
return '<div class="' + className + '">' + data.content + '</div>';
}
},
{ field: 'create_time', title: '记录时间', minWidth: 160, search: 'time_limit' },
{ field: 'app_name', title: 'app_name' },
{ field: 'controller_name', title: 'controller_name', },
{ field: 'action_name', title: 'action_name' },
]],
toolbar: [
'refresh',
'export'
]
});
ua.listen();
});