Files
xk-admin/apps/web-antd/src/utils/formatStoreNameWithHu.ts
2026-07-18 10:22:36 +08:00

16 lines
503 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 在线处方诊所名追加「is_online 为 1/2/3问诊/复诊等),线下 0 不加
*/
export function formatStoreNameWithHu(
storeName: string | null | undefined,
isOnline: number | string | null | undefined,
): string {
const name = String(storeName ?? '').trim();
if (!name) return '';
const online = Number(isOnline);
if (online === 1 || online === 2 || online === 3) {
return name.endsWith('(互)') ? name : `${name}(互)`;
}
return name;
}