增加人像页面
This commit is contained in:
@@ -1,84 +1,33 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
import { DictEnum } from '@vben/constants';
|
||||
import { getPopupContainer } from '@vben/utils';
|
||||
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'libCode',
|
||||
label: '人员库编码',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'imgName',
|
||||
label: '人像名称',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'imgCode',
|
||||
label: '图片编码',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'imgUrl',
|
||||
label: '图片的存储地址',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {},
|
||||
componentProps: {
|
||||
getPopupContainer,
|
||||
options: getDictOptions(DictEnum.SYS_USER_SEX),
|
||||
},
|
||||
fieldName: 'sex',
|
||||
label: '性别',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'email',
|
||||
label: '邮箱',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'tel',
|
||||
label: '联系方式',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {},
|
||||
fieldName: 'certificateType',
|
||||
label: '证件类型',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'certificateNo',
|
||||
label: '证件号码',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'birthDate',
|
||||
label: '出生日期',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'createById',
|
||||
label: '创建人id',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'updateById',
|
||||
label: '更新人id',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'searchValue',
|
||||
label: '搜索值',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '主键id',
|
||||
field: 'id',
|
||||
},
|
||||
|
||||
{
|
||||
title: '人员库编码',
|
||||
field: 'libCode',
|
||||
@@ -87,16 +36,9 @@ export const columns: VxeGridProps['columns'] = [
|
||||
title: '人像名称',
|
||||
field: 'imgName',
|
||||
},
|
||||
{
|
||||
title: '图片编码',
|
||||
field: 'imgCode',
|
||||
},
|
||||
{
|
||||
title: '图片的存储地址',
|
||||
field: 'imgUrl',
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
field: 'sex',
|
||||
},
|
||||
{
|
||||
title: '邮箱',
|
||||
@@ -118,45 +60,16 @@ export const columns: VxeGridProps['columns'] = [
|
||||
title: '出生日期',
|
||||
field: 'birthDate',
|
||||
},
|
||||
{
|
||||
title: '创建人id',
|
||||
field: 'createById',
|
||||
},
|
||||
{
|
||||
title: '更新人id',
|
||||
field: 'updateById',
|
||||
},
|
||||
{
|
||||
title: '搜索值',
|
||||
field: 'searchValue',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: {
|
||||
default: 'action',
|
||||
},
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '主键id',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '人员库编码',
|
||||
fieldName: 'libCode',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '人像名称',
|
||||
fieldName: 'imgName',
|
||||
@@ -164,21 +77,13 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '图片编码',
|
||||
fieldName: 'imgCode',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '图片的存储地址',
|
||||
fieldName: 'imgUrl',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '性别 1:男',
|
||||
label: '性别',
|
||||
fieldName: 'sex',
|
||||
component: 'Select',
|
||||
componentProps: {},
|
||||
componentProps: {
|
||||
getPopupContainer,
|
||||
options: getDictOptions(DictEnum.SYS_USER_SEX),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '邮箱',
|
||||
@@ -194,7 +99,10 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '证件类型',
|
||||
fieldName: 'certificateType',
|
||||
component: 'Select',
|
||||
componentProps: {},
|
||||
componentProps: {
|
||||
getPopupContainer,
|
||||
options: getDictOptions(DictEnum.SYS_CERTIFICATE_TYPE),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '证件号码',
|
||||
@@ -207,18 +115,13 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '创建人id',
|
||||
fieldName: 'createById',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '更新人id',
|
||||
fieldName: 'updateById',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '搜索值',
|
||||
fieldName: 'searchValue',
|
||||
component: 'Input',
|
||||
label: '人像图片',
|
||||
fieldName: 'img',
|
||||
component: 'ImageUpload',
|
||||
componentProps: {
|
||||
// accept: 'image/*', // 可选拓展名或者mime类型 ,拼接
|
||||
maxCount: 1, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型
|
||||
},
|
||||
formItemClass: 'col-span-2',
|
||||
},
|
||||
];
|
||||
|
Reference in New Issue
Block a user