chore: 完善请假申请

This commit is contained in:
dap
2024-12-16 21:01:30 +08:00
parent 3d7f3aef58
commit e52ec4f9b9
9 changed files with 299 additions and 24 deletions

View File

@@ -1,4 +1,4 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { FormSchemaGetter, VbenFormSchema } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { DictEnum } from '@vben/constants';
@@ -18,6 +18,13 @@ const leaveTypeOptions = [
{ label: '其他', value: '7' },
];
export const leaveFlowOptions = [
{ label: '请假流程-普通', value: 'leave1' },
{ label: '请假流程-排他网关', value: 'leave2' },
{ label: '请假流程-并行网关', value: 'leave3' },
{ label: '请假流程-会签', value: 'leave4' },
];
export const querySchema: FormSchemaGetter = () => [
{
component: 'InputNumber',
@@ -86,7 +93,9 @@ export const columns: VxeGridProps['columns'] = [
},
];
export const modalSchema: FormSchemaGetter = () => [
export const modalSchema: (isEdit: boolean) => VbenFormSchema[] = (
isEdit: boolean,
) => [
{
label: '主键',
fieldName: 'id',
@@ -96,6 +105,22 @@ export const modalSchema: FormSchemaGetter = () => [
triggerFields: [''],
},
},
{
label: '流程类型',
fieldName: 'flowType',
component: 'Select',
help: '这里仅仅为了发起流程方便, 实际不应该包含此字段',
componentProps: {
options: leaveFlowOptions,
getPopupContainer,
},
defaultValue: 'leave1',
rules: 'selectRequired',
dependencies: {
show: () => isEdit,
triggerFields: [''],
},
},
{
label: '请假类型',
fieldName: 'leaveType',