Files
xk-admin/apps/web-antd/src/utils/formatStoreNameWithHu.ts

16 lines
503 B
TypeScript
Raw Normal View History

2026-07-18 10:22:36 +08:00
/**
* 线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;
}