|
|
@@ -3,6 +3,7 @@
|
|
|
<Breadcrumb />
|
|
|
|
|
|
<a-card title="用户管理">
|
|
|
+ <AppQueryFilter>
|
|
|
<a-row class="query-row">
|
|
|
<a-col :flex="'1000px'" class="query-main">
|
|
|
<a-form class="queryForm app-query-form" :model="queryData" :label-col-props="{ span: 6 }" :wrapper-col-props="{ span: 18 }"
|
|
|
@@ -49,10 +50,12 @@
|
|
|
</a-space>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
+ </AppQueryFilter>
|
|
|
|
|
|
- <a-table :data="data" :bordered="false" hoverable column-resizable class="table" :loading="loading"
|
|
|
- :scroll="{ x: 1550 }"
|
|
|
- :columns="columns" :pagination="{
|
|
|
+ <div class="table-wrap">
|
|
|
+ <a-table :data="data" :bordered="false" hoverable class="table" :loading="loading"
|
|
|
+ :scroll="{ x: TABLE_SCROLL_X }"
|
|
|
+ :columns="tableColumns" :pagination="{
|
|
|
showPageSize: true,
|
|
|
showJumper: true,
|
|
|
showTotal: true,
|
|
|
@@ -61,11 +64,13 @@
|
|
|
total: pagination.total
|
|
|
}" @page-change="handlePageChange" @page-size-change="handlePageSizeChange">
|
|
|
<template #username="{ record }">
|
|
|
- <a-avatar :size="35">
|
|
|
- <img :alt="record.username ?? ''"
|
|
|
- :src="record.avatar ?? 'https://lepao-cloud.xxoo365.top/view.php/25aa126dc406974ff3579a99a2c6501a.png'" />
|
|
|
- </a-avatar>
|
|
|
- {{ record.username }}
|
|
|
+ <div class="user-cell">
|
|
|
+ <a-avatar :size="35" class="user-cell__avatar">
|
|
|
+ <img :alt="record.username ?? ''"
|
|
|
+ :src="record.avatar ?? 'https://lepao-cloud.xxoo365.top/view.php/25aa126dc406974ff3579a99a2c6501a.png'" />
|
|
|
+ </a-avatar>
|
|
|
+ <span class="user-cell__name">{{ record.username || '-' }}</span>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<template #registTime="{ record }">
|
|
|
{{ stramptoTime(record.registTime) }}
|
|
|
@@ -74,27 +79,23 @@
|
|
|
{{ stramptoTime(record.lastTime ?? record.registTime) }}
|
|
|
</template>
|
|
|
<template #qq_bind="{ record }">
|
|
|
- <template v-if="record.qq_social_nickname || record.qq_social_avatar">
|
|
|
- <a-space>
|
|
|
- <a-avatar :size="24">
|
|
|
- <img v-if="record.qq_social_avatar" :alt="record.qq_social_nickname || 'QQ'" :src="record.qq_social_avatar" />
|
|
|
- <icon-qq v-else />
|
|
|
- </a-avatar>
|
|
|
- <span>{{ record.qq_social_nickname || '未获取' }}</span>
|
|
|
- </a-space>
|
|
|
- </template>
|
|
|
+ <div v-if="record.qq_social_nickname || record.qq_social_avatar" class="bind-cell">
|
|
|
+ <a-avatar :size="24" class="bind-cell__avatar">
|
|
|
+ <img v-if="record.qq_social_avatar" :alt="record.qq_social_nickname || 'QQ'" :src="record.qq_social_avatar" />
|
|
|
+ <icon-qq v-else />
|
|
|
+ </a-avatar>
|
|
|
+ <span class="bind-cell__text">{{ record.qq_social_nickname || '未获取' }}</span>
|
|
|
+ </div>
|
|
|
<span v-else class="muted">未绑定</span>
|
|
|
</template>
|
|
|
<template #wx_bind="{ record }">
|
|
|
- <template v-if="record.wx_social_nickname || record.wx_social_avatar">
|
|
|
- <a-space>
|
|
|
- <a-avatar :size="24">
|
|
|
- <img v-if="record.wx_social_avatar" :alt="record.wx_social_nickname || '微信'" :src="record.wx_social_avatar" />
|
|
|
- <icon-wechat v-else />
|
|
|
- </a-avatar>
|
|
|
- <span>{{ record.wx_social_nickname || '未获取' }}</span>
|
|
|
- </a-space>
|
|
|
- </template>
|
|
|
+ <div v-if="record.wx_social_nickname || record.wx_social_avatar" class="bind-cell">
|
|
|
+ <a-avatar :size="24" class="bind-cell__avatar">
|
|
|
+ <img v-if="record.wx_social_avatar" :alt="record.wx_social_nickname || '微信'" :src="record.wx_social_avatar" />
|
|
|
+ <icon-wechat v-else />
|
|
|
+ </a-avatar>
|
|
|
+ <span class="bind-cell__text">{{ record.wx_social_nickname || '未获取' }}</span>
|
|
|
+ </div>
|
|
|
<span v-else class="muted">未绑定</span>
|
|
|
</template>
|
|
|
<template #last_login_type="{ record }">
|
|
|
@@ -125,6 +126,7 @@
|
|
|
</a-dropdown>
|
|
|
</template>
|
|
|
</a-table>
|
|
|
+ </div>
|
|
|
</a-card>
|
|
|
</div>
|
|
|
|
|
|
@@ -218,6 +220,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, reactive, onMounted, computed } from 'vue'
|
|
|
+import { useResponsiveTable } from '@/hooks/useResponsiveTable'
|
|
|
import { adminGetUserList, adminChangeLepaoCount, adminSetSendCountAutoApprove, adminSetUserBan } from '@/api/user'
|
|
|
import { getPermissionPoints, getPermissionResources, getUserPermissions, setUserPermissions, updatePermissionResource } from '@/api/permission'
|
|
|
import { Notification, Message, Modal } from '@arco-design/web-vue'
|
|
|
@@ -465,58 +468,88 @@ const handlePermissionBeforeOk = async (done) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const columns = [
|
|
|
+const { useTableColumns } = useResponsiveTable()
|
|
|
+
|
|
|
+/** 列宽合计,移动端横向滚动查看全部字段 */
|
|
|
+const TABLE_SCROLL_X = 1650
|
|
|
|
|
|
+const columnDefs = [
|
|
|
{
|
|
|
title: 'UUID',
|
|
|
dataIndex: 'uuid',
|
|
|
- width: 160,
|
|
|
- }, {
|
|
|
+ width: 200,
|
|
|
+ ellipsis: true,
|
|
|
+ tooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
title: '用户名',
|
|
|
slotName: 'username',
|
|
|
- width: 160,
|
|
|
- }, {
|
|
|
+ width: 180,
|
|
|
+ ellipsis: true,
|
|
|
+ tooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
title: '邮箱',
|
|
|
dataIndex: 'email',
|
|
|
- width: 180,
|
|
|
+ width: 200,
|
|
|
+ ellipsis: true,
|
|
|
+ tooltip: true
|
|
|
},
|
|
|
{
|
|
|
title: 'QQ 绑定',
|
|
|
slotName: 'qq_bind',
|
|
|
- width: 150,
|
|
|
+ width: 160,
|
|
|
+ ellipsis: true,
|
|
|
+ tooltip: true
|
|
|
},
|
|
|
{
|
|
|
title: '微信绑定',
|
|
|
slotName: 'wx_bind',
|
|
|
- width: 150,
|
|
|
+ width: 160,
|
|
|
+ ellipsis: true,
|
|
|
+ tooltip: true
|
|
|
},
|
|
|
{
|
|
|
title: '登录方式',
|
|
|
slotName: 'last_login_type',
|
|
|
width: 120,
|
|
|
- }, {
|
|
|
+ ellipsis: true,
|
|
|
+ tooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
title: '注册时间',
|
|
|
slotName: 'registTime',
|
|
|
- width: 160,
|
|
|
- }, {
|
|
|
+ width: 170,
|
|
|
+ ellipsis: true,
|
|
|
+ tooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
title: '上次登录时间',
|
|
|
slotName: 'lastTime',
|
|
|
- width: 160,
|
|
|
- }, {
|
|
|
+ width: 170,
|
|
|
+ ellipsis: true,
|
|
|
+ tooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
title: '剩余乐跑次数',
|
|
|
dataIndex: 'lepao_count',
|
|
|
- width: 120,
|
|
|
- }, {
|
|
|
+ width: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
title: '账号状态',
|
|
|
slotName: 'is_banned_status',
|
|
|
- width: 100,
|
|
|
- }, {
|
|
|
+ width: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
title: '操作',
|
|
|
slotName: 'optional',
|
|
|
width: 120,
|
|
|
align: 'center',
|
|
|
fixed: 'right'
|
|
|
- }]
|
|
|
+ }
|
|
|
+]
|
|
|
+
|
|
|
+const tableColumns = useTableColumns(columnDefs)
|
|
|
|
|
|
const search = () => {
|
|
|
pagination.current = 1
|
|
|
@@ -649,10 +682,63 @@ const formatLastLoginType = (type) => {
|
|
|
width: 100%;
|
|
|
}
|
|
|
|
|
|
-.table {
|
|
|
+.table-wrap {
|
|
|
+ width: 100%;
|
|
|
+ overflow-x: auto;
|
|
|
+ -webkit-overflow-scrolling: touch;
|
|
|
margin-top: 15px;
|
|
|
}
|
|
|
|
|
|
+.table {
|
|
|
+ margin-top: 0;
|
|
|
+ min-width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.table :deep(.arco-table-td),
|
|
|
+.table :deep(.arco-table-th) {
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.user-cell {
|
|
|
+ display: inline-flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 8px;
|
|
|
+ max-width: 100%;
|
|
|
+ min-width: 0;
|
|
|
+ vertical-align: middle;
|
|
|
+}
|
|
|
+
|
|
|
+.user-cell__avatar {
|
|
|
+ flex-shrink: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.user-cell__name {
|
|
|
+ min-width: 0;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+}
|
|
|
+
|
|
|
+.bind-cell {
|
|
|
+ display: inline-flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 6px;
|
|
|
+ max-width: 100%;
|
|
|
+ min-width: 0;
|
|
|
+ vertical-align: middle;
|
|
|
+}
|
|
|
+
|
|
|
+.bind-cell__avatar {
|
|
|
+ flex-shrink: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.bind-cell__text {
|
|
|
+ min-width: 0;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+}
|
|
|
+
|
|
|
.muted {
|
|
|
color: var(--color-text-3);
|
|
|
}
|