feat: 字典
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import type { FormSchemaGetter } from '#/adapter';
|
||||
import type { FormSchemaGetter, VxeGridProps } from '#/adapter';
|
||||
|
||||
import { getPopupContainer } from '@vben/utils';
|
||||
|
||||
import { renderDictTag } from '#/utils/render';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
placeholder: 'TODO: 字典类型',
|
||||
getPopupContainer,
|
||||
},
|
||||
fieldName: 'dictType',
|
||||
@@ -18,6 +21,43 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
},
|
||||
];
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '字典标签',
|
||||
field: 'cssClass',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
const { dictValue } = row;
|
||||
return renderDictTag(dictValue, [row as any]);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '字典键值',
|
||||
field: 'dictValue',
|
||||
},
|
||||
{
|
||||
title: '字典排序',
|
||||
field: 'dictSort',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
||||
export const drawerSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
|
Reference in New Issue
Block a user