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 []