log.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ;
  2. layui.define(['form','table','code'], function (e) {
  3. var s = layui.$,
  4. l = (layui.layer, layui.laytpl, layui.setter, layui.view, layui.admin),
  5. table = layui.table,
  6. upload = layui.upload,
  7. code = layui.code,
  8. form = layui.form;
  9. table.render({
  10. elem:'#log-table'
  11. ,url:'load.html'
  12. ,where:{position:s('input[name=position]').val()}
  13. ,toolbar:'#topToolbar'
  14. ,cols: [[
  15. {field:'id', title: 'ID'}
  16. ,{field:'user', title: '用户'}
  17. ,{field:'action',title:'操作模块'}
  18. ,{field:'action_text',title:'操作说明'}
  19. ,{field:'create_time', title: '时间'}
  20. ,{title:'操作', fixed: 'right', width:150, align:'center', toolbar: '#rowToolbar'}
  21. ]]
  22. ,id: 'log-table'
  23. ,page: true
  24. });
  25. table.on('tool(log)', function(obj){
  26. var data = obj.data;
  27. var layEvent = obj.event;
  28. var tr = obj.tr;
  29. if(layEvent === 'params'){
  30. layer.open({
  31. type: 2,
  32. title: '查看参数',
  33. shadeClose: true,
  34. shade: true,
  35. area: ['50%', '80%'],
  36. content: 'params.html?id='+data['id']
  37. });
  38. }
  39. });
  40. var log = function(){}
  41. e('log',new log());
  42. })