read_list_view.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {extend name="public/layout" /} {block name="title"}素材库{/block}
  2. {block name="body"}
  3. <style>
  4. html,
  5. body {
  6. display: block;
  7. /*min-width: 1100px;*/
  8. background-color: white;
  9. }
  10. .layui-table thead tr,
  11. .layui-table-header {
  12. background-color: #D8E6F1 !important;
  13. }
  14. </style>
  15. <body>
  16. <div class="layui-fluid">
  17. <table id="log" lay-filter="log"></table>
  18. </div>
  19. <script type="text/html" id="employeetpl">
  20. {{# if(d.employee){ }}
  21. {{d.employee.name}}
  22. {{# }else{ }}
  23. {{# } }}
  24. </script>
  25. <script type="text/html" id="sawtpl">
  26. {{# if(d.saw == 1){ }}
  27. 已读
  28. {{# }else{ }}
  29. 未读
  30. {{# } }}
  31. </script>
  32. {/block}
  33. {block name="js"}
  34. <script>
  35. layui.config({
  36. base: '__LAYUI__/',
  37. urlbase: '/sys'
  38. }).extend({
  39. index: 'lib/index' //主入口模块
  40. }).use(['index', 'table'], function () {
  41. var $ = layui.$,
  42. table = layui.table;
  43. table.render({
  44. elem: '#log',
  45. url: '{:url("msg/read_list")}?index='+"{$id}",
  46. page: true,
  47. height: 'full-50',
  48. cols: [
  49. [{
  50. type: 'numbers',
  51. field: 'id',
  52. fixed: 'left',
  53. title: '序号',
  54. }, {
  55. align: 'employee',
  56. toolbar: '#employeetpl',
  57. title: '接收人',
  58. }, {
  59. align: 'center',
  60. field: 'saw',
  61. title: '状态',
  62. toolbar: '#sawtpl',
  63. }]
  64. ],
  65. text: '对不起,加载出现异常!'
  66. });
  67. });
  68. </script>
  69. {/block}