lanjianrong 3 years ago
parent
commit
9bb03d93b9

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

@@ -41,6 +41,7 @@ const Staff: React.FC<ListProps> = ({ schema, dataID, dispatch, accountTypeList
       accountType: '1',
       dataID
     },
+    title: '',
     visible: false,
     currentModalType: ModalType.ADD,
     defaultFormData: {}
@@ -121,6 +122,7 @@ const Staff: React.FC<ListProps> = ({ schema, dataID, dispatch, accountTypeList
                 ...state,
                 visible: true,
                 currentModalType: ModalType.UPDATE,
+                title: record.name,
                 defaultFormData: {
                   dataID: record.ID,
                   institutionID: record.institution.ID,
@@ -168,6 +170,7 @@ const Staff: React.FC<ListProps> = ({ schema, dataID, dispatch, accountTypeList
                   visible: true,
                   currentModalType: ModalType.ADD,
                   institutionDisable: true,
+                  title: '',
                   defaultFormData: {
                     institutionID: dataID,
                     institutionDisable: true
@@ -183,7 +186,7 @@ const Staff: React.FC<ListProps> = ({ schema, dataID, dispatch, accountTypeList
         title={
           <>
             {state.currentModalType === ModalType.ADD ? '新增账号' : null}
-            {state.currentModalType === ModalType.UPDATE ? '编辑账号' : null}
+            {state.currentModalType === ModalType.UPDATE ? `编辑账号(${state.title})` : null}
           </>
         }
         visible={state.visible}

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

@@ -49,6 +49,7 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
       search: null,
       institutionID: null
     },
+    title: '',
     visible: false,
     currentModalType: ModalType.ADD,
     defaultFormData: {}
@@ -67,6 +68,7 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
               ...state,
               visible: true,
               currentModalType: ModalType.PREVIEW,
+              title: record.name,
               defaultFormData: {
                 dataID: record.ID,
                 institutionID: record.institution.ID,
@@ -148,6 +150,7 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
                 ...state,
                 visible: true,
                 currentModalType: ModalType.UPDATE,
+                title: record.name,
                 defaultFormData: {
                   dataID: record.ID,
                   institutionID: record.institution.ID,
@@ -205,6 +208,7 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
                   ...state,
                   visible: true,
                   currentModalType: ModalType.ADD,
+                  title: '',
                   defaultFormData: {
                     ...state.defaultFormData,
                     dataID: null,
@@ -224,8 +228,8 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
         title={
           <>
             {state.currentModalType === ModalType.ADD ? '新增账号' : null}
-            {state.currentModalType === ModalType.UPDATE ? '编辑账号' : null}
-            {state.currentModalType === ModalType.PREVIEW ? '员工详情' : null}
+            {state.currentModalType === ModalType.UPDATE ? `编辑账号(${state.title})` : null}
+            {state.currentModalType === ModalType.PREVIEW ? `员工详情(${state.title})` : null}
           </>
         }
         visible={state.visible}