userAdmin.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <div id="userAdmin">
  3. <el-row>
  4. <el-col :span="24" class="userInfo">
  5. <el-col :span="24" class="top">
  6. <span>用户列表</span>
  7. </el-col>
  8. <el-col :span="24" class="info">
  9. <el-tabs v-model="activeName" @tab-click="handleClick">
  10. <el-tab-pane label="待审用户" name="first">
  11. <el-col :span="24" class="userList" v-for="(item, index) in userList" :key="index">
  12. <el-col :span="20" class="name"> 登录名称:登录名称 </el-col>
  13. <el-col :span="4" class="date">
  14. 2020-02-06
  15. </el-col>
  16. <el-col :span="12" class="left">
  17. <el-col :span="6" style="margin:0 10px 0 0;">
  18. <el-image style="width:110px;height:110px;" :src="item.img_path"></el-image>
  19. </el-col>
  20. <el-col :span="17" class="leftInfo">
  21. <p>{{ item.name }}</p>
  22. <p>类别:{{ item.role === '1' ? '管理员' : item.role === '2' ? '个人' : item.role === '3' ? '企业管理员' : '未选择' }}</p>
  23. <p>电话:{{ item.phone }}</p>
  24. </el-col>
  25. </el-col>
  26. <el-col :span="12" class="right">
  27. <el-link :underline="false">审核用户</el-link>
  28. </el-col>
  29. </el-col>
  30. <el-col :span="24" class="page">
  31. <el-pagination
  32. @size-change="handleSizeChange"
  33. @current-change="handleCurrentChange"
  34. :current-page="currentPage1"
  35. layout="total, prev, pager, next, jumper"
  36. :total="userListTotal"
  37. >
  38. </el-pagination>
  39. </el-col>
  40. </el-tab-pane>
  41. <el-tab-pane label="已审用户" name="second">
  42. <el-col :span="24" class="userList" v-for="(item, index) in adminList" :key="index">
  43. <el-col :span="20" class="name"> 登录名称:登录名称 </el-col>
  44. <el-col :span="4" class="date">
  45. 2020-02-06
  46. </el-col>
  47. <el-col :span="12" class="left">
  48. <el-col :span="6" style="margin:0 10px 0 0;">
  49. <el-image style="width:110px;height:110px;" :src="item.img_path"></el-image>
  50. </el-col>
  51. <el-col :span="17" class="leftInfo">
  52. <p>{{ item.name }}</p>
  53. <p>类别:{{ item.role === '1' ? '管理员' : item.role === '2' ? '个人' : item.role === '3' ? '企业管理员' : '未选择' }}</p>
  54. <p>电话:{{ item.phone }}</p>
  55. </el-col>
  56. </el-col>
  57. <el-col :span="12" class="right">
  58. <el-link :underline="false">查看详情</el-link><br />
  59. <el-link :underline="false" @click="handleDelete(item.id)">删除用户</el-link>
  60. </el-col>
  61. </el-col>
  62. <el-col :span="24" class="page">
  63. <el-pagination
  64. @size-change="handleSizeChange"
  65. @current-change="handleCurrentChange"
  66. :current-page="currentPage2"
  67. layout="total, prev, pager, next, jumper"
  68. :total="adminListTotal"
  69. >
  70. </el-pagination>
  71. </el-col>
  72. </el-tab-pane>
  73. </el-tabs>
  74. </el-col>
  75. </el-col>
  76. </el-row>
  77. </div>
  78. </template>
  79. <script>
  80. export default {
  81. name: 'userAdmin',
  82. props: {
  83. userList: null,
  84. userListTotal: null,
  85. adminList: null,
  86. adminListTotal: null,
  87. },
  88. components: {},
  89. data: () => ({
  90. activeName: 'first',
  91. currentPage1: 1,
  92. currentPage2: 1,
  93. }),
  94. created() {},
  95. computed: {},
  96. methods: {
  97. handleClick(tab, event) {
  98. console.log(tab, event);
  99. },
  100. handleSizeChange(val) {
  101. console.log(`每页 ${val} 条`);
  102. },
  103. handleCurrentChange(val) {
  104. console.log(`当前页: ${val}`);
  105. },
  106. handleDelete(id) {
  107. this.$emit('delete', { id });
  108. },
  109. },
  110. };
  111. </script>
  112. <style lang="less" scoped>
  113. p {
  114. padding: 0;
  115. margin: 0;
  116. }
  117. .top {
  118. height: 60px;
  119. border-bottom: 1px solid #215299;
  120. line-height: 60px;
  121. }
  122. .top span {
  123. display: inline-block;
  124. width: 130px;
  125. height: 60px;
  126. text-align: center;
  127. line-height: 60px;
  128. background-color: #215299;
  129. color: #fff;
  130. }
  131. .info {
  132. padding: 20px;
  133. }
  134. .userList {
  135. height: 190px;
  136. border: 1px solid #ccc;
  137. margin: 0 0 15px 0;
  138. }
  139. .userList .name {
  140. height: 40px;
  141. line-height: 40px;
  142. background-color: #fafafa;
  143. color: #888;
  144. padding: 0 10px;
  145. }
  146. .userList .date {
  147. height: 40px;
  148. line-height: 40px;
  149. background-color: #fafafa;
  150. color: #888;
  151. }
  152. .userList .left {
  153. height: 110px;
  154. margin: 19px 0;
  155. border-right: 2px solid #ccc;
  156. }
  157. .userList .left .leftInfo p {
  158. margin: 10px 0;
  159. }
  160. .userList .right {
  161. height: 110px;
  162. margin: 19px 0;
  163. padding: 0 30px;
  164. }
  165. .adminList {
  166. height: 190px;
  167. border: 1px solid #ccc;
  168. }
  169. .page {
  170. height: 30px;
  171. text-align: center;
  172. }
  173. </style>