feat(admin): 用户与观看记录展示系统
This commit is contained in:
1 parent
c1fb6cc21c
commit
0578052d6e
4 files changed
+28
-1
No files matched your search
@@ -11,6 +11,7 @@ import {
|
||||
COUNTRY_OPTIONS,
|
||||
formatDuration,
|
||||
statusMeta,
|
||||
systemText,
|
||||
useAppUsers
|
||||
} from './composables/useAppUsers'
|
||||
|
||||
@@ -172,6 +173,9 @@ function canBeBanned(row) {
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="系统" width="130" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ systemText(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机 / 邮箱" min-width="150" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span class="app-user-mono">{{ row.maskedTarget || '—' }}</span>
|
||||
@@ -268,6 +272,7 @@ function canBeBanned(row) {
|
||||
<el-descriptions-item label="最后登录">{{
|
||||
detail.lastLoginAt || '—'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="系统">{{ systemText(detail) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="会员">
|
||||
{{ detail.vipLevel ? `等级 ${detail.vipLevel}` : '未开通(第二阶段)' }}
|
||||
</el-descriptions-item>
|
||||
@@ -299,6 +304,9 @@ function canBeBanned(row) {
|
||||
<el-table-column label="完成" width="70">
|
||||
<template #default="{ row }">{{ row.finished ? '是' : '否' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="系统" width="120" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ systemText(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="来源" width="80">
|
||||
<template #default="{ row }">{{
|
||||
SOURCE_TEXT[row.source] || row.source || '—'
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import PageHeading from '@/views/components/PageHeading.vue'
|
||||
import { pageWatchHistoryApi } from '@/api/admin/appUser'
|
||||
import { formatDuration } from './composables/useAppUsers'
|
||||
import { formatDuration, systemText } from './composables/useAppUsers'
|
||||
|
||||
const SOURCE_OPTIONS = [
|
||||
{ value: '', label: '全部' },
|
||||
@@ -176,6 +176,9 @@ onMounted(load)
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="系统" width="130" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ systemText(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="短剧" min-width="190">
|
||||
<template #default="{ row }">
|
||||
<el-tooltip :content="contentTooltip(row)" placement="top">
|
||||
|
||||
@@ -34,6 +34,16 @@ export function statusMeta(status) {
|
||||
)
|
||||
}
|
||||
|
||||
const PLATFORM_TEXT = { ANDROID: 'Android', IOS: 'iOS', WEB: 'Web' }
|
||||
|
||||
/** 登录会话上的系统,例如 Android 16。没有记录时显示横线。 */
|
||||
export function systemText(row) {
|
||||
const name = PLATFORM_TEXT[row?.platform] || row?.platform || ''
|
||||
const version = row?.osVersion || ''
|
||||
const text = `${name} ${version}`.trim()
|
||||
return text || '—'
|
||||
}
|
||||
|
||||
/** 毫秒转 mm:ss,观看流水里的进度用 */
|
||||
export function formatDuration(ms) {
|
||||
const total = Math.max(0, Math.floor((ms || 0) / 1000))
|
||||
|
||||
Reference in new issue
Block a user