人人商城

menu.html 11KB

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