From bbff52f324c3c5708f7437dcd122252ee5836abf Mon Sep 17 00:00:00 2001 From: Vicky <10212746+haifeng-jiang@user.noreply.gitee.com> Date: Thu, 5 Nov 2026 10:56:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(drama):=20=E7=9F=AD=E5=89=A7=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E5=90=88=E5=B9=B6=E4=B8=BA=E5=AE=A1=E6=A0=B8=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E5=B9=B6=E4=B8=8A=E7=BA=BF=E4=B8=80=E9=94=AE=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 审核列草稿/已下线/审核中统一为「审核通过并上线」, 审核中保留驳回,待发布与已上线维持原按钮。 --- src/api/admin/drama.ts | 5 +++-- src/api/admin/types.ts | 3 ++- src/views/contentManagement/DramaManagementView.vue | 9 +++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/api/admin/drama.ts b/src/api/admin/drama.ts index 6187444..c0fc026 100644 --- a/src/api/admin/drama.ts +++ b/src/api/admin/drama.ts @@ -40,9 +40,10 @@ export const deleteDramaApi = (id: number) => { return request.delete({ url: `/admin/dramas/${id}` }) } -/** 审核与发布:submit / approve / reject / publish / offline */ +/** 审核与发布:submit / approve / reject / publish / offline / approvePublish */ export const changeDramaStatusApi = (id: number, action: DramaReviewAction, reason?: string) => { - return request.post({ url: `/admin/dramas/${id}/${action}`, data: { reason } }) + const path = action === 'approvePublish' ? 'approve-publish' : action + return request.post({ url: `/admin/dramas/${id}/${path}`, data: { reason } }) } /** 下拉选项(短剧表单用),只返回 id/name */ diff --git a/src/api/admin/types.ts b/src/api/admin/types.ts index 511431b..9a708b6 100644 --- a/src/api/admin/types.ts +++ b/src/api/admin/types.ts @@ -73,7 +73,8 @@ export interface DramaSaveData { sort?: number } -export type DramaReviewAction = 'submit' | 'approve' | 'reject' | 'publish' | 'offline' +export type DramaReviewAction = + 'submit' | 'approve' | 'reject' | 'publish' | 'offline' | 'approvePublish' export interface EpisodeItem { id: number diff --git a/src/views/contentManagement/DramaManagementView.vue b/src/views/contentManagement/DramaManagementView.vue index 8981589..cf5a117 100644 --- a/src/views/contentManagement/DramaManagementView.vue +++ b/src/views/contentManagement/DramaManagementView.vue @@ -33,7 +33,7 @@ import { } from '@/views/contentManagement/upload/imagePresets' const router = useRouter() -const { can, hasAny } = useRbac() +const { can } = useRbac() const loading = ref(false) const list = ref([]) @@ -110,7 +110,8 @@ const actionMeta = { approve: { label: '审核通过', done: '已通过审核' }, reject: { label: '驳回', done: '已驳回' }, publish: { label: '上线', done: '已上线' }, - offline: { label: '下线', done: '已下线' } + offline: { label: '下线', done: '已下线' }, + approvePublish: { label: '审核通过并上线', done: '已通过审核并上线' } } async function load() { @@ -435,9 +436,9 @@ async function runAction(row, action) { function reviewActions(row) { const canReview = can('drama:review') if (row.status === 'draft' || row.status === 'offline') { - return hasAny('drama:update', 'drama:review') ? ['submit'] : [] + return canReview ? ['approvePublish'] : [] } - if (row.status === 'reviewing') return canReview ? ['approve', 'reject'] : [] + if (row.status === 'reviewing') return canReview ? ['approvePublish', 'reject'] : [] if (row.status === 'approved') return canReview ? ['publish'] : [] if (row.status === 'published') return canReview ? ['offline'] : [] return []