Files
xk-admin/apps/web-antd/src/views/log/api-log/config/platform.ts
李琦 402da17e3d 1. 管理员管理模块拆分
2. 图片上传自动压缩(大于850kb)
3. 省市区选择组件重构,支持搜索
2026-05-27 09:34:08 +08:00

36 lines
1.0 KiB
TypeScript

export const API_OP_LOG_PLATFORM_OPTIONS = [
{ label: '后台', value: 0 },
{ label: '用户移动端', value: 1 },
{ label: '医生移动端', value: 2 },
{ label: '互医内部接口', value: 3 },
] as const;
export function getApiOpLogPlatformLabel(
platformType: number | string | null | undefined,
): string {
const value = Number(platformType);
const found = API_OP_LOG_PLATFORM_OPTIONS.find((item) => item.value === value);
return found?.label ?? '历史/未知';
}
export function getApiOpLogOperatorLabel(row: {
platform_type?: number;
admin?: { nick_name?: string };
user?: { nickname?: string };
}): string {
const type = row.platform_type;
if (type === 3) {
return '互医中转';
}
if (type === 2) {
return row?.user?.nickname || row?.admin?.nick_name || '-';
}
if (type === 1) {
return row?.user?.nickname || '获取失败';
}
if (type === 0) {
return row?.admin?.nick_name || '获取失败';
}
return row?.admin?.nick_name || row?.user?.nickname || '-';
}