/** * 确认状态 */ export enum Confirmation { Yes = 1, // 是 No = 0, // 否 } /** * 获取确认状态列表 * @returns */ export function getConfirmationList() { return [ { label: '是', value: Confirmation.Yes }, { label: '否', value: Confirmation.No } ] } /** * 获取确认状态名称 * @param value * @returns */ export function getConfirmationName(value?: number) { const item = getConfirmationList().find((e) => e.value === value) return item?.label ?? value }