心理咨询网
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.

menu.html 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. {include file='common/head.html'}
  2. <div class="layui-body">
  3. {if([$list])}
  4. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  5. <ul class="layui-tab-title">
  6. <li class="layui-this" lay-id="t1">菜单列表</li>
  7. <li lay-id="t2">菜单新增</li>
  8. </ul>
  9. <div class="layui-tab-content">
  10. <div class="layui-tab-item layui-show">
  11. <table class="layui-table" id="menuTable">
  12. <thead>
  13. <tr>
  14. <th>序号</th>
  15. <th>菜单名称</th>
  16. <th>菜单编码</th>
  17. <th>父编码</th>
  18. <th>排序</th>
  19. <th>URL</th>
  20. <th>状态</th>
  21. <th>操作</th>
  22. </tr>
  23. </thead>
  24. <tbody>
  25. {foreach $menus(key,value)}
  26. <tr data-tt-id='[value->mcode]' data-tt-parent-id="[value->pcode]">
  27. <td>[num]</td>
  28. <td>
  29. <i class="fa [value->ico]" aria-hidden="true"></i>
  30. [value->name]</td>
  31. <td>[value->mcode]</td>
  32. <td>[value->pcode]</td>
  33. <td>[value->sorting]</td>
  34. <td>[value->url]</td>
  35. <td>
  36. {if($value->status)}
  37. <a href="{url./admin/'.C.'/mod/mcode/'.$value->mcode.'/field/status/value/0}"><i class='fa fa-toggle-on' title="点击关闭显示"></i></a>
  38. {else}
  39. <a href="{url./admin/'.C.'/mod/mcode/'.$value->mcode.'/field/status/value/1}"><i class='fa fa-toggle-off' title="点击开启显示"></i></a>
  40. {/if}
  41. </td>
  42. <td>
  43. {fun=get_btn_del($value->mcode,'mcode')}
  44. {fun=get_btn_mod($value->mcode,'mcode')}
  45. </td>
  46. </tr>
  47. {/foreach}
  48. </tbody>
  49. </table>
  50. <script>
  51. $("#menuTable").treetable({ expandable: true,column: 1,indent:20,stringCollapse:'收缩',stringExpand:'展开' });
  52. </script>
  53. </div>
  54. <div class="layui-tab-item">
  55. <form action="{url./admin/Menu/add}" method="post" class="layui-form">
  56. <input type="hidden" name="formcheck" value="{$formcheck}" >
  57. <div class="layui-form-item">
  58. <label class="layui-form-label">父菜单</label>
  59. <div class="layui-input-block">
  60. <select name="pcode" lay-verify="required">
  61. <option value="0">顶级菜单 </option>
  62. {$menu_select}
  63. </select>
  64. </div>
  65. </div>
  66. <div class="layui-form-item">
  67. <label class="layui-form-label">菜单名称</label>
  68. <div class="layui-input-block">
  69. <input type="text" name="name" required lay-verify="required" placeholder="请输入菜单名称" class="layui-input">
  70. </div>
  71. </div>
  72. <div class="layui-form-item">
  73. <label class="layui-form-label">URL</label>
  74. <div class="layui-input-block">
  75. <input type="text" name="url" placeholder="请输入菜单URL" class="layui-input">
  76. </div>
  77. </div>
  78. <div class="layui-form-item">
  79. <label class="layui-form-label">排序</label>
  80. <div class="layui-input-block">
  81. <input type="text" name="sorting" placeholder="请输入菜单排序" value="255" class="layui-input">
  82. </div>
  83. </div>
  84. <div class="layui-form-item">
  85. <label class="layui-form-label">状态</label>
  86. <div class="layui-input-block">
  87. <input type="radio" name="status" value="1" title="显示" checked>
  88. <input type="radio" name="status" value="0" title="隐藏">
  89. </div>
  90. </div>
  91. <div class="layui-form-item">
  92. <label class="layui-form-label">桌面快捷图</label>
  93. <div class="layui-input-block">
  94. <input type="radio" name="shortcut" value="1" title="是" checked>
  95. <input type="radio" name="shortcut" value="0" title="否">
  96. </div>
  97. </div>
  98. <div class="layui-form-item">
  99. <label class="layui-form-label">快捷图标</label>
  100. <div class="layui-input-block">
  101. <input type="text" name="ico" placeholder="请输入菜单快捷图标" class="layui-input">
  102. </div>
  103. </div>
  104. <div class="layui-form-item">
  105. <label class="layui-form-label">功能按钮</label>
  106. <div class="layui-input-block">
  107. {foreach $actions(key,value)}
  108. <input type="checkbox" name="actions[]" value="[value->value]" title="[value->item]">
  109. {/foreach}
  110. </div>
  111. </div>
  112. <div class="layui-form-item">
  113. <div class="layui-input-block">
  114. <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
  115. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  116. </div>
  117. </div>
  118. </form>
  119. </div>
  120. </div>
  121. </div>
  122. {/if}
  123. {if([$mod])}
  124. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  125. <ul class="layui-tab-title">
  126. <li class="layui-this">菜单修改</li>
  127. </ul>
  128. <div class="layui-tab-content">
  129. <div class="layui-tab-item layui-show">
  130. <form action="{url./admin/Menu/mod/mcode/'.[$get.mcode].'}{$backurl}" method="post" class="layui-form">
  131. <input type="hidden" name="formcheck" value="{$formcheck}" >
  132. <div class="layui-form-item">
  133. <label class="layui-form-label">父菜单</label>
  134. <div class="layui-input-block">
  135. <select name="pcode" lay-verify="required">
  136. <option value="0">顶级菜单 </option>
  137. {$menu_select}
  138. </select>
  139. </div>
  140. </div>
  141. <div class="layui-form-item">
  142. <label class="layui-form-label">菜单名称</label>
  143. <div class="layui-input-block">
  144. <input type="text" name="name" required lay-verify="required" value="{$menu->name}" placeholder="请输入菜单名称" class="layui-input">
  145. </div>
  146. </div>
  147. <div class="layui-form-item">
  148. <label class="layui-form-label">URL</label>
  149. <div class="layui-input-block">
  150. <input type="text" name="url" value="{$menu->url}" placeholder="请输入菜单URL" class="layui-input">
  151. </div>
  152. </div>
  153. <div class="layui-form-item">
  154. <label class="layui-form-label">排序</label>
  155. <div class="layui-input-block">
  156. <input type="text" name="sorting" value="{$menu->sorting}" placeholder="请输入菜单排序" value="255" class="layui-input">
  157. </div>
  158. </div>
  159. <div class="layui-form-item">
  160. <label class="layui-form-label">状态</label>
  161. <div class="layui-input-block">
  162. <input type="radio" name="status" value="1" title="显示" {if([$menu->status]==1)}checked="checked"{/if}>
  163. <input type="radio" name="status" value="0" title="隐藏" {if([$menu->status]==0)}checked="checked"{/if}>
  164. </div>
  165. </div>
  166. <div class="layui-form-item">
  167. <label class="layui-form-label">桌面快捷图</label>
  168. <div class="layui-input-block">
  169. <input type="radio" name="shortcut" value="1" title="是" {if([$menu->shortcut]==1)}checked="checked"{/if}>
  170. <input type="radio" name="shortcut" value="0" title="否" {if([$menu->shortcut]==0)}checked="checked"{/if}>
  171. </div>
  172. </div>
  173. <div class="layui-form-item">
  174. <label class="layui-form-label">快捷图标</label>
  175. <div class="layui-input-block">
  176. <input type="text" name="ico" value="{$menu->ico}" placeholder="请输入菜单快捷图标" class="layui-input">
  177. </div>
  178. </div>
  179. <div class="layui-form-item">
  180. <label class="layui-form-label">功能按钮</label>
  181. <div class="layui-input-block">
  182. {foreach $actions(key,value)}
  183. <input type="checkbox" name="actions[]" value="[value->value]" {if(in_array($value->value,[$menu->actions]))}checked="checked"{/if} title="[value->item]">
  184. {/foreach}
  185. </div>
  186. </div>
  187. <div class="layui-form-item">
  188. <div class="layui-input-block">
  189. <button class="layui-btn" lay-submit>立即提交</button>
  190. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  191. {fun=get_btn_back()}
  192. </div>
  193. </div>
  194. </form>
  195. </div>
  196. </div>
  197. </div>
  198. {/if}
  199. </div>
  200. {include file='common/foot.html'}