index.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <div class="panel-content">
  2. <div class="panel-title fluid">
  3. <div class="title-main">
  4. <% for (let menu of userMenu) { %>
  5. <% if (menu.title === secondMenu[action].title) { %>
  6. <%= menu.title %>
  7. <% } else { %>
  8. <a href="<%= menu.url %>" class="btn btn-primary btn-link" style="margin-left: 0;margin-right: 12px"><%= menu.title %></a>
  9. <% } %>
  10. <% } %>
  11. </div>
  12. </div>
  13. <div class="content-wrap">
  14. <div class="c-header">
  15. <form class="form-inline" method="get" action="" id="searchUser">
  16. <!--最近使用定额-->
  17. <div class="btn-group">
  18. <button type="button" class="btn btn-default dropdown-toggle btn-sm" data-toggle="dropdown"
  19. aria-haspopup="true" aria-expanded="false">
  20. 最近使用费用定额:<lable><%= compilationMap[filter.latestUsed] === undefined ? '所有' : compilationMap[filter.latestUsed].name %></lable> <span class="caret"></span>
  21. </button>
  22. <ul class="dropdown-menu selector">
  23. <li><a data-value="">所有</a></li>
  24. <% for(let compilation of compilationList){ %>
  25. <li><a data-value="<%= compilation._id.toString()%>"><%= compilation.name %></a></li>
  26. <% } %>
  27. </ul>
  28. <input type="hidden" name="latestUsed" value="<%= filter.latestUsed%>" />
  29. </div>
  30. <!--已升级费用定额-->
  31. <div class="btn-group">
  32. <button type="button" class="btn btn-default dropdown-toggle btn-sm" data-toggle="dropdown"
  33. aria-haspopup="true" aria-expanded="false">
  34. 已升级费用定额:<lable><%= compilationMap[filter.upGrade] === undefined ? '所有' : compilationMap[filter.upGrade].name %></lable> <span class="caret"></span>
  35. </button>
  36. <ul class="dropdown-menu selector">
  37. <li><a data-value="">所有</a></li>
  38. <% for(let compilation of compilationList){ %>
  39. <li><a data-value="<%= compilation._id.toString()%>"><%= compilation.name %></a></li>
  40. <% } %>
  41. </ul>
  42. <input type="hidden" name="upGrade" value="<%= filter.upGrade%>" />
  43. </div>
  44. <!--最新注册-->
  45. <div class="btn-group">
  46. <button type="button" class="btn btn-default dropdown-toggle btn-sm" data-toggle="dropdown"
  47. aria-haspopup="true" aria-expanded="false">
  48. 最新注册:<lable><%= filter.regtimeMsg === undefined ? '所有' : filter.regtimeMsg %></lable><span class="caret"></span>
  49. </button>
  50. <ul class="dropdown-menu selector">
  51. <li><a data-value="0">所有</a></li>
  52. <li><a data-value="1">最近24小时</a></li>
  53. <li><a data-value="2">最近3天</a></li>
  54. <li><a data-value="3">最近7天</a></li>
  55. <li><a data-value="4">最近30天</a></li>
  56. </ul>
  57. <input type="hidden" name="regtime" value="<%= filter.regtime%>" />
  58. </div>
  59. <!--最近登录-->
  60. <div class="btn-group">
  61. <button type="button" class="btn btn-default dropdown-toggle btn-sm" data-toggle="dropdown"
  62. aria-haspopup="true" aria-expanded="false">
  63. 最近登录:<lable><%= filter.loginMsg === undefined ? '所有' : filter.loginMsg %></lable><span class="caret"></span>
  64. </button>
  65. <ul class="dropdown-menu selector">
  66. <li><a data-value="0">所有</a></li>
  67. <li><a data-value="1">最近24小时</a></li>
  68. <li><a data-value="2">最近3天</a></li>
  69. <li><a data-value="3">最近7天</a></li>
  70. <li><a data-value="4">最近30天</a></li>
  71. </ul>
  72. <input type="hidden" name="loginTime" value="<%= filter.loginTime%>" />
  73. </div>
  74. <!--结果-->
  75. <div class="btn-group">
  76. &nbsp;共 <%= total %> 条结果
  77. </div>
  78. <!--搜索-->
  79. <div class="btn-group pull-right">
  80. <div class="input-group">
  81. <input type="text" name="keyword" class="form-control input-sm" value="<%= filter.keyword === undefined ? '' : filter.keyword %>" placeholder="手机/邮箱/姓名/公司">
  82. <span class="input-group-btn">
  83. <button class="btn btn-default btn-sm" type="submit">
  84. <i class="glyphicon glyphicon-search"></i>
  85. </button>
  86. </span>
  87. </div>
  88. </div>
  89. </form>
  90. </div>
  91. <div class="c-body">
  92. <table class="table">
  93. <thead>
  94. <tr>
  95. <th width="15%">注册手机/QQ</th>
  96. <th width="10%">姓名</th>
  97. <th width="20%">企业名称</th>
  98. <th width="10%">企业地区</th>
  99. <th width="12%">最近使用</th>
  100. <!--<th width="10%">在线时长(<%= filter.loginMsg === undefined ? '所有' : filter.loginMsg %>)</th>-->
  101. <th width="10%">累计时长</th>
  102. <th width="10%">注册时间</th>
  103. <th width="10%">最近登录</th>
  104. <% if (manager.superAdmin == 1) { %>
  105. <th>操作</th>
  106. <% }%>
  107. <!--<th>详细</th>-->
  108. </tr>
  109. </thead>
  110. <tbody>
  111. <% userList.forEach(function (user){ %>
  112. <tr>
  113. <td><%= user.mobile %><br><%= user.qq %></td>
  114. <td><%= user.real_name %></td>
  115. <td><%= user.company %></td>
  116. <td><%= model.province[user.province] %></td>
  117. <td><%= compilationMap[user.latest_used]?compilationMap[user.latest_used].name:""%></td>
  118. <td><a onclick="getOnlineInfo('<%= user._doc.filter%>')" href="#time-detail" data-toggle="modal" data-target="#time-detail"><%= user._doc.online_times %></a></td>
  119. <td><%= moment(user.create_time).tz("Asia/Shanghai").format('YYYY-MM-DD HH:mm:ss') %></td>
  120. <td><%= user.latest_login?moment(user.latest_login).tz("Asia/Shanghai").format('YYYY-MM-DD HH:mm:ss'):"" %></td>
  121. <% if (manager.superAdmin == 1) { %>
  122. <td>
  123. <a onclick='deleteUser("<%= user._id.toString()%>")' data-toggle="modal" data-target="#delUser" class="btn text-danger" style="padding: 0px">删除</a>
  124. <a href="#update" data-toggle="modal" data-target="#update" class="btn" onclick='getUserUpgradeInfo("<%= user._id.toString()%>")'>升级</a>
  125. </td>
  126. <% }%>
  127. <!--<td><a role="button" data-toggle="modal" data-target="#view" onclick='getUserInfo("<%= user._id.toString()%>")'>详细</a></td>-->
  128. <!--<td><a href="#update" data-toggle="modal" data-target="#update" onclick='getUserUpgradeInfo("<%= user._id.toString()%>")'>升级</a></td>-->
  129. </tr>
  130. <% }) %>
  131. </tbody>
  132. </table>
  133. <nav aria-label="Page navigation">
  134. <%include ../layout/page.html %>
  135. </nav>
  136. </div>
  137. </div>
  138. </div>
  139. <!-- 弹窗查看用户详情-->
  140. <div class="modal fade" id="view" tabindex="-1" role="dialog">
  141. <div class="modal-dialog" role="document">
  142. <div class="modal-content">
  143. <div class="modal-header">
  144. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  145. <h4 class="modal-title" >用户信息</h4>
  146. </div>
  147. <div class="modal-body">
  148. <table class="table table-bordered">
  149. <tbody id="userInfoTable">
  150. </tbody>
  151. </table>
  152. </div>
  153. <div class="modal-footer">
  154. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. <!-- 用户升级弹窗-->
  160. <div class="modal fade" id="update" tabindex="-1" role="dialog">
  161. <div class="modal-dialog" role="document">
  162. <div class="modal-content">
  163. <div class="modal-header">
  164. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  165. <h4 class="modal-title" >产品升级</h4>
  166. </div>
  167. <div class="modal-body">
  168. <table class="table table-bordered">
  169. <tbody id="upgrade_table">
  170. </tbody>
  171. </table>
  172. </div>
  173. <div class="modal-footer">
  174. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. <!--弹出删除-->
  180. <div class="modal fade" id="delUser" data-backdrop="static" style="display: none;" aria-hidden="true">
  181. <div class="modal-dialog" role="document">
  182. <div class="modal-content">
  183. <div class="modal-header">
  184. <h5 class="modal-title">删除确认</h5>
  185. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  186. <span aria-hidden="true">×</span>
  187. </button>
  188. </div>
  189. <div class="modal-body">
  190. <h5 class="text-danger">删除用户的同时会删除项目数据和用户补充人材库、定额库等数据,且无法恢复,确认是否删除?</h5>
  191. <input type="hidden" id="userID">
  192. <input type="hidden" id="delCount">
  193. </div>
  194. <div class="modal-footer">
  195. <a id="deleteConfirm" href="javascript:void(0);" class="btn btn-danger" >确认</a>
  196. <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <!-- 弹窗在线时长-->
  202. <div class="modal fade" id="time-detail" tabindex="-1" role="dialog">
  203. <div class="modal-dialog" role="document">
  204. <div class="modal-content">
  205. <div class="modal-header">
  206. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  207. <h4 class="modal-title" >在线时长详情</h4>
  208. </div>
  209. <div class="modal-body">
  210. <table class="table table-bordered" id = 'time-detail-table'>
  211. <tr><th>日期/时间</th><th>在线时长</th></tr>
  212. <!--<tr><th>日期/时间</th><th>在线时长</th></tr>
  213. <tr><td>04-10</td><td>2小时10分钟</td></tr>
  214. <tr><td>04-09</td><td>1小时7分钟</td></tr>
  215. <tr><td>04-08</td><td>2小时35分钟</td></tr>-->
  216. </table>
  217. </div>
  218. <div class="modal-footer">
  219. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  220. </div>
  221. </div>
  222. </div>
  223. </div>
  224. <script type="text/javascript">
  225. let compilationList = JSON.parse('<%- compilationString %>');
  226. let adminName = '<%- adminName %>';
  227. </script>
  228. <script type="text/javascript" src="/web/users/js/user.js"></script>