1. 推广员功能增强
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
This commit is contained in:
@@ -1,11 +1,33 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
const prefix = 'log/';
|
||||
|
||||
export type ApiLogUserSearchItem = {
|
||||
id: number;
|
||||
name: string;
|
||||
avatar: string;
|
||||
role_label: string;
|
||||
user_type: 'admin' | 'patient' | 'doctor';
|
||||
platform_type: 0 | 1 | 2;
|
||||
};
|
||||
|
||||
/**
|
||||
* 分页查询用户列表
|
||||
* @param data
|
||||
* 分页查询 Api 访问日志
|
||||
*/
|
||||
export async function getOldApiLogList(data: any) {
|
||||
return requestClient.get<any>(`${prefix}api-list`, { params: data });
|
||||
}
|
||||
// Api访问日志
|
||||
|
||||
/**
|
||||
* Api 访问日志操作用户搜索
|
||||
*/
|
||||
export async function searchApiLogUsers(params: {
|
||||
user_type: 'admin' | 'patient' | 'doctor';
|
||||
keyword: string;
|
||||
pageSize?: number;
|
||||
}) {
|
||||
return requestClient.get<{ items: ApiLogUserSearchItem[] }>(
|
||||
`${prefix}user-search`,
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,10 +9,9 @@ export const formOptions: VbenFormProps = {
|
||||
collapsed: false,
|
||||
schema: [
|
||||
{
|
||||
component: 'VbenInput',
|
||||
// defaultValue: [dayjs().startOf('month'), dayjs()],
|
||||
fieldName: 'user_id',
|
||||
label: '用户ID',
|
||||
component: 'ApiLogUserPicker',
|
||||
fieldName: 'user_filter',
|
||||
label: '操作用户',
|
||||
},
|
||||
{
|
||||
component: 'VbenInput',
|
||||
|
||||
@@ -54,10 +54,13 @@ export const gridOptions: VxeGridProps<RowType> = {
|
||||
ajax: {
|
||||
// 请求后端接口方法
|
||||
query: async ({ page }, formValues) => {
|
||||
const { user_filter, platform_type, ...rest } = formValues;
|
||||
return await getOldApiLogList({
|
||||
page: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
...rest,
|
||||
user_id: user_filter?.id,
|
||||
platform_type: platform_type ?? user_filter?.platform_type,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -19,10 +19,30 @@ import { getIcon } from '#/util/tool';
|
||||
import {Icon} from "#/components/icon";
|
||||
|
||||
ref(false);
|
||||
|
||||
let gridApiRef: ReturnType<typeof useVbenVxeGrid>[1];
|
||||
|
||||
function syncPlatformType(platformType: 0 | 1 | 2) {
|
||||
gridApiRef?.formApi?.setFieldValue('platform_type', platformType);
|
||||
}
|
||||
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
formOptions: {
|
||||
...formOptions,
|
||||
schema: formOptions.schema?.map((item) =>
|
||||
item.fieldName === 'user_filter'
|
||||
? {
|
||||
...item,
|
||||
componentProps: {
|
||||
onPlatformTypeChange: syncPlatformType,
|
||||
},
|
||||
}
|
||||
: item,
|
||||
),
|
||||
},
|
||||
gridOptions,
|
||||
});
|
||||
gridApiRef = gridApi;
|
||||
|
||||
const [FormModal, formModalApi] = useVbenModal({
|
||||
connectedComponent: FormModalDemo,
|
||||
|
||||
Reference in New Issue
Block a user