|
@@ -3,15 +3,16 @@ import type { ProColumnType, ActionType } from '@ant-design/pro-table'
|
|
|
import { Button } from 'antd'
|
|
|
import consts from '@/utils/consts'
|
|
|
import { useRef, useState, useEffect } from 'react'
|
|
|
-import { connect } from 'umi'
|
|
|
+import { connect, useRequest } from 'umi'
|
|
|
import type { ConnectProps } from 'umi'
|
|
|
import type { InstitutionsModelState } from '../model'
|
|
|
// import StaffModal, { ModalType } from './components/StaffModal'
|
|
|
-import { queryAcountList } from '@/services/api/institution'
|
|
|
+import { queryAcountList, queryAccountDetail } from '@/services/api/institution'
|
|
|
import dayjs from 'dayjs'
|
|
|
import StaffDrawer, { ModalType } from './components/StaffDrawer'
|
|
|
import type { SchemaBaseModelState } from '@/pages/Schema/Base/model'
|
|
|
import { BaseMenuEnum } from '@/pages/Schema/Base'
|
|
|
+import StaffDetailModal from '../Company/Detail/components/StaffDetailModal'
|
|
|
|
|
|
type ListProps = ConnectProps & {
|
|
|
accountTypeList: { label: string; value: string }[]
|
|
@@ -41,17 +42,37 @@ const CompanyList: React.FC<ListProps> = ({ dispatch, accountTypeList }) => {
|
|
|
accountType: 1
|
|
|
},
|
|
|
visible: false,
|
|
|
+ visibles: false,
|
|
|
+ staffDetail: [],
|
|
|
+ ID: '',
|
|
|
currentModalType: ModalType.ADD,
|
|
|
defaultFormData: null
|
|
|
})
|
|
|
+
|
|
|
// const { run: tryDelProject } = useRequest(delProject, {
|
|
|
// manual: true,
|
|
|
// onSuccess: () => tRef.current?.reload()
|
|
|
// })
|
|
|
+ // const { run: tryAccountDetail } = useRequest(() => queryAccountDetail(), {
|
|
|
+ // manual: true,
|
|
|
+ // onSuccess: result => {
|
|
|
+ // setState({ ...state, staffDetail: result })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // useEffect(() => {}, [])
|
|
|
const columns: ProColumnType<API.AccountListItem>[] = [
|
|
|
{
|
|
|
dataIndex: 'account',
|
|
|
- title: '账号'
|
|
|
+ title: '账号',
|
|
|
+ render: (name, record) => (
|
|
|
+ <div
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
+ onClick={() => {
|
|
|
+ setState({ ...state, visibles: true, staffDetail: record })
|
|
|
+ }}>
|
|
|
+ {name}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
},
|
|
|
{
|
|
|
dataIndex: 'name',
|
|
@@ -165,6 +186,11 @@ const CompanyList: React.FC<ListProps> = ({ dispatch, accountTypeList }) => {
|
|
|
reloadTable={() => tRef.current?.reload()}
|
|
|
setVisible={(visible: boolean) => setState({ ...state, visible })}
|
|
|
/>
|
|
|
+ <StaffDetailModal
|
|
|
+ visibles={state.visibles}
|
|
|
+ setVisible={(visibles: boolean) => setState({ ...state, visibles })}
|
|
|
+ staffDetail={state.staffDetail}
|
|
|
+ />
|
|
|
</div>
|
|
|
)
|
|
|
}
|