feat: ai code
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { SystemUserApi } from '#/api/system/user';
|
||||
|
||||
import { DICT_TYPE } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
@@ -7,6 +8,13 @@ import { getDictOptions } from '@vben/hooks';
|
||||
import { getSimpleUserList } from '#/api/system/user';
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
let userList: SystemUserApi.User[] = [];
|
||||
async function getUserData() {
|
||||
userList = await getSimpleUserList();
|
||||
}
|
||||
|
||||
getUserData();
|
||||
|
||||
/** 列表的搜索表单 */
|
||||
export function useGridFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
@@ -69,15 +77,20 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
field: 'picUrl',
|
||||
title: '图片',
|
||||
minWidth: 110,
|
||||
fixed: 'left',
|
||||
slots: { default: 'picUrl' },
|
||||
cellRender: {
|
||||
name: 'CellImage',
|
||||
},
|
||||
},
|
||||
{
|
||||
minWidth: 180,
|
||||
field: 'userId',
|
||||
title: '用户',
|
||||
slots: { default: 'userId' },
|
||||
minWidth: 180,
|
||||
formatter: ({ cellValue }) =>
|
||||
userList.find((user) => user.id === cellValue)?.nickname || '-',
|
||||
},
|
||||
{
|
||||
field: 'platform',
|
||||
|
||||
Reference in New Issue
Block a user