feat(web-admin): add mobile plan detail and shared action guards.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
17edd7016f
commit
1a5aa1c934
3 files changed
+193
-40
No files matched your search
@@ -0,0 +1,34 @@
|
||||
export function canEditPlan(row: { archiveStatus?: string; followStatus?: string }) {
|
||||
return row.archiveStatus !== 'archived' && row.followStatus !== 'cancelled'
|
||||
}
|
||||
|
||||
export function canArrangeTransport(row: {
|
||||
transportStatus?: string
|
||||
archiveStatus?: string
|
||||
followStatus?: string
|
||||
}) {
|
||||
return (
|
||||
(row.transportStatus === 'pending' || row.transportStatus === 'arranged') &&
|
||||
row.archiveStatus !== 'archived' &&
|
||||
row.followStatus !== 'cancelled'
|
||||
)
|
||||
}
|
||||
|
||||
export function arrangeTransportLabel(row: { transportStatus?: string }) {
|
||||
return row.transportStatus === 'arranged' ? '调整运输' : '安排运输'
|
||||
}
|
||||
|
||||
export function canVoidPlan(row: { archiveStatus?: string; followStatus?: string }) {
|
||||
return row.archiveStatus !== 'archived' && row.followStatus !== 'cancelled'
|
||||
}
|
||||
|
||||
export function canWaitNotice(row: { followStatus?: string; archiveStatus?: string }) {
|
||||
return (
|
||||
(row.followStatus === 'pending_arrange' || row.followStatus === 'drafting') &&
|
||||
row.archiveStatus !== 'archived'
|
||||
)
|
||||
}
|
||||
|
||||
export function canCancelWaitNotice(row: { followStatus?: string; archiveStatus?: string }) {
|
||||
return row.followStatus === 'wait_notice' && row.archiveStatus !== 'archived'
|
||||
}
|
||||
Reference in new issue
Block a user