截流自动化的商城平台
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. {layout name="layout2" /}
  2. <style>
  3. .layui-form-item .layui-input-inline {
  4. width: 270px;
  5. }
  6. </style>
  7. <div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
  8. <input type="hidden" value="{$detail.id}" name="id">
  9. <div class="layui-form-item">
  10. <label class="layui-form-label">父类菜单</label>
  11. <div class="layui-input-inline">
  12. <select name="pid" class="layui-select" lay-search>
  13. {eq name="detail.type" value="1"}<option value="0">顶级</option>{/eq}
  14. {volist name='menu_lists' id='vo'}
  15. <option value="{$vo.id}" {eq name="detail['pid']" value="$vo.id"} selected {/eq} >{$vo.name}</option>
  16. {/volist}
  17. </select>
  18. </div>
  19. </div>
  20. <div class="layui-form-item">
  21. <label class="layui-form-label">名称</label>
  22. <div class="layui-input-inline">
  23. <input type="text" name="name" placeholder="请输入菜单名称" autocomplete="off" class="layui-input" value="{$detail.name}" lay-verify="required" placeholder="请输入菜单名称" lay-vertype="tips">
  24. </div>
  25. </div>
  26. <div class="layui-form-item">
  27. <label class="layui-form-label">类型</label>
  28. <div class="layui-input-inline">
  29. <input type="radio" lay-filter="type" name="type" value="1" title="菜单" {eq name="detail.type" value="1"}checked{/eq}>
  30. <input type="radio" lay-filter="type" name="type" value="2" title="权限" {eq name="detail.type" value="2"}checked{/eq}>
  31. </div>
  32. </div>
  33. <div class="layui-form-item">
  34. <label class="layui-form-label">规则</label>
  35. <div class="layui-input-inline">
  36. <input type="text" name="uri" placeholder="请输入控制器方法规则:例:admin/lists" autocomplete="off" class="layui-input" lay-vertype="tips" value="{$detail.uri}">
  37. </div>
  38. </div>
  39. <div class="layui-form-item">
  40. <label class="layui-form-label">排序</label>
  41. <div class="layui-input-inline">
  42. <input type="number" name="sort" autocomplete="off" class="layui-input" lay-verify="required" placeholder="请输入排序,数字越大越靠前" lay-vertype="tips" value="{$detail.sort}">
  43. </div>
  44. </div>
  45. <div class="layui-form-item">
  46. <label class="layui-form-label">请选择图标</label>
  47. <div class="layui-input-inline">
  48. <input type="text" id="iconPicker" lay-filter="iconPicker" style="display:none;">
  49. <input type="hidden" name="icon" value="{$detail.icon}">
  50. </div>
  51. </div>
  52. <div class="layui-form-item">
  53. <label class="layui-form-label">状态</label>
  54. <div class="layui-input-inline">
  55. <input type="checkbox" lay-filter="disable" name="disable" lay-skin="switch" lay-text="启用|禁用" {if condition="$detail.disable eq 0" }checked{/if}>
  56. </div>
  57. </div>
  58. <div class="layui-form-item layui-hide">
  59. <input type="button" lay-submit lay-filter="menu-submit" id="menu-submit" value="确认">
  60. </div>
  61. </div>
  62. <script>
  63. layui.config({
  64. version:"{$front_version}",
  65. base: '/static/lib/'
  66. }).extend({
  67. iconPicker: 'iconpicker/module/iconPicker/iconPicker'
  68. }).use(['form','iconPicker'], function(){
  69. var $ = layui.$
  70. ,form = layui.form ;
  71. var iconPicker = layui.iconPicker;
  72. iconPicker.render({
  73. // 选择器,推荐使用input
  74. elem: '#iconPicker',
  75. // 数据类型:fontClass/unicode,推荐使用fontClass
  76. type: 'fontClass',
  77. // 是否开启搜索:true/false,默认true
  78. search: true,
  79. // 是否开启分页:true/false,默认true
  80. page: true,
  81. // 每页显示数量,默认12
  82. limit: 50,
  83. // 每个图标格子的宽度:'43px'或'20%'
  84. cellWidth: '43px',
  85. // 点击回调
  86. click: function (data) {
  87. $('input[name="icon"]').val(data.icon);
  88. }
  89. });
  90. iconPicker.checkIcon('iconPicker', '{$detail.icon}');
  91. form.on('radio(type)', function (data) {
  92. if (data.value == 1) {
  93. $("#pid").prepend("<option value='0'>顶级</option>");
  94. } else {
  95. $("#pid option[value='0']").remove();
  96. }
  97. form.render('select');
  98. });
  99. })
  100. </script>