|
@@ -1,5 +1,6 @@
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
import type { ProColumnType, ActionType } from '@ant-design/pro-table'
|
|
|
+import { PageContainer } from '@ant-design/pro-layout'
|
|
|
import { Button } from 'antd'
|
|
|
import consts from '@/utils/consts'
|
|
|
import { useRef, useState, useEffect } from 'react'
|
|
@@ -9,11 +10,11 @@ import type { InstitutionsModelState } from '../model'
|
|
|
// import StaffModal, { ModalType } from './components/StaffModal'
|
|
|
import { queryAcountList } from '@/services/api/institution'
|
|
|
import dayjs from 'dayjs'
|
|
|
-import StaffDrawer, { ModalType } from './components/StaffDrawer'
|
|
|
+import StaffDetail, { ModalType } from './components/StaffDetail'
|
|
|
import type { SchemaBaseModelState } from '@/pages/Schema/Base/model'
|
|
|
import { BaseMenuEnum } from '@/pages/Schema/Base'
|
|
|
-import StaffDetailModal from '../Company/Detail/components/StaffDetailModal'
|
|
|
import { generateColumns } from '@/utils/util'
|
|
|
+import AnimateContent from '@/components/AnimateContent'
|
|
|
|
|
|
type ListProps = ConnectProps & {
|
|
|
accountTypeList: { label: string; value: string }[]
|
|
@@ -47,7 +48,7 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
|
|
|
search: null
|
|
|
},
|
|
|
visible: false,
|
|
|
- visibles: false,
|
|
|
+ readOnly: true,
|
|
|
staffDetail: [],
|
|
|
ID: '',
|
|
|
currentModalType: ModalType.ADD,
|
|
@@ -74,7 +75,22 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
|
|
|
<div
|
|
|
className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
onClick={() => {
|
|
|
- setState({ ...state, visibles: true, staffDetail: record })
|
|
|
+ setState({
|
|
|
+ ...state,
|
|
|
+ visible: true,
|
|
|
+ readOnly: true,
|
|
|
+ currentModalType: ModalType.DETAIL,
|
|
|
+ defaultFormData: {
|
|
|
+ // ...record,
|
|
|
+ institution: null,
|
|
|
+ ID: record.ID,
|
|
|
+ account: record.account,
|
|
|
+ name: record.name,
|
|
|
+ gender: record.gender,
|
|
|
+ institutionID: record.institution.ID,
|
|
|
+ accountType: record.accountType
|
|
|
+ }
|
|
|
+ })
|
|
|
}}>
|
|
|
{name}
|
|
|
</div>
|
|
@@ -176,7 +192,7 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
|
|
|
]
|
|
|
|
|
|
return (
|
|
|
- <div>
|
|
|
+ <PageContainer title={false}>
|
|
|
<ProTable<API.AccountListItem>
|
|
|
rowKey="ID"
|
|
|
params={state.params}
|
|
@@ -210,19 +226,18 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
|
|
|
}}
|
|
|
search={false}
|
|
|
/>
|
|
|
- <StaffDrawer
|
|
|
- type={state.currentModalType}
|
|
|
- defaultFormData={state.defaultFormData}
|
|
|
+ <AnimateContent
|
|
|
visible={state.visible}
|
|
|
- reload={() => tRef.current?.reload()}
|
|
|
- setVisible={(visible: boolean) => setState({ ...state, visible })}
|
|
|
- />
|
|
|
- <StaffDetailModal
|
|
|
- visibles={state.visibles}
|
|
|
- setVisible={(visibles: boolean) => setState({ ...state, visibles })}
|
|
|
- staffDetail={state.staffDetail}
|
|
|
- />
|
|
|
- </div>
|
|
|
+ onVisibleChange={visible => setState({ ...state, visible })}>
|
|
|
+ <StaffDetail
|
|
|
+ type={state.currentModalType}
|
|
|
+ defaultFormData={state.defaultFormData}
|
|
|
+ visible={state.visible}
|
|
|
+ reload={() => tRef.current?.reload()}
|
|
|
+ onVisibleChange={(visible: boolean) => setState({ ...state, visible })}
|
|
|
+ />
|
|
|
+ </AnimateContent>
|
|
|
+ </PageContainer>
|
|
|
)
|
|
|
}
|
|
|
|