2026-10-22 00:27:12 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="privacy-page">
|
2026-10-26 12:25:14 +08:00
|
|
|
|
<header class="admin-view-heading">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<span class="admin-view-heading__eyebrow">账号与内容安全</span>
|
|
|
|
|
|
<h1>隐私与内容复核</h1>
|
|
|
|
|
|
<p>处理账号注销、待审内容与历史手机号加密回填。</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</header>
|
|
|
|
|
|
|
2026-10-22 00:27:12 +08:00
|
|
|
|
<a-alert
|
|
|
|
|
|
type="warning"
|
|
|
|
|
|
show-icon
|
|
|
|
|
|
message="内容审核当前为本地模拟流程,不会调用微信内容安全接口。正式上线前需接入审核服务并复核隐私指引。"
|
|
|
|
|
|
class="page-notice"
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<a-tabs v-model:active-key="activeTab" @change="loadActiveTab">
|
|
|
|
|
|
<a-tab-pane key="closures" tab="账号注销申请">
|
|
|
|
|
|
<a-table :columns="closureColumns" :data-source="closures" :loading="closureLoading" row-key="id" :scroll="{ x: 'max-content' }">
|
|
|
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
|
|
|
<template v-if="column.key === 'account'">{{ record.nickname }}({{ record.userType === 2 ? '店长' : '员工' }})</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'shops'">{{ (record.shopNames || []).join('、') || '无关联门店' }}</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'time'">{{ record.requestedAt || '-' }}</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'action'">
|
|
|
|
|
|
<a-space>
|
|
|
|
|
|
<a-button type="link" @click="openClosure(record as AccountClosureRequestVO, 'APPROVE')">处理</a-button>
|
|
|
|
|
|
<a-button type="link" danger @click="openClosure(record as AccountClosureRequestVO, 'REJECT')">驳回</a-button>
|
|
|
|
|
|
</a-space>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</a-table>
|
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
|
|
|
|
|
|
|
<a-tab-pane key="moderation" tab="内容复核">
|
|
|
|
|
|
<a-table :columns="moderationColumns" :data-source="moderation" :loading="moderationLoading" row-key="id" :scroll="{ x: 'max-content' }">
|
|
|
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
|
|
|
<template v-if="column.key === 'type'">{{ moderationType(record.contentType) }}</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'content'">
|
2026-10-25 05:58:35 +08:00
|
|
|
|
<div class="moderation-content">
|
|
|
|
|
|
<div class="moderation-author">{{ record.authorName || '未知发布者' }}</div>
|
|
|
|
|
|
<pre class="payload-preview">{{ record.textPreview || '无文字内容' }}</pre>
|
|
|
|
|
|
<a-space v-if="record.images?.length" wrap>
|
|
|
|
|
|
<a-image
|
|
|
|
|
|
v-for="image in record.images"
|
|
|
|
|
|
:key="String(image.fileId)"
|
|
|
|
|
|
:src="image.url"
|
|
|
|
|
|
:width="56"
|
|
|
|
|
|
:height="56"
|
|
|
|
|
|
fit="cover"
|
|
|
|
|
|
:preview="Boolean(image.url)"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<span v-if="record.images.some((image: NonNullable<ContentModerationRecordVO['images']>[number]) => !image.url)" class="image-pending">图片预览不可用</span>
|
|
|
|
|
|
</a-space>
|
|
|
|
|
|
</div>
|
2026-10-22 00:27:12 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'status'">{{ record.status === 'RETRY' ? '待复核(模拟服务故障)' : '待复核' }}</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'action'">
|
|
|
|
|
|
<a-space>
|
|
|
|
|
|
<a-button type="link" @click="openModeration(record as ContentModerationRecordVO, true)">通过</a-button>
|
|
|
|
|
|
<a-button type="link" danger @click="openModeration(record as ContentModerationRecordVO, false)">拒绝</a-button>
|
|
|
|
|
|
</a-space>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</a-table>
|
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
|
|
|
|
|
|
|
<a-tab-pane key="backfill" tab="手机号加密回填">
|
|
|
|
|
|
<a-space direction="vertical" size="middle" class="backfill-panel">
|
|
|
|
|
|
<p>先查看冲突和待处理记录数。正式回填仅在 Nacos 显式启用后可执行;检测到重复数据时会整批停止,不覆盖冲突记录。</p>
|
|
|
|
|
|
<a-space>
|
|
|
|
|
|
<a-button :loading="backfillLoading" @click="loadBackfillReport">检查数据</a-button>
|
|
|
|
|
|
<a-button type="primary" danger :disabled="!backfillReport || hasBackfillConflicts" :loading="backfillLoading" @click="runBackfill">执行回填</a-button>
|
|
|
|
|
|
</a-space>
|
|
|
|
|
|
<a-descriptions v-if="backfillReport" bordered :column="2" size="small">
|
|
|
|
|
|
<a-descriptions-item label="待处理账号">{{ backfillReport.userRowsToUpdate }}</a-descriptions-item>
|
|
|
|
|
|
<a-descriptions-item label="待处理订单">{{ backfillReport.orderRowsToUpdate }}</a-descriptions-item>
|
|
|
|
|
|
<a-descriptions-item label="账号冲突">{{ backfillReport.accountConflictRows }}</a-descriptions-item>
|
|
|
|
|
|
<a-descriptions-item label="手机号冲突">{{ backfillReport.phoneConflictRows }}</a-descriptions-item>
|
|
|
|
|
|
</a-descriptions>
|
|
|
|
|
|
<a-alert v-if="backfillReport?.conflictingUserIds?.length" type="error" show-icon message="发现冲突,已禁止执行回填" :description="`涉及账号 ID:${backfillReport.conflictingUserIds.join('、')}`" />
|
|
|
|
|
|
</a-space>
|
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
|
</a-tabs>
|
|
|
|
|
|
|
|
|
|
|
|
<a-modal v-model:open="closureOpen" :title="closureDecision === 'APPROVE' ? '处理注销申请' : '驳回注销申请'" :confirm-loading="actionLoading" :mask-closable="false" @ok="submitClosure">
|
|
|
|
|
|
<template v-if="closureTarget && closureDecision === 'APPROVE'">
|
|
|
|
|
|
<div v-if="closureTarget.userType === 2 && closureTarget.shopIds?.length" class="closure-shops">
|
|
|
|
|
|
<p>关联门店:{{ (closureTarget.shopNames || []).join('、') }}</p>
|
|
|
|
|
|
<a-radio-group v-model:value="closureMode">
|
|
|
|
|
|
<a-radio value="transfer">移交门店</a-radio>
|
|
|
|
|
|
<a-radio value="archive">归档全部门店</a-radio>
|
|
|
|
|
|
</a-radio-group>
|
|
|
|
|
|
<a-select v-if="closureMode === 'transfer'" v-model:value="successorManagerId" class="full-width" placeholder="选择接手店长" :options="successorOptions" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<p v-else>确认清理该账号资料并撤销其会话?必要业务记录会保留并去除账号身份关联。</p>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<a-form-item :label="closureDecision === 'REJECT' ? '驳回原因' : '处理说明'">
|
|
|
|
|
|
<a-textarea v-model:value="closureNote" :rows="3" :placeholder="closureDecision === 'REJECT' ? '请填写驳回原因' : '可填写处理说明'" />
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
|
|
|
|
|
<a-modal v-model:open="moderationOpen" :title="moderationApproved ? '通过内容复核' : '拒绝内容'" :confirm-loading="actionLoading" :mask-closable="false" @ok="submitModeration">
|
|
|
|
|
|
<p v-if="moderationTarget">{{ moderationType(moderationTarget.contentType) }}内容,记录号 {{ moderationTarget.id }}</p>
|
|
|
|
|
|
<a-form-item label="复核说明"><a-textarea v-model:value="moderationReason" :rows="3" placeholder="说明本次模拟复核结果" /></a-form-item>
|
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import { computed, onMounted, ref } from 'vue'
|
|
|
|
|
|
import { message, Modal } from 'ant-design-vue'
|
|
|
|
|
|
import {
|
|
|
|
|
|
adminPrivacyComplianceApi,
|
|
|
|
|
|
type AccountClosureRequestVO,
|
|
|
|
|
|
type ClosureSuccessorManagerVO,
|
|
|
|
|
|
type ContentModerationRecordVO,
|
|
|
|
|
|
type PhoneBackfillReportVO
|
|
|
|
|
|
} from '@/api/admin'
|
|
|
|
|
|
|
|
|
|
|
|
const activeTab = ref('closures')
|
|
|
|
|
|
const closures = ref<AccountClosureRequestVO[]>([])
|
|
|
|
|
|
const moderation = ref<ContentModerationRecordVO[]>([])
|
|
|
|
|
|
const successorManagers = ref<ClosureSuccessorManagerVO[]>([])
|
|
|
|
|
|
const backfillReport = ref<PhoneBackfillReportVO | null>(null)
|
|
|
|
|
|
const closureLoading = ref(false)
|
|
|
|
|
|
const moderationLoading = ref(false)
|
|
|
|
|
|
const backfillLoading = ref(false)
|
|
|
|
|
|
const actionLoading = ref(false)
|
|
|
|
|
|
const closureOpen = ref(false)
|
|
|
|
|
|
const closureTarget = ref<AccountClosureRequestVO | null>(null)
|
|
|
|
|
|
const closureDecision = ref<'APPROVE' | 'REJECT'>('APPROVE')
|
|
|
|
|
|
const closureMode = ref<'transfer' | 'archive'>('transfer')
|
|
|
|
|
|
const successorManagerId = ref<string | number>()
|
|
|
|
|
|
const closureNote = ref('')
|
|
|
|
|
|
const moderationOpen = ref(false)
|
|
|
|
|
|
const moderationTarget = ref<ContentModerationRecordVO | null>(null)
|
|
|
|
|
|
const moderationApproved = ref(false)
|
|
|
|
|
|
const moderationReason = ref('')
|
|
|
|
|
|
const hasBackfillConflicts = computed(() => Boolean(backfillReport.value?.accountConflictRows || backfillReport.value?.phoneConflictRows))
|
|
|
|
|
|
const successorOptions = computed(() => successorManagers.value.map(manager => ({ label: `${manager.nickname || '店长'}(${manager.id})`, value: manager.id })))
|
|
|
|
|
|
|
|
|
|
|
|
const closureColumns = [
|
|
|
|
|
|
{ title: '申请人', key: 'account' },
|
|
|
|
|
|
{ title: '关联门店', key: 'shops' },
|
|
|
|
|
|
{ title: '申请时间', key: 'time' },
|
|
|
|
|
|
{ title: '处理', key: 'action', width: 140 }
|
|
|
|
|
|
]
|
|
|
|
|
|
const moderationColumns = [
|
|
|
|
|
|
{ title: '类型', key: 'type', width: 120 },
|
|
|
|
|
|
{ title: '隔离内容', key: 'content', width: 420 },
|
|
|
|
|
|
{ title: '状态', key: 'status', width: 180 },
|
|
|
|
|
|
{ title: '提交时间', dataIndex: 'createTime', key: 'createTime' },
|
|
|
|
|
|
{ title: '复核', key: 'action', width: 140 }
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
async function loadClosures() {
|
|
|
|
|
|
closureLoading.value = true
|
|
|
|
|
|
try {
|
|
|
|
|
|
const [items, managers] = await Promise.all([
|
|
|
|
|
|
adminPrivacyComplianceApi.listClosures(),
|
|
|
|
|
|
adminPrivacyComplianceApi.listSuccessorManagers()
|
|
|
|
|
|
])
|
|
|
|
|
|
closures.value = items || []
|
|
|
|
|
|
successorManagers.value = managers || []
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
message.error(error instanceof Error ? error.message : '获取注销申请失败')
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
closureLoading.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function loadModeration() {
|
|
|
|
|
|
moderationLoading.value = true
|
|
|
|
|
|
try { moderation.value = await adminPrivacyComplianceApi.listModeration() || [] }
|
|
|
|
|
|
catch (error) { message.error(error instanceof Error ? error.message : '获取复核列表失败') }
|
|
|
|
|
|
finally { moderationLoading.value = false }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function loadActiveTab() {
|
|
|
|
|
|
if (activeTab.value === 'closures') void loadClosures()
|
|
|
|
|
|
if (activeTab.value === 'moderation') void loadModeration()
|
|
|
|
|
|
if (activeTab.value === 'backfill') void loadBackfillReport()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function openClosure(record: AccountClosureRequestVO, decision: 'APPROVE' | 'REJECT') {
|
|
|
|
|
|
closureTarget.value = record
|
|
|
|
|
|
closureDecision.value = decision
|
|
|
|
|
|
closureMode.value = 'transfer'
|
|
|
|
|
|
successorManagerId.value = undefined
|
|
|
|
|
|
closureNote.value = decision === 'REJECT' ? '' : '已完成门店交接或归档,并按要求清理账号资料。'
|
|
|
|
|
|
closureOpen.value = true
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function submitClosure() {
|
|
|
|
|
|
if (!closureTarget.value) return
|
|
|
|
|
|
if (closureDecision.value === 'REJECT' && !closureNote.value.trim()) {
|
|
|
|
|
|
message.warning('请填写驳回原因')
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
const managerHasShops = closureDecision.value === 'APPROVE' && closureTarget.value.userType === 2 && (closureTarget.value.shopIds || []).length > 0
|
|
|
|
|
|
if (managerHasShops && closureMode.value === 'transfer' && !successorManagerId.value) {
|
|
|
|
|
|
message.warning('请选择接手店长')
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
if (managerHasShops && closureMode.value === 'archive' && !(await confirmArchive())) return
|
|
|
|
|
|
actionLoading.value = true
|
|
|
|
|
|
try {
|
|
|
|
|
|
await adminPrivacyComplianceApi.processClosure(closureTarget.value.id, {
|
|
|
|
|
|
decision: closureDecision.value,
|
|
|
|
|
|
successorManagerId: managerHasShops && closureMode.value === 'transfer' ? successorManagerId.value : undefined,
|
|
|
|
|
|
archiveShopIds: managerHasShops && closureMode.value === 'archive' ? closureTarget.value.shopIds : undefined,
|
|
|
|
|
|
note: closureNote.value.trim() || undefined
|
|
|
|
|
|
})
|
|
|
|
|
|
message.success(closureDecision.value === 'APPROVE' ? '账号资料已处理' : '申请已驳回')
|
|
|
|
|
|
closureOpen.value = false
|
|
|
|
|
|
await loadClosures()
|
|
|
|
|
|
} catch (error) { message.error(error instanceof Error ? error.message : '处理失败') }
|
|
|
|
|
|
finally { actionLoading.value = false }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function confirmArchive() {
|
|
|
|
|
|
return new Promise<boolean>(resolve => Modal.confirm({
|
|
|
|
|
|
title: '确认归档全部门店?',
|
|
|
|
|
|
content: '归档后关联门店将停止营业,请确认已完成必要交接。',
|
|
|
|
|
|
okText: '确认归档',
|
|
|
|
|
|
cancelText: '返回',
|
|
|
|
|
|
onOk: () => resolve(true),
|
|
|
|
|
|
onCancel: () => resolve(false)
|
|
|
|
|
|
}))
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function openModeration(record: ContentModerationRecordVO, approved: boolean) {
|
|
|
|
|
|
moderationTarget.value = record
|
|
|
|
|
|
moderationApproved.value = approved
|
|
|
|
|
|
moderationReason.value = approved ? '本地模拟复核通过。' : ''
|
|
|
|
|
|
moderationOpen.value = true
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function submitModeration() {
|
|
|
|
|
|
if (!moderationTarget.value) return
|
|
|
|
|
|
if (!moderationReason.value.trim()) {
|
|
|
|
|
|
message.warning('请填写复核说明')
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
actionLoading.value = true
|
|
|
|
|
|
try {
|
|
|
|
|
|
await adminPrivacyComplianceApi.reviewContent(moderationTarget.value.id, { approved: moderationApproved.value, reason: moderationReason.value.trim() })
|
|
|
|
|
|
message.success(moderationApproved.value ? '内容已通过复核' : '内容已拒绝')
|
|
|
|
|
|
moderationOpen.value = false
|
|
|
|
|
|
await loadModeration()
|
|
|
|
|
|
} catch (error) { message.error(error instanceof Error ? error.message : '复核失败') }
|
|
|
|
|
|
finally { actionLoading.value = false }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function loadBackfillReport() {
|
|
|
|
|
|
backfillLoading.value = true
|
|
|
|
|
|
try { backfillReport.value = await adminPrivacyComplianceApi.phoneBackfillReport() }
|
|
|
|
|
|
catch (error) { message.error(error instanceof Error ? error.message : '检查失败') }
|
|
|
|
|
|
finally { backfillLoading.value = false }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function runBackfill() {
|
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
|
title: '执行手机号加密回填?',
|
|
|
|
|
|
content: '该操作只更新无重复冲突的历史账号和订单手机号。请确认已在目标环境 Nacos 显式开启回填开关。',
|
|
|
|
|
|
okText: '执行回填',
|
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
|
onOk: async () => {
|
|
|
|
|
|
backfillLoading.value = true
|
|
|
|
|
|
try {
|
|
|
|
|
|
backfillReport.value = await adminPrivacyComplianceApi.runPhoneBackfill()
|
|
|
|
|
|
message.success(`回填完成:账号 ${backfillReport.value.userRowsUpdated} 条,订单 ${backfillReport.value.orderRowsUpdated} 条`)
|
|
|
|
|
|
} catch (error) { message.error(error instanceof Error ? error.message : '回填失败') }
|
|
|
|
|
|
finally { backfillLoading.value = false }
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function moderationType(type: string) {
|
2026-10-25 05:58:35 +08:00
|
|
|
|
return ({ USER_PROFILE: '个人资料', USER_AVATAR: '头像', PRODUCT: '作品', EFFECT_DIAGRAM: '效果图', COMMENT: '评论', ORDER_ARTIST_REVIEW: '订单评价', SHOP: '门店资料', ANNOUNCEMENT: '公告', SYSTEM_MESSAGE: '系统消息' } as Record<string, string>)[type] || type
|
2026-10-22 00:27:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(loadActiveTab)
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.privacy-page { display: grid; gap: 16px; }
|
|
|
|
|
|
.page-notice { border-radius: 8px; }
|
|
|
|
|
|
.payload-preview { max-width: 420px; max-height: 180px; margin: 0; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 12px; }
|
2026-10-25 05:58:35 +08:00
|
|
|
|
.moderation-content { display: grid; gap: 6px; }
|
|
|
|
|
|
.moderation-author { color: var(--ant-color-text-secondary); font-size: 12px; }
|
|
|
|
|
|
.image-pending { color: var(--ant-color-text-secondary); font-size: 12px; }
|
2026-10-22 00:27:12 +08:00
|
|
|
|
.backfill-panel { width: 100%; padding: 8px 0; }
|
|
|
|
|
|
.closure-shops { display: grid; gap: 12px; margin-bottom: 16px; }
|
|
|
|
|
|
.closure-shops p { margin: 0; }
|
|
|
|
|
|
.full-width { width: 100%; margin-top: 12px; }
|
|
|
|
|
|
</style>
|