index.html 12 KB

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