|
@@ -55,16 +55,28 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- if (defaultFormData?.dataID && !organizationList?.length) {
|
|
|
+ if (defaultFormData?.institutionID && !organizationList?.length) {
|
|
|
dispatch({
|
|
|
type: 'institutions/queryOrganizationList',
|
|
|
payload: {
|
|
|
- dataID: defaultFormData?.dataID,
|
|
|
+ dataID: defaultFormData?.institutionID,
|
|
|
structureType: '1'
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- }, [visible])
|
|
|
+ }, [defaultFormData?.institutionID, visible])
|
|
|
+ useEffect(() => {
|
|
|
+ if (organizationList?.length) {
|
|
|
+ form.setSchemaByPath('organizationalStructureID', {
|
|
|
+ type: 'string',
|
|
|
+ widget: 'treeSelect',
|
|
|
+ props: {
|
|
|
+ treeDefaultExpandAll: true,
|
|
|
+ treeData: organizationList
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }, [organizationList?.length])
|
|
|
// useEffect(() => {
|
|
|
// if (!schema) {
|
|
|
// dispatch({
|
|
@@ -112,7 +124,6 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
}
|
|
|
|
|
|
const SiteInput = props => {
|
|
|
- console.log('widget props:', props)
|
|
|
return (
|
|
|
<DebounceSelect
|
|
|
className="w-full"
|
|
@@ -140,14 +151,6 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
type: 'string',
|
|
|
widget: 'site'
|
|
|
})
|
|
|
- form.setSchemaByPath('organizationalStructureID', {
|
|
|
- type: 'string',
|
|
|
- widget: 'treeSelect',
|
|
|
- props: {
|
|
|
- treeDefaultExpandAll: true,
|
|
|
- treeData: organizationList
|
|
|
- }
|
|
|
- })
|
|
|
})
|
|
|
}
|
|
|
|