fix(form): 开关类字段补齐默认值,修复导入弹窗误报"缺少必填字段"
共享导入弹窗的"是否覆盖"Switch 未声明默认值,表单值为 undefined 被
requestClient.upload 的 FormData 丢弃,后端 @NotNull(是否支持更新不能为空)
直接 400,必须手动拨动一次开关才能提交。补 rules: z.boolean().default(false),
一处修复覆盖全部接入该弹窗的列表页。
同时补齐其余 4 个无默认值的开关/勾选字段:
- bi/decision/alert-rule: enabled 默认 0(禁用)
- hrm/attendance/holiday: isLegal 默认 0(非法定)
- crm/permission: toBizTypes 默认 [](同时转移 / 同时添加至)
- wls/transfer: confirmFlag 默认 false
Co-Authored-By: Claude Code <noreply@anthropic.com>
| | |
| | | |
| | | import { Button, message, Upload } from 'ant-design-vue'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { useVbenForm, z } from '#/adapter/form'; |
| | | import { $t } from '#/locales'; |
| | | |
| | | export interface ImportModalProps { |
| | |
| | | checkedChildren: '是', |
| | | unCheckedChildren: '否', |
| | | }, |
| | | rules: z.boolean().default(false), |
| | | help: '是否更新已经存在的数据', |
| | | }, |
| | | ], |
| | |
| | | label: '启用', |
| | | component: 'Switch', |
| | | componentProps: { checkedValue: 1, unCheckedValue: 0 }, |
| | | defaultValue: 0, |
| | | }, |
| | | { |
| | | fieldName: 'notificationType', label: '通知方式', component: 'Input', |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | defaultValue: [], |
| | | }, |
| | | ]; |
| | | } |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | defaultValue: [], |
| | | dependencies: { |
| | | triggerFields: ['ids', 'bizType'], |
| | | show: (values) => { |
| | |
| | | trueValue: 1, |
| | | falseValue: 0, |
| | | }, |
| | | defaultValue: 0, |
| | | help: '勾选表示为法定节假日', |
| | | }, |
| | | { |
| | |
| | | componentProps: { |
| | | disabled: true, |
| | | }, |
| | | defaultValue: false, |
| | | dependencies: { |
| | | triggerFields: ['type'], |
| | | show: (values) => values.type === WlsTransferTypeEnum.OUTER, |