/** 表单选填项常为 null,PUT 时去掉以免后端对 null 调 trim */ export function omitNullFields>(input: T): Partial { const out: Partial = {}; for (const [key, value] of Object.entries(input)) { if (value === null || value === undefined) continue; (out as Record)[key] = value; } return out; }