lanjianrong 3 gadi atpakaļ
vecāks
revīzija
9d7348eac8

+ 15 - 12
src/pages/Institutions/Staff/components/StaffDrawer.tsx

@@ -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
-        }
-      })
     })
   }
 

+ 0 - 2
src/pages/Institutions/model.ts

@@ -50,8 +50,6 @@ const InstitutionsModel: InstitutionsModelType = {
 
       const response = yield call(getAccountTypeList)
       if (response?.code === consts.RET_CODE.SUCCESS) {
-        console.log(response.data)
-
         yield put({
           type: 'save',
           payload: {