page-user.component.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <nz-page-header>
  2. <nz-page-header-title
  3. >用户列表
  4. <br />
  5. <div class="subtitle">
  6. 使用“十四五”高等教育国家规划教材申报系统的所有用户,在这里你可以对用户账号进行统一管理。
  7. </div>
  8. </nz-page-header-title>
  9. <nz-page-header-extra>
  10. <nz-space>
  11. <button
  12. style="background: #3e49b3; border: 1px #3e49b3"
  13. *nzSpaceItem
  14. nz-button
  15. nzType="primary"
  16. (click)="createUser()"
  17. >
  18. 创建用户
  19. </button>
  20. </nz-space>
  21. </nz-page-header-extra>
  22. </nz-page-header>
  23. <div class="content">
  24. <!-- <comp-table-list
  25. #list
  26. [schema]="_User"
  27. *ngIf="className && fieldsArray"
  28. [className]="className"
  29. [fieldsArray]="fieldsArray"
  30. [queryParams]="queryParams"
  31. ></comp-table-list> -->
  32. <!-- <comp-table-list
  33. #list
  34. [schema]="ProfileList"
  35. *ngIf="className && fieldsArray"
  36. [className]="className"
  37. [fieldsArray]="fieldsArray"
  38. [queryParams]="queryParams"
  39. ></comp-table-list> -->
  40. <div class="tool">
  41. <div class="tool-left">
  42. <div class="search">
  43. <nz-input-group style="width: 210px" [nzPrefix]="prefixTemplateUser">
  44. <input
  45. type="text"
  46. nz-input
  47. placeholder="输入关键词"
  48. [(ngModel)]="searchValue"
  49. (ngModelChange)="getProfile()"
  50. />
  51. </nz-input-group>
  52. <ng-template #prefixTemplateUser
  53. ><span nz-icon nzType="search"></span
  54. ></ng-template>
  55. </div>
  56. <div class=""></div>
  57. </div>
  58. <div class="tool-right">
  59. <!-- <button
  60. [ngClass]="{ 'form-button': setOfCheckedId.size }"
  61. nz-button
  62. [disabled]="!setOfCheckedId.size"
  63. nzType="primary"
  64. (click)="createUser()"
  65. >
  66. 导出
  67. <span nz-icon nzType="down" nzTheme="outline"></span>
  68. </button> -->
  69. </div>
  70. </div>
  71. <nz-table
  72. #tableData
  73. [nzData]="profiles"
  74. [nzTotal]="profileLength"
  75. [nzPageSize]="pageSize"
  76. [nzPageIndex]="pageIndex"
  77. style="margin: 10px 0"
  78. [nzLoading]="loading"
  79. nzSize="middle"
  80. [nzFrontPagination]="false"
  81. [nzNoResult]="emptyResult"
  82. nzTableLayout="fixed"
  83. (nzPageIndexChange)="pageIndexChange($event)"
  84. >
  85. <thead>
  86. <tr>
  87. <th
  88. nzWidth="50px"
  89. nzLeft
  90. [nzChecked]="checkedAll"
  91. [nzIndeterminate]="indeterminate"
  92. nzLabel="Select all"
  93. (nzCheckedChange)="onAllChecked($event)"
  94. ></th>
  95. <th nzWidth="120px">用户</th>
  96. <th nzWidth="120px">手机号</th>
  97. <th nzWidth="120px">邮箱</th>
  98. <th nzWidth="120px">人员类型</th>
  99. <th nzWidth="80px">认证状态</th>
  100. <th nzWidth="150px" nzEllipsis>单位类型</th>
  101. <th nzWidth="50px" nzRight>操作</th>
  102. </tr>
  103. </thead>
  104. <tbody>
  105. @for (data of profiles; track data.id) {
  106. <tr>
  107. <td
  108. nzLeft
  109. [nzChecked]="setOfCheckedId.has(data.id)"
  110. (nzCheckedChange)="
  111. onItemChecked(data.id,$event)
  112. "
  113. ></td>
  114. <td nzEllipsis (click)="goDateil(data.get('user')?.id)" class="activeTd">
  115. <nz-avatar nzIcon="user"></nz-avatar>
  116. {{ data?.get('user')?.get('name') || '-' }}
  117. </td>
  118. <td>
  119. {{ data?.get('user')?.get('phone') || '-' }}
  120. </td>
  121. <td nzEllipsis>
  122. <div class="email">
  123. <span
  124. class="state"
  125. [style.background]="
  126. data?.get('user')?.get('accountState') == '已认证' ? '#1EB76D' : '#C9CDD4'
  127. "
  128. ></span>
  129. <div class="text">{{ data?.get('user')?.get('email') || data?.get('email') }}</div>
  130. </div>
  131. </td>
  132. <td>
  133. {{ data?.get('identity') }}
  134. </td>
  135. <td>
  136. @switch (data?.get('user')?.get('accountState')) { @case ('待认证') {
  137. <nz-tag [nzBordered]="false" [nzColor]="'geekblue'">待认证</nz-tag>
  138. } @case ('已认证') {
  139. <nz-tag [nzBordered]="false" [nzColor]="'success'">已认证</nz-tag>
  140. } @case ('已禁用') {
  141. <nz-tag [nzBordered]="false" [nzColor]="'error'">已禁用</nz-tag>
  142. } }
  143. </td>
  144. <td nzEllipsis>
  145. {{ data?.get('companyType') }}
  146. </td>
  147. <td nzRight>
  148. <button
  149. nz-button
  150. nz-dropdown
  151. [nzDropdownMenu]="menu"
  152. [nzPlacement]="'bottomLeft'"
  153. >
  154. <span nz-icon nzType="ellipsis" nzTheme="outline"></span>
  155. </button>
  156. <nz-dropdown-menu #menu="nzDropdownMenu">
  157. <ul nz-menu>
  158. @if (data?.get('user')?.get('accountState') == '待认证') {
  159. <li nz-menu-item>
  160. <button
  161. nz-button
  162. nzType="link"
  163. style="color: #231c1f"
  164. (click)="updateUser(data, '通过认证')"
  165. >
  166. <span
  167. nz-icon
  168. nzType="safety-certificate"
  169. nzTheme="outline"
  170. ></span
  171. >通过认证
  172. </button>
  173. </li>
  174. }
  175. <!-- @if (data?.user.accountState != '已禁用') {
  176. <li nz-menu-item>
  177. <button
  178. nz-button
  179. nzType="link"
  180. (click)="updateUser(data, '禁用')"
  181. style="color: #231c1f"
  182. >
  183. <span nz-icon nzType="stop" nzTheme="outline"></span>禁用账号
  184. </button>
  185. </li>
  186. } -->
  187. <li nz-menu-item>
  188. <button
  189. (click)="updateUser(data, '删除')"
  190. nz-button
  191. nzType="link"
  192. style="color: #231c1f"
  193. >
  194. <span nz-icon nzType="delete" nzTheme="outline"></span
  195. >删除账号
  196. </button>
  197. </li>
  198. <!-- <li nz-menu-item>
  199. <button
  200. nz-button
  201. nzType="link"
  202. style="color: #231c1f"
  203. (click)="goDateil(data.user?.objectId)"
  204. >
  205. <span
  206. nz-icon
  207. nzType="user"
  208. nzTheme="outline"
  209. ></span
  210. >用户详情
  211. </button>
  212. </li> -->
  213. </ul>
  214. </nz-dropdown-menu>
  215. </td>
  216. </tr>
  217. }
  218. </tbody>
  219. </nz-table>
  220. <ng-template #emptyResult>
  221. <nz-empty nzNotFoundImage="/img/group-empty.png"></nz-empty>
  222. </ng-template>
  223. </div>
  224. <!-- 全选操作:批量操作 -->
  225. <div class="batch-toolbar-modal" *ngIf="setOfCheckedId?.size">
  226. <div class="batch-toolbar">
  227. <div class="styles_counter__18S08">
  228. <span>已选</span>
  229. <span class="styles_num__178Wa">{{ setOfCheckedId.size }}</span>
  230. </div>
  231. <div class="batch-toolbar-actions">
  232. <div class="ant-space ant-space-horizontal ant-space-align-center">
  233. <div class="ant-space-item" style="margin-right: 16px">
  234. <button nz-button nzType="text" (click)="deleteSelected()">
  235. <span nz-icon nzType="delete"></span>
  236. 删除
  237. </button>
  238. </div>
  239. </div>
  240. </div>
  241. <div class="styles_cancel__AARoT">
  242. <button nz-button nzType="text" (click)="resetChange()">取消选中</button>
  243. </div>
  244. </div>
  245. </div>