Browse Source

fix: 组织架构相关的修复

outaozhen 3 years ago
parent
commit
93c703874d

+ 5 - 4
src/pages/Institutions/Company/Detail/components/Organization.tsx

@@ -233,11 +233,12 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
             if (expanded) {
               if (state.expandTreeIds.includes(record.ID)) return
               setState({ ...state, expandTreeIds: [...state.expandTreeIds, record.ID] })
+            } else {
+              setState({
+                ...state,
+                expandTreeIds: state.expandTreeIds.filter(item => item !== record.ID)
+              })
             }
-            setState({
-              ...state,
-              expandTreeIds: state.expandTreeIds.filter(item => item !== record.ID)
-            })
           }
         }}
         // expandedRowRender={expandedRowRender}

+ 6 - 6
src/pages/Institutions/Company/Detail/components/Staff.tsx

@@ -65,12 +65,12 @@ const Staff: React.FC<ListProps> = ({ schema, dataID, dispatch, accountTypeList
         return <span>{genderEum[gender]}</span>
       }
     },
-    // {
-    //   dataIndex: 'organizationalStructureID',
-    //   key: 'organizationalStructureID',
-    //   title: '组织架构',
-    //   renderText: (_, record) => record.organizationalStructure.name
-    // },
+    {
+      dataIndex: 'organizationalStructureID',
+      key: 'organizationalStructureID',
+      title: '组织架构',
+      renderText: (_, record) => record.organizationalStructure?.name
+    },
     {
       dataIndex: 'institutionID',
       key: 'institutionID',

+ 6 - 6
src/pages/Institutions/Staff/index.tsx

@@ -98,12 +98,12 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
         return <span>{genderEum[gender]}</span>
       }
     },
-    // {
-    //   dataIndex: 'organizationalStructureID',
-    //   key: 'organizationalStructureID',
-    //   title: '组织架构',
-    //   renderText: (_, record) => record.organizationalStructure.name
-    // },
+    {
+      dataIndex: 'organizationalStructureID',
+      key: 'organizationalStructureID',
+      title: '组织架构',
+      renderText: (_, record) => record.organizationalStructure?.name
+    },
     {
       dataIndex: 'institutionID',
       key: 'institutionID',