path: '/company', | path: '/company', | ||||
routes: [ | routes: [ | ||||
{ | { | ||||
name: '企业列表', | |||||
name: '所有企业', | |||||
path: '/company/list', | path: '/company/list', | ||||
component: './Company/List', | component: './Company/List', | ||||
access: 'member', | access: 'member', |
</head> | </head> | ||||
<body> | <body> | ||||
<div id="root"></div> | <div id="root"></div> | ||||
<script src="/umi.6e92b7d0.js"></script> | |||||
<script src="/umi.eb8daf1a.js"></script> | |||||
</body> | </body> | ||||
</html> | </html> |
import React from 'react'; | import React from 'react'; | ||||
export async function getRoutes() { | export async function getRoutes() { | ||||
const routes = {"1":{"path":"/login","layout":false,"access":"login","id":"1"},"2":{"path":"/","redirect":"/company/list","parentId":"ant-design-pro-layout","id":"2"},"3":{"path":"/login","layout":false,"id":"3"},"4":{"name":"企业管理","access":"company","path":"/company","parentId":"ant-design-pro-layout","id":"4"},"5":{"name":"企业列表","path":"/company/list","access":"member","parentId":"4","id":"5"},"6":{"name":"VIP列表","path":"/company/vip","access":"vip","parentId":"4","id":"6"},"7":{"name":"部门管理","path":"/company/department","access":"department","parentId":"4","id":"7"},"8":{"name":"职位管理","path":"/company/post","access":"job","parentId":"4","id":"8"},"9":{"name":"求职者管理","access":"jobSeeker","path":"/jobseeker","parentId":"ant-design-pro-layout","id":"9"},"10":{"name":"简历列表","path":"/jobseeker/list","access":"jobResume","parentId":"9","id":"10"},"11":{"name":"求职者账号列表","path":"/jobseeker/account","access":"customerList","parentId":"9","id":"11"},"12":{"name":"招聘会管理","access":"jobFair","path":"/fair","parentId":"ant-design-pro-layout","id":"12"},"13":{"name":"招聘会列表","path":"/fair/list","access":"jobFairList","parentId":"12","id":"13"},"14":{"name":"新闻资讯","access":"information","path":"/information","parentId":"ant-design-pro-layout","id":"14"},"15":{"name":"栏目/频道","path":"/information/section","access":"section","parentId":"14","id":"15"},"16":{"name":"文章列表","path":"/information/article","access":"article","parentId":"14","id":"16"},"17":{"name":"广告/活动管理","access":"advertisement","path":"/advertisement","parentId":"ant-design-pro-layout","id":"17"},"18":{"name":"广告/活动列表","path":"/advertisement/list","access":"advertisementList","parentId":"17","id":"18"},"19":{"name":"广告/活动投放","path":"/advertisement/putin","access":"putIn","parentId":"17","id":"19"},"20":{"name":"春节引流活动管理","access":"activity","path":"/activity","parentId":"ant-design-pro-layout","id":"20"},"21":{"name":"活动门店","path":"/activity/list","access":"activityAddress","parentId":"20","id":"21"},"22":{"name":"账号权限","path":"/permission","access":"permission","parentId":"ant-design-pro-layout","id":"22"},"23":{"name":"权限管理","path":"/permission/list","access":"list","parentId":"22","id":"23"},"24":{"name":"角色管理","path":"/permission/role","access":"role","parentId":"22","id":"24"},"25":{"name":"账号管理","path":"/permission/account","access":"account","parentId":"22","id":"25"},"26":{"name":"系统管理","path":"/setting","parentId":"ant-design-pro-layout","id":"26"},"27":{"name":"系统设置","path":"/setting/system","access":"other","parentId":"26","id":"27"},"28":{"name":"字典设置","path":"/setting/dictionary","access":"dictionaryList","parentId":"26","id":"28"},"29":{"name":"分词器","path":"/setting/other","access":"otherTokenizer","parentId":"26","id":"29"},"30":{"name":"反馈管理","path":"/feedback/list","access":"feedback","parentId":"ant-design-pro-layout","id":"30"},"ant-design-pro-layout":{"id":"ant-design-pro-layout","path":"/","isLayout":true}} as const; | |||||
const routes = {"1":{"path":"/login","layout":false,"access":"login","id":"1"},"2":{"path":"/","redirect":"/company/list","parentId":"ant-design-pro-layout","id":"2"},"3":{"path":"/login","layout":false,"id":"3"},"4":{"name":"企业管理","access":"company","path":"/company","parentId":"ant-design-pro-layout","id":"4"},"5":{"name":"所有企业","path":"/company/list","access":"member","parentId":"4","id":"5"},"6":{"name":"VIP列表","path":"/company/vip","access":"vip","parentId":"4","id":"6"},"7":{"name":"部门管理","path":"/company/department","access":"department","parentId":"4","id":"7"},"8":{"name":"职位管理","path":"/company/post","access":"job","parentId":"4","id":"8"},"9":{"name":"求职者管理","access":"jobSeeker","path":"/jobseeker","parentId":"ant-design-pro-layout","id":"9"},"10":{"name":"简历列表","path":"/jobseeker/list","access":"jobResume","parentId":"9","id":"10"},"11":{"name":"求职者账号列表","path":"/jobseeker/account","access":"customerList","parentId":"9","id":"11"},"12":{"name":"招聘会管理","access":"jobFair","path":"/fair","parentId":"ant-design-pro-layout","id":"12"},"13":{"name":"招聘会列表","path":"/fair/list","access":"jobFairList","parentId":"12","id":"13"},"14":{"name":"新闻资讯","access":"information","path":"/information","parentId":"ant-design-pro-layout","id":"14"},"15":{"name":"栏目/频道","path":"/information/section","access":"section","parentId":"14","id":"15"},"16":{"name":"文章列表","path":"/information/article","access":"article","parentId":"14","id":"16"},"17":{"name":"广告/活动管理","access":"advertisement","path":"/advertisement","parentId":"ant-design-pro-layout","id":"17"},"18":{"name":"广告/活动列表","path":"/advertisement/list","access":"advertisementList","parentId":"17","id":"18"},"19":{"name":"广告/活动投放","path":"/advertisement/putin","access":"putIn","parentId":"17","id":"19"},"20":{"name":"春节引流活动管理","access":"activity","path":"/activity","parentId":"ant-design-pro-layout","id":"20"},"21":{"name":"活动门店","path":"/activity/list","access":"activityAddress","parentId":"20","id":"21"},"22":{"name":"账号权限","path":"/permission","access":"permission","parentId":"ant-design-pro-layout","id":"22"},"23":{"name":"权限管理","path":"/permission/list","access":"list","parentId":"22","id":"23"},"24":{"name":"角色管理","path":"/permission/role","access":"role","parentId":"22","id":"24"},"25":{"name":"账号管理","path":"/permission/account","access":"account","parentId":"22","id":"25"},"26":{"name":"系统管理","path":"/setting","parentId":"ant-design-pro-layout","id":"26"},"27":{"name":"系统设置","path":"/setting/system","access":"other","parentId":"26","id":"27"},"28":{"name":"字典设置","path":"/setting/dictionary","access":"dictionaryList","parentId":"26","id":"28"},"29":{"name":"分词器","path":"/setting/other","access":"otherTokenizer","parentId":"26","id":"29"},"30":{"name":"反馈管理","path":"/feedback/list","access":"feedback","parentId":"ant-design-pro-layout","id":"30"},"ant-design-pro-layout":{"id":"ant-design-pro-layout","path":"/","isLayout":true}} as const; | |||||
return { | return { | ||||
routes, | routes, | ||||
routeComponents: { | routeComponents: { |
ProBreadcrumb, | ProBreadcrumb, | ||||
} from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
import { GetUserMenulist } from '@/apis/api'; | |||||
import { GetUserMenulist} from '@/apis/api'; | |||||
export async function getInitialState(): Promise<{ permissions: object[] }> { | export async function getInitialState(): Promise<{ permissions: object[] }> { | ||||
const token = sessionStorage.getItem('token'); | const token = sessionStorage.getItem('token'); | ||||
let permissions = []; | let permissions = []; | ||||
if (!token) { | if (!token) { |
theme={{ | theme={{ | ||||
token: { | token: { | ||||
colorPrimary: '#4FBE70', | colorPrimary: '#4FBE70', | ||||
} | |||||
}, | |||||
components: { | |||||
Segmented: { | |||||
itemSelectedBg: '#19be6e', | |||||
itemSelectedColor: '#ffffff' | |||||
}, | |||||
}, | |||||
}} | }} | ||||
> | > | ||||
<Modal | <Modal |
ProTable, TableDropdown, PageContainer | ProTable, TableDropdown, PageContainer | ||||
} from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
import { Button, Image, ConfigProvider, Select, message } from 'antd'; | import { Button, Image, ConfigProvider, Select, message } from 'antd'; | ||||
import { getCompanyList, GetCompanyInfo, updateCompany, PostCompanyExport } from '@/apis/api'; | |||||
import { getCompanyList, GetCompanyInfo, updateCompany, PostCompanyExport, getRoleGetpermissionids } from '@/apis/api'; | |||||
import { Imageprefix } from '@/constants'; | import { Imageprefix } from '@/constants'; | ||||
import { findId } from '@/utils/dataHelper'; | |||||
const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any) => { | const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any) => { | ||||
const actionRef = useRef<ActionType>(); | const actionRef = useRef<ActionType>(); | ||||
getId(id) | getId(id) | ||||
} | } | ||||
const [addButton, setAddButton] = useState<boolean>(true) | |||||
const [editButton, setEditButton] = useState<boolean>(true) | |||||
useEffect(() => { | useEffect(() => { | ||||
if (!openModel.openModal) { | if (!openModel.openModal) { | ||||
actionRef.current.reload(); | actionRef.current.reload(); | ||||
} | } | ||||
}} | }} | ||||
> | > | ||||
<ProTable | |||||
size='small' | |||||
bordered={true} | |||||
scroll={{ x: 1300 }} | |||||
actionRef={actionRef} | |||||
dataSource={list} | |||||
columns={[ | |||||
{ | |||||
title: 'ID', | |||||
dataIndex: 'id', | |||||
width: 100, | |||||
fixed: 'left', | |||||
}, | |||||
{ | |||||
title: '企业名称', | |||||
dataIndex: 'full_name', | |||||
width: 240, | |||||
}, | |||||
{ | |||||
title: '来源', | |||||
dataIndex: 'origin_text', | |||||
search: false, | |||||
width: 100, | |||||
}, | |||||
{ | |||||
title: '登录次数', | |||||
dataIndex: 'login_count', | |||||
search: false, | |||||
width: 100 | |||||
}, | |||||
{ | |||||
title: '点击次数', | |||||
dataIndex: 'click_count', | |||||
search: false, | |||||
width: 100 | |||||
}, | |||||
{ | |||||
title: '会员类型', | |||||
dataIndex: 'member_type', | |||||
width: 100, | |||||
hidden: true, | |||||
valueType: 'select', | |||||
valueEnum: { | |||||
0: { text: '全部' }, | |||||
1: { | |||||
text: '试用申请中', | |||||
}, | |||||
2: { | |||||
text: '试用正式', | |||||
}, | |||||
3: { | |||||
text: '普通申请中', | |||||
}, | |||||
4: { | |||||
text: '普通正式', | |||||
}, | |||||
5: { | |||||
text: 'VIP申请中', | |||||
}, | |||||
6: { | |||||
text: 'VIP正式', | |||||
}, | |||||
<ProTable | |||||
size='small' | |||||
bordered={true} | |||||
scroll={{ x: 1300 }} | |||||
actionRef={actionRef} | |||||
dataSource={list} | |||||
columns={[ | |||||
{ | |||||
title: 'ID', | |||||
dataIndex: 'id', | |||||
width: 100, | |||||
fixed: 'left', | |||||
}, | |||||
{ | |||||
title: '企业名称', | |||||
dataIndex: 'full_name', | |||||
width: 240, | |||||
}, | |||||
{ | |||||
title: '来源', | |||||
dataIndex: 'origin_text', | |||||
search: false, | |||||
width: 100, | |||||
}, | |||||
{ | |||||
title: '登录次数', | |||||
dataIndex: 'login_count', | |||||
search: false, | |||||
width: 100 | |||||
}, | |||||
{ | |||||
title: '点击次数', | |||||
dataIndex: 'click_count', | |||||
search: false, | |||||
width: 100 | |||||
}, | |||||
{ | |||||
title: '会员类型', | |||||
dataIndex: 'member_type', | |||||
width: 100, | |||||
hidden: true, | |||||
valueType: 'select', | |||||
valueEnum: { | |||||
0: { text: '全部' }, | |||||
1: { | |||||
text: '试用申请中', | |||||
}, | |||||
2: { | |||||
text: '试用正式', | |||||
}, | |||||
3: { | |||||
text: '普通申请中', | |||||
}, | |||||
4: { | |||||
text: '普通正式', | |||||
}, | |||||
5: { | |||||
text: 'VIP申请中', | |||||
}, | |||||
6: { | |||||
text: 'VIP正式', | |||||
}, | }, | ||||
}, | }, | ||||
{ | |||||
title: '会员类型', | |||||
dataIndex: 'member_type_text', | |||||
width: 100, | |||||
search: false, | |||||
render: (_, record) => (<> | |||||
{ | |||||
record.member_type_text && <Button type="primary" size='small' onClick={() => { | |||||
sessionStorage.setItem('vip_company_info', JSON.stringify(record)) | |||||
history.push({ | |||||
pathname: '/company/vip' | |||||
}) | |||||
}}> | |||||
{record.member_type_text} | |||||
</Button> | |||||
} | |||||
}, | |||||
{ | |||||
title: '会员类型', | |||||
dataIndex: 'member_type_text', | |||||
width: 100, | |||||
search: false, | |||||
render: (_, record) => (<> | |||||
{ | |||||
record.member_type_text && <Button type="primary" size='small' onClick={() => { | |||||
sessionStorage.setItem('vip_company_info', JSON.stringify(record)) | |||||
history.push({ | |||||
pathname: '/company/vip' | |||||
}) | |||||
}}> | |||||
{record.member_type_text} | |||||
</Button> | |||||
} | |||||
</>), | |||||
valueType: 'select', | |||||
valueEnum: { | |||||
0: { text: '全部' }, | |||||
1: { | |||||
text: '试用申请中', | |||||
}, | |||||
2: { | |||||
text: '试用正式', | |||||
}, | |||||
3: { | |||||
text: '普通申请中', | |||||
}, | |||||
4: { | |||||
text: '普通正式', | |||||
}, | |||||
5: { | |||||
text: 'VIP申请中', | |||||
}, | |||||
6: { | |||||
text: 'VIP正式', | |||||
}, | |||||
</>), | |||||
valueType: 'select', | |||||
valueEnum: { | |||||
0: { text: '全部' }, | |||||
1: { | |||||
text: '试用申请中', | |||||
}, | }, | ||||
}, | |||||
{ | |||||
title: '开始时间', | |||||
dataIndex: 'start_date', | |||||
search: false, | |||||
width: 140 | |||||
}, | |||||
{ | |||||
title: '到期时间', | |||||
dataIndex: 'end_date', | |||||
search: false, | |||||
width: 140 | |||||
}, { | |||||
title: '剩余点数', | |||||
dataIndex: 'code', | |||||
search: false, | |||||
width: 100 | |||||
}, | |||||
{ | |||||
title: '会员状态', | |||||
dataIndex: 'member_status', | |||||
width: 100, | |||||
hidden: true, | |||||
valueType: 'select', | |||||
valueEnum: { | |||||
0: { text: '全部' }, | |||||
1: { | |||||
text: '待审', | |||||
}, | |||||
2: { | |||||
text: '正常', | |||||
}, | |||||
3: { | |||||
text: '到期', | |||||
}, | |||||
4: { | |||||
text: '推荐', | |||||
} | |||||
2: { | |||||
text: '试用正式', | |||||
}, | }, | ||||
}, | |||||
{ | |||||
title: '状态', | |||||
dataIndex: 'status', | |||||
hidden: true, | |||||
valueType: 'select', | |||||
valueEnum: { | |||||
0: { text: '全部' }, | |||||
1: { | |||||
text: '开通', | |||||
}, | |||||
2: { | |||||
text: '关闭', | |||||
}, | |||||
3: { | |||||
text: '普通申请中', | |||||
}, | }, | ||||
}, | |||||
{ | |||||
title: '会员状态', | |||||
dataIndex: 'member_status_text', | |||||
width: 120, | |||||
search: false, | |||||
valueType: 'select', | |||||
valueEnum: { | |||||
0: { text: '全部' }, | |||||
1: { | |||||
text: '待审', | |||||
}, | |||||
2: { | |||||
text: '正常', | |||||
}, | |||||
3: { | |||||
text: '到期', | |||||
}, | |||||
4: { | |||||
text: '推荐', | |||||
} | |||||
4: { | |||||
text: '普通正式', | |||||
}, | |||||
5: { | |||||
text: 'VIP申请中', | |||||
}, | |||||
6: { | |||||
text: 'VIP正式', | |||||
}, | }, | ||||
}, | }, | ||||
{ | |||||
title: '企业照片', | |||||
dataIndex: 'photo', | |||||
search: false, | |||||
width: 100, | |||||
render: (_, record) => (<> | |||||
<Image src={`${Imageprefix + record.photo}`} width={40} height={40} /> | |||||
</> | |||||
) | |||||
}, { | |||||
title: '照片审核', | |||||
dataIndex: 'photo_status_text', | |||||
search: false, | |||||
width: 120, | |||||
render: (_, record) => (<> | |||||
<Select | |||||
size="small" | |||||
style={{ width: 100 }} | |||||
value={record.photo_status_text} | |||||
options={[ | |||||
{ | |||||
label: '待审', | |||||
value: 1, | |||||
}, | |||||
{ | |||||
label: '通过', | |||||
value: 2, | |||||
}, | |||||
{ | |||||
label: '不通过', | |||||
value: 3, | |||||
}, | |||||
]} | |||||
onChange={async (value) => { | |||||
let info = await GetCompanyInfo({ id: record.id }); | |||||
let res = await updateCompany({ ...info.data, photo_status: value }); | |||||
actionRef.current.reload(); | |||||
}} | |||||
></Select> | |||||
</>) | |||||
}, | |||||
{ | |||||
title: '营业执照', | |||||
dataIndex: 'license_path', | |||||
search: false, | |||||
width: 120, | |||||
render: (_, record) => (<> | |||||
<Image src={`${Imageprefix}${record.license_path}`} width={40} height={40} /> | |||||
</> | |||||
) | |||||
}, | |||||
{ | |||||
title: '开始时间', | |||||
dataIndex: 'start_date', | |||||
search: false, | |||||
width: 140 | |||||
}, | |||||
{ | |||||
title: '到期时间', | |||||
dataIndex: 'end_date', | |||||
search: false, | |||||
width: 140 | |||||
}, { | |||||
title: '剩余点数', | |||||
dataIndex: 'code', | |||||
search: false, | |||||
width: 100 | |||||
}, | |||||
{ | |||||
title: '会员状态', | |||||
dataIndex: 'member_status', | |||||
width: 100, | |||||
hidden: true, | |||||
valueType: 'select', | |||||
valueEnum: { | |||||
0: { text: '全部' }, | |||||
1: { | |||||
text: '待审', | |||||
}, | |||||
2: { | |||||
text: '正常', | |||||
}, | |||||
3: { | |||||
text: '到期', | |||||
}, | |||||
4: { | |||||
text: '推荐', | |||||
} | |||||
}, | }, | ||||
{ | |||||
title: '营业执照审核', | |||||
dataIndex: 'license_status_text', | |||||
search: false, | |||||
width: 120, | |||||
render: (_, record) => (<> | |||||
<Select | |||||
size="small" | |||||
style={{ width: 100 }} | |||||
value={record.license_status_text} | |||||
options={[ | |||||
{ | |||||
label: '待审', | |||||
value: 1, | |||||
}, | |||||
{ | |||||
label: '通过', | |||||
value: 2, | |||||
}, | |||||
{ | |||||
label: '不通过', | |||||
value: 3, | |||||
}, | |||||
]} | |||||
onChange={async (value) => { | |||||
let info = await GetCompanyInfo({ id: record.id }); | |||||
let res = await updateCompany({ ...info.data, license_status: value }); | |||||
actionRef.current.reload(); | |||||
}} | |||||
></Select> | |||||
</>) | |||||
}, | |||||
{ | |||||
title: '状态', | |||||
dataIndex: 'status', | |||||
hidden: true, | |||||
valueType: 'select', | |||||
valueEnum: { | |||||
0: { text: '全部' }, | |||||
1: { | |||||
text: '开通', | |||||
}, | |||||
2: { | |||||
text: '关闭', | |||||
}, | |||||
}, | }, | ||||
{ | |||||
title: '登录账号', | |||||
dataIndex: 'login_name', | |||||
width: 200 | |||||
}, | |||||
{ | |||||
title: '会员状态', | |||||
dataIndex: 'member_status_text', | |||||
width: 120, | |||||
search: false, | |||||
valueType: 'select', | |||||
valueEnum: { | |||||
0: { text: '全部' }, | |||||
1: { | |||||
text: '待审', | |||||
}, | |||||
2: { | |||||
text: '正常', | |||||
}, | |||||
3: { | |||||
text: '到期', | |||||
}, | |||||
4: { | |||||
text: '推荐', | |||||
} | |||||
}, | }, | ||||
{ | |||||
title: '操作', | |||||
width: 300, | |||||
key: 'option', | |||||
valueType: 'option', | |||||
fixed: 'right', | |||||
render: (_, record, action) => [ | |||||
<Button key='1' type='link' onClick={() => { | |||||
setId(record.id) | |||||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||||
}}>编辑</Button>, | |||||
<Button key='2' type='link' onClick={() => { | |||||
GetCompanyInfo({ id: record.id }).then(res => { | |||||
sessionStorage.setItem('company_info', JSON.stringify(res.data)) | |||||
history.push({ | |||||
pathname: '/company/department' | |||||
}) | |||||
}, | |||||
{ | |||||
title: '企业照片', | |||||
dataIndex: 'photo', | |||||
search: false, | |||||
width: 100, | |||||
render: (_, record) => (<> | |||||
<Image src={`${Imageprefix + record.photo}`} width={40} height={40} /> | |||||
</> | |||||
) | |||||
}, { | |||||
title: '照片审核', | |||||
dataIndex: 'photo_status_text', | |||||
search: false, | |||||
width: 120, | |||||
render: (_, record) => (<> | |||||
<Select | |||||
size="small" | |||||
style={{ width: 100 }} | |||||
value={record.photo_status_text} | |||||
options={[ | |||||
{ | |||||
label: '待审', | |||||
value: 1, | |||||
}, | |||||
{ | |||||
label: '通过', | |||||
value: 2, | |||||
}, | |||||
{ | |||||
label: '不通过', | |||||
value: 3, | |||||
}, | |||||
]} | |||||
onChange={async (value) => { | |||||
let info = await GetCompanyInfo({ id: record.id }); | |||||
let res = await updateCompany({ ...info.data, photo_status: value }); | |||||
actionRef.current.reload(); | |||||
}} | |||||
></Select> | |||||
</>) | |||||
}, | |||||
{ | |||||
title: '营业执照', | |||||
dataIndex: 'license_path', | |||||
search: false, | |||||
width: 120, | |||||
render: (_, record) => (<> | |||||
<Image src={`${Imageprefix}${record.license_path}`} width={40} height={40} /> | |||||
</> | |||||
) | |||||
}, | |||||
{ | |||||
title: '营业执照审核', | |||||
dataIndex: 'license_status_text', | |||||
search: false, | |||||
width: 120, | |||||
render: (_, record) => (<> | |||||
<Select | |||||
size="small" | |||||
style={{ width: 100 }} | |||||
value={record.license_status_text} | |||||
options={[ | |||||
{ | |||||
label: '待审', | |||||
value: 1, | |||||
}, | |||||
{ | |||||
label: '通过', | |||||
value: 2, | |||||
}, | |||||
{ | |||||
label: '不通过', | |||||
value: 3, | |||||
}, | |||||
]} | |||||
onChange={async (value) => { | |||||
let info = await GetCompanyInfo({ id: record.id }); | |||||
let res = await updateCompany({ ...info.data, license_status: value }); | |||||
actionRef.current.reload(); | |||||
}} | |||||
></Select> | |||||
</>) | |||||
}, | |||||
{ | |||||
title: '登录账号', | |||||
dataIndex: 'login_name', | |||||
width: 200 | |||||
}, | |||||
{ | |||||
title: '操作', | |||||
width: 300, | |||||
key: 'option', | |||||
valueType: 'option', | |||||
fixed: 'right', | |||||
render: (_, record, action) => [ | |||||
<> | |||||
{ | |||||
editButton && <Button key='1' type='link' onClick={() => { | |||||
setId(record.id) | |||||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||||
}}>编辑</Button> | |||||
} | |||||
</>, | |||||
<Button key='2' type='link' onClick={() => { | |||||
GetCompanyInfo({ id: record.id }).then(res => { | |||||
sessionStorage.setItem('company_info', JSON.stringify(res.data)) | |||||
history.push({ | |||||
pathname: '/company/department' | |||||
}) | }) | ||||
}}>查看部门</Button>, | |||||
<TableDropdown | |||||
key="actionGroup" | |||||
menus={[ | |||||
{ | |||||
name: '查看职位', | |||||
key: '3', | |||||
onClick: () => { | |||||
GetCompanyInfo({ id: record.id }).then(res => { | |||||
sessionStorage.setItem('post_company_info', JSON.stringify(res.data)) | |||||
history.push({ | |||||
pathname: '/company/post' | |||||
}) | |||||
}) | |||||
}}>查看部门</Button>, | |||||
<TableDropdown | |||||
key="actionGroup" | |||||
menus={[ | |||||
{ | |||||
name: '查看职位', | |||||
key: '3', | |||||
onClick: () => { | |||||
GetCompanyInfo({ id: record.id }).then(res => { | |||||
sessionStorage.setItem('post_company_info', JSON.stringify(res.data)) | |||||
history.push({ | |||||
pathname: '/company/post' | |||||
}) | }) | ||||
}, | |||||
}) | |||||
}, | }, | ||||
{ | |||||
name: '子账号解绑', | |||||
key: '4', | |||||
onClick: () => { | |||||
setId(record.id) | |||||
dispatch({ type: 'openModel/getOpenBindModal', payload: true }) | |||||
}, | |||||
}, | |||||
{ | |||||
name: '子账号解绑', | |||||
key: '4', | |||||
onClick: () => { | |||||
setId(record.id) | |||||
dispatch({ type: 'openModel/getOpenBindModal', payload: true }) | |||||
}, | }, | ||||
]} | |||||
/>, | |||||
], | |||||
}, | |||||
]} | |||||
rowKey="id" | |||||
pagination={{ | |||||
current: page, | |||||
pageSize: pageSize, | |||||
showSizeChanger: true, | |||||
total: total, | |||||
pageSizeOptions: [9, 18, 27, 99], | |||||
onChange(page, pageSize) { | |||||
setPage(page) | |||||
setPageSize(pageSize) | |||||
}, | |||||
onShowSizeChange(current, size) { | |||||
setPage(current) | |||||
setPageSize(size) | |||||
} | |||||
}} | |||||
request={async (params = {} as Record<string, any>) => | |||||
getCompanyList({ | |||||
page: page, | |||||
pagesize: pageSize, | |||||
sort: 'id', | |||||
sortby: 'desc', | |||||
id: params.id, | |||||
keyword: params.full_name, | |||||
login_name: params.login_name, | |||||
member_type: params.member_type, | |||||
member_status: params.member_status, | |||||
status: params.status, | |||||
}).then(res => { | |||||
setList(res.data.list) | |||||
setTotal(res.data.total) | |||||
}) | |||||
}, | |||||
]} | |||||
/>, | |||||
], | |||||
}, | |||||
]} | |||||
rowKey="id" | |||||
pagination={{ | |||||
current: page, | |||||
pageSize: pageSize, | |||||
showSizeChanger: true, | |||||
total: total, | |||||
pageSizeOptions: [9, 18, 27, 99], | |||||
onChange(page, pageSize) { | |||||
setPage(page) | |||||
setPageSize(pageSize) | |||||
}, | |||||
onShowSizeChange(current, size) { | |||||
setPage(current) | |||||
setPageSize(size) | |||||
} | } | ||||
headerTitle="企业列表" | |||||
toolBarRender={() => [ | |||||
<Button type="primary" onClick={() => { | |||||
message.info('数据导出需要时间,请耐心等待') | |||||
PostCompanyExport().then(res => { | |||||
let url = Imageprefix + res.data.excel_url; | |||||
window.open(url); | |||||
message.info('数据导出完毕') | |||||
}) | |||||
}}> | |||||
导出数据 | |||||
</Button>, | |||||
<Button type="primary" onClick={() => { | |||||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||||
}}> | |||||
添加企业 | |||||
</Button> | |||||
]} | |||||
/> | |||||
}} | |||||
request={async (params = {} as Record<string, any>) => | |||||
getCompanyList({ | |||||
page: page, | |||||
pagesize: pageSize, | |||||
sort: 'id', | |||||
sortby: 'desc', | |||||
id: params.id, | |||||
keyword: params.full_name, | |||||
login_name: params.login_name, | |||||
member_type: params.member_type, | |||||
member_status: params.member_status, | |||||
status: params.status, | |||||
}).then(res => { | |||||
setList(res.data.list) | |||||
setTotal(res.data.total) | |||||
}) | |||||
} | |||||
headerTitle="企业列表" | |||||
toolBarRender={() => [ | |||||
<Button type="primary" onClick={() => { | |||||
message.info('数据导出需要时间,请耐心等待') | |||||
PostCompanyExport().then(res => { | |||||
let url = Imageprefix + res.data.excel_url; | |||||
window.open(url); | |||||
message.info('数据导出完毕') | |||||
}) | |||||
}}> | |||||
导出数据 | |||||
</Button>, | |||||
<> | |||||
{ | |||||
addButton && <Button type="primary" onClick={() => { | |||||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||||
}}> | |||||
添加企业 | |||||
</Button> | |||||
} | |||||
</> | |||||
]} | |||||
/> | |||||
</ConfigProvider> | </ConfigProvider> | ||||
</> | </> | ||||
); | ); |
theme={{ | theme={{ | ||||
token: { | token: { | ||||
colorPrimary: '#4FBE70', | colorPrimary: '#4FBE70', | ||||
} | |||||
}, components: { | |||||
Segmented: { | |||||
itemSelectedBg: '#19be6e', | |||||
itemSelectedColor: '#ffffff' | |||||
}, | |||||
}, | |||||
}} | }} | ||||
> | > | ||||
<Modal | <Modal | ||||
onCancel={() => { | onCancel={() => { | ||||
dispatch({ type: 'openModel/getOpenModal', payload: false }) | dispatch({ type: 'openModel/getOpenModal', payload: false }) | ||||
}} | }} | ||||
afterOpenChange={(open) => { | |||||
afterOpenChange={async (open) => { | |||||
if (open && id) { | if (open && id) { | ||||
PostCompanyJobInfo({ id: id }).then(res => { | |||||
formMapRef?.current?.forEach((formInstanceRef) => { | |||||
res.data.age_arr = [res.data.age_min, res.data.age_max]; | |||||
res.data.household_arr = [ | |||||
res.data.household_province ? res.data.household_province : null, | |||||
res.data.household_city ? res.data.household_city : null | |||||
]; | |||||
res.data.location_arr = [ | |||||
res.data.location_province ? res.data.location_province : null, | |||||
res.data.location_city ? res.data.location_city : null, | |||||
res.data.location_town ? res.data.location_town : null | |||||
]; | |||||
const gangweizhizeStartIndex = res.data.describe_text.indexOf('<div>岗位职责</div>') + '<div>岗位职责</div>'.length; | |||||
const gangweizhizeEndIndex = res.data.describe_text.indexOf('<div>任职要求</div>'); | |||||
const gangweizhizeContent = res.data.describe_text.substring(gangweizhizeStartIndex, gangweizhizeEndIndex); | |||||
const renzhiyaoqiuStartIndex = res.data.describe_text.indexOf('<div>任职要求</div>') + '<div>任职要求</div>'.length; | |||||
const renzhiyaoqiuContent = res.data.describe_text.substring(renzhiyaoqiuStartIndex); | |||||
res.data.gangweizhize = gangweizhizeContent.trim(); | |||||
res.data.renzhiyaoqiu = renzhiyaoqiuContent.trim(); | |||||
formInstanceRef?.current?.setFieldsValue(res.data); | |||||
}); | |||||
setDetail(res.data) | |||||
let res = await PostCompanyJobInfo({ id: id }) | |||||
let res1 = await GetCompanyInfo({ id: res.data.company_id }) | |||||
sessionStorage.setItem('post_company_info', JSON.stringify(res1.data)) | |||||
formMapRef?.current?.forEach((formInstanceRef) => { | |||||
res.data.age_arr = [res.data.age_min, res.data.age_max]; | |||||
res.data.household_arr = [ | |||||
res.data.household_province ? res.data.household_province : null, | |||||
res.data.household_city ? res.data.household_city : null | |||||
]; | |||||
res.data.location_arr = [ | |||||
res.data.location_province ? res.data.location_province : null, | |||||
res.data.location_city ? res.data.location_city : null, | |||||
res.data.location_town ? res.data.location_town : null | |||||
]; | |||||
const gangweizhizeStartIndex = res.data.describe_text.indexOf('<div>岗位职责</div>') + '<div>岗位职责</div>'.length; | |||||
const gangweizhizeEndIndex = res.data.describe_text.indexOf('<div>任职要求</div>'); | |||||
const gangweizhizeContent = res.data.describe_text.substring(gangweizhizeStartIndex, gangweizhizeEndIndex); | |||||
const renzhiyaoqiuStartIndex = res.data.describe_text.indexOf('<div>任职要求</div>') + '<div>任职要求</div>'.length; | |||||
const renzhiyaoqiuContent = res.data.describe_text.substring(renzhiyaoqiuStartIndex); | |||||
res.data.gangweizhize = gangweizhizeContent.trim(); | |||||
res.data.renzhiyaoqiu = renzhiyaoqiuContent.trim(); | |||||
formInstanceRef?.current?.setFieldsValue(res.data); | |||||
}); | }); | ||||
setDetail(res.data) | |||||
} else { | } else { | ||||
formMapRef?.current?.forEach((formInstanceRef) => { | formMapRef?.current?.forEach((formInstanceRef) => { | ||||
formInstanceRef?.current?.setFieldsValue({ | formInstanceRef?.current?.setFieldsValue({ | ||||
latitude: sessionStorage.getItem('post_company_info') ? JSON.parse(sessionStorage.getItem('post_company_info')).latitude : 0, | latitude: sessionStorage.getItem('post_company_info') ? JSON.parse(sessionStorage.getItem('post_company_info')).latitude : 0, | ||||
other_address: sessionStorage.getItem('post_company_info') ? JSON.parse(sessionStorage.getItem('post_company_info')).address : '', | other_address: sessionStorage.getItem('post_company_info') ? JSON.parse(sessionStorage.getItem('post_company_info')).address : '', | ||||
interview_address: sessionStorage.getItem('post_company_info') ? JSON.parse(sessionStorage.getItem('post_company_info')).address : '', | interview_address: sessionStorage.getItem('post_company_info') ? JSON.parse(sessionStorage.getItem('post_company_info')).address : '', | ||||
phone_public: 2, | |||||
mobile_public: 2, | |||||
email_public: 2, | |||||
fax_public: 2, | |||||
phone_public: 1, | |||||
mobile_public: 1, | |||||
email_public: 1, | |||||
fax_public: 1, | |||||
status: 1 | status: 1 | ||||
}); | }); | ||||
}); | }); | ||||
if (detail) { | if (detail) { | ||||
values.id = detail.id; | values.id = detail.id; | ||||
let res = await PostCompanyJobEdit(values) | let res = await PostCompanyJobEdit(values) | ||||
message.success('提交成功') | message.success('提交成功') | ||||
dispatch({ type: 'openModel/getOpenModal', payload: false }) | dispatch({ type: 'openModel/getOpenModal', payload: false }) | ||||
placeholder="请选择企业" | placeholder="请选择企业" | ||||
fieldProps={{ | fieldProps={{ | ||||
fieldNames: selectfieldCompanyNames, | fieldNames: selectfieldCompanyNames, | ||||
defaultValue: sessionStorage.getItem('post_company_info') ? JSON.parse(sessionStorage.getItem('post_company_info')).full_name : null, | |||||
disabled: sessionStorage.getItem('post_company_info') ? true : false | disabled: sessionStorage.getItem('post_company_info') ? true : false | ||||
}} | }} | ||||
rules={[{ required: true, message: '请选择企业' }]} | rules={[{ required: true, message: '请选择企业' }]} | ||||
}) | }) | ||||
}} | }} | ||||
request={(keyword) => | request={(keyword) => | ||||
getCompanyList({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||||
getCompanyList({ page: 1, pagesize: 999, keyword: sessionStorage.getItem('post_company_info') ? JSON.parse(sessionStorage.getItem('post_company_info')).full_name : keyword.keyWords }).then(res => { | |||||
return res.data.list; | return res.data.list; | ||||
}) | }) | ||||
} | } |
theme={{ | theme={{ | ||||
token: { | token: { | ||||
colorPrimary: '#4FBE70', | colorPrimary: '#4FBE70', | ||||
} | |||||
} , components: { | |||||
Segmented: { | |||||
itemSelectedBg: '#19be6e', | |||||
itemSelectedColor: '#ffffff' | |||||
}, | |||||
}, | |||||
}} | }} | ||||
> | > | ||||
theme={{ | theme={{ | ||||
token: { | token: { | ||||
colorPrimary: '#4FBE70', | colorPrimary: '#4FBE70', | ||||
} | |||||
} , components: { | |||||
Segmented: { | |||||
itemSelectedBg: '#19be6e', | |||||
itemSelectedColor: '#ffffff' | |||||
}, | |||||
}, | |||||
}} | }} | ||||
> | > | ||||
<Modal | <Modal |
theme={{ | theme={{ | ||||
token: { | token: { | ||||
colorPrimary: '#4FBE70', | colorPrimary: '#4FBE70', | ||||
} | |||||
} , components: { | |||||
Segmented: { | |||||
itemSelectedBg: '#19be6e', | |||||
itemSelectedColor: '#ffffff' | |||||
}, | |||||
}, | |||||
}} | }} | ||||
> | > | ||||
<Modal | <Modal |
theme={{ | theme={{ | ||||
token: { | token: { | ||||
colorPrimary: '#4FBE70', | colorPrimary: '#4FBE70', | ||||
} | |||||
} , components: { | |||||
Segmented: { | |||||
itemSelectedBg: '#19be6e', | |||||
itemSelectedColor: '#ffffff' | |||||
}, | |||||
}, | |||||
}} | }} | ||||
> | > | ||||
<ProForm<ResumeType.basic> | <ProForm<ResumeType.basic> |
editableKeys, | editableKeys, | ||||
onSave: async (rowKey, data: ResumeType.intentionPosition, row) => { | onSave: async (rowKey, data: ResumeType.intentionPosition, row) => { | ||||
console.log(rowKey, data, row) | console.log(rowKey, data, row) | ||||
// data.customer_id = id.customer_id; | |||||
// if (rowKey && originList.findIndex(item => item.id === rowKey) !== -1) { | |||||
// let res1 = await PostJobapplicantUpdateintro({ id: rowKey, customer_id: data.customer_id, content: data.content}) | |||||
// message.success('提交成功') | |||||
// actionRef.current.reload(); | |||||
// } else { | |||||
// let res1 = await PostJobapplicantAddassistandintro({ customer_id: data.customer_id, intro_content: [data.content]}) | |||||
// message.success('提交成功') | |||||
// actionRef.current.reload(); | |||||
// } | |||||
data.customer_id = id.customer_id; | |||||
if (rowKey && originList.findIndex(item => item.id === rowKey) !== -1) { | |||||
let res1 = await PostJobapplicantUpdateintro({ id: rowKey, customer_id: data.customer_id, content: data.content}) | |||||
message.success('提交成功') | |||||
actionRef.current.reload(); | |||||
} else { | |||||
let res1 = await PostJobapplicantAddassistandintro({ customer_id: data.customer_id, intro_content: [data.content]}) | |||||
message.success('提交成功') | |||||
actionRef.current.reload(); | |||||
} | |||||
}, | }, | ||||
onChange: setEditableRowKeys | onChange: setEditableRowKeys | ||||
}} | }} |
theme={{ | theme={{ | ||||
token: { | token: { | ||||
colorPrimary: '#4FBE70', | colorPrimary: '#4FBE70', | ||||
} | |||||
} , components: { | |||||
Segmented: { | |||||
itemSelectedBg: '#19be6e', | |||||
itemSelectedColor: '#ffffff' | |||||
}, | |||||
}, | |||||
}} | }} | ||||
> | > | ||||
<Modal | <Modal | ||||
label="描述" | label="描述" | ||||
placeholder="请输入描述" | placeholder="请输入描述" | ||||
/> | /> | ||||
</ProForm> | </ProForm> | ||||
</Modal> | </Modal> | ||||
</ConfigProvider> | </ConfigProvider> |
import { useRef, useState, useEffect } from 'react'; | |||||
import { connect } from '@umijs/max'; | |||||
import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||||
import { | |||||
ProFormText, | |||||
ProFormSegmented, | |||||
ProFormSelect, | |||||
ProForm, | |||||
FormControlRender, | |||||
ProFormCascader, | |||||
ProFormSwitch | |||||
} from '@ant-design/pro-components'; | |||||
import { ConfigProvider, Flex, Space, Modal, message, Image, Row, Col, Switch, Form, Typography } from 'antd'; | |||||
import { addPermission, updatePermission, getPermissionListWithchilds, GetDetailPermission } from '@/apis/api'; | |||||
const selectfieldNames = { label: 'name', value: 'id' }; | |||||
const cascaderfieldNames = { label: 'name', value: 'id', children: 'childs' }; | |||||
export const filterChildPermissionsByType : Function = (permissions : Object[]) => { | |||||
return permissions.map(parent => ({ | |||||
...parent, | |||||
childs: parent.childs ? filterOutPermissionsOfCertainType(parent.childs, 1) : undefined, | |||||
})); | |||||
} | |||||
export const filterOutPermissionsOfCertainType : Function = (permissions : Object[], excludeType : number) => { | |||||
return permissions.filter(permission => permission.p_type !== excludeType) | |||||
.map(child => ({ | |||||
...child, | |||||
childs: child.childs ? filterOutPermissionsOfCertainType(child.childs, excludeType) : undefined, | |||||
})); | |||||
} | |||||
const PagesPermissionListParent: React.FC = ({ dispatch, dictModel, openModel, id }: any) => { | |||||
const formRef = useRef<ProFormInstance>(); | |||||
const [openPreview, setOpenPreview] = useState(false); | |||||
const [detail, setDetail] = useState<PermissionType.list | null>(null) | |||||
useEffect(() => { | |||||
setOpenPreview(openModel.openParentModal) | |||||
}, [openModel.openParentModal]) | |||||
return ( | |||||
<> | |||||
<ConfigProvider | |||||
theme={{ | |||||
token: { | |||||
colorPrimary: '#4FBE70', | |||||
}, components: { | |||||
Segmented: { | |||||
itemSelectedBg: '#19be6e', | |||||
itemSelectedColor: '#ffffff' | |||||
}, | |||||
}, | |||||
}} | |||||
> | |||||
<Modal | |||||
open={openPreview} | |||||
title="更换父级" | |||||
centered | |||||
maskClosable={false} | |||||
footer={null} | |||||
destroyOnClose | |||||
width={1000} | |||||
onCancel={() => { | |||||
dispatch({ type: 'openModel/getOpenParentModal', payload: false }) | |||||
}} | |||||
> | |||||
<ProForm<PermissionType.list> | |||||
formRef={formRef} | |||||
request={async () => { | |||||
let res = await GetDetailPermission({ id: id.id }) | |||||
setDetail(res.data) | |||||
return res.data; | |||||
}} | |||||
submitter={{ | |||||
searchConfig: { | |||||
resetText: '取消', | |||||
submitText: '保存', | |||||
}, | |||||
render: (_, dom) => { return <Flex justify='flex-end'> <Space>{dom}</Space></Flex> }, | |||||
onReset: () => { | |||||
setDetail(null) | |||||
dispatch({ type: 'openModel/getOpenParentModal', payload: false }) | |||||
} | |||||
}} | |||||
onFinish={async (values) => { | |||||
console.log(values) | |||||
values.id = id.id; | |||||
values.parent_id = values.parent_arr && values.parent_arr.length > 0 ? values.parent_arr[values.parent_arr.length - 1] : detail?.parent_id | |||||
delete values.parent_arr; | |||||
let res = await updatePermission(values) | |||||
message.success('提交成功') | |||||
dispatch({ type: 'openModel/getOpenParentModal', payload: false }) | |||||
}} | |||||
> | |||||
<ProFormCascader | |||||
label="父级菜单" | |||||
name="parent_arr" | |||||
fieldProps={{ | |||||
fieldNames: cascaderfieldNames, | |||||
changeOnSelect: true | |||||
}} | |||||
request={async () => { | |||||
let res = await getPermissionListWithchilds({ page: 1, pagesize: 9999 }) | |||||
return filterChildPermissionsByType(res.data.permissions) | |||||
}} | |||||
placeholder="请选择要归属的父级菜单" | |||||
/> | |||||
</ProForm> | |||||
</Modal> | |||||
</ConfigProvider> | |||||
</> | |||||
); | |||||
}; | |||||
export default connect(({ dictModel, openModel }: any) => ({ | |||||
dictModel, openModel | |||||
}))(PagesPermissionListParent); |
import { | import { | ||||
ProTable, TableDropdown | ProTable, TableDropdown | ||||
} from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
import { Button, Image, ConfigProvider, Tag } from 'antd'; | |||||
import { getPermissionListWithchilds} from '@/apis/api'; | |||||
import { Button, Image, ConfigProvider, Tag, Modal } from 'antd'; | |||||
import { getPermissionListWithchilds } from '@/apis/api'; | |||||
import { Imageprefix } from '@/constants'; | import { Imageprefix } from '@/constants'; | ||||
const PagesPermissionListTable: React.FC = ({ dispatch, openModel, getId }: any) => { | const PagesPermissionListTable: React.FC = ({ dispatch, openModel, getId }: any) => { | ||||
getId(id) | getId(id) | ||||
} | } | ||||
useEffect(() => { | |||||
if (!openModel.openParentModal) { | |||||
actionRef.current.reload(); | |||||
} | |||||
}, [openModel.openParentModal]) | |||||
useEffect(() => { | useEffect(() => { | ||||
if (!openModel.openModal) { | if (!openModel.openModal) { | ||||
actionRef.current.reload(); | actionRef.current.reload(); | ||||
{record.p_type == 1 ? <><Tag>权限</Tag></> : <> <Tag color='green'>菜单</Tag></>} | {record.p_type == 1 ? <><Tag>权限</Tag></> : <> <Tag color='green'>菜单</Tag></>} | ||||
</> | </> | ||||
) | ) | ||||
},{ | |||||
}, { | |||||
title: '路径', | title: '路径', | ||||
dataIndex: 'path', | dataIndex: 'path', | ||||
search: false, | search: false, | ||||
}, | }, | ||||
{ | { | ||||
title: '操作', | title: '操作', | ||||
width: 300, | |||||
width: 400, | |||||
key: 'option', | key: 'option', | ||||
valueType: 'option', | valueType: 'option', | ||||
fixed: 'right', | fixed: 'right', | ||||
setId(record) | setId(record) | ||||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | dispatch({ type: 'openModel/getOpenModal', payload: true }) | ||||
}}>编辑</Button>, | }}>编辑</Button>, | ||||
<Button key='1' type='link' onClick={() => { | |||||
<Button key='2' type='link' onClick={() => { | |||||
record.nextlevel = record.id // 添加下级栏目,把id赋值给nextlevel | record.nextlevel = record.id // 添加下级栏目,把id赋值给nextlevel | ||||
setId(record) | setId(record) | ||||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | dispatch({ type: 'openModel/getOpenModal', payload: true }) | ||||
}}>添加下级栏目</Button>, | }}>添加下级栏目</Button>, | ||||
<Button key='2' type='link' onClick={() => { | |||||
<Button key='3' type='link' onClick={() => { | |||||
setId(record) | |||||
dispatch({ type: 'openModel/getOpenParentModal', payload: true }) | |||||
}}>更换父级</Button>, | |||||
<Button key='4' type='link' onClick={() => { | |||||
}}>删除</Button>, | }}>删除</Button>, | ||||
], | ], | ||||
}, | }, |
theme={{ | theme={{ | ||||
token: { | token: { | ||||
colorPrimary: '#4FBE70', | colorPrimary: '#4FBE70', | ||||
} | |||||
} , components: { | |||||
Segmented: { | |||||
itemSelectedBg: '#19be6e', | |||||
itemSelectedColor: '#ffffff' | |||||
}, | |||||
}, | |||||
}} | }} | ||||
> | > | ||||
<Modal | <Modal |
ProFormDependency | ProFormDependency | ||||
} from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
import { ConfigProvider, Flex, Space, Modal, message, Image, Row, Col, Switch, Form, Typography } from 'antd'; | import { ConfigProvider, Flex, Space, Modal, message, Image, Row, Col, Switch, Form, Typography } from 'antd'; | ||||
import { PostSysconfigAdd, PostSysconfigUpdate, GetSysconfigDetail } from '@/apis/api'; | |||||
import { PostSysconfigAdd, PostSysconfigUpdate, GetSysconfigDetail } from '@/apis/api'; | |||||
import RichComponent from '@/components/Common/rich'; | import RichComponent from '@/components/Common/rich'; | ||||
const PagesSettingSystemCreate: React.FC = ({ dispatch, dictModel, openModel, id }: any) => { | const PagesSettingSystemCreate: React.FC = ({ dispatch, dictModel, openModel, id }: any) => { | ||||
itemSelectedBg: '#19be6e', | itemSelectedBg: '#19be6e', | ||||
itemSelectedColor: '#ffffff' | itemSelectedColor: '#ffffff' | ||||
}, | }, | ||||
}, | |||||
}, | |||||
}} | }} | ||||
> | > | ||||
<Modal | <Modal |
openFeeModal: false, // vip变更费用开关 | openFeeModal: false, // vip变更费用开关 | ||||
openFairDetailModal: false, // 预览招聘会 | openFairDetailModal: false, // 预览招聘会 | ||||
openBindModal: false, // 预览招聘会 | openBindModal: false, // 预览招聘会 | ||||
openParentModal: false, // 更换父级的开关 | |||||
}, | }, | ||||
reducers: { | reducers: { | ||||
openBindModal: payload | openBindModal: payload | ||||
} | } | ||||
}, | }, | ||||
setOpenParentModal(state: any, { payload }: any) { | |||||
return { | |||||
...state, | |||||
openParentModal: payload | |||||
} | |||||
}, | |||||
setEditRegister(state: any, { payload }: any) { | setEditRegister(state: any, { payload }: any) { | ||||
if (state.editRegisterKey && state.editRegisterKey !== payload.key) { | if (state.editRegisterKey && state.editRegisterKey !== payload.key) { | ||||
console.log(error) | console.log(error) | ||||
} | } | ||||
}, | }, | ||||
*getOpenParentModal({ payload }: any, { put }: any): any { | |||||
try { | |||||
yield put({ | |||||
type: 'setOpenParentModal', | |||||
payload: payload | |||||
}) | |||||
} catch (error) { | |||||
console.log(error) | |||||
} | |||||
}, | |||||
*getEditRegister({ payload }: any, { put }: any): any { | *getEditRegister({ payload }: any, { put }: any): any { | ||||
try { | try { |
import { LoginForm, ProFormCaptcha, ProForm, ProFormText, ProFormDependency, } from '@ant-design/pro-components'; | import { LoginForm, ProFormCaptcha, ProForm, ProFormText, ProFormDependency, } from '@ant-design/pro-components'; | ||||
import { message, Row, Col, Image, ConfigProvider } from 'antd'; | import { message, Row, Col, Image, ConfigProvider } from 'antd'; | ||||
import type { CSSProperties } from 'react'; | import type { CSSProperties } from 'react'; | ||||
import { Login, PostSmsSend, GetCaptcha, GetUserMenulist } from '@/apis/api'; | |||||
import { Login, PostSmsSend, GetCaptcha, GetUserMenulist , getRoleGetpermissionids} from '@/apis/api'; | |||||
const contentStyle: CSSProperties = { | const contentStyle: CSSProperties = { | ||||
display: 'flex', | display: 'flex', | ||||
alignItems: 'center', | alignItems: 'center', | ||||
...s, | ...s, | ||||
permissions: permissions, | permissions: permissions, | ||||
})); | })); | ||||
sessionStorage.setItem('role', res.data.rolename) | |||||
history.push('/'); | history.push('/'); | ||||
} catch (error) { | } catch (error) { | ||||
captRef.current.resetFields(); | captRef.current.resetFields(); |
import { ConfigProvider } from 'antd'; | import { ConfigProvider } from 'antd'; | ||||
import PagesPermissionListTable from '@/components/Render/Permission/List/table' | import PagesPermissionListTable from '@/components/Render/Permission/List/table' | ||||
import PagesPermissionListCreate from '@/components/Render/Permission/List/create' | import PagesPermissionListCreate from '@/components/Render/Permission/List/create' | ||||
import PagesPermissionListParent from '@/components/Render/Permission/List/parent' | |||||
const PermissionListPage: React.FC = ({ dispatch, openModel }: any) => { | const PermissionListPage: React.FC = ({ dispatch, openModel }: any) => { | ||||
const [id, setId] = useState<number>(0); | const [id, setId] = useState<number>(0); | ||||
> | > | ||||
<PagesPermissionListTable getId={getId}></PagesPermissionListTable> | <PagesPermissionListTable getId={getId}></PagesPermissionListTable> | ||||
<PagesPermissionListCreate id={id}></PagesPermissionListCreate> | <PagesPermissionListCreate id={id}></PagesPermissionListCreate> | ||||
<PagesPermissionListParent id={id}></PagesPermissionListParent> | |||||
</ConfigProvider> | </ConfigProvider> | ||||
</> | </> | ||||
); | ); |
export const findId = (array: [], id: number) => { | |||||
let result = false; | |||||
result = array.includes(id); | |||||
return result; | |||||
} |
export const isProduction = process.env.BUILD_ENV === 'production'; | |||||
export const isDevelopment = process.env.BUILD_ENV === 'development'; | |||||
console.log('process.env.BUILD_ENV', process.env.BUILD_ENV); | |||||
export const Imageprefix = isProduction ? 'https://rcsc-test.jcjob.cn/img/' : 'https://admin1.jcjob.cn/img/'; |