feat(drama): 短剧审核合并为审核通过并上线一键操作
审核列草稿/已下线/审核中统一为「审核通过并上线」, 审核中保留驳回,待发布与已上线维持原按钮。
This commit is contained in:
1 parent
9ce014e7b3
commit
bbff52f324
3 files changed
+10
-7
No files matched your search
@@ -40,9 +40,10 @@ export const deleteDramaApi = (id: number) => {
|
|||||||
return request.delete<void>({ url: `/admin/dramas/${id}` })
|
return request.delete<void>({ url: `/admin/dramas/${id}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 审核与发布:submit / approve / reject / publish / offline */
|
/** 审核与发布:submit / approve / reject / publish / offline / approvePublish */
|
||||||
export const changeDramaStatusApi = (id: number, action: DramaReviewAction, reason?: string) => {
|
export const changeDramaStatusApi = (id: number, action: DramaReviewAction, reason?: string) => {
|
||||||
return request.post<void>({ url: `/admin/dramas/${id}/${action}`, data: { reason } })
|
const path = action === 'approvePublish' ? 'approve-publish' : action
|
||||||
|
return request.post<void>({ url: `/admin/dramas/${id}/${path}`, data: { reason } })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 下拉选项(短剧表单用),只返回 id/name */
|
/** 下拉选项(短剧表单用),只返回 id/name */
|
||||||
|
|||||||
@@ -73,7 +73,8 @@ export interface DramaSaveData {
|
|||||||
sort?: number
|
sort?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DramaReviewAction = 'submit' | 'approve' | 'reject' | 'publish' | 'offline'
|
export type DramaReviewAction =
|
||||||
|
'submit' | 'approve' | 'reject' | 'publish' | 'offline' | 'approvePublish'
|
||||||
|
|
||||||
export interface EpisodeItem {
|
export interface EpisodeItem {
|
||||||
id: number
|
id: number
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import {
|
|||||||
} from '@/views/contentManagement/upload/imagePresets'
|
} from '@/views/contentManagement/upload/imagePresets'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const { can, hasAny } = useRbac()
|
const { can } = useRbac()
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const list = ref([])
|
const list = ref([])
|
||||||
@@ -110,7 +110,8 @@ const actionMeta = {
|
|||||||
approve: { label: '审核通过', done: '已通过审核' },
|
approve: { label: '审核通过', done: '已通过审核' },
|
||||||
reject: { label: '驳回', done: '已驳回' },
|
reject: { label: '驳回', done: '已驳回' },
|
||||||
publish: { label: '上线', done: '已上线' },
|
publish: { label: '上线', done: '已上线' },
|
||||||
offline: { label: '下线', done: '已下线' }
|
offline: { label: '下线', done: '已下线' },
|
||||||
|
approvePublish: { label: '审核通过并上线', done: '已通过审核并上线' }
|
||||||
}
|
}
|
||||||
|
|
||||||
async function load() {
|
async function load() {
|
||||||
@@ -435,9 +436,9 @@ async function runAction(row, action) {
|
|||||||
function reviewActions(row) {
|
function reviewActions(row) {
|
||||||
const canReview = can('drama:review')
|
const canReview = can('drama:review')
|
||||||
if (row.status === 'draft' || row.status === 'offline') {
|
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 === 'approved') return canReview ? ['publish'] : []
|
||||||
if (row.status === 'published') return canReview ? ['offline'] : []
|
if (row.status === 'published') return canReview ? ['offline'] : []
|
||||||
return []
|
return []
|
||||||
|
|||||||
Reference in new issue
Block a user