diff --git a/src/api/admin/appUser.ts b/src/api/admin/appUser.ts index ae6bfa7..884938d 100644 --- a/src/api/admin/appUser.ts +++ b/src/api/admin/appUser.ts @@ -13,6 +13,20 @@ export interface AppUserPageParams { registerSource?: string } +export interface WatchHistoryPageParams { + pageIndex?: number + pageSize?: number + keyword?: string + userId?: number + dramaTitle?: string + dramaId?: number + episodeId?: number + source?: string + finished?: boolean + startTime?: string + endTime?: string +} + export const pageAppUsersApi = (params: AppUserPageParams) => { return request.get>({ url: '/admin/app-users/page', params }) } @@ -32,6 +46,13 @@ export const listAppUserWatchHistoryApi = (id: number, limit = 50) => { }) } +export const pageWatchHistoryApi = (params: WatchHistoryPageParams) => { + return request.get>({ + url: '/admin/watch-history/page', + params + }) +} + /** normal / limited / banned,封禁与限制会立即吊销该用户全部会话 */ export const updateAppUserStatusApi = (id: number, status: string, reason?: string) => { return request.put({ diff --git a/src/api/admin/types.ts b/src/api/admin/types.ts index 8056e89..e8562a8 100644 --- a/src/api/admin/types.ts +++ b/src/api/admin/types.ts @@ -307,11 +307,15 @@ export interface AppUserBanRecord { export interface WatchHistoryItem { id: number + userId?: number + uid?: string + nickname?: string dramaId: number dramaTitle?: string dramaPublished?: boolean episodeId: number episodeNo?: number + episodeTitle?: string positionMs: number durationMs: number finished?: boolean @@ -324,7 +328,10 @@ export interface WatchHistoryItem { export interface CommentItem { id: number dramaId: number + dramaTitle?: string episodeId: number + episodeNo?: number + episodeTitle?: string parentId: number rootId: number userId: number diff --git a/src/views/governance/ContentGovernanceView.vue b/src/views/governance/ContentGovernanceView.vue index d49d567..90a9b8f 100644 --- a/src/views/governance/ContentGovernanceView.vue +++ b/src/views/governance/ContentGovernanceView.vue @@ -26,12 +26,14 @@ const canWordUpdate = can('sensitive-word:update') const activeTab = ref('comments') const COMMENT_STATUS = [ + { value: '', label: '全部状态', tag: 'info' }, { value: 'pending', label: '待审核', tag: 'warning' }, { value: 'published', label: '已发布', tag: 'success' }, { value: 'rejected', label: '已驳回', tag: 'danger' }, { value: 'deleted', label: '已删除', tag: 'info' } ] const REPORT_STATUS = [ + { value: '', label: '全部状态', tag: 'info' }, { value: 'pending', label: '待处理', tag: 'warning' }, { value: 'handled', label: '已处理', tag: 'success' }, { value: 'rejected', label: '已驳回', tag: 'info' } @@ -48,6 +50,13 @@ function meta(list, value) { function levelText(level) { return WORD_LEVELS.find((item) => item.value === level)?.label || level } +function commentEpisodeText(row) { + if (row.episodeNo) return `第 ${row.episodeNo} 集` + return row.episodeId ? `分集 #${row.episodeId}` : '未关联分集' +} +function commentContentTooltip(row) { + return `短剧 ID:${row.dramaId} / 分集 ID:${row.episodeId || '未关联'}` +} const comments = reactive({ rows: [], @@ -55,7 +64,7 @@ const comments = reactive({ loading: false, page: 1, size: 10, - status: 'pending', + status: '', keyword: '' }) async function loadComments() { @@ -123,7 +132,7 @@ const reports = reactive({ loading: false, page: 1, size: 10, - status: 'pending' + status: '' }) async function loadReports() { reports.loading = true @@ -325,7 +334,17 @@ const handleTargetText = computed(() => { - + + +