manage-users.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. {template 'common/header'}
  2. {template 'account/account-header'}
  3. <div class="alert alert-info hidden">
  4. <p><i class="fa fa-exclamation-circle"></i> 无主管理员时,创始人为默认主管理员;</p>
  5. <p><i class="fa fa-exclamation-circle"></i> 主管理员拥有公众号的所有权限,并且公众号的权限(模块、模板)根据主管理员来获取;</p>
  6. <p><i class="fa fa-exclamation-circle"></i> 操作员和管理员不允许删除公众号和编辑公众号资料;</p>
  7. <p><i class="fa fa-exclamation-circle"></i> 管理员可以管理操作员;</p>
  8. </div>
  9. <div id="js-account-manage-users" ng-controller="AccountManageUsers" ng-cloak>
  10. <table class="table we7-table table-manage-user">
  11. <col width="230px" />
  12. <col />
  13. <col />
  14. <tr>
  15. <th>权限</th>
  16. <th class="text-left">用户名</th>
  17. <th class="text-right">
  18. <a href="javascript:;" class="color-default" data-toggle="modal" data-target="#user-modal">添加使用者</a>
  19. </th>
  20. </tr>
  21. <tr ng-if="vice_founder">
  22. <td>副创始人</td>
  23. <td class="text-left" ng-bind="vice_founder.username"></td>
  24. <td class="text-right ">
  25. <div class="link-group">
  26. {if permission_check_account_user('see_account_manage_users_edit_vicefounder')}
  27. <a href="javascript:;" ng-click="changeVice(vice_founder.username)">修改</a>
  28. <we7-modal-tip on-confirm="delPermission(vice_founder.uid)" content="'确认删除当前选择的用户?'"><a href="javascript:;" >删除</a></we7-modal-tip>
  29. {/if}
  30. </div>
  31. </td>
  32. </tr>
  33. <tr>
  34. <td>主管理员</td>
  35. <td class="text-left" ng-bind="owner.username" ng-if="owner"></td>
  36. <td class="text-left" ng-bind="vice_founder.username" ng-if="!owner && vice_founder"></td>
  37. <td class="text-left" ng-if="!owner && !vice_founder">{$founder_info}</td>
  38. <td class="text-right ">
  39. <div class="link-group">
  40. {if permission_check_account_user('see_account_manage_users_edit_owner')}
  41. <a href="javascript:;" ng-click="changeOwner(owner.username)">修改</a>
  42. <we7-modal-tip on-confirm="delPermission(owner.uid)" content="'确认删除当前选择的用户?'"><a href="javascript:;" ng-if="owner" class="hidden">删除</a></we7-modal-tip>
  43. {/if}
  44. </div>
  45. </td>
  46. </tr>
  47. <tr ng-repeat="(key, item) in manager" ng-if="manager">
  48. <td ng-if="key == 0" rowspan="{{manager.length}}">管理员</td>
  49. <td class="text-left" ng-class="{'we7-padding-none': key != 0}" ng-bind="item.username" style="padding-left: 0"></td>
  50. <td class="text-right ">
  51. <div class="link-group">
  52. {if permission_check_account_user('see_account_manage_users_set_permission_for_manager')}
  53. <a href="javascript:;" ng-click="setPermission(item.uid)">权限设置</a>
  54. {/if}
  55. {if permission_check_account_user('see_account_manage_users_delmanager')}
  56. <we7-modal-tip on-confirm="delPermission(item.uid)" content="'确认删除当前选择的用户?'"><a href="javascript:;">删除</a></we7-modal-tip>
  57. {/if}
  58. </div>
  59. </td>
  60. </tr>
  61. <tr ng-repeat="(key, item) in operator" ng-if="operator">
  62. <td ng-if="key == 0" rowspan="{{operator.length}}">操作员</td>
  63. <td class="text-left" ng-class="{'we7-padding-none': key != 0}" ng-bind="item.username"></td>
  64. <td class="text-right">
  65. <div class="link-group">
  66. {if permission_check_account_user('see_account_manage_users_set_permission_for_operator')}
  67. <a href="javascript:;" ng-click="setPermission(item.uid)">权限设置</a>
  68. {/if}
  69. {if permission_check_account_user('see_account_manage_users_deloperator')}
  70. <we7-modal-tip on-confirm="delPermission(item.uid)" content="'确认删除当前选择的用户?'"><a href="javascript:;" >删除</a></we7-modal-tip>
  71. {/if}
  72. </div>
  73. </td>
  74. </tr>
  75. </table>
  76. <!-- 添加主管理员模态框 -->
  77. <div class="modal" id="owner-modal">
  78. <div class="modal-dialog">
  79. <div class="modal-content">
  80. <div class="modal-header">
  81. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  82. <h3 class="modal-title">修改账号主管理员</h3>
  83. </div>
  84. <div class="modal-body we7-form">
  85. <div class="form-group">
  86. <label class="col-sm-2 control-label">用户名</label>
  87. <div class="col-sm-10">
  88. <input id="add-owner-username" type="text" class="form-control">
  89. <span class="help-block">请输入完整的用户名。</span>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="modal-footer">
  94. <button type="button" class="btn btn-primary" ng-click="addOwner()">确认</button>
  95. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. <!-- 添加账号操作员/管理模态框 -->
  101. <div class="modal" id="user-modal">
  102. <div class="modal-dialog">
  103. <div class="modal-content">
  104. <div class="modal-header">
  105. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  106. <h3 class="modal-title">添加账号操作员/管理员/副创始人</h3>
  107. </div>
  108. <div class="modal-body we7-form">
  109. <div class="form-group" ng-show="state == 'founder' || state == 'owner' || state == 'vice_founder'">
  110. <label class="control-label col-sm-2"></label>
  111. <div class="col-sm-10">
  112. <input class="addtype" type="radio" id="addtype-1" name="addtype" value="{ACCOUNT_MANAGE_TYPE_OPERATOR}" checked>
  113. <label for="addtype-1" class="radio-inline">操作员</label>
  114. <input class="addtype" type="radio" id="addtype-2" name="addtype" value="{ACCOUNT_MANAGE_TYPE_MANAGER}">
  115. <label class="radio-inline" for="addtype-2">管理员</label>
  116. {if permission_check_account_user('see_account_manage_users_add_viceuser')}
  117. <input class="addtype" type="radio" id="addtype-4" name="addtype" value="{ACCOUNT_MANAGE_TYPE_VICE_FOUNDER}">
  118. <label class="radio-inline" for="addtype-4">副创始人</label>
  119. {/if}
  120. {if permission_check_account_user('see_account_manage_users_adduser')}<a style="float: right" class="color-default" target = '_blank' href="{url 'user/create'}">+添加用户</a>{/if}
  121. </div>
  122. </div>
  123. <div class="form-group">
  124. <label class="col-sm-2 control-label">用户名</label>
  125. <div class="col-sm-10">
  126. <input id="add-username" type="text" class="form-control">
  127. <span class="help-block">请输入完整的用户名。</span>
  128. </div>
  129. </div>
  130. </div>
  131. <div class="modal-footer">
  132. <button type="button" class="btn btn-primary" ng-click="addUsername()">确认</button>
  133. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <script>
  140. angular.module('accountApp').value('config', {
  141. vice_founder: {php echo !empty($vice_founder) ? json_encode($vice_founder) : 'null'},
  142. owner: {php echo !empty($owner) ? json_encode($owner) : 'null'},
  143. manager: {php echo !empty($manager) ? json_encode($manager) : 'null'},
  144. operator: {php echo !empty($operator) ? json_encode($operator) : 'null'},
  145. state: {php echo !empty($state) ? json_encode($state) : 'null'},
  146. accountType: {php echo !empty($_GPC['account_type']) ? json_encode($_GPC['account_type']) : '1'},
  147. links: {
  148. delete: "{php echo url('account/post-user/delete', array('acid' => $acid, 'uniacid' => $uniacid))}",
  149. setPermission: "{php echo url('account/post-user/set_permission', array('acid' => $acid, 'uniacid' => $uniacid));}",
  150. addUser: "{php echo url('account/post-user/set_manager', array('acid' => $acid, 'uniacid' => $uniacid))}"
  151. }
  152. });
  153. angular.bootstrap($('#js-account-manage-users'), ['accountApp']);
  154. </script>
  155. {template 'common/footer'}