This commit is contained in:
@@ -55,7 +55,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<a-table :columns="moderationColumns" :data-source="moderation" :loading="moderationLoading" row-key="id" :scroll="{ x: 'max-content' }">
|
<a-table :columns="moderationColumns" :data-source="moderation" :loading="moderationLoading" row-key="id" :scroll="{ x: 'max-content' }">
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'type'">{{ moderationType(record.contentType) }}</template>
|
<template v-if="column.key === 'type'">
|
||||||
|
<span :title="isUnknownModerationType(record.contentType) ? record.contentType : undefined">{{ moderationType(record.contentType) }}</span>
|
||||||
|
</template>
|
||||||
<template v-else-if="column.key === 'content'">
|
<template v-else-if="column.key === 'content'">
|
||||||
<div class="moderation-content">
|
<div class="moderation-content">
|
||||||
<div class="moderation-author">{{ record.authorName || '未知发布者' }}</div>
|
<div class="moderation-author">{{ record.authorName || '未知发布者' }}</div>
|
||||||
@@ -323,8 +325,36 @@ function runBackfill() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function moderationType(type: string) {
|
// 内容复核类型枚举(t_content_moderation_record.content_type)中文映射,集中在此维护
|
||||||
return ({ USER_PROFILE: '个人资料', USER_AVATAR: '头像', PRODUCT: '作品', EFFECT_DIAGRAM: '效果图', COMMENT: '评论', ORDER_ARTIST_REVIEW: '订单评价', SHOP: '门店资料', ANNOUNCEMENT: '公告', SYSTEM_MESSAGE: '系统消息' } as Record<string, string>)[type] || type
|
const MODERATION_TYPE_LABELS: Record<string, string> = {
|
||||||
|
USER_PROFILE: '个人资料',
|
||||||
|
USER_AVATAR: '头像',
|
||||||
|
NAIL_ARTIST_PROFILE: '美甲师资料',
|
||||||
|
STAFF_REGISTRATION: '美甲师注册申请',
|
||||||
|
PRODUCT: '作品',
|
||||||
|
EFFECT_DIAGRAM: '效果图',
|
||||||
|
COMMENT: '评论',
|
||||||
|
ORDER_ARTIST_REVIEW: '订单评价',
|
||||||
|
SHOP: '门店资料',
|
||||||
|
ANNOUNCEMENT: '公告',
|
||||||
|
SYSTEM_MESSAGE: '系统消息'
|
||||||
|
}
|
||||||
|
const warnedModerationTypes = new Set<string>()
|
||||||
|
|
||||||
|
function moderationType(type?: string | null) {
|
||||||
|
const key = String(type || '').trim()
|
||||||
|
const label = MODERATION_TYPE_LABELS[key]
|
||||||
|
if (label) return label
|
||||||
|
if (key && !warnedModerationTypes.has(key)) {
|
||||||
|
warnedModerationTypes.add(key)
|
||||||
|
console.warn(`[内容复核] 未映射的内容类型枚举:${key}`)
|
||||||
|
}
|
||||||
|
return '其他'
|
||||||
|
}
|
||||||
|
|
||||||
|
function isUnknownModerationType(type?: string | null) {
|
||||||
|
const key = String(type || '').trim()
|
||||||
|
return !key || !MODERATION_TYPE_LABELS[key]
|
||||||
}
|
}
|
||||||
|
|
||||||
let skipInitialActivationRefresh = true
|
let skipInitialActivationRefresh = true
|
||||||
|
|||||||
Reference in New Issue
Block a user