menu.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. {template 'common/header'}
  2. <div class="js-menu-container" ng-controller="MenuCtrl" ng-cloak>
  3. <div class="we7-padding-bottom clearfix">
  4. <div class="pull-right">
  5. <a class="btn btn-primary we7-padding-horizontal" ng-click="editItemPanel({group : 'frame'})">+新建菜单</a>
  6. </div>
  7. </div>
  8. <div class="panel we7-panel panel-table">
  9. <div class="panel-heading">
  10. <div class="table-div table-div-menu">
  11. <div class="table-div__item order">排序</div>
  12. <div class="table-div__item name">菜单</div>
  13. <div class="table-div__item display">开关</div>
  14. <div class="table-div__item action">操作</div>
  15. </div>
  16. </div>
  17. <div class="panel-body system-menu-list">
  18. <ul class="one">
  19. {loop $system_menu $permission_name $menu}
  20. {if $menu['title']!=''}
  21. <li class="menu-item">
  22. <div class="table-div table-div-menu">
  23. <div class="table-div__item order">
  24. {php echo intval($menu['displayorder'])}
  25. </div>
  26. <div class="table-div__item name">{$menu['title']}</div>
  27. <div class="table-div__item display">
  28. {if in_array($permission_name, array('appmarket', 'site', 'myself'))}
  29. <span class="color-gray">不可关闭</span>
  30. {else}
  31. <span class="switch" ng-init="displayStatus['{$permission_name}'] = {php echo $menu['is_display'] ? 'true' : 'false'}" ng-click="changeDisplay('{$permission_name}')" ng-class="{'switchOn' : displayStatus['{$permission_name}'], 'switchOff' : !displayStatus['{$permission_name}']}"></span>
  32. {/if}
  33. </div>
  34. <div class="table-div__item action">
  35. <div class="link-group">
  36. {if empty($menu['is_system'])}
  37. <a href="javascript:;" ng-click="removeSubItem('{$menu['permission_name']}')">删除</a>
  38. {/if}
  39. <a href="javascript:;" ng-click="editMainMenu({php echo intval($menu['displayorder'])}, '{$permission_name}')">编辑</a>
  40. {if !empty($menu['section'])}
  41. <a href="javascript:;" class="toggle"></a>
  42. {/if}
  43. </div>
  44. </div>
  45. </div>
  46. <ul class="two">
  47. {loop $menu['section'] $section_name $section}
  48. <li class="menu-item">
  49. <div class="table-div table-div-menu">
  50. <div class="table-div__item order">
  51. {php echo intval($section['displayorder'])}
  52. </div>
  53. <div class="table-div__item name">{$section['title']}</div>
  54. <div class="table-div__item display">
  55. {if in_array($section_name, $account_all_type_sign)}
  56. <span class="switch" ng-init="displayStatus['{$section_name}'] = {php echo $section['is_display'] ? 'true' : 'false'}" ng-click="changeDisplay('{$section_name}')" ng-class="{'switchOn' : displayStatus['{$section_name}'], 'switchOff' : !displayStatus['{$section_name}']}"></span>
  57. {/if}
  58. <!--<span class="switch switchOn"></span>-->
  59. </div>
  60. <div class="table-div__item action">
  61. <div class="link-group">
  62. <a href="javascript:;" class="toggle"></a>
  63. </div>
  64. </div>
  65. </div>
  66. <ul class="three">
  67. {if in_array($section_name, $account_all_type_sign)}
  68. {php $section_menu_two = $section['section']}
  69. {else}
  70. {php $section_menu_two = $section['menu']}
  71. {/if}
  72. {loop $section_menu_two $sub_permission_name $sub_menu}
  73. {if $sub_permission_name == 'wxapp_platform_material'}
  74. {php continue;}
  75. {/if}
  76. <li class="menu-item ">
  77. <div class="table-div table-div-menu">
  78. <div class="table-div__item order">
  79. {php echo intval($sub_menu['displayorder'])}
  80. </div>
  81. <div class="table-div__item name">{$sub_menu['title']}</div>
  82. <div class="table-div__item display">
  83. {if $sub_permission_name == 'system_setting_menu'}
  84. <span class="color-gray">默认开启</span>
  85. {else}
  86. {if !in_array($section_name, $account_all_type_sign)}
  87. <span class="switch" ng-init="displayStatus['{$sub_menu['permission_name']}'] = {php echo $sub_menu['is_display'] ? 'true' : 'false'}" ng-click="changeDisplay('{$sub_menu['permission_name']}')" ng-class="{'switchOn' : displayStatus['{$sub_menu['permission_name']}'], 'switchOff' : !displayStatus['{$sub_menu['permission_name']}']}"></span>
  88. {/if}
  89. {/if}
  90. </div>
  91. <div class="table-div__item action">
  92. <div class="link-group">
  93. {if $section_name != 'platform_module'}
  94. <a href="javascript:;" ng-click="addSubItem('{$sub_permission_name}', {title : '', displayorder : 0, isDisplay : 1})">+添加子菜单</a>
  95. {/if}
  96. <a href="javascript:;" ng-click="editItemPanel({displayorder: '{$sub_menu['displayorder']}', title : '{$sub_menu['title']}', url : '{$sub_menu['url']}', permissionName : '{$sub_menu['permission_name']}', isSystem : '{$sub_menu['is_system']}', id : '{$sub_menu['id']}', 'group' : '{$sub_menu['group']}', 'icon' : '{$sub_menu['icon']}'})">编辑</a>
  97. {if empty($sub_menu['is_system'])}<a href="javascript:;" ng-click="removeSubItem('{$sub_permission_name}')">删除</a>{/if}
  98. {if !empty($sub_menu['menu'])}
  99. <a href="javascript:;" class="toggle"></a>
  100. {/if}
  101. </div>
  102. </div>
  103. </div>
  104. <ul class="four">
  105. {if in_array($section_name, $account_all_type_sign)}
  106. {loop $sub_menu['menu'] $sub_menu_permission_name $sub_menu_permission}
  107. <li class="menu-item ">
  108. <div class="table-div table-div-menu">
  109. <div class="table-div__item order">
  110. {php echo intval($sub_menu_permission['displayorder'])}
  111. </div>
  112. <div class="table-div__item name">{$sub_menu_permission['title']}</div>
  113. <div class="table-div__item display">
  114. {if $sub_menu_permission_name == 'system_setting_menu'}
  115. <span class="color-gray">默认开启</span>
  116. {else}
  117. <span class="switch" ng-init="displayStatus['{$sub_menu_permission['permission_name']}'] = {php echo $sub_menu_permission['is_display'] ? 'true' : 'false'}" ng-click="changeDisplay('{$sub_menu_permission['permission_name']}')" ng-class="{'switchOn' : displayStatus['{$sub_menu_permission['permission_name']}'], 'switchOff' : !displayStatus['{$sub_menu_permission['permission_name']}']}"></span>
  118. {/if}
  119. </div>
  120. <div class="table-div__item action">
  121. <div class="link-group">
  122. <a href="javascript:;" ng-click="editItemPanel({displayorder: '{$sub_menu_permission['displayorder']}', title : '{$sub_menu_permission['title']}', url : '{$sub_menu_permission['url']}', permissionName : '{$sub_menu_permission['permission_name']}', isSystem : '{$sub_menu_permission['is_system']}', id : '{$sub_menu_permission['id']}', 'group' : '{$sub_menu_permission['group']}', 'icon' : '{$sub_menu_permission['icon']}'})">编辑</a>
  123. {if empty($sub_menu_permission['is_system'])}<a href="javascript:;" ng-click="removeSubItem('{$sub_menu_permission['permission_name']}')">删除</a>{/if}
  124. <a href="javascript:;" class="toggle"></a>
  125. </div>
  126. </div>
  127. </div>
  128. </li>
  129. {/loop}
  130. {/if}
  131. </ul>
  132. </li>
  133. {/loop}
  134. </ul>
  135. </li>
  136. {/loop}
  137. </ul>
  138. </li>
  139. {/if}
  140. {/loop}
  141. </ul>
  142. </div>
  143. </div>
  144. <script>
  145. $('.toggle').click(function () {
  146. $(this).parent().parent().parent().parent().toggleClass('menu-open')
  147. })
  148. </script>
  149. <div class="modal fade bs-example-modal-sm" id="editorder" tabindex="-1" style="z-index:1039" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  150. <div class="modal-dialog we7-modal-dialog ">
  151. <div class="modal-content">
  152. <div class="modal-header">
  153. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  154. <h4 class="modal-title">编辑菜单</h4>
  155. </div>
  156. <form action="" method="post" enctype="multipart/form-data" class="we7-form form" >
  157. <div class="modal-body">
  158. <div class="form-group">
  159. <label class="col-sm-2 control-label">菜单排序</label>
  160. <div class="col-sm-10">
  161. <input type="text" min="0" ng-model="mainMenu.displayorder" class="form-control">
  162. <span class="help-block">注:生序排列。数字越小,排名越靠前</span>
  163. </div>
  164. </div>
  165. </div>
  166. <div class="modal-footer">
  167. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  168. <button type="button" class="btn btn-primary" name="submit" value="保存" ng-click="saveorder()">保存</button>
  169. </div>
  170. </form>
  171. </div>
  172. </div>
  173. </div>
  174. <div class="modal fade bs-example-modal-sm js-edit-panel" id="edit" tabindex="-1" style="z-index:1039" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  175. <div class="modal-dialog we7-modal-dialog ">
  176. <div class="modal-content">
  177. <div class="modal-header">
  178. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  179. <h4 class="modal-title">编辑菜单</h4>
  180. </div>
  181. <form action="" method="post" enctype="multipart/form-data" class="we7-form form" >
  182. <div class="modal-body">
  183. <div class="form-group">
  184. <label class="col-sm-2 control-label">菜单排序</label>
  185. <div class="col-sm-10">
  186. <input type="text" name="displayorder" ng-model="activeItem.displayorder" class="form-control">
  187. </div>
  188. </div>
  189. <div class="form-group">
  190. <label class="col-sm-2 control-label">菜单名称</label>
  191. <div class="col-sm-10">
  192. <input type="text" name="title" ng-model="activeItem.title" class="form-control">
  193. </div>
  194. </div>
  195. <div class="form-group">
  196. <label class="col-sm-2 control-label"> 菜单标识</label>
  197. <div class="col-sm-10">
  198. <input type="text" name="permission_name" ng-readonly="activeItem.isSystem == '1'" ng-model="activeItem.permissionName" class="form-control">
  199. </div>
  200. </div>
  201. <div class="form-group">
  202. <label class="col-sm-2 control-label"> 菜单链接</label>
  203. <div class="col-sm-10">
  204. <input type="text" name="url" ng-readonly="activeItem.isSystem == '1'" ng-model="activeItem.url" class="form-control">
  205. <span class="help-block">注:支持相对链接。非相对链接请填写以http或https开头的完整链接</span>
  206. </div>
  207. </div>
  208. <div class="form-group" ng-hide="activeItem.isSystem == '1'">
  209. <label class="col-sm-2 control-label"> 菜单图标</label>
  210. <div class="col-sm-10">
  211. <div class="input-group">
  212. <input type="text" name="icon" value="" ng-model="activeItem.icon" class="form-control">
  213. <span class="input-group-addon" style="width:35px; border-left:none"><i class="fa fa-external-link"></i></span>
  214. <span class="input-group-btn"> <a href="javascript:;" class="btn btn-default" ng-click="selectMenuIcon();">&nbsp;选择图标</a></span>
  215. </div>
  216. </div>
  217. </div>
  218. </div>
  219. <div class="modal-footer">
  220. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  221. <button type="button" class="btn btn-primary" name="submit" value="保存" ng-click="editItem()">保存</button>
  222. </div>
  223. </form>
  224. </div>
  225. </div>
  226. </div>
  227. </div>
  228. <script type="text/javascript">
  229. $(function(){
  230. angular.bootstrap($('.js-menu-container'), ['systemApp']);
  231. });
  232. </script>
  233. {template 'common/footer'}