17 lines
557 B
TypeScript
17 lines
557 B
TypeScript
import type { OceanBookingStatus } from './types'
|
|
|
|
export const oceanBookingStatusLabels: Record<OceanBookingStatus, string> = {
|
|
DRAFT: '草稿',
|
|
RELEASED: '已放舱',
|
|
}
|
|
|
|
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] || '未知状态'
|
|
}
|