1. 管理员管理模块拆分

2. 图片上传自动压缩(大于850kb)
3. 省市区选择组件重构,支持搜索
This commit is contained in:
李琦
2026-05-27 09:34:08 +08:00
parent 68fd7b0045
commit 402da17e3d
56 changed files with 4188 additions and 13664 deletions

View File

@@ -0,0 +1,35 @@
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 || '-';
}

View File

@@ -1,5 +1,7 @@
import type { VbenFormProps } from '#/adapter/form';
import { API_OP_LOG_PLATFORM_OPTIONS } from './platform';
// import dayjs from 'dayjs';
export const formOptions: VbenFormProps = {
@@ -18,6 +20,16 @@ export const formOptions: VbenFormProps = {
fieldName: 'router',
label: 'api接口',
},
{
component: 'Select',
componentProps: {
allowClear: true,
options: [...API_OP_LOG_PLATFORM_OPTIONS],
placeholder: '全部',
},
fieldName: 'platform_type',
label: '接口来源',
},
{
component: 'RangePicker',
componentProps: {

View File

@@ -32,6 +32,12 @@ export const gridOptions: VxeGridProps<RowType> = {
slots: { default: 'admin' },
},
{ field: 'url', title: '访问路由' },
{
field: 'platform_type',
title: '接口来源',
slots: { default: 'platform_type' },
width: 120,
},
{ field: 'ip', title: '用户IP地址' },
{ field: 'ip_address', title: 'IP归属地' },
{ field: 'controller', title: '访问控制器' },