index.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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. <!--<td><a role="button" data-toggle="modal" data-target="#view" onclick='getUserInfo("<%= user._id.toString()%>")'>详细</a></td>-->
  122. <% if (manager.superAdmin == 1) { %>
  123. <td>
  124. <a onclick='deleteUser("<%= user._id.toString()%>")' data-toggle="modal" data-target="#delUser" class="btn text-danger" style="padding: 0px">删除</a>
  125. <a href="#update" data-toggle="modal" data-target="#update" class="btn" onclick='getUserUpgradeInfo("<%= user._id.toString()%>")'>升级</a>
  126. </td>
  127. <% }%>
  128. </tr>
  129. <% }) %>
  130. </tbody>
  131. </table>
  132. <nav aria-label="Page navigation">
  133. <%include ../layout/page.html %>
  134. </nav>
  135. </div>
  136. </div>
  137. </div>
  138. <!-- 弹窗查看用户详情-->
  139. <div class="modal fade" id="view" tabindex="-1" role="dialog">
  140. <div class="modal-dialog" role="document">
  141. <div class="modal-content">
  142. <div class="modal-header">
  143. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  144. <h4 class="modal-title" >用户信息</h4>
  145. </div>
  146. <div class="modal-body">
  147. <table class="table table-bordered">
  148. <tbody id="userInfoTable">
  149. </tbody>
  150. </table>
  151. </div>
  152. <div class="modal-footer">
  153. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. <!-- 用户升级弹窗-->
  159. <div class="modal fade" id="update" tabindex="-1" role="dialog">
  160. <div class="modal-dialog" role="document">
  161. <div class="modal-content">
  162. <div class="modal-header">
  163. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  164. <h4 class="modal-title" >产品升级</h4>
  165. </div>
  166. <div class="modal-body">
  167. <table class="table table-bordered">
  168. <tbody id="upgrade_table">
  169. </tbody>
  170. </table>
  171. </div>
  172. <div class="modal-footer">
  173. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. <!-- 弹窗显示已升级专业版-->
  179. <div class="modal fade" id="pdu" tabindex="-1" role="dialog">
  180. <div class="modal-dialog" role="document">
  181. <div class="modal-content">
  182. <div class="modal-header">
  183. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  184. <h4 class="modal-title" >已升级专业版</h4>
  185. </div>
  186. <div class="modal-body">
  187. <table class="table table-bordered">
  188. <tr><th>定额</th><th>升级时间</th></tr>
  189. <tr><td>重庆定额(2018)</td><td>2019-09-11</td></tr>
  190. <tr><td>甘肃定额(2013)</td><td>2019-09-09</td></tr>
  191. </table>
  192. </div>
  193. <div class="modal-footer">
  194. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. <!--弹出删除-->
  200. <div class="modal fade" id="delUser" data-backdrop="static" style="display: none;" aria-hidden="true">
  201. <div class="modal-dialog" role="document">
  202. <div class="modal-content">
  203. <div class="modal-header">
  204. <h5 class="modal-title">删除确认</h5>
  205. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  206. <span aria-hidden="true">×</span>
  207. </button>
  208. </div>
  209. <div class="modal-body">
  210. <h5 class="text-danger">删除用户的同时会删除项目数据和用户补充人材库、定额库等数据,且无法恢复,确认是否删除?</h5>
  211. <input type="hidden" id="userID">
  212. <input type="hidden" id="delCount">
  213. </div>
  214. <div class="modal-footer">
  215. <a id="deleteConfirm" href="javascript:void(0);" class="btn btn-danger" >确认</a>
  216. <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. <!-- 弹窗在线时长-->
  222. <div class="modal fade" id="time-detail" tabindex="-1" role="dialog">
  223. <div class="modal-dialog" role="document">
  224. <div class="modal-content">
  225. <div class="modal-header">
  226. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  227. <h4 class="modal-title" >在线时长详情</h4>
  228. </div>
  229. <div class="modal-body">
  230. <table class="table table-bordered" id = 'time-detail-table'>
  231. <tr><th>日期/时间</th><th>在线时长</th></tr>
  232. <!--<tr><th>日期/时间</th><th>在线时长</th></tr>
  233. <tr><td>04-10</td><td>2小时10分钟</td></tr>
  234. <tr><td>04-09</td><td>1小时7分钟</td></tr>
  235. <tr><td>04-08</td><td>2小时35分钟</td></tr>-->
  236. </table>
  237. </div>
  238. <div class="modal-footer">
  239. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  240. </div>
  241. </div>
  242. </div>
  243. </div>
  244. <script type="text/javascript">
  245. let compilationList = JSON.parse('<%- compilationString %>');
  246. let adminName = '<%- adminName %>';
  247. </script>
  248. <script type="text/javascript" src="/web/users/js/user.js"></script>