AdminGateway.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <el-container>
  3. <el-header height="220">
  4. <el-row style="margin-top: 10px">
  5. <el-select
  6. v-model="queryInfo.scope"
  7. clearable
  8. placeholder="查询条件"
  9. style="margin-left: 5px"
  10. @change="onSelectChange"
  11. />
  12. <el-button type="plain" icon="el-icon-refresh" style="margin-left: 5px" @click="onRefresh">刷新</el-button>
  13. </el-row>
  14. </el-header>
  15. <el-main>
  16. <el-table
  17. :data="dataList"
  18. border
  19. style="width: 100%"
  20. >
  21. <el-table-column
  22. fixed="left"
  23. label="No"
  24. type="index"
  25. />
  26. <el-table-column
  27. prop="avatarUrl"
  28. label="头像"
  29. width="90"
  30. >
  31. <template slot-scope="scope">
  32. <el-image :src="scope.row.avatarUrl" min-width="30" height="20" />
  33. </template>
  34. </el-table-column>
  35. <el-table-column
  36. prop="userId"
  37. label="用户 ID"
  38. >
  39. </el-table-column>
  40. <el-table-column
  41. prop="username"
  42. label="用户名"
  43. />
  44. <el-table-column
  45. prop="screenName"
  46. label="显示名"
  47. >
  48. <template slot-scope="scope">
  49. <router-link target="_blank" :to="`/user/${scope.row.userId}`">
  50. <span>{{ scope.row.screenName }}</span>
  51. </router-link>
  52. </template>
  53. </el-table-column>
  54. <el-table-column
  55. prop="signature"
  56. label="签名"
  57. :show-overflow-tooltip="true"
  58. >
  59. <template slot-scope="scope">
  60. <el-tooltip
  61. v-if="scope.row.signature"
  62. :content="scope.row.signature"
  63. raw-content
  64. placement="top-start"
  65. >
  66. <span v-if="scope.row.signature && scope.row.signature.length <= 15">
  67. {{ scope.row.signature }}
  68. </span>
  69. <span v-if="scope.row.signature && scope.row.signature.length > 15">
  70. {{ scope.row.signature.substr(0, 15) + "..." }}
  71. </span>
  72. </el-tooltip>
  73. <span v-else-if="scope.row.signature === null">-</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column
  77. prop="pubDate"
  78. label="注册时间"
  79. width="150"
  80. />
  81. <el-table-column
  82. prop="scope"
  83. label="帐号状态"
  84. width="120"
  85. >
  86. <template slot-scope="scope">
  87. <el-tag v-if="scope.row.status === 1" :type="'warning'" disable-transitions>
  88. 正常
  89. </el-tag>
  90. <el-tag v-else-if="scope.row.status === 2" :type="'success'" disable-transitions>
  91. 封禁中
  92. </el-tag>
  93. <el-tag v-else :type="'danger'" disable-transitions>
  94. 已注销
  95. </el-tag>
  96. </template>
  97. </el-table-column>
  98. <el-table-column
  99. fixed="right"
  100. label="操作"
  101. width="280"
  102. >
  103. <template slot-scope="scope">
  104. <el-button
  105. size="mini"
  106. @click="handleEdit(scope.$index, scope.row)"
  107. >编辑</el-button>
  108. <el-button
  109. size="mini"
  110. type="danger"
  111. @click="handleDelete(scope.$index, scope.row)"
  112. >删除</el-button>
  113. </template>
  114. </el-table-column>
  115. </el-table>
  116. <el-pagination
  117. background
  118. :small="screenWidth <= 768"
  119. layout="prev, pager, next"
  120. :page-size="pageSize"
  121. :current-page="currentPage"
  122. :total="totalSize"
  123. @current-change="handleCurrentChange"
  124. @prev-click="handleCurrentChange"
  125. @next-click="handleCurrentChange"
  126. />
  127. </el-main>
  128. <!-- 修改视频可见范围对话框 -->
  129. <el-dialog
  130. append-to-body
  131. :visible.sync="showEditScopeDialog"
  132. width="30%"
  133. center
  134. >
  135. <el-card class="box-card">
  136. <div slot="header" class="clearfix">
  137. <span>修改视频可见范围</span>
  138. <el-button style="float: right; padding: 3px 0" type="text">更新</el-button>
  139. </div>
  140. <div class="text item">
  141. <el-select v-model="form.scope" placeholder="选择可见范围">
  142. <el-option label="本人可见" value="1" />
  143. <el-option label="所有人可见" value="2" />
  144. <el-option label="VIP 可见" value="3" />
  145. <el-option label="验证码可见" value="4" />
  146. </el-select>
  147. </div>
  148. </el-card>
  149. </el-dialog>
  150. </el-container>
  151. </template>
  152. <script>
  153. import { getUserList } from '@/api/admin'
  154. export default {
  155. name: 'AdminUserList',
  156. data() {
  157. return {
  158. queryInfo: {
  159. scope: null,
  160. pn: 1
  161. },
  162. // 屏幕宽度, 为了控制分页条的大小
  163. screenWidth: document.body.clientWidth,
  164. currentPage: 1,
  165. pageSize: 12,
  166. totalSize: 0,
  167. dataList: [],
  168. nextId: 0
  169. }
  170. },
  171. created() {
  172. document.title = 'AdminAccessLog'
  173. this.getData()
  174. },
  175. methods: {
  176. getData() {
  177. },
  178. onRefresh() {
  179. this.getData()
  180. },
  181. handleCurrentChange(pageNumber) {
  182. this.currentPage = pageNumber
  183. this.getData()
  184. // 回到顶部
  185. scrollTo(0, 0)
  186. },
  187. handleEdit(index, row) {
  188. this.$message.info('handleEdit')
  189. },
  190. handleDelete(index, row) {
  191. this.$confirm('确定要删除 ' + row.title + '?', '提示', {
  192. confirmButtonText: '确定',
  193. cancelButtonText: '取消',
  194. type: 'warning'
  195. }).then(() => {
  196. this.$message.info('handleDelete')
  197. }).catch(() => {
  198. this.$message({
  199. type: 'info',
  200. message: '已取消'
  201. })
  202. })
  203. },
  204. onSelectChange() {
  205. this.$message.info(this.queryInfo)
  206. }
  207. }
  208. }
  209. </script>
  210. <style>
  211. </style>