manage-modules-tpl-wxapp.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. {template 'common/header'}
  2. {template 'account/account-header'}
  3. <div id="js-account-manage-modules-tpl" ng-controller="AccountMangeModulesTpl" ng-cloak>
  4. <div class="alert alert-info">
  5. <p><i class="fa fa-exclamation-circle"></i> 无主管理员时,创始人为默认主管理员,小程序拥有所有权限</p>
  6. </div>
  7. {if !in_array($owner['uid'], $founders)}
  8. <table c class="table we7-table table-hover" >
  9. <tr>
  10. <th colspan="5" class="text-left">
  11. <span class="we7-padding-right">会员权限组: {{owner.group.name}}</span>
  12. <span></span>
  13. </th>
  14. {if $_W['role'] == ACCOUNT_MANAGE_NAME_FOUNDER && !in_array($owner['uid'], $founders)}
  15. <th class="text-right"><a href="{php echo url('user/edit/edit_modules_tpl',array('uid'=>$owner['uid']))}" class="color-default">修改</a></th>
  16. {else}
  17. <th class="text-right"><a href="" class="color-default"></a></th>
  18. {/if}
  19. </tr>
  20. <tbody ng-repeat="module_tpl in modules_tpl | filter:{'type':'default'}">
  21. <tr>
  22. <td colspan="5" class="text-left we7-padding-right" ng-init="module_tpl.show = true">
  23. <span>{{module_tpl.name}}</span>
  24. </td>
  25. <td>
  26. <div class="link-group">
  27. <a href="javascript:;" class="color-default" ng-show="module_tpl.show" ng-click="module_tpl.show = false">收起</a>
  28. <a href="javascript:;" class="color-default" ng-show="!module_tpl.show" ng-click="module_tpl.show = true">展开</a>
  29. <!--<a href="javascript:;" class="color-default">删除</a>-->
  30. </div>
  31. </td><!--默认展开-->
  32. </tr>
  33. <tr ng-show="module_tpl.show">
  34. <td colspan="5">
  35. <div class="col-sm-1 color-gray text-left we7-padding-none">小程序应用</div>
  36. <div class="col-sm-11">
  37. <div class="col-sm-3 text-left we7-margin-bottom" ng-repeat="module in module_tpl.wxapp">
  38. <div ng-if="module.name != 'all'" class="text-over text-left">
  39. <img ng-src="{{ module.logo }}" alt="" style="width:50px;height:50px;">
  40. {{ module.title }}
  41. </div>
  42. <label class="label label-info" ng-if="module.name == 'all'">所有模块</label>
  43. </div>
  44. </div>
  45. </td>
  46. <td class="we7-padding-right color-default"></td>
  47. </tr>
  48. <tr style="display:none;">
  49. <td colspan="5">
  50. <div class="col-sm-1 color-gray text-left we7-padding-none">小程序应用</div>
  51. <div class="col-sm-11">
  52. <div class="col-sm-3 text-left we7-margin-bottom" ng-repeat="module in module_tpl.wxapp">
  53. <a href="javascript:;" class="label label-info" ng-bind="module.title"></a>
  54. </div>
  55. </div>
  56. </td>
  57. <td class="we7-padding-right color-default"></td>
  58. </tr>
  59. <tr ng-show="module_tpl.show" style="display:none;">
  60. <td colspan="5">
  61. <div class="col-sm-1 color-gray text-left we7-padding-none">模板</div>
  62. <div class="col-sm-11">
  63. <div class="col-sm-3 text-left we7-margin-bottom" ng-repeat="tpl in module_tpl.templates">
  64. <a href="javascript:;" class="label label-info" ng-bind="tpl.title"></a>
  65. </div>
  66. </div>
  67. </td>
  68. <td class="we7-padding-right color-default"></td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. <table c class="table we7-table table-hover" >
  73. <tr>
  74. <th colspan="5" class="text-left">
  75. <span class="we7-padding-right">应用权限组</span>
  76. <span></span>
  77. </th>
  78. {if $_W['role'] == ACCOUNT_MANAGE_NAME_FOUNDER && !in_array($owner['uid'], $founders)}
  79. <th class="text-right"><a class="color-default" data-toggle="modal" data-target="#change-group">修改</a></th>
  80. {/if}
  81. </tr>
  82. <tbody ng-repeat="module_tpl in modules_tpl | filter:{'type':'extend'}">
  83. <tr>
  84. <td colspan="5" class="text-left we7-padding-right" ng-init="module_tpl.show = true">
  85. <span>{{module_tpl.name}}</span>
  86. </td>
  87. <td>
  88. <div class="link-group">
  89. <a href="javascript:;" class="color-default" ng-show="module_tpl.show" ng-click="module_tpl.show = false">收起</a>
  90. <a href="javascript:;" class="color-default" ng-show="!module_tpl.show" ng-click="module_tpl.show = true">展开</a>
  91. </div>
  92. </td><!--默认展开-->
  93. </tr>
  94. <tr ng-show="module_tpl.show">
  95. <td colspan="5">
  96. <div class="col-sm-1 color-gray text-left we7-padding-none">小程序应用</div>
  97. <div class="col-sm-11">
  98. <div class="col-sm-3 text-left we7-margin-bottom" ng-repeat="module in module_tpl.wxapp">
  99. <div ng-if="module.name != 'all'" class="text-over text-left">
  100. <img ng-src="{{ module.logo }}" alt="" style="width:50px;height:50px;">
  101. {{ module.title }}
  102. </div>
  103. <label class="label label-info" ng-if="module.name == 'all'">所有模块</label>
  104. </div>
  105. </div>
  106. </td>
  107. <td class="we7-padding-right color-default"></td>
  108. </tr>
  109. <tr style="display:none;">
  110. <td colspan="5">
  111. <div class="col-sm-1 color-gray text-left we7-padding-none">小程序应用</div>
  112. <div class="col-sm-11">
  113. <div class="col-sm-3 text-left we7-margin-bottom" ng-repeat="module in module_tpl.wxapp">
  114. <a href="javascript:;" class="label label-info" ng-bind="module.title"></a>
  115. </div>
  116. </div>
  117. </td>
  118. <td class="we7-padding-right color-default"></td>
  119. </tr>
  120. <tr ng-show="module_tpl.show" style="display:none;">
  121. <td colspan="5">
  122. <div class="col-sm-1 color-gray text-left we7-padding-none">模板</div>
  123. <div class="col-sm-11">
  124. <div class="col-sm-3 text-left we7-margin-bottom" ng-repeat="tpl in module_tpl.templates">
  125. <a href="javascript:;" class="label label-info" ng-bind="tpl.title"></a>
  126. </div>
  127. </div>
  128. </td>
  129. <td class="we7-padding-right color-default"></td>
  130. </tr>
  131. </tbody>
  132. </table>
  133. <table class="table we7-table table-hover account-package-extra">
  134. <tr>
  135. <th colspan="5" class="text-left">
  136. <span class="we7-padding-right">附加权限</span>
  137. <span></span>
  138. </th>
  139. {if $_W['role'] == ACCOUNT_MANAGE_NAME_FOUNDER && !in_array($owner['uid'], $founders) }
  140. <th class="text-right"><a class="color-default" data-toggle="modal" data-target="#jurisdiction-add">修改</a></th>
  141. {/if}
  142. </tr>
  143. {if !in_array($owner['uid'], $founders)}
  144. <tr>
  145. <td colspan="6">
  146. <div class="col-sm-1 color-gray text-left we7-padding-none">小程序应用</div>
  147. <div class="col-sm-11 js-extra-modules">
  148. <div class="col-sm-3 text-left we7-margin-bottom" ng-repeat="module in extend.modules" ng-if="extend.modules">
  149. <div ng-if="module.name != 'all'" class="text-over text-left">
  150. <img ng-src="{{ module.logo }}" alt="" style="width:50px;height:50px;">
  151. {{ module.title }}
  152. </div>
  153. <label class="label label-info" ng-if="module.name == 'all'">所有模块</label>
  154. </div>
  155. <div class="col-sm-3 text-left we7-margin-bottom" ng-if="!extend.modules">
  156. <a href="javascript:;">---</a>
  157. </div>
  158. </div>
  159. </td>
  160. </tr>
  161. {/if}
  162. </table>
  163. {/if}
  164. {if $_W['role'] == ACCOUNT_MANAGE_NAME_FOUNDER && !in_array($owner['uid'], $founders) || $_W['role'] == ACCOUNT_MANAGE_NAME_VICE_FOUNDER && $owner['uid'] != $_W['uid']}
  165. <div class="uploader-modal modal fade module" id="jurisdiction-add">
  166. <div class="modal-dialog modal-lg">
  167. <div class="modal-content ">
  168. <div class="modal-header">
  169. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  170. <h4 class="modal-title" id="myModalLabel2">选择</h4>
  171. </div>
  172. <div class="modal-body material-content clearfix">
  173. <div class="material-nav" ng-init="jurindex=0">
  174. <a href="javascript:;" ng-click="tabChange(0)" ng-class="{true:'active',false:''}[jurindex==0]" >应用</a>
  175. <!--<a href="javascript:;" ng-click="tabChange(1)" ng-class="{true:'active',false:''}[jurindex==1]">模板</a>-->
  176. </div>
  177. <div class="material-body" ng-show="jurindex==0" id="content-modules">
  178. <div class="row">
  179. {loop $modules $module_name $module}
  180. {if empty($module['issystem']) && $module['wxapp_support'] == 2}
  181. <div class="col-sm-2">
  182. <div class="item {if is_array($current_module_names) && in_array($module_name, $current_module_names)}active{/if}"
  183. data-title="{$module['title']}"
  184. data-name="{$module['name']}"
  185. onclick="$(this).toggleClass('active')">
  186. <img ng-src="{$module['logo']}" alt="" class="icon"/>
  187. <div class="name">{$module['title']}</div>
  188. <div class="mask">
  189. <span class="wi wi-right"></span>
  190. </div>
  191. </div>
  192. </div>
  193. {/if}
  194. {/loop}
  195. </div>
  196. </div>
  197. <div class="material-body" ng-show="jurindex==1" id="content-templates">
  198. <div class="row">
  199. {loop $templates $temp}
  200. <div class="col-sm-2">
  201. <div ng-click="itemClick()" class="item {if is_array($extend['templates']) && in_array($temp, $extend['templates'])}active{/if}" data-title="{$temp['title']}" data-name="{$temp['name']}" data-id="{$temp['id']}" onclick="$(this).toggleClass('active')">
  202. <i class="wi wi-home" style="color: #ddd;font-size: 48px;position:relative; top:-15px; margin: 0;"></i>
  203. <div class="name">{$temp['title']}</div>
  204. <div class="mask">
  205. <span class="wi wi-right"></span>
  206. </div>
  207. </div>
  208. </div>
  209. {/loop}
  210. </div>
  211. </div>
  212. </div>
  213. <div class="material-pager text-right clearfix">
  214. <div class="pull-left we7-form">
  215. <input type="checkbox" id="selected-all" ng-model="allmodule" ng-change="allmodulechange(allmodule)">
  216. <label for="selected-all">全选</label>
  217. </div>
  218. <ul class="pagination">
  219. </ul>
  220. </div>
  221. <div class="modal-footer">
  222. <button type="button" class="btn btn-primary" ng-click="addExtend()">确定</button>
  223. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  224. </div>
  225. </div>
  226. </div>
  227. </div>
  228. <div class="modal" id="change-group">
  229. <div class="modal-dialog we7-modal-dialog">
  230. <div class="modal-content">
  231. <div class="modal-header">
  232. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  233. </div>
  234. <div class="modal-body">
  235. <div class="tab-content we7-form">
  236. <table class="table we7-table table-hover">
  237. <tr>
  238. <th class="text-left bg-light-gray">应用权限组(各权限组均包含系统模块和微站默认模板)</th>
  239. <th class="text-right bg-light-gray">操作</th>
  240. </tr>
  241. {if permission_check_account_user('see_account_manage_module_tpl_all_permission')}
  242. <tr>
  243. <td class="text-left">
  244. <input id="check-0" type="checkbox" name="package[]" autocomplete="off" value="-1" {if is_array($owner['group']['package']) && in_array('-1', $owner['group']['package'])}checked disabled{/if}{if is_array($extendpackage) && !empty($extendpackage[-1])}checked {/if} />
  245. <label for="check-0" class="we7-padding-left we7-margin-horizontal-none">所有服务</label>
  246. </td>
  247. <td class="text-left">
  248. <div class="link-group">
  249. <a href="javascript:;" class="color-default js-unfold" data-toggle="collapse" data-target="#extend0" ng-click="changeText($event)">展开</a>
  250. </div>
  251. </td>
  252. </tr>
  253. <tr class="collapse bg-light-gray" aria-expanded="true" id="extend0">
  254. <td colspan="2">
  255. <div class="col-sm-2 color-gray text-left we7-padding-none">应用权限</div>
  256. <div class="col-sm-10">
  257. <div class="col-sm-3 text-left">
  258. <span class="label label-danger">系统所有模块</span>
  259. </div>
  260. </div>
  261. <div class="col-sm-2 color-gray text-left we7-padding-none">模板权限</div>
  262. <div class="col-sm-10">
  263. <div class="col-sm-3 text-left">
  264. <span class="label label-danger">系统所有模板</span>
  265. </div>
  266. </div>
  267. </td>
  268. </tr>
  269. {/if}
  270. {loop $uni_groups $package}
  271. {if !(is_array($owner['group']['package']) && in_array($package['id'], $owner['group']['package']))}
  272. <tr>
  273. <td class="text-left">
  274. <input id="check-{$package['id']}" type="checkbox" name="package[]" autocomplete="off" {if is_array($owner['group']['package']) && in_array($package['id'], $owner['group']['package'])}checked disabled{/if} {if is_array($extendpackage) && !empty($extendpackage[$package['id']])}checked {/if} value="{$package['id']}" />
  275. <label for="check-{$package['id']}" class="we7-padding-left we7-margin-horizontal-none">{$package['name']}</label>
  276. </td>
  277. <td>
  278. <div class="link-group">
  279. <a href="javascript:;" class="color-default js-unfold" data-toggle="collapse" data-target="#extend{$package['id']}" ng-click="changeText($event)">展开</a>
  280. </div>
  281. </td>
  282. </tr>
  283. <tr class="collapse bg-light-gray" aria-expanded="true" id="extend{$package['id']}">
  284. <td colspan="2">
  285. <div>
  286. <div class="col-sm-2 color-gray text-left we7-padding-none">应用权限</div>
  287. <div class="col-sm-10">
  288. <div class="col-sm-3 text-left" ng-style="{'margin-right': '35px','margin-bottom': '15px'}">
  289. <a href="javascript:;" class="label label-info">系统模块</a>
  290. </div>
  291. {loop $package['modules'] $module}
  292. <div class="col-sm-3 text-left" ng-style="{'margin-right': '35px','margin-bottom': '15px'}">
  293. <a href="javascript:;" class="label label-info">{$module['title']}</a>
  294. </div>
  295. {/loop}
  296. </div>
  297. </div>
  298. <div>
  299. <div class="col-sm-2 color-gray text-left we7-padding-none">模板权限</div>
  300. <div class="col-sm-10">
  301. <div class="col-sm-3 text-left" ng-style="{'margin-right': '35px','margin-bottom': '15px'}">
  302. <a href="javascript:;" class="label label-info">微站默认模板</a>
  303. </div>
  304. {loop $package['templates'] $template}
  305. <div class="col-sm-3 text-left" ng-style="{'margin-right': '35px','margin-bottom': '15px'}">
  306. <a href="javascript:;" class="label label-info">{$template['title']}</a>
  307. </div>
  308. {/loop}
  309. </div>
  310. </div>
  311. </td>
  312. </tr>
  313. {/if}
  314. {/loop}
  315. </table>
  316. </div>
  317. </div>
  318. <div class="modal-footer">
  319. <button type="button" class="btn btn-primary" ng-click="changeGroup()">确定</button>
  320. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. {/if}
  326. </div>
  327. <script>
  328. angular.module('accountApp').value('config', {
  329. owner: {php echo !empty($owner) ? json_encode($owner) : 'null'},
  330. modules_tpl: {php echo !empty($modules_tpl) ? json_encode($modules_tpl) : 'null'},
  331. extend: {php echo !empty($extend) ? json_encode($extend) : 'null'},
  332. links: {
  333. postModulesTpl: "{php echo url('account/post/modules_tpl', array('acid' => $acid, 'uniacid' => $uniacid))}",
  334. },
  335. });
  336. angular.bootstrap($('#js-account-manage-modules-tpl'), ['accountApp']);
  337. </script>
  338. {template 'common/footer'}