|
|
@@ -4,37 +4,46 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; |
|
|
|
import { |
|
|
|
ProTable, TableDropdown, PageContainer |
|
|
|
} from '@ant-design/pro-components'; |
|
|
|
import { Button, Image, ConfigProvider, Select, message } from 'antd'; |
|
|
|
import { GetCompanyRecruiters, GetCompanyInfo, updateCompany, PostCompanyExport , PostCompanyTurnJobseeker} from '@/apis/api'; |
|
|
|
import { Button, Image, ConfigProvider, Select, Modal, message } from 'antd'; |
|
|
|
import { GetCompanyRecruiters, GetCompanyInfo, updateCompany, PostCompanyExport, PostCompanyTurnJobseeker } from '@/apis/api'; |
|
|
|
import { Imageprefix } from '@/constants'; |
|
|
|
|
|
|
|
const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any) => { |
|
|
|
const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, id }: any) => { |
|
|
|
const actionRef = useRef<ActionType>(); |
|
|
|
const [openPreview, setOpenPreview] = useState(false); |
|
|
|
|
|
|
|
const [list, setList] = useState<object[]>([]) |
|
|
|
const [total, setTotal] = useState<number>(0) |
|
|
|
const [page, setPage] = useState<number>(1) |
|
|
|
const [pageSize, setPageSize] = useState<number>(10) |
|
|
|
|
|
|
|
const setId = (id: number) => { |
|
|
|
getId(id) |
|
|
|
} |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (!openModel.openBindModal) { |
|
|
|
actionRef.current.reload(); |
|
|
|
} |
|
|
|
setOpenPreview(openModel.openBindModal) |
|
|
|
}, [openModel.openBindModal]) |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
<> |
|
|
|
<ConfigProvider |
|
|
|
theme={{ |
|
|
|
token: { |
|
|
|
colorPrimary: '#4FBE70', |
|
|
|
colorLink: '#4FBE70', |
|
|
|
} |
|
|
|
<Modal |
|
|
|
open={openPreview} |
|
|
|
title="" |
|
|
|
centered |
|
|
|
maskClosable={false} |
|
|
|
footer={null} |
|
|
|
destroyOnClose |
|
|
|
width={1000} |
|
|
|
onCancel={() => { |
|
|
|
dispatch({ type: 'openModel/getOpenBindModal', payload: false }) |
|
|
|
}} |
|
|
|
> |
|
|
|
<ConfigProvider |
|
|
|
theme={{ |
|
|
|
token: { |
|
|
|
colorPrimary: '#4FBE70', |
|
|
|
colorLink: '#4FBE70', |
|
|
|
} |
|
|
|
}} |
|
|
|
> |
|
|
|
<ProTable |
|
|
|
size='small' |
|
|
|
bordered={true} |
|
|
@@ -60,12 +69,12 @@ const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any |
|
|
|
fixed: 'right', |
|
|
|
render: (_, record, action) => [ |
|
|
|
<Button key='1' type='link' onClick={() => { |
|
|
|
PostCompanyTurnJobseeker({company_id:record.company_id, customer_id: record.id, role: 1}).then(res => { |
|
|
|
PostCompanyTurnJobseeker({ company_id: record.company_id, customer_id: record.id, role: 1 }).then(res => { |
|
|
|
message.success('解除授权成功'); |
|
|
|
actionRef.current.reload(); |
|
|
|
}) |
|
|
|
}}>解除授权</Button> |
|
|
|
|
|
|
|
|
|
|
|
], |
|
|
|
}, |
|
|
|
]} |
|
|
@@ -91,6 +100,7 @@ const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any |
|
|
|
pagesize: pageSize, |
|
|
|
sort: 'id', |
|
|
|
sortby: 'desc', |
|
|
|
id: id |
|
|
|
}).then(res => { |
|
|
|
setList(res.data.customers) |
|
|
|
setTotal(res.data.total) |
|
|
@@ -98,7 +108,10 @@ const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any |
|
|
|
} |
|
|
|
headerTitle="管理已经授权的账号" |
|
|
|
/> |
|
|
|
</ConfigProvider> |
|
|
|
</ConfigProvider> |
|
|
|
|
|
|
|
</Modal> |
|
|
|
|
|
|
|
</> |
|
|
|
); |
|
|
|
}; |