group.html 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. {include file="public/header" /}
  2. <body class="gray-bg">
  3. <div class="layui-fluid layui-col-xs12">
  4. <div class="layui-card">
  5. <div class="layui-tab layui-tab-card">
  6. <ul class="layui-tab-title">
  7. {volist name="Think.config.config_group_list" id="group"}
  8. <a href="{:url('?id='.$key)}"><li {eq name="id" value="$key"}class="layui-this"{/eq}>{$group}配置</li></a>
  9. {/volist}
  10. </ul>
  11. <div class="layui-tab-content">
  12. <div class="layui-tab-item layui-show ">
  13. <div class="layui-form">
  14. <div class="layui-row layui-col-space10 layui-form-item ">
  15. {volist name="list" id="config"}
  16. <div class="layui-form-item layui-col-xs-offset1 layui-col-xs8">
  17. <label class="layui-form-label">{$config.title}</label>
  18. <div class="layui-input-block">
  19. {switch name="config.type"}
  20. {case value="0"}
  21. <input type="text"name="config[{$config.name}]" value="{$config.value}" lay-verify="required|number" placeholder="{$config.remark}" class="layui-input ">
  22. {/case}
  23. {case value="1"}
  24. <input type="text" name="config[{$config.name}]" value="{$config.value}" lay-verify="required" placeholder="{$config.remark}" class="layui-input ">
  25. {/case}
  26. {case value="2"}
  27. <textarea name="config[{$config.name}]" placeholder="{$config.remark}" lay-verify="required" class="layui-textarea">{$config.value}</textarea>
  28. {/case}
  29. {case value="3"}
  30. <textarea name="config[{$config.name}]" placeholder="{$config.remark}" lay-verify="required" class="layui-textarea">{$config.value}</textarea>
  31. {/case}
  32. {case value="4"}
  33. <select name="config[{$config.name}]" lay-verify="required" lay-search="">
  34. {volist name=":parse_config_attr($config['extra'])" id="vo"}
  35. <option value="{$key}" {eq name="config.value" value="$key"}selected{/eq}>{$vo}</option>
  36. {/volist}
  37. </select>
  38. {/case}
  39. {/switch}
  40. </div>
  41. </div>
  42. {/volist}
  43. {if condition='!empty($list)'}
  44. <div class="layui-form-item layui-col-xs-offset1 layui-col-xs8">
  45. <div class="layui-input-block">
  46. <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
  47. </button>
  48. </div>
  49. </div>
  50. {/if}
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. {include file="public/footer" /}
  59. <script>
  60. layui.use(['form'], function() {
  61. var form = layui.form;
  62. form.on('submit(component-form-element)', function (data) {
  63. $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
  64. $.ajax({
  65. url:"{:url('save')}",
  66. type:'post',
  67. dataType:'json',
  68. data:data.field,
  69. success:function(res){
  70. if (res.code == 200) {
  71. wk.success(res.msg);
  72. } else {
  73. wk.error(res.msg);
  74. }
  75. $(".layui-btn").removeClass('layui-disabled').removeAttr('disabled');
  76. }
  77. })
  78. });
  79. });
  80. </script>
  81. </body>
  82. </html>