| | |
| | | import type { HrmLeaveTypeConfigApi } from '#/api/hrm/leave-type-config'; |
| | | |
| | | /** 表单类型 */ |
| | | export type FormType = 'update'; |
| | | export type FormType = 'create' | 'update'; |
| | | |
| | | /** 新增/修改请假扣款配置的表单 */ |
| | | export function useFormSchema(): VbenFormSchema[] { |
| | |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'name', |
| | | fieldName: 'leaveType', |
| | | label: '请假类型', |
| | | component: 'Input', |
| | | component: 'Select', |
| | | componentProps: { |
| | | disabled: true, |
| | | placeholder: '', |
| | | options: [ |
| | | { label: '事假', value: 1 }, |
| | | { label: '病假', value: 2 }, |
| | | { label: '年假', value: 3 }, |
| | | { label: '婚假', value: 4 }, |
| | | { label: '产假', value: 5 }, |
| | | { label: '丧假', value: 6 }, |
| | | ], |
| | | placeholder: '请选择请假类型', |
| | | style: { width: '100%' }, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['id'], |
| | | // 编辑时不允许修改请假类型 |
| | | componentProps: (values: Record<string, unknown>) => ({ |
| | | disabled: Boolean(values.id), |
| | | }), |
| | | }, |
| | | rules: 'required', |
| | | formItemClass: 'col-span-2', |
| | | }, |
| | | { |
| | |
| | | fieldName: 'status', |
| | | label: '状态', |
| | | component: 'RadioGroup', |
| | | defaultValue: 0, |
| | | componentProps: { |
| | | options: [ |
| | | { label: '启用', value: 0 }, |