|
@@ -139,26 +139,34 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
widget: 'site'
|
|
|
})
|
|
|
})
|
|
|
- queryOrganizationalStructureList({
|
|
|
- dataID: defaultFormData?.institutionID,
|
|
|
- structureType: '1'
|
|
|
- }).then(organizationList => {
|
|
|
- if (organizationList) {
|
|
|
- form.setSchemaByPath('organizationalStructureID', {
|
|
|
- type: 'string',
|
|
|
- widget: 'treeSelect',
|
|
|
- props: {
|
|
|
- treeDefaultExpandAll: true,
|
|
|
- treeData: organizationList.data
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ if (defaultFormData?.institutionID) {
|
|
|
+ queryOrganizationalStructureList({
|
|
|
+ dataID: defaultFormData?.institutionID,
|
|
|
+ structureType: '1'
|
|
|
+ }).then(organizationList => {
|
|
|
+ if (organizationList) {
|
|
|
+ form.setSchemaByPath('organizationalStructureID', {
|
|
|
+ type: 'string',
|
|
|
+ widget: 'treeSelect',
|
|
|
+ props: {
|
|
|
+ treeDefaultExpandAll: true,
|
|
|
+ treeData: organizationList.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ form.setSchemaByPath('organizationalStructureID', {
|
|
|
+ type: 'string',
|
|
|
+ widget: 'treeSelect',
|
|
|
+ hidden: true
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const watch = {
|
|
|
institutionID: val => {
|
|
|
- if (!defaultFormData?.institutionID) {
|
|
|
+ if (!defaultFormData?.institutionID && val) {
|
|
|
queryOrganizationalStructureList({
|
|
|
dataID: val,
|
|
|
structureType: '1'
|