feat(admin): 观看/收藏/点赞列表单独增加系统列
用户单元格只保留身份信息,Android/iOS 抽成独立「系统」列,三页列结构一致。
This commit is contained in:
1 parent
c89c5668e1
commit
5dbc752798
5 files changed
+19
-15
No files matched your search
@@ -7,20 +7,13 @@ import { computed } from 'vue'
|
||||
* 后台各列表共用的「用户」单元格。
|
||||
*
|
||||
* 口径:已登录显示昵称 + uid;未登录显示「游客」标签 + deviceId(单行省略,悬浮看全值)。
|
||||
* 第二行只展示客户端平台(Android / iOS),老客户端没上报时显示横线。
|
||||
* 客户端平台由独立的「系统」列展示,这里不再重复。
|
||||
*/
|
||||
const props = defineProps({
|
||||
row: { type: Object, required: true }
|
||||
})
|
||||
|
||||
const PLATFORM_TEXT = { ANDROID: 'Android', IOS: 'iOS', WEB: 'Web' }
|
||||
|
||||
const isGuest = computed(() => props.row?.userId == null)
|
||||
|
||||
const platformText = computed(() => {
|
||||
const platform = props.row?.platform || ''
|
||||
return PLATFORM_TEXT[platform] || platform || '—'
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -37,7 +30,6 @@ const platformText = computed(() => {
|
||||
}}</span>
|
||||
<span class="app-user-uid">{{ row.uid || `用户 #${row.userId}` }}</span>
|
||||
</template>
|
||||
<span class="app-user-platform">{{ platformText }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -48,9 +40,4 @@ const platformText = computed(() => {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.app-user-platform {
|
||||
color: #b0adbd;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -6,6 +6,7 @@ import dayjs from 'dayjs'
|
||||
import PageHeading from '@/views/components/PageHeading.vue'
|
||||
import AppUserCell from '@/views/components/AppUserCell.vue'
|
||||
import { pageFavoritesApi } from '@/api/admin/engagement'
|
||||
import { platformText } from './composables/useAppUsers'
|
||||
|
||||
const PAGE_SIZES = [10, 20, 50]
|
||||
|
||||
@@ -110,6 +111,9 @@ onMounted(load)
|
||||
<AppUserCell :row="row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="系统" width="100">
|
||||
<template #default="{ row }">{{ platformText(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="短剧" min-width="220">
|
||||
<template #default="{ row }">
|
||||
<div class="engagement-drama">
|
||||
|
||||
@@ -6,6 +6,7 @@ import dayjs from 'dayjs'
|
||||
import PageHeading from '@/views/components/PageHeading.vue'
|
||||
import AppUserCell from '@/views/components/AppUserCell.vue'
|
||||
import { pageLikesApi } from '@/api/admin/engagement'
|
||||
import { platformText } from './composables/useAppUsers'
|
||||
|
||||
const PAGE_SIZES = [10, 20, 50]
|
||||
const TARGET_OPTIONS = [
|
||||
@@ -133,6 +134,9 @@ onMounted(load)
|
||||
<AppUserCell :row="row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="系统" width="100">
|
||||
<template #default="{ row }">{{ platformText(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="目标类型" width="110">
|
||||
<template #default="{ row }">{{ typeText(row.targetType) }}</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -5,7 +5,7 @@ import { onMounted, reactive, ref } from 'vue'
|
||||
import PageHeading from '@/views/components/PageHeading.vue'
|
||||
import AppUserCell from '@/views/components/AppUserCell.vue'
|
||||
import { pageWatchHistoryApi } from '@/api/admin/appUser'
|
||||
import { formatDuration } from './composables/useAppUsers'
|
||||
import { formatDuration, platformText } from './composables/useAppUsers'
|
||||
|
||||
const SOURCE_OPTIONS = [
|
||||
{ value: '', label: '全部' },
|
||||
@@ -174,6 +174,9 @@ onMounted(load)
|
||||
<AppUserCell :row="row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="系统" width="100">
|
||||
<template #default="{ row }">{{ platformText(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="短剧" min-width="190">
|
||||
<template #default="{ row }">
|
||||
<el-tooltip :content="contentTooltip(row)" placement="top">
|
||||
|
||||
@@ -36,6 +36,12 @@ export function statusMeta(status) {
|
||||
|
||||
const PLATFORM_TEXT = { ANDROID: 'Android', IOS: 'iOS', WEB: 'Web' }
|
||||
|
||||
/** 客户端平台,只有 iOS / Android 两种取值(缺记录显示横线)。 */
|
||||
export function platformText(row) {
|
||||
const platform = row?.platform || ''
|
||||
return PLATFORM_TEXT[platform] || platform || '—'
|
||||
}
|
||||
|
||||
/** 登录会话上的系统,例如 Android 16。没有记录时显示横线。 */
|
||||
export function systemText(row) {
|
||||
const name = PLATFORM_TEXT[row?.platform] || row?.platform || ''
|
||||
|
||||
Reference in new issue
Block a user