detail.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <style>
  2. </style>
  3. <div class="layui-fluid">
  4. <div class="layui-card">
  5. <div class="layui-form layui-card-header layuiadmin-card-header-auto">
  6. <button class="layui-btn layuiadmin-btn" data-type="export">导出</button>
  7. </div>
  8. <div class="layui-card-body">
  9. <table id="{$lay_table}" lay-filter="{$lay_table}"></table>
  10. </div>
  11. </div>
  12. </div>
  13. <script>
  14. layui.use(['index', 'admin', 'form', 'table'], function () {
  15. const $ = layui.$;
  16. const admin = layui.admin;
  17. const form = layui.form;
  18. const table = layui.table;
  19. form.render();
  20. table.render({
  21. elem: '#{$lay_table}',
  22. url: "{:url('officer/listDetail')}?id={$id}",
  23. cols: [
  24. [
  25. {field: 'name', title: '姓名' ,width: 150},
  26. {field: 'mobile', title: '手机号', width: 200},
  27. {field: 'sex', title: '性别', width: 150},
  28. {field: 'age', title: '年龄', width: 150},
  29. {field: 'marry', title: '婚姻状况', width: 150},
  30. {field: 'education', title: '学历', width: 150},
  31. {field: 'major', title: '专业', width: 150},
  32. {field: 'score', title: '总分', width: 150},
  33. {field: 'create_time', title: '提交时间', align: 'center'},
  34. ]
  35. ],
  36. page: true,
  37. limit: 50,
  38. cellMinWidth: 150,
  39. text: '对不起,加载出现异常!'
  40. });
  41. //事件
  42. const active = {
  43. export: function() {
  44. const url = "{:url('officer/export')}?id={$id}";
  45. window.open(url);
  46. },
  47. };
  48. $('.layui-btn.layuiadmin-btn').on('click', function () {
  49. const type = $(this).data('type');
  50. active[type] ? active[type].call(this) : '';
  51. });
  52. });
  53. </script>