index.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {extend name="../../base/view/common/base" /}
  2. <!-- 主体 -->
  3. {block name="body"}
  4. <div class="p-page">
  5. <table class="layui-hide" id="conf" lay-filter="conf"></table>
  6. </div>
  7. <script type="text/html" id="toolbarDemo">
  8. <div class="layui-btn-container">
  9. <h3>模块配置及数据权限配置</h3>
  10. </div>
  11. </script>
  12. {/block}
  13. <!-- /主体 -->
  14. <!-- 脚本 -->
  15. {block name="script"}
  16. <script>
  17. const moduleInit = ['tool'];
  18. function gouguInit() {
  19. var table = layui.table, tool = layui.tool, form = layui.form;
  20. layui.pageTable = table.render({
  21. elem: '#conf',
  22. title: '配置列表',
  23. toolbar: '#toolbarDemo',
  24. defaultToolbar: false,
  25. url: "/home/dataauth/index",
  26. cellMinWidth: 80,
  27. page: false, //开启分页
  28. limit: 20,
  29. cols: [
  30. [{
  31. field: 'id',
  32. width: 80,
  33. title: 'ID编号',
  34. align: 'center'
  35. }, {
  36. field: 'title',
  37. width: 200,
  38. title: '权限名称'
  39. }, {
  40. field: 'name',
  41. width: 200,
  42. title: '权限标识'
  43. }, {
  44. field: 'desc',
  45. minWidth: 300,
  46. title: '描述'
  47. }, {
  48. width: 100,
  49. title: '操作',
  50. align: 'center',
  51. templet: function (d) {
  52. var html = '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" >编辑配置</button>';
  53. return html;
  54. }
  55. }]
  56. ]
  57. });
  58. //监听行工具事件
  59. table.on('tool(conf)', function (obj) {
  60. var data = obj.data;
  61. if (obj.event === 'edit') {
  62. tool.side('/home/dataauth/edit?id=' + data.id);
  63. return;
  64. }
  65. });
  66. }
  67. </script>
  68. {/block}
  69. <!-- /脚本 -->