截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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