fix:修复打包报错: top level await 的问题

This commit is contained in:
YunaiV
2025-04-22 18:49:31 +08:00
parent 5eee27218c
commit e9f2b5701c
8 changed files with 67 additions and 22 deletions

View File

@@ -3,6 +3,7 @@ import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
import type { VbenFormSchema } from '#/adapter/form';
import type { OnActionClickFn } from '#/adapter/vxe-table';
import type { SystemDeptApi } from '#/api/system/dept';
import type { SystemUserApi } from '#/api/system/user';
import { useAccess } from '@vben/access';
@@ -122,9 +123,9 @@ export function useFormSchema(): VbenFormSchema[] {
}
/** 列表的字段 */
const userList = await getSimpleUserList();
export function useGridColumns(
onActionClick?: OnActionClickFn<SystemDeptApi.SystemDept>,
getLeaderName?: (userId: number) => string | undefined,
): VxeTableGridOptions<SystemDeptApi.SystemDept>['columns'] {
return [
{
@@ -140,9 +141,7 @@ export function useGridColumns(
title: '负责人',
minWidth: 150,
formatter: (row) => {
return (
userList.find((user) => user.id === row.cellValue)?.nickname || '-'
);
return getLeaderName?.(row.cellValue) || '-';
},
},
{