feat(admin): 用户管理新增用户明细抽屉,聚合资金与交易全链路数据

- 用户管理操作列新增「明细」入口,抽屉按权限提供 5 个 Tab:钱包流水、订单记录、提现记录、邀请返利、支付记录
- 后端:后台订单列表新增 user_id 精确过滤(owner_id / renter_id),邀请关系与返利流水新增 inviter_id / invitee_id 过滤
- 修复:返利流水的「被邀请人手机号」筛选此前后端未实现,一直无效
- 资金流水页、支付记录页支持 ?user_id= 预填,可从明细直达
- 顺带将 invitation/dto.go、repository.go 中两处既有缩进错位按 gofmt 规整
This commit is contained in:
yml2213
2026-10-13 14:49:36 +08:00
parent 4a9e5f9d66
commit 0d6a7786a4
12 changed files with 1100 additions and 48 deletions
@@ -22,13 +22,21 @@ import { realnameStatusLabel, userStatusLabel } from '@/shared/utils/statusLabel
import { formatDateTime } from '@/shared/utils/time'
import { useAdminSessionStore } from '@/stores/adminSession'
import AdminTablePagination from '../components/AdminTablePagination.vue'
import AdminUserDetailDrawer from '../components/AdminUserDetailDrawer.vue'
const adminSession = useAdminSessionStore()
const canAdjustWallet = computed(() => adminSession.hasPermission('user:wallet_adjust'))
const canAdjustGrowthPoints = computed(() => adminSession.hasPermission('user:growth_points'))
const canViewUserDetail = computed(
() =>
adminSession.hasPermission('wallet:view') ||
adminSession.hasPermission('order:list') ||
adminSession.hasPermission('withdrawal:list')
)
const submitting = ref(false)
const activeUser = ref<AdminUserItem | null>(null)
const detailUser = ref<AdminUserItem | null>(null)
const quotaUser = ref<AdminUserItem | null>(null)
const realnameUser = ref<AdminUserItem | null>(null)
const manualRealnameUser = ref<AdminUserItem | null>(null)
@@ -82,6 +90,10 @@ function resetFilters() {
queryUsers()
}
function openUserDetail(row: AdminUserItem) {
detailUser.value = row
}
function openFreeze(row: AdminUserItem) {
activeUser.value = row
freezeReason.value = ''
@@ -412,9 +424,18 @@ function moneyCent(value: number | string | undefined) {
<el-table-column label="注册时间" min-width="160">
<template #default="{ row }">{{ formatDateTime(row.created_at) }}</template>
</el-table-column>
<el-table-column label="操作" width="360" fixed="right" align="right">
<el-table-column label="操作" width="400" fixed="right" align="right">
<template #default="{ row }">
<div class="table-actions">
<el-button
v-if="canViewUserDetail"
text
type="primary"
size="small"
@click="openUserDetail(row)"
>
明细
</el-button>
<el-button
v-if="canAdjustWallet"
text
@@ -752,6 +773,12 @@ function moneyCent(value: number | string | undefined) {
</el-button>
</template>
</el-dialog>
<AdminUserDetailDrawer
:model-value="!!detailUser"
:user="detailUser"
@update:model-value="(val: boolean) => !val && (detailUser = null)"
/>
</section>
</template>