user_list.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <{include file="./admin/header.html"}>
  2. <{include file="./admin/left.html"}>
  3. <{include file="./admin/nav.html"}>
  4. <style>
  5. .set-nav {
  6. margin: 0 auto;
  7. }
  8. .set-nav-hr {
  9. background-color: #ddd;
  10. height: 1px;
  11. position: relative;
  12. }
  13. .form-group label {
  14. font-weight: 600;
  15. }
  16. .checkbox-inline, .radio-inline {
  17. font-weight: 400!important;
  18. }
  19. .rowlabel {
  20. font-weight: 300!important;
  21. }
  22. .music_play_hide {
  23. display:none;
  24. }
  25. </style>
  26. <{if !$platfrom}>
  27. 请先创建一个列表。进入<a href="<{$web_cfg.domain}>/?c=Admin_Platform_index&a=PageList">平台列表</a>
  28. <{else}>
  29. <div class="panel panel-default col-md-7">
  30. <div class="panel-body">
  31. <table class="table">
  32. <thead>
  33. <tr>
  34. <th>UID</th>
  35. <th>用户名</th>
  36. <th>权限组</th>
  37. <th>权限设置</th>
  38. <th>平台列表</th>
  39. <th>密码修改</th>
  40. <th>删除</th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. <{if !$users}>
  45. <tr><td colspan="4" align="center">暂无用户信息</td></tr>
  46. <{/if}>
  47. <{foreach from=$users item=user}>
  48. <tr>
  49. <td><{$user.uid}></td>
  50. <td><{$user.name}></td>
  51. <td><{if $user.permission == 'admin'}> <span class="text-primary">管理员</span> <{else}> 普通帐号 <{/if}> </td>
  52. <td><a href="<{$web_cfg.domain}>/?c=admin_backUser&a=setPermission&uid=<{$user.uid}>">权限设置</a></td>
  53. <td><a href="<{$web_cfg.domain}>/?c=admin_backUser&a=SetPlatfrom&uid=<{$user.uid}>">平台列表</a>
  54. <td><a href="<{$web_cfg.domain}>/?c=Admin_BackUser&a=MP&uid=<{$user.uid}>">密码修改</a></td>
  55. <td><a href="javascript:;" class="deleteUser" data-uid="<{$user.uid}>">删除</a></td>
  56. </tr>
  57. <{/foreach}>
  58. </tbody>
  59. </table>
  60. </div>
  61. </div>
  62. <form id="create_user_form" action="<{$web_cfg.domain}>/?c=Admin_BackUser&a=CreateUser" method="post">
  63. <div class="col-md-5" style="padding-left: 30px;">
  64. <{if $errMsg.ok}>
  65. <div class="tip_message_success">创建成功</div>
  66. <{/if}>
  67. <{if !$errMsg.ok && $errMsg.msg}>
  68. <div class="tip_message_fail">创建失败,原因:<{$errMsg.msg}></div>
  69. <{/if}>
  70. <{if !$errMsg || $errMsg.msg}>
  71. <div class="form-group">
  72. <label class="control-label">创建新帐号</label>
  73. </div>
  74. <div class="form-group">
  75. <label class="control-label rowlabel">用户名</label>
  76. <input name="name" type="text" class="form-control" value="<{$submitData.name}>">
  77. </div>
  78. <div class="form-group">
  79. <label class="control-label rowlabel">密码</label>
  80. <input name="password" type="password" class="form-control" value="<{$submitData.password}>">
  81. </div>
  82. <div class="form-group">
  83. <label><input name="auto_generate" type="checkbox" value="1" <{if $submitData.auto_generate}>checked<{/if}>> 自动生成密码</label>
  84. </div>
  85. <div class="form-group">
  86. <label class="control-label rowlabel">平台列表</label>
  87. <div>
  88. <{foreach from=$platfrom item=item}>
  89. <label class="checkbox-inline"><input name="platfrom[]" type="checkbox" value="<{$item.id}>" > <{$item.name}></label>
  90. <{/foreach}>
  91. </div>
  92. </div>
  93. <div class="form-group">
  94. <label class="control-label rowlabel">邮箱</label>
  95. <input name="email" type="text" class="form-control" value="<{$submitData.email}>">
  96. </div>
  97. <div class="form-group">
  98. <label class="control-label rowlabel">部门</label>
  99. <input name="division" type="text" class="form-control" value="<{$submitData.division}>">
  100. </div>
  101. <div>
  102. <button id="add_platform_btn" class="button button-primary button-small">创建</button>
  103. </div>
  104. <{/if}>
  105. <{if $errMsg.ok}>
  106. <div class="form-group">
  107. <label class="control-label rowlabel">用户名:</label>
  108. <{$new_user.name}>
  109. </div>
  110. <div class="form-group">
  111. <label class="control-label rowlabel">密码:</label>
  112. <{$new_user.password}>
  113. </div>
  114. <div class="form-group">
  115. <label class="control-label rowlabel">平台列表:</label>
  116. <{foreach from=$submitData.platfrom item=platfromId}>
  117. <{$platfrom[$platfromId].name}>&nbsp;
  118. <{/foreach}>
  119. </div>
  120. <div class="form-group">
  121. <label class="control-label rowlabel">邮箱:</label>
  122. <{$new_user.email}>
  123. </div>
  124. <div class="form-group">
  125. <label class="control-label rowlabel">部门:</label>
  126. <{$new_user.division}>
  127. </div>
  128. <{/if}>
  129. </div>
  130. </form>
  131. <{/if}>
  132. <script>
  133. KISSY.use('node, io', function (S, Node, IO) {
  134. var $ = S.all;
  135. $('#add_platform_btn').on('click', function () {
  136. var name = $('input[name=name]').val();
  137. if (S.trim(name) == '') {
  138. showError('姓名不能为空');
  139. return false;
  140. }
  141. });
  142. function showError($msg) {
  143. alert($msg);
  144. }
  145. $(".deleteUser").on('click', function () {
  146. var uid = $(this).attr('data-uid');
  147. if (!uid) {
  148. alert('无效uid');
  149. return false;
  150. }
  151. if (!confirm('确定要删除帐号?')) {
  152. return false;
  153. }
  154. new IO({
  155. type: "post"
  156. , url: VG.conf.root_domain + '/?c=admin_backUser&a=DeleteUser'
  157. , data: {'uid':uid}
  158. , success: function (data) {
  159. if (data.ok) { //ok
  160. alert('操作成功');
  161. location.reload();
  162. } else {
  163. alert('操作失败,原因:'+data.msg);
  164. }
  165. return false;
  166. }
  167. , error: function (NULL, textStatus) {
  168. alert("请求服务器失败,原因:"+textStatus);
  169. }
  170. , dataType: "json"
  171. });
  172. });
  173. });
  174. </script>
  175. <{include file="./admin/bottom.html"}>