Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

92 строки
3.5 KiB

  1. <title>模板参数设置</title>
  2. <div class="layui-card layadmin-header">
  3. <div class="layui-breadcrumb" lay-filter="breadcrumb">
  4. <a lay-href="">主页</a>
  5. <a><cite>系统设置</cite></a>
  6. <a><cite>信息管理</cite></a>
  7. <a><cite>模板管理</cite></a>
  8. <a><cite>模板参数设置</cite></a>
  9. </div>
  10. </div>
  11. <div class="layui-fluid">
  12. <blockquote class="layui-elem-quote layui-bg-orange">设置的参数您可以在模版中通过 {$kx.tplconfig.参数KEY} 调用;</blockquote>
  13. <div class="layui-card">
  14. <div id="layui-search" class="layui-form layui-form layui-card-header layuiadmin-card-header-auto" style="display: none">
  15. <div class="layui-form-item">
  16. <div id="layui-search-fields" class="layui-search-fields" style="display: inline-block">
  17. </div>
  18. <div id="layui-search-button" class="layui-inline">
  19. <button class="layui-btn layuiadmin-btn" lay-submit lay-filter="LAY-front-search">
  20. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
  21. </button>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="layui-card-body">
  26. <div style="padding-bottom: 10px;" id="layui-top-button">
  27. </div>
  28. <table id="LAY-curd-table" lay-filter="LAY-curd-table"></table>
  29. <script type="text/html" id="table-curd-list">
  30. </script>
  31. </div>
  32. </div>
  33. </div>
  34. <script>
  35. var config = {
  36. api: {
  37. list: '/manage/template/config.json',
  38. config: '/manage/template/config.json',
  39. },
  40. tableEdit: function (obj, elem) {
  41. },
  42. topButton: {
  43. add: {
  44. text: '添加一行',
  45. action: function () {
  46. layui.table.cache["LAY-curd-table"].push({name: '', key: '', value: ''});
  47. tableIns.reload({url: '', data: layui.table.cache["LAY-curd-table"]})
  48. }
  49. },
  50. save: {
  51. text: '保存',
  52. action: function () {
  53. var items = [];
  54. layui.each(layui.table.cache["LAY-curd-table"], function (k, v) {
  55. if (!(v instanceof Array) && v.key) {
  56. items.push(v);
  57. }
  58. });
  59. layui.admin.req({
  60. url: config.api.config,
  61. data: {template: layui.router().search.template, items: items},
  62. method: 'POST',
  63. success: function (res) {
  64. tableIns.reload({url: '', data: res.data});
  65. layer.msg('操作成功');
  66. }
  67. });
  68. }
  69. }
  70. },
  71. actionButton: {
  72. del: {
  73. action(obj) {
  74. obj.del()
  75. }
  76. },
  77. },
  78. table: {
  79. where: {template: layui.router().search.template},
  80. height: 0,
  81. cols: [[
  82. {field: 'name', title: '参数名', edit: 'text'},
  83. {field: 'key', title: '参数KEY', edit: 'text'},
  84. {field: 'value', title: '参数值', edit: 'text'},
  85. {title: '操作', width: 220, align: 'center', fixed: 'right', toolbar: '#table-curd-list'}
  86. ]],
  87. }
  88. };
  89. layui.use('curd/list', layui.factory('curd/list'));
  90. </script>