feat(admin): 统一用户单元格,展示游客设备号与客户端系统
- 新增 AppUserCell,游客显示标签+deviceId,第二行统一展示系统与机型 - 收藏、点赞、观看记录三页复用,观看记录去掉重复的系统列
This commit is contained in:
1 parent
c45820258e
commit
f3fbc57c14
5 files changed
+78
-50
No files matched your search
@@ -0,0 +1,63 @@
|
||||
<!-- Author: fruit.com.cn -->
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
|
||||
/**
|
||||
* 后台各列表共用的「用户」单元格。
|
||||
*
|
||||
* 口径:已登录显示昵称 + uid;未登录显示「游客」标签 + deviceId(单行省略,悬浮看全值)。
|
||||
* 第二行统一展示客户端系统,系统缺失(老客户端没上报)时显示横线。
|
||||
*/
|
||||
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 systemText = computed(() => {
|
||||
const row = props.row || {}
|
||||
const name = PLATFORM_TEXT[row.platform] || row.platform || ''
|
||||
const version = row.osVersion || ''
|
||||
const text = `${name} ${version}`.trim()
|
||||
if (!text) return '—'
|
||||
return row.deviceModel ? `${text} · ${row.deviceModel}` : text
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="app-user-meta">
|
||||
<template v-if="isGuest">
|
||||
<el-tag type="info" size="small">游客</el-tag>
|
||||
<span class="app-user-uid app-user-device" :title="row.deviceId || ''">{{
|
||||
row.deviceId || '—'
|
||||
}}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="app-user-name" :title="row.nickname || ''">{{
|
||||
row.nickname || '未设置昵称'
|
||||
}}</span>
|
||||
<span class="app-user-uid">{{ row.uid || `用户 #${row.userId}` }}</span>
|
||||
</template>
|
||||
<span class="app-user-system">{{ systemText }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.app-user-device {
|
||||
max-width: 150px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.app-user-system {
|
||||
color: #b0adbd;
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user