优化
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import type { OceanBookingStatus } from './types'
|
||||
|
||||
export const oceanBookingStatusLabels: Record<OceanBookingStatus, string> = {
|
||||
DRAFT: '草稿',
|
||||
SUBMITTED: '已提交',
|
||||
CONFIRMED: '已确认',
|
||||
RELEASED: '已放舱',
|
||||
FAILED: '订舱失败',
|
||||
CHANGE_PENDING: '变更中',
|
||||
CANCELLED: '已取消',
|
||||
}
|
||||
|
||||
export const oceanBookingStatusOptions = Object.entries(oceanBookingStatusLabels).map(([value, label]) => ({
|
||||
value: value as OceanBookingStatus,
|
||||
label,
|
||||
}))
|
||||
|
||||
export function oceanBookingStatusLabel(status: string | null | undefined, emptyLabel = '未设置') {
|
||||
if (!status) return emptyLabel
|
||||
return oceanBookingStatusLabels[status as OceanBookingStatus] || '未知状态'
|
||||
}
|
||||
Reference in New Issue
Block a user