diff --git a/src/pages/user/Popup.tsx b/src/pages/user/Popup.tsx index dbb9479..56b7f78 100644 --- a/src/pages/user/Popup.tsx +++ b/src/pages/user/Popup.tsx @@ -29,6 +29,7 @@ export default (props: { action: NewAction; visible: boolean; roleList: API.RolesListItem[]; + currentCompanyId: number | string; companyList: API.CompanyListItem[]; dataSourceList: API.DataSourceListItem[]; formValues: Partial; @@ -48,6 +49,7 @@ export default (props: { roleList, companyList, dataSourceList, + currentCompanyId, } = props; const dataSourceForm = ( @@ -165,7 +167,7 @@ export default (props: { } : { enabled: true, - companyId: companyList[0]?.id, + companyId: currentCompanyId || companyList[0]?.id, } } open={visible} diff --git a/src/pages/user/index.tsx b/src/pages/user/index.tsx index b51a864..f047b81 100644 --- a/src/pages/user/index.tsx +++ b/src/pages/user/index.tsx @@ -412,6 +412,7 @@ const User: React.FC = () => { visible={visible} formValues={formValues} roleList={roleList} + currentCompanyId={companyType} companyList={companyList} dataSourceList={dataSourceList} onDone={handleDone}