Merge remote-tracking branch 'origin/develop3' into develop3
This commit is contained in:
commit
dbcda1a192
@ -32,12 +32,14 @@ export const ApproverPropertyConfig: React.FC<PropertyConfigProps> = ({
|
|||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
// 🔄 按需加载数据源(只加载当前选中的审批人类型对应的数据源)
|
// 🔄 按需加载数据源(只加载当前选中的审批人类型对应的数据源)
|
||||||
|
// 获取当前审批人类型,默认为 'USER'
|
||||||
const currentApproverType = field.approverType || 'USER';
|
const currentApproverType = field.approverType || 'USER';
|
||||||
|
|
||||||
|
// 只有当选中对应类型时才加载数据源
|
||||||
const { options: userOptions } = useFieldOptions({
|
const { options: userOptions } = useFieldOptions({
|
||||||
dataSourceType: currentApproverType === 'USER' ? 'predefined' : 'static', // 只在选中时加载
|
dataSourceType: currentApproverType === 'USER' ? 'predefined' : 'static',
|
||||||
predefinedDataSource: { sourceType: DataSourceType.USERS },
|
predefinedDataSource: { sourceType: DataSourceType.USERS },
|
||||||
options: [] // 未选中时使用空数组
|
options: [] // 未选中时返回空数组
|
||||||
});
|
});
|
||||||
|
|
||||||
const { options: roleOptions } = useFieldOptions({
|
const { options: roleOptions } = useFieldOptions({
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user