| </head> | </head> | ||||
| <body> | <body> | ||||
| <div id="root"></div> | <div id="root"></div> | ||||
| <script src="/umi.d33b65e9.js"></script> | |||||
| <script src="/umi.1ea9be75.js"></script> | |||||
| </body> | </body> | ||||
| </html> | </html> |
| "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[580],{90672:function(K,C,e){var R=e(1413),i=e(45987),a=e(62435),P=e(34176),g=e(86074),A=["fieldProps","proFieldProps"],s=function(c,Z){var U=c.fieldProps,x=c.proFieldProps,t=(0,i.Z)(c,A);return(0,g.jsx)(P.Z,(0,R.Z)({ref:Z,valueType:"textarea",fieldProps:U,proFieldProps:x},t))};C.Z=a.forwardRef(s)},79127:function(K,C,e){e.r(C),e.d(C,{default:function(){return Y}});var R=e(5574),i=e.n(R),a=e(62435),P=e(59530),g=e(28459),A=e(15009),s=e.n(A),L=e(99289),c=e.n(L),Z=e(95338),U=e(14726),x=e(39680),t=e(86074),W=function(n){var o=n.dispatch,E=n.getId,p=n.openModel,u=(0,a.useRef)(),F=(0,a.useState)([]),f=i()(F,2),m=f[0],T=f[1],O=function(v){E(v)};return(0,a.useEffect)(function(){p.openModal||u.current.reload()},[p.openModal]),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(g.ZP,{theme:{token:{colorPrimary:"#4FBE70",colorLink:"#4FBE70"}},children:(0,t.jsx)(Z.Z,{actionRef:u,dataSource:m,search:!1,columns:[{title:"\u5206\u8BCD\u5185\u5BB9",dataIndex:"text"},{title:"\u64CD\u4F5C",key:"option",valueType:"option",fixed:"right",render:function(v,j,S){return[(0,t.jsx)(U.ZP,{type:"link",onClick:function(){o({type:"openModel/getOpenModal",payload:!0})},children:"\u66F4\u65B0\u5206\u8BCD\u5668"},"1")]}}],rowKey:"id",request:c()(s()().mark(function y(){var v,j=arguments;return s()().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return v=j.length>0&&j[0]!==void 0?j[0]:{},h.abrupt("return",(0,x.Ekb)().then(function(I){T([{text:I.data.text}])}));case 2:case"end":return h.stop()}},y)})),headerTitle:"\u5206\u8BCD\u5668"})})})},N=(0,P.connect)(function(r){var n=r.dictModel,o=r.openModel;return{dictModel:n,openModel:o}})(W),$=e(97269),G=e(90672),b=e(17788),z=e(86250),H=e(42075),J=e(68872),w={label:"name",value:"id"},Q=function(n){var o=n.dispatch,E=n.dictModel,p=n.openModel,u=n.id,F=(0,a.useRef)(),f=(0,a.useState)(!1),m=i()(f,2),T=m[0],O=m[1],y=(0,a.useState)(null),v=i()(y,2),j=v[0],S=v[1];(0,a.useEffect)(function(){O(p.openModal)},[p.openModal]);var h=(0,a.useState)(""),I=i()(h,2),q=I[0],k=I[1],_=function(d){k(d)};return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(g.ZP,{theme:{token:{colorPrimary:"#4FBE70"}},children:(0,t.jsx)(b.Z,{open:T,title:"\u66F4\u65B0\u5206\u8BCD\u5668",centered:!0,maskClosable:!1,footer:null,destroyOnClose:!0,width:1e3,onCancel:function(){o({type:"openModel/getOpenModal",payload:!1})},children:(0,t.jsx)($.A,{formRef:F,request:c()(s()().mark(function M(){var d;return s()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!u){l.next=8;break}return l.next=3,(0,x.Ekb)({id:u});case 3:return d=l.sent,S(d.data),l.abrupt("return",d.data);case 8:return l.abrupt("return",{text:""});case 9:case"end":return l.stop()}},M)})),submitter:{searchConfig:{resetText:"\u53D6\u6D88",submitText:"\u4FDD\u5B58"},render:function(d,D){return(0,t.jsxs)(z.Z,{justify:"flex-end",children:[" ",(0,t.jsx)(H.Z,{children:D})]})},onReset:function(){S(null),o({type:"openModel/getOpenModal",payload:!1})}},onFinish:function(){var M=c()(s()().mark(function d(D){var l;return s()().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return B.next=2,(0,x.iwN)(D);case 2:l=B.sent,J.ZP.success("\u63D0\u4EA4\u6210\u529F"),o({type:"openModel/getOpenModal",payload:!1});case 5:case"end":return B.stop()}},d)}));return function(d){return M.apply(this,arguments)}}(),children:(0,t.jsx)(G.Z,{name:"text",label:"\u5206\u8BCD\u5185\u5BB9",placeholder:"\u8BF7\u8F93\u5165\u5206\u8BCD\u5185\u5BB9",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u8BCD\u5185\u5BB9"}]})})})})})},V=(0,P.connect)(function(r){var n=r.dictModel,o=r.openModel;return{dictModel:n,openModel:o}})(Q),X=function(n){var o=n.dispatch,E=n.openModel,p=(0,a.useState)(0),u=i()(p,2),F=u[0],f=u[1],m=function(O){f(O)};return(0,a.useEffect)(function(){E.openModal||f(0)},[E.openModal]),(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(g.ZP,{theme:{token:{colorPrimary:"#4FBE70"}},children:[(0,t.jsx)(N,{getId:m}),(0,t.jsx)(V,{id:F})]})})},Y=(0,P.connect)(function(r){var n=r.openModel;return{openModel:n}})(X)}}]); |
| export const PostCompanyMultiClose = PostModel(url.companyMultiClose); | export const PostCompanyMultiClose = PostModel(url.companyMultiClose); | ||||
| export const PostCompanyMultiOpen = PostModel(url.companyMultiOpen); | export const PostCompanyMultiOpen = PostModel(url.companyMultiOpen); | ||||
| export const PostCompanyFeechange = PostModel(url.companyFeechange); | export const PostCompanyFeechange = PostModel(url.companyFeechange); | ||||
| export const PostCompanyMultiopenvip = PostModel(url.CompanyMultiopenvip); | |||||
| export const PostCompanyEdit = PostModel(url.companyEdit); | export const PostCompanyEdit = PostModel(url.companyEdit); | ||||
| export const PostCompanyViplist = GetModel(url.companyViplist); | export const PostCompanyViplist = GetModel(url.companyViplist); | ||||
| export const PostCompanyJobAdd = PostModel(url.companyJobAdd); | export const PostCompanyJobAdd = PostModel(url.companyJobAdd); | ||||
| export const PostcompanyJobDel = PostModel(url.companyJobDel); | |||||
| export const PostCompanyJobEdit = PostModel(url.companyJobEdit); | export const PostCompanyJobEdit = PostModel(url.companyJobEdit); | ||||
| export const GetCompanyJobList = GetModel(url.companyJobList); | export const GetCompanyJobList = GetModel(url.companyJobList); | ||||
| export const PostCompanyJobInfo = GetModel(url.companyJobInfo); | export const PostCompanyJobInfo = GetModel(url.companyJobInfo); | ||||
| export const PostcompanymMultieditPulishJob = PostModel(url.companymMultieditPulishJob); | |||||
| export const PostcompanymMultieditstatusjob = PostModel(url.companymMultieditstatusjob); | |||||
| export const PostCompanyDepartmentAdd = PostModel(url.companyDepartmentAdd); | export const PostCompanyDepartmentAdd = PostModel(url.companyDepartmentAdd); | ||||
| export const PostcompanyDepartmentDel= PostModel(url.companyDepartmentDel); | |||||
| export const PostCompanyDepartmentEdit = PostModel(url.companyDepartmentEdit); | export const PostCompanyDepartmentEdit = PostModel(url.companyDepartmentEdit); | ||||
| export const GetCompanyDepartmentList = GetModel(url.CompanyDepartmentList); | export const GetCompanyDepartmentList = GetModel(url.CompanyDepartmentList); | ||||
| export const GetCompanyDepartmentInfo = GetModel(url.companyDepartmentInfo); | export const GetCompanyDepartmentInfo = GetModel(url.companyDepartmentInfo); | ||||
| export const PostcompanyDepartmentsDel = PostModel(url.companyDepartmentsDel); | |||||
| // 类型 | // 类型 | ||||
| export const PostHousekeepingtypeAdd = PostModel(url.HousekeepingtypeAdd); | export const PostHousekeepingtypeAdd = PostModel(url.HousekeepingtypeAdd); |
| companyEdit: String, | companyEdit: String, | ||||
| companyVipmanage: String, | companyVipmanage: String, | ||||
| companyViplist: String, | companyViplist: String, | ||||
| CompanyMultiopenvip: String, | |||||
| companyJobAdd: String, | companyJobAdd: String, | ||||
| companyJobEdit: String, | companyJobEdit: String, | ||||
| companyJobDel: String, | |||||
| companyJobList: String, | companyJobList: String, | ||||
| companyJobInfo: String, | companyJobInfo: String, | ||||
| companymMultieditPulishJob: String, | |||||
| companymMultieditstatusjob: String, | |||||
| CompanyRecruiters: String, | CompanyRecruiters: String, | ||||
| CompanyTurnJobseeker: String, | CompanyTurnJobseeker: String, | ||||
| CompanyMultieditstatus: String, | CompanyMultieditstatus: String, | ||||
| companyDepartmentAdd: String, | companyDepartmentAdd: String, | ||||
| companyDepartmentDel: String, | |||||
| companyDepartmentEdit: String, | companyDepartmentEdit: String, | ||||
| CompanyDepartmentList: String, | CompanyDepartmentList: String, | ||||
| companyDepartmentInfo: String, | companyDepartmentInfo: String, | ||||
| companyDepartmentsDel: String, | |||||
| // 类型 | // 类型 | ||||
| HousekeepingtypeAdd: String, | HousekeepingtypeAdd: String, | ||||
| HousekeepingtypeDel: String, | HousekeepingtypeDel: String, |
| companyViplist: admin + '/company/viplist', | companyViplist: admin + '/company/viplist', | ||||
| companyJobAdd: admin + '/company/job_add', | companyJobAdd: admin + '/company/job_add', | ||||
| companyJobDel: admin + '/company/job_del', | |||||
| companyJobEdit: admin + '/company/job_edit', | companyJobEdit: admin + '/company/job_edit', | ||||
| companyJobList: admin + '/company/job_list', | companyJobList: admin + '/company/job_list', | ||||
| companyJobInfo: admin + '/company/job_info', | companyJobInfo: admin + '/company/job_info', | ||||
| companymMultieditPulishJob: admin + '/company/multieditpulishjob', | |||||
| companymMultieditstatusjob: admin + '/company/multieditstatusjob', | |||||
| CompanyRecruiters: admin + '/company/recruiters', | CompanyRecruiters: admin + '/company/recruiters', | ||||
| CompanyTurnJobseeker: admin + '/company/turn_jobseeker', | CompanyTurnJobseeker: admin + '/company/turn_jobseeker', | ||||
| CompanyMultieditstatus: admin + '/company/multieditstatus', | CompanyMultieditstatus: admin + '/company/multieditstatus', | ||||
| companyDepartmentAdd: admin + '/company/department_add', | companyDepartmentAdd: admin + '/company/department_add', | ||||
| companyDepartmentDel: admin + '/company/department_del', | |||||
| companyDepartmentEdit: admin + '/company/department_edit', | companyDepartmentEdit: admin + '/company/department_edit', | ||||
| CompanyDepartmentList: admin + '/company/department_list', | CompanyDepartmentList: admin + '/company/department_list', | ||||
| companyDepartmentInfo: admin + '/company/department_info', | companyDepartmentInfo: admin + '/company/department_info', | ||||
| companyDepartmentsDel: admin + '/company/departments_del', | |||||
| CompanyMultiopenvip: admin + '/company/multiopenvip', | |||||
| // 家政 | // 家政 | ||||
| // 类型 | // 类型 | ||||
| HousekeepingtypeAdd: admin + '/housekeepingtype/add', | HousekeepingtypeAdd: admin + '/housekeepingtype/add', |
| onConfirm={(e) => { | onConfirm={(e) => { | ||||
| PostActivityaddressDel({ id: record.id }).then(res => { | PostActivityaddressDel({ id: record.id }).then(res => { | ||||
| message.success('删除成功') | message.success('删除成功') | ||||
| actionRef.current.reload(); | |||||
| actionRef.current?.reload(); | |||||
| }) | }) | ||||
| }} | }} | ||||
| okText="删除" | okText="删除" | ||||
| cancelText="取消" | cancelText="取消" | ||||
| > | > | ||||
| <a | |||||
| key="delete" | |||||
| > | |||||
| 删除 | |||||
| </a> | |||||
| <Button danger type='link'>删除</Button> | |||||
| </Popconfirm> | </Popconfirm> | ||||
| ], | ], | ||||
| }, | }, |
| import { | import { | ||||
| ProTable, TableDropdown | ProTable, TableDropdown | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { Button, Image, ConfigProvider, Space, Descriptions } from 'antd'; | |||||
| import { Button, Image, ConfigProvider, Space, Descriptions, Popconfirm } from 'antd'; | |||||
| import { GetAdvertareaList } from '@/apis/api'; | import { GetAdvertareaList } from '@/apis/api'; | ||||
| const PagesMainAdvertisementListTable: React.FC = ({ dispatch, openModel, getId }: any) => { | const PagesMainAdvertisementListTable: React.FC = ({ dispatch, openModel, getId }: any) => { | ||||
| setId(record.id) | setId(record.id) | ||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | dispatch({ type: 'openModel/getOpenModal', payload: true }) | ||||
| }}>编辑</Button>, | }}>编辑</Button>, | ||||
| <Button key='2' type='link' onClick={() => { | |||||
| }}>删除</Button> | |||||
| <Popconfirm | |||||
| title="是否删除" | |||||
| onConfirm={(e) => { | |||||
| delSection({ id: record.id }).then(res => { | |||||
| message.success('删除成功') | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| }} | |||||
| okText="删除" | |||||
| cancelText="取消" | |||||
| > | |||||
| <Button danger type='link'>删除</Button> | |||||
| </Popconfirm> | |||||
| ], | ], | ||||
| }, | }, | ||||
| ]} | ]} |
| setId(record.id) | setId(record.id) | ||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | dispatch({ type: 'openModel/getOpenModal', payload: true }) | ||||
| }}>编辑</Button>, | }}>编辑</Button>, | ||||
| <Button size='small' type='link' onClick={() => { | |||||
| // Modal.confirm({ | |||||
| // title: '更换图片', | |||||
| // content: (<> | |||||
| // <ProForm submitter={{ render: false }}> | |||||
| // <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="更换图片" image_type={3} imageUrl={record.photo} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||||
| // </ProForm> | |||||
| // </>), | |||||
| // async onOk() { | |||||
| // // let info = await GetCompanyInfo({ id: record.id }); | |||||
| // // let res = await updateCompany({ ...info.data, license_path: uploadedFilelicenseNameRef.current }); | |||||
| // // setUploadedFilelicenseName(''); | |||||
| // actionRef.current?.reload(); | |||||
| // }, | |||||
| // onCancel() { | |||||
| // console.log('Cancel'); | |||||
| // }, | |||||
| // okText: '保存', | |||||
| // cancelText: '取消', | |||||
| // centered: true, | |||||
| // }); | |||||
| }}>更换图片</Button>, | |||||
| <Popconfirm | <Popconfirm | ||||
| title="是否删除" | title="是否删除" | ||||
| onConfirm={(e) => { | onConfirm={(e) => { | ||||
| PostAdvertscheduleDel({ id: record.id }).then(res => { | PostAdvertscheduleDel({ id: record.id }).then(res => { | ||||
| message.success('删除成功') | message.success('删除成功') | ||||
| actionRef.current.reload(); | |||||
| actionRef.current?.reload(); | |||||
| }) | }) | ||||
| }} | }} | ||||
| okText="删除" | okText="删除" | ||||
| cancelText="取消" | cancelText="取消" | ||||
| > | > | ||||
| <a | |||||
| key="delete" | |||||
| > | |||||
| 删除 | |||||
| </a> | |||||
| <Button danger type='link'>删除</Button> | |||||
| </Popconfirm> | </Popconfirm> | ||||
| ], | ], | ||||
| }, | }, | ||||
| ]} | ]} |
| import { | import { | ||||
| ProTable, ProFormSelect | ProTable, ProFormSelect | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { Button, ConfigProvider, Modal } from 'antd'; | |||||
| import { GetCompanyDepartmentList, getCompanyList, GetCompanyInfo } from '@/apis/api'; | |||||
| import { Button, ConfigProvider, Modal, Popconfirm, message, Space } from 'antd'; | |||||
| import { GetCompanyDepartmentList, getCompanyList, GetCompanyInfo, PostcompanyDepartmentsDel, PostcompanyDepartmentDel } from '@/apis/api'; | |||||
| const selectfieldNames = { label: 'full_name', value: 'id' }; | const selectfieldNames = { label: 'full_name', value: 'id' }; | ||||
| const PagesMainCompanyDepartmentTable: React.FC = ({ dispatch, getId, openModel }: any) => { | const PagesMainCompanyDepartmentTable: React.FC = ({ dispatch, getId, openModel }: any) => { | ||||
| const actionRef = useRef<ActionType>(); | const actionRef = useRef<ActionType>(); | ||||
| const [page, setPage] = useState<number>(1) | const [page, setPage] = useState<number>(1) | ||||
| const [pageSize, setPageSize] = useState<number>(10) | const [pageSize, setPageSize] = useState<number>(10) | ||||
| const [companyId, setCompanyId] = useState<number>(0); | const [companyId, setCompanyId] = useState<number>(0); | ||||
| const [ids, setIds] = useState<number[]>([]) | |||||
| const setId = (id: number) => { | const setId = (id: number) => { | ||||
| getId(id) | getId(id) | ||||
| } | } | ||||
| colorPrimary: '#4FBE70', | colorPrimary: '#4FBE70', | ||||
| colorLink: '#4FBE70', | colorLink: '#4FBE70', | ||||
| }, | |||||
| components: { | |||||
| Modal: { | |||||
| colorPrimary: '#4FBE70', | |||||
| } | |||||
| } | } | ||||
| }} | }} | ||||
| > | > | ||||
| actionRef={actionRef} | actionRef={actionRef} | ||||
| dataSource={list} | dataSource={list} | ||||
| search={{ span: 8, labelWidth: 'auto' }} | search={{ span: 8, labelWidth: 'auto' }} | ||||
| tableAlertRender={({ | |||||
| selectedRowKeys, | |||||
| selectedRows, | |||||
| onCleanSelected, | |||||
| }) => { | |||||
| setIds(selectedRowKeys) | |||||
| return ( | |||||
| <Space size={24}> | |||||
| <span> | |||||
| 已选 {selectedRowKeys.length} 项 | |||||
| <a style={{ marginInlineStart: 8 }} onClick={onCleanSelected}> | |||||
| 取消选择 | |||||
| </a> | |||||
| </span> | |||||
| </Space> | |||||
| ); | |||||
| }} | |||||
| tableAlertOptionRender={({ | |||||
| onCleanSelected, | |||||
| }) => { | |||||
| return ( | |||||
| <Space size={16}> | |||||
| <Button type="primary" onClick={() => { | |||||
| Modal.confirm({ | |||||
| title: '批量删除', | |||||
| content: '确定要删除所选的数据吗', | |||||
| onOk() { | |||||
| PostcompanyDepartmentsDel({ ids: ids }).then(res => { | |||||
| onCleanSelected() | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '确定', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| }}> | |||||
| 批量删除 | |||||
| </Button>, | |||||
| </Space> | |||||
| ); | |||||
| }} | |||||
| rowSelection={{ | rowSelection={{ | ||||
| type: 'checkbox' | type: 'checkbox' | ||||
| }} | }} | ||||
| setId(record.id) | setId(record.id) | ||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | dispatch({ type: 'openModel/getOpenModal', payload: true }) | ||||
| }}>编辑</Button>, | }}>编辑</Button>, | ||||
| <Button key='2' type='link' danger onClick={() => { | |||||
| setId(record.id) | |||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||||
| }}>删除</Button> | |||||
| <Popconfirm | |||||
| title="是否删除" | |||||
| onConfirm={(e) => { | |||||
| PostcompanyDepartmentDel({ id: record.id }).then(res => { | |||||
| message.success('删除成功') | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| }} | |||||
| okText="删除" | |||||
| cancelText="取消" | |||||
| > | |||||
| <Button danger type='link'>删除</Button> | |||||
| </Popconfirm>, | |||||
| ], | ], | ||||
| }, | }, | ||||
| ]} | ]} | ||||
| actionRef.current?.reload(); | actionRef.current?.reload(); | ||||
| }} | }} | ||||
| headerTitle="部门列表" | headerTitle="部门列表" | ||||
| toolBarRender={() => [<Button type="primary" onClick={() => { | |||||
| Modal.confirm({ | |||||
| title: '批量删除', | |||||
| content: '确定要删除所选的数据吗,参数:id', | |||||
| onOk() { | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '确定', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| }}> | |||||
| 批量删除 | |||||
| </Button>, | |||||
| <Button type="primary" onClick={() => { | |||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||||
| }}> | |||||
| 添加部门 | |||||
| </Button>, | |||||
| toolBarRender={() => [ | |||||
| <Button type="primary" onClick={() => { | |||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||||
| }}> | |||||
| 添加部门 | |||||
| </Button>, | |||||
| ]} | ]} | ||||
| /> | /> | ||||
| import { useRef, useState, useEffect } from 'react'; | import { useRef, useState, useEffect } from 'react'; | ||||
| import { connect, history, Link } from '@umijs/max'; | import { connect, history, Link } from '@umijs/max'; | ||||
| import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | ||||
| ProTable, ProFormRadio, ProForm | ProTable, ProFormRadio, ProForm | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { Button, Image, ConfigProvider, Select, message, Descriptions, Space, Radio, Modal, Form, Row,Col, Badge } from 'antd'; | |||||
| import { Button, Image, ConfigProvider, Select, message, Descriptions, Space, Radio, Modal, Flex, Row, Col, Badge } from 'antd'; | |||||
| import { getCompanyList, GetCompanyInfo, updateCompany, PostCompanyExport, PostCompanyEdit, PostCompanyMultieditstatus } from '@/apis/api'; | import { getCompanyList, GetCompanyInfo, updateCompany, PostCompanyExport, PostCompanyEdit, PostCompanyMultieditstatus } from '@/apis/api'; | ||||
| import { Imageprefix } from '@/constants'; | import { Imageprefix } from '@/constants'; | ||||
| const [page, setPage] = useState<number>(1) | const [page, setPage] = useState<number>(1) | ||||
| const [pageSize, setPageSize] = useState<number>(10) | const [pageSize, setPageSize] = useState<number>(10) | ||||
| const [expandedRowKeys, setExpandedRowKeys] = useState<string[]>([]) | const [expandedRowKeys, setExpandedRowKeys] = useState<string[]>([]) | ||||
| const [openMultieditPreview, setOpenMultieditPreview] = useState(false); | |||||
| const [ids, setIds] = useState<number[]>([]) | const [ids, setIds] = useState<number[]>([]) | ||||
| const [status, setStatus] = useState<number>(0) | |||||
| const [status, setStatus] = useState<number>(1) | |||||
| actionRef={actionRef} | actionRef={actionRef} | ||||
| dataSource={list} | dataSource={list} | ||||
| search={{ span: 6, labelWidth: 'auto' }} | search={{ span: 6, labelWidth: 'auto' }} | ||||
| tableAlertRender={({ | |||||
| selectedRowKeys, | |||||
| selectedRows, | |||||
| onCleanSelected, | |||||
| }) => { | |||||
| setIds(selectedRowKeys) | |||||
| return ( | |||||
| <Space size={24}> | |||||
| <span> | |||||
| 已选 {selectedRowKeys.length} 项 | |||||
| <a style={{ marginInlineStart: 8 }} onClick={onCleanSelected}> | |||||
| 取消选择 | |||||
| </a> | |||||
| </span> | |||||
| </Space> | |||||
| ); | |||||
| }} | |||||
| tableAlertOptionRender={() => { | |||||
| return ( | |||||
| <Space size={16}> | |||||
| <Button type="primary" onClick={() => { | |||||
| if (ids.length === 0) { | |||||
| message.error('请选择要操作的数据') | |||||
| } else { | |||||
| setOpenMultieditPreview(true) | |||||
| } | |||||
| }}> | |||||
| 批量管理账号 | |||||
| </Button>, | |||||
| </Space> | |||||
| ); | |||||
| }} | |||||
| rowSelection={{ | rowSelection={{ | ||||
| type: 'checkbox', | |||||
| onChange: (selectedRowKeys, selectedRows) => { | |||||
| setIds(selectedRowKeys) | |||||
| }, | |||||
| type: 'checkbox' | |||||
| }} | }} | ||||
| expandable={{ | expandable={{ | ||||
| expandedRowRender | expandedRowRender | ||||
| } | } | ||||
| headerTitle="企业列表" | headerTitle="企业列表" | ||||
| toolBarRender={() => [ | toolBarRender={() => [ | ||||
| <Button type="primary" onClick={() => { | |||||
| if (ids.length === 0) { | |||||
| message.error('请选择要操作的数据') | |||||
| } else { | |||||
| Modal.confirm({ | |||||
| title: '请选择对批量数据进行何种操作', | |||||
| content: (<> | |||||
| <Radio.Group size='small' value={status} onChange={(e) => { | |||||
| setStatus(e.target.value) | |||||
| }} options={[ | |||||
| { value: 1, label: '开通账号' }, | |||||
| { value: 2, label: '关闭账号' } | |||||
| ]} > | |||||
| {/* <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>开通账号</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={2}>关闭账号</Radio> | |||||
| </Col> | |||||
| {/* <Col span={12}> | |||||
| <Radio value={3}>禁用1天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={4}>禁用3天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={5}>禁用7天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={6}>禁用15天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={7}>禁用30天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={8}>永久禁用</Radio> | |||||
| </Col> | |||||
| </Row> */} | |||||
| </Radio.Group> | |||||
| </>), | |||||
| async onOk() { | |||||
| if (status) { | |||||
| let res = PostCompanyMultieditstatus({ ids: ids, status: status }) | |||||
| actionRef.current?.reload(); | |||||
| } else { | |||||
| message.error('请选择状态') | |||||
| return false | |||||
| } | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '确定', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| } | |||||
| }}> | |||||
| 批量管理账号 | |||||
| </Button>, | |||||
| <Button type="primary" onClick={() => { | <Button type="primary" onClick={() => { | ||||
| message.info('数据导出需要时间,请耐心等待') | message.info('数据导出需要时间,请耐心等待') | ||||
| PostCompanyExport().then(res => { | PostCompanyExport().then(res => { | ||||
| </Button >, | </Button >, | ||||
| ]} | ]} | ||||
| /> | /> | ||||
| <Modal | |||||
| open={openMultieditPreview} | |||||
| title='请选择对批量数据进行何种操作' | |||||
| centered | |||||
| maskClosable={false} | |||||
| destroyOnClose | |||||
| width={400} | |||||
| onCancel={() => { | |||||
| setOpenMultieditPreview(false) | |||||
| }} | |||||
| onOk={() => { | |||||
| if (status) { | |||||
| PostCompanyMultieditstatus({ ids: ids, status: status }).then(res => { | |||||
| setOpenMultieditPreview(false) | |||||
| actionRef.current?.clearSelected(); | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| } else { | |||||
| message.error('请选择状态') | |||||
| return false | |||||
| } | |||||
| } | |||||
| } | |||||
| > | |||||
| <Flex justify='center' align='center' style={{ minHeight: 100 }}> | |||||
| <Radio.Group size='small' value={status} onChange={(e) => { | |||||
| setStatus(e.target.value) | |||||
| }} options={[ | |||||
| { value: 1, label: '开通账号' }, | |||||
| { value: 2, label: '关闭账号' } | |||||
| ]} > | |||||
| {/* <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>开通账号</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={2}>关闭账号</Radio> | |||||
| </Col> | |||||
| {/* <Col span={12}> | |||||
| <Radio value={3}>禁用1天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={4}>禁用3天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={5}>禁用7天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={6}>禁用15天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={7}>禁用30天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={8}>永久禁用</Radio> | |||||
| </Col> | |||||
| </Row> */} | |||||
| </Radio.Group> | |||||
| </Flex> | |||||
| </Modal > | |||||
| </ConfigProvider > | </ConfigProvider > | ||||
| </> | </> | ||||
| ); | ); |
| import { | import { | ||||
| ProTable, ProFormSelect | ProTable, ProFormSelect | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { Button, ConfigProvider, message, Space, Descriptions, Radio, Row, Col, Modal } from 'antd'; | |||||
| import { GetCompanyJobList, getCompanyList, GetCompanyInfo, PostJobExport } from '@/apis/api'; | |||||
| import { Button, ConfigProvider, message, Space, Descriptions, Radio, Row, Popconfirm, Modal, Flex, InputNumber } from 'antd'; | |||||
| import { GetCompanyJobList, getCompanyList, GetCompanyInfo, PostJobExport, PostcompanymMultieditPulishJob, PostcompanymMultieditstatusjob, PostcompanyJobDel } from '@/apis/api'; | |||||
| import { Imageprefix } from '@/constants'; | import { Imageprefix } from '@/constants'; | ||||
| const selectfieldNames = { label: 'full_name', value: 'id' }; | const selectfieldNames = { label: 'full_name', value: 'id' }; | ||||
| const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any) => { | const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any) => { | ||||
| const [pageSize, setPageSize] = useState<number>(10) | const [pageSize, setPageSize] = useState<number>(10) | ||||
| const [companyId, setCompanyId] = useState<number>(0); | const [companyId, setCompanyId] = useState<number>(0); | ||||
| const [expandedRowKeys, setExpandedRowKeys] = useState<string[]>([]) | const [expandedRowKeys, setExpandedRowKeys] = useState<string[]>([]) | ||||
| const [openMultieditPreview, setOpenMultieditPreview] = useState(false); | |||||
| const [openMultieditPreview2, setOpenMultieditPreview2] = useState(false); | |||||
| const [ids, setIds] = useState<number[]>([]) | |||||
| const [status, setStatus] = useState<number>(1) | |||||
| const [usefuLife, setUsefuLife] = useState<number>(1) | |||||
| const [disabledDate, setDisabledDate] = useState<Date | String | null>(null); | |||||
| const setId = (id: number) => { | const setId = (id: number) => { | ||||
| getId(id) | getId(id) | ||||
| } | } | ||||
| }; | }; | ||||
| }, [openModel.openModal]) | }, [openModel.openModal]) | ||||
| const handleTimeChange = (value) => { | |||||
| setUsefuLife(value) | |||||
| const today = new Date(); | |||||
| let end_date = new Date(today); | |||||
| end_date.setDate(today.getDate() + value); | |||||
| // 格式化日期为 YYYY-MM-DD | |||||
| const formatDate = (date: Date): string => { | |||||
| const year = date.getFullYear(); | |||||
| const month = String(date.getMonth() + 1).padStart(2, '0'); | |||||
| const day = String(date.getDate()).padStart(2, '0'); | |||||
| return `${year}-${month}-${day}`; | |||||
| }; | |||||
| const formattedEndDate = formatDate(end_date); | |||||
| setDisabledDate(formattedEndDate); | |||||
| console.log(formattedEndDate); | |||||
| }; | |||||
| return ( | return ( | ||||
| <> | <> | ||||
| token: { | token: { | ||||
| colorPrimary: '#4FBE70', | colorPrimary: '#4FBE70', | ||||
| colorLink: '#4FBE70', | colorLink: '#4FBE70', | ||||
| } | } | ||||
| }} | }} | ||||
| > | > | ||||
| actionRef={actionRef} | actionRef={actionRef} | ||||
| dataSource={list} | dataSource={list} | ||||
| search={{ span: 8, labelWidth: 'auto' }} | search={{ span: 8, labelWidth: 'auto' }} | ||||
| tableAlertRender={({ | |||||
| selectedRowKeys, | |||||
| selectedRows, | |||||
| onCleanSelected, | |||||
| }) => { | |||||
| setIds(selectedRowKeys) | |||||
| return ( | |||||
| <Space size={24}> | |||||
| <span> | |||||
| 已选 {selectedRowKeys.length} 项 | |||||
| <a style={{ marginInlineStart: 8 }} onClick={onCleanSelected}> | |||||
| 取消选择 | |||||
| </a> | |||||
| </span> | |||||
| </Space> | |||||
| ); | |||||
| }} | |||||
| tableAlertOptionRender={({ | |||||
| onCleanSelected, | |||||
| }) => { | |||||
| return ( | |||||
| <Space> | |||||
| <Button type="primary" onClick={() => { | |||||
| if (ids.length === 0) { | |||||
| message.error('请选择要操作的数据') | |||||
| } else { | |||||
| setOpenMultieditPreview(true) | |||||
| } | |||||
| }}> | |||||
| 批量发布 | |||||
| </Button>, | |||||
| <Button type="primary" onClick={() => { | |||||
| if (ids.length === 0) { | |||||
| message.error('请选择要操作的数据') | |||||
| } else { | |||||
| setOpenMultieditPreview2(true) | |||||
| } | |||||
| }}> | |||||
| 批量更改状态 | |||||
| </Button>, | |||||
| <Button type="primary" onClick={() => { | |||||
| Modal.confirm({ | |||||
| title: '批量删除', | |||||
| content: '确定要删除所选的数据吗', | |||||
| onOk() { | |||||
| const promises = ids.map(item => { | |||||
| return PostcompanyJobDel({ id: item }); | |||||
| }); | |||||
| // 等待所有请求完成 | |||||
| Promise.all(promises) | |||||
| .then(() => { | |||||
| message.success('批量删除成功'); | |||||
| actionRef.current?.clearSelected(); | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| .catch(error => { | |||||
| console.error('批量删除成功:', error); | |||||
| message.error('批量删除成功'); | |||||
| }); | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '确定', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| }}> | |||||
| 批量删除 | |||||
| </Button>, | |||||
| </Space> | |||||
| ); | |||||
| }} | |||||
| rowSelection={{ | rowSelection={{ | ||||
| type: 'checkbox' | type: 'checkbox' | ||||
| }} | }} | ||||
| title: '操作', | title: '操作', | ||||
| key: 'option', | key: 'option', | ||||
| valueType: 'option', | valueType: 'option', | ||||
| width: 200, | |||||
| render: (_, record, action) => [ | render: (_, record, action) => [ | ||||
| <Button key='1' type='link' onClick={() => { | <Button key='1' type='link' onClick={() => { | ||||
| setId(record.id) | setId(record.id) | ||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | dispatch({ type: 'openModel/getOpenModal', payload: true }) | ||||
| }}>编辑</Button> | |||||
| }}>编辑</Button>, | |||||
| <Popconfirm | |||||
| title="是否删除" | |||||
| onConfirm={(e) => { | |||||
| PostcompanyJobDel({ id: record.id }).then(res => { | |||||
| message.success('删除成功') | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| }} | |||||
| okText="删除" | |||||
| cancelText="取消" | |||||
| > | |||||
| <Button danger type='link'>删除</Button> | |||||
| </Popconfirm>, | |||||
| ], | ], | ||||
| }, | }, | ||||
| ]} | ]} | ||||
| }} | }} | ||||
| headerTitle="职位列表" | headerTitle="职位列表" | ||||
| toolBarRender={() => [<Button type="primary" onClick={() => { | |||||
| Modal.confirm({ | |||||
| title: '批量发布', | |||||
| content: (<> | |||||
| <div>参数: id, status,useful_life ,disabled_date </div> | |||||
| <h4 style={{ fontWeight: 'bold' }}>有效期:</h4> | |||||
| <Radio.Group size='small' onChange={async (e) => { | |||||
| actionRef.current?.reload(); | |||||
| }}> | |||||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>1天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>3天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>7天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>15天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>30天</Radio> | |||||
| </Col> | |||||
| </Row> | |||||
| </Radio.Group> | |||||
| </>), | |||||
| onOk() { | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '确定', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| }}> | |||||
| 批量发布 | |||||
| </Button>, | |||||
| <Button type="primary" onClick={() => { | |||||
| Modal.confirm({ | |||||
| title: '批量更改状态', | |||||
| content: (<> | |||||
| <div>参数: id, status</div> | |||||
| <Radio.Group size='small' onChange={async (e) => { | |||||
| actionRef.current?.reload(); | |||||
| }}> | |||||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>发布中</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>未发布</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>暂停</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>已锁定</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>回收站</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>已过期</Radio> | |||||
| </Col> | |||||
| </Row> | |||||
| </Radio.Group> | |||||
| </>), | |||||
| onOk() { | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '确定', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| }}> | |||||
| 批量更改状态 | |||||
| </Button>, | |||||
| <Button type="primary" onClick={() => { | |||||
| message.info('数据导出需要时间,请耐心等待') | |||||
| PostJobExport().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> | |||||
| toolBarRender={() => [ | |||||
| <Button type="primary" onClick={() => { | |||||
| message.info('数据导出需要时间,请耐心等待') | |||||
| PostJobExport().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> | |||||
| ]} | ]} | ||||
| /> | /> | ||||
| <Modal | |||||
| open={openMultieditPreview} | |||||
| title='请选择对批量数据进行何种操作' | |||||
| centered | |||||
| maskClosable={false} | |||||
| destroyOnClose | |||||
| width={400} | |||||
| onCancel={() => { | |||||
| setOpenMultieditPreview(false) | |||||
| }} | |||||
| onOk={() => { | |||||
| if (usefuLife && disabledDate && status) { | |||||
| PostcompanymMultieditPulishJob({ id: ids, useful_life: usefuLife, disabled_date: disabledDate, status: status }).then(res => { | |||||
| setOpenMultieditPreview(false) | |||||
| actionRef.current?.clearSelected(); | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| } else { | |||||
| message.error('请完成表单') | |||||
| return false | |||||
| } | |||||
| } | |||||
| } | |||||
| > | |||||
| <Flex vertical justify='center' style={{ minHeight: 100 }}> | |||||
| <Space direction='vertical'> | |||||
| <h4 style={{ fontWeight: 'bold' }}>状态:</h4> | |||||
| <Radio.Group size='small' value={status} onChange={(e) => { | |||||
| setStatus(e.target.value) | |||||
| }}> | |||||
| <Radio value={1}>发布中</Radio> | |||||
| <Radio value={2}>未发布</Radio> | |||||
| <Radio value={3}>暂停</Radio> | |||||
| <Radio value={4}>已锁定</Radio> | |||||
| <Radio value={5}>回收站</Radio> | |||||
| <Radio value={6}>已过期</Radio> | |||||
| </Radio.Group> | |||||
| <h4 style={{ fontWeight: 'bold' }}>职位有效天数:</h4> | |||||
| <InputNumber min={1} placeholder='请输入职位有效天数' onChange={(value) => { | |||||
| handleTimeChange(value) | |||||
| }} style={{ width: '100%' }} /> | |||||
| </Space> | |||||
| </Flex> | |||||
| </Modal > | |||||
| <Modal | |||||
| open={openMultieditPreview2} | |||||
| title='请选择对批量数据进行何种操作' | |||||
| centered | |||||
| maskClosable={false} | |||||
| destroyOnClose | |||||
| width={400} | |||||
| onCancel={() => { | |||||
| setOpenMultieditPreview2(false) | |||||
| }} | |||||
| onOk={() => { | |||||
| if (status) { | |||||
| PostcompanymMultieditstatusjob({ id: ids, status: status }).then(res => { | |||||
| setOpenMultieditPreview2(false) | |||||
| actionRef.current?.clearSelected(); | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| } else { | |||||
| message.error('请完成表单') | |||||
| return false | |||||
| } | |||||
| } | |||||
| } | |||||
| > | |||||
| <Flex vertical justify='center' style={{ minHeight: 100 }}> | |||||
| <Space direction='vertical'> | |||||
| <h4 style={{ fontWeight: 'bold' }}>状态:</h4> | |||||
| <Radio.Group size='small' value={status} onChange={(e) => { | |||||
| setStatus(e.target.value) | |||||
| }}> | |||||
| <Radio value={1}>发布中</Radio> | |||||
| <Radio value={2}>未发布</Radio> | |||||
| <Radio value={3}>暂停</Radio> | |||||
| <Radio value={4}>已锁定</Radio> | |||||
| <Radio value={5}>回收站</Radio> | |||||
| <Radio value={6}>已过期</Radio> | |||||
| </Radio.Group> | |||||
| </Space> | |||||
| </Flex> | |||||
| </Modal > | |||||
| </ConfigProvider> | </ConfigProvider> | ||||
| </> | </> |
| import { | import { | ||||
| ProTable | ProTable | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { Button, Image, ConfigProvider, Input, Descriptions, Space, Modal, Radio, Row, Col } from 'antd'; | |||||
| import { PostCompanyViplist, PostCompanyFeechange } from '@/apis/api'; | |||||
| import { Button, Image, ConfigProvider, Input, Descriptions, Space, Modal, Radio, Row, Col, InputNumber, message, Flex } from 'antd'; | |||||
| import { PostCompanyViplist, PostCompanyFeechange, PostCompanyMultiopenvip } from '@/apis/api'; | |||||
| import { Imageprefix } from '@/constants'; | import { Imageprefix } from '@/constants'; | ||||
| const [page, setPage] = useState<number>(1) | const [page, setPage] = useState<number>(1) | ||||
| const [pageSize, setPageSize] = useState<number>(10) | const [pageSize, setPageSize] = useState<number>(10) | ||||
| const [fullname, setFullname] = useState<any>(sessionStorage.getItem('vip_company_info') ? JSON.parse(sessionStorage.getItem('vip_company_info')).full_name : '') | const [fullname, setFullname] = useState<any>(sessionStorage.getItem('vip_company_info') ? JSON.parse(sessionStorage.getItem('vip_company_info')).full_name : '') | ||||
| const [openMultieditPreview, setOpenMultieditPreview] = useState(false); | |||||
| const [ids, setIds] = useState<number[]>([]) | |||||
| const [memberType, setMemberType] = useState<number>(1) | |||||
| const [startDate, setStartDate] = useState<Date | String | null>(null); | |||||
| const [endDate, setEndDate] = useState<Date | String | null>(null); | |||||
| const setId = (id: number) => { | const setId = (id: number) => { | ||||
| getId(id) | getId(id) | ||||
| } | } | ||||
| } | } | ||||
| }, [openModel.openFeeModal]) | }, [openModel.openFeeModal]) | ||||
| const handleTimeChange = (value) => { | |||||
| const today = new Date(); | |||||
| let start_date = today; | |||||
| let end_date = new Date(today); | |||||
| end_date.setDate(today.getDate() + value); | |||||
| // 格式化日期为 YYYY-MM-DD | |||||
| const formatDate = (date: Date): string => { | |||||
| const year = date.getFullYear(); | |||||
| const month = String(date.getMonth() + 1).padStart(2, '0'); | |||||
| const day = String(date.getDate()).padStart(2, '0'); | |||||
| return `${year}-${month}-${day}`; | |||||
| }; | |||||
| const formattedStartDate = formatDate(start_date); | |||||
| const formattedEndDate = formatDate(end_date); | |||||
| setStartDate(formattedStartDate); | |||||
| setEndDate(formattedEndDate); | |||||
| console.log(formattedStartDate); | |||||
| console.log(formattedEndDate); | |||||
| }; | |||||
| const expandedRowRender = (record) => { | const expandedRowRender = (record) => { | ||||
| return ( | return ( | ||||
| <> | <> | ||||
| ); | ); | ||||
| }; | }; | ||||
| return ( | return ( | ||||
| <> | <> | ||||
| <ConfigProvider | <ConfigProvider | ||||
| colorPrimary: '#4FBE70', | colorPrimary: '#4FBE70', | ||||
| colorLink: '#4FBE70', | colorLink: '#4FBE70', | ||||
| }, | |||||
| components: { | |||||
| Modal: { | |||||
| colorPrimary: '#4FBE70', | |||||
| } | |||||
| } | } | ||||
| }} | }} | ||||
| > | > | ||||
| search={{ | search={{ | ||||
| span: 8, labelWidth: 'auto' | span: 8, labelWidth: 'auto' | ||||
| }} | }} | ||||
| tableAlertRender={({ | |||||
| selectedRowKeys, | |||||
| selectedRows, | |||||
| onCleanSelected, | |||||
| }) => { | |||||
| setIds(selectedRowKeys) | |||||
| return ( | |||||
| <Space size={24}> | |||||
| <span> | |||||
| 已选 {selectedRowKeys.length} 项 | |||||
| <a style={{ marginInlineStart: 8 }} onClick={onCleanSelected}> | |||||
| 取消选择 | |||||
| </a> | |||||
| </span> | |||||
| </Space> | |||||
| ); | |||||
| }} | |||||
| tableAlertOptionRender={() => { | |||||
| return ( | |||||
| <Space size={16}> | |||||
| <Button type="primary" onClick={() => { | |||||
| if (ids.length === 0) { | |||||
| message.error('请选择要操作的数据') | |||||
| } else { | |||||
| setOpenMultieditPreview(true) | |||||
| } | |||||
| }}> | |||||
| 批量开通会员 | |||||
| </Button>, | |||||
| </Space> | |||||
| ); | |||||
| }} | |||||
| rowSelection={{ | rowSelection={{ | ||||
| type: 'checkbox' | type: 'checkbox' | ||||
| }} | }} | ||||
| actionRef.current?.reload(); | actionRef.current?.reload(); | ||||
| }} | }} | ||||
| headerTitle="VIP企业列表" | headerTitle="VIP企业列表" | ||||
| toolBarRender={() => [ | |||||
| <Button type="primary" onClick={() => { | |||||
| Modal.confirm({ | |||||
| title: '请选择对批量数据开通哪种会员类型', | |||||
| content: (<> | |||||
| <div>参数: id, member_type,start_date,end_date </div> | |||||
| <h4 style={{ fontWeight: 'bold' }}>类型:</h4> | |||||
| <Radio.Group size='small' onChange={async (e) => { | |||||
| actionRef.current?.reload(); | |||||
| }}> | |||||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>试用申请中</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>试用正式</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>普通申请中</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>普通正式</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>VIP申请中</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>VIP正式</Radio> | |||||
| </Col> | |||||
| </Row> | |||||
| </Radio.Group> | |||||
| <h4 style={{ fontWeight: 'bold' }}>时长:</h4> | |||||
| <Radio.Group size='small' onChange={async (e) => { | |||||
| actionRef.current?.reload(); | |||||
| }}> | |||||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>1天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>3天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>7天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>15天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>30天</Radio> | |||||
| </Col> | |||||
| </Row> | |||||
| </Radio.Group> | |||||
| </>), | |||||
| onOk() { | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '保存', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| }}> | |||||
| 批量开通会员 | |||||
| </Button>, | |||||
| ]} | |||||
| /> | /> | ||||
| <Modal | |||||
| open={openMultieditPreview} | |||||
| title='请选择对批量数据进行何种操作' | |||||
| centered | |||||
| maskClosable={false} | |||||
| destroyOnClose | |||||
| width={400} | |||||
| onCancel={() => { | |||||
| setOpenMultieditPreview(false) | |||||
| }} | |||||
| onOk={() => { | |||||
| if (memberType && startDate && endDate) { | |||||
| PostCompanyMultiopenvip({ ids: ids, member_type: memberType, start_date: startDate, end_date: endDate }).then(res => { | |||||
| setOpenMultieditPreview(false) | |||||
| actionRef.current?.clearSelected(); | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| } else { | |||||
| message.error('请完成表单') | |||||
| return false | |||||
| } | |||||
| } | |||||
| } | |||||
| > | |||||
| <Flex vertical justify='center' style={{ minHeight: 100 }}> | |||||
| <Space direction='vertical'> | |||||
| <h4 style={{ fontWeight: 'bold' }}>类型:</h4> | |||||
| <Radio.Group size='small' value={memberType} onChange={(e) => { | |||||
| setMemberType(e.target.value) | |||||
| }}> | |||||
| <Radio value={1}>试用申请中</Radio> | |||||
| <Radio value={2}>试用正式</Radio> | |||||
| <Radio value={3}>普通申请中</Radio> | |||||
| <Radio value={4}>普通正式</Radio> | |||||
| <Radio value={5}>VIP申请中</Radio> | |||||
| <Radio value={6}>VIP正式</Radio> | |||||
| </Radio.Group> | |||||
| <h4 style={{ fontWeight: 'bold' }}>时长:</h4> | |||||
| <InputNumber min={1} placeholder='请输入时长' onChange={(value) => { | |||||
| handleTimeChange(value) | |||||
| }} style={{ width: '100%' }} /> | |||||
| </Space> | |||||
| </Flex> | |||||
| </Modal > | |||||
| </ConfigProvider> | </ConfigProvider> | ||||
| </> | </> | ||||
| ); | ); |
| import { | import { | ||||
| ProTable, ProForm | ProTable, ProForm | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { Button, ConfigProvider, Tag, Modal, Radio, Row, Col, Descriptions, Space, Image } from 'antd'; | |||||
| import { Button, ConfigProvider, Flex, Modal, Radio, message, DatePicker, Descriptions, Space, Image, Popconfirm } from 'antd'; | |||||
| import { Imageprefix } from '@/constants'; | import { Imageprefix } from '@/constants'; | ||||
| import { listRecruitment, GetRecruitmentDetail } from '@/apis/api'; | |||||
| import { listRecruitment, GetRecruitmentDetail, PostRecruitmentUpdate, PostRecruitmentDel } from '@/apis/api'; | |||||
| import UploadModel from '@/components/Common/upload'; | import UploadModel from '@/components/Common/upload'; | ||||
| const [total, setTotal] = useState<number>(0) | const [total, setTotal] = useState<number>(0) | ||||
| const [page, setPage] = useState<number>(1) | const [page, setPage] = useState<number>(1) | ||||
| const [pageSize, setPageSize] = useState<number>(10) | const [pageSize, setPageSize] = useState<number>(10) | ||||
| const [openMultieditPreview, setOpenMultieditPreview] = useState(false); | |||||
| const [ids, setIds] = useState<number[]>([]) | |||||
| const [status, setStatus] = useState<number>(1) | |||||
| const [startDate, setStartDate] = useState<Date | String | null>(null); | |||||
| const [endDate, setEndDate] = useState<Date | String | null>(null); | |||||
| const setId = (id: number) => { | const setId = (id: number) => { | ||||
| getId(id) | getId(id) | ||||
| } | } | ||||
| uploadedFilephotoNameRef.current = uploadedFilephotoName; | uploadedFilephotoNameRef.current = uploadedFilephotoName; | ||||
| }, [uploadedFilephotoName]) | }, [uploadedFilephotoName]) | ||||
| const expandedRowRender = (record) => { | const expandedRowRender = (record) => { | ||||
| return ( | return ( | ||||
| <> | <> | ||||
| actionRef={actionRef} | actionRef={actionRef} | ||||
| dataSource={list} | dataSource={list} | ||||
| search={{ span: 8, labelWidth: 'auto' }} | search={{ span: 8, labelWidth: 'auto' }} | ||||
| tableAlertRender={({ | |||||
| selectedRowKeys, | |||||
| selectedRows, | |||||
| onCleanSelected, | |||||
| }) => { | |||||
| setIds(selectedRows) | |||||
| return ( | |||||
| <Space size={24}> | |||||
| <span> | |||||
| 已选 {selectedRows.length} 项 | |||||
| <a style={{ marginInlineStart: 8 }} onClick={onCleanSelected}> | |||||
| 取消选择 | |||||
| </a> | |||||
| </span> | |||||
| </Space> | |||||
| ); | |||||
| }} | |||||
| tableAlertOptionRender={() => { | |||||
| return ( | |||||
| <Space> | |||||
| <Button type="primary" onClick={() => { | |||||
| if (ids.length === 0) { | |||||
| message.error('请选择要操作的数据') | |||||
| } else { | |||||
| setOpenMultieditPreview(true) | |||||
| } | |||||
| }}> | |||||
| 批量管理招聘会 | |||||
| </Button>, | |||||
| <Button type="primary" onClick={() => { | |||||
| Modal.confirm({ | |||||
| title: '批量删除', | |||||
| content: '确定要删除所选的数据吗', | |||||
| onOk() { | |||||
| const promises = ids.map(item => { | |||||
| return PostRecruitmentDel({ id: item.id }); | |||||
| }); | |||||
| // 等待所有请求完成 | |||||
| Promise.all(promises) | |||||
| .then(() => { | |||||
| message.success('批量删除成功'); | |||||
| actionRef.current?.clearSelected(); | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| .catch(error => { | |||||
| console.error('批量删除成功:', error); | |||||
| message.error('批量删除成功'); | |||||
| }); | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '确定', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| }}> | |||||
| 批量删除 | |||||
| </Button>, | |||||
| </Space> | |||||
| ); | |||||
| }} | |||||
| rowSelection={{ | rowSelection={{ | ||||
| type: 'checkbox' | type: 'checkbox' | ||||
| }} | }} | ||||
| dataIndex: 'open_date', | dataIndex: 'open_date', | ||||
| width: 200, | width: 200, | ||||
| search: false | search: false | ||||
| }, { | |||||
| title: '结束时间', | |||||
| dataIndex: 'close_date', | |||||
| width: 200, | |||||
| search: false | |||||
| }, { | }, { | ||||
| title: '开启状态', | title: '开启状态', | ||||
| dataIndex: 'status', | dataIndex: 'status', | ||||
| width: 300, | |||||
| render: (_, record) => (<> | |||||
| <Radio.Group size='small' value={record.status} onChange={async (e) => { | |||||
| actionRef.current?.reload(); | |||||
| }}> | |||||
| <Radio value={1}>已开启</Radio> | |||||
| <Radio value={2}>已关闭</Radio> | |||||
| </Radio.Group> | |||||
| </>), | |||||
| width: 200, | |||||
| valueType: 'select', | valueType: 'select', | ||||
| valueEnum: { | valueEnum: { | ||||
| 0: { text: '全部' }, | 0: { text: '全部' }, | ||||
| 1: { | 1: { | ||||
| text: '已开启', | text: '已开启', | ||||
| status: 'Processing' | |||||
| }, | }, | ||||
| 2: { | 2: { | ||||
| text: '已关闭', | text: '已关闭', | ||||
| status: 'Error' | |||||
| } | } | ||||
| }, | }, | ||||
| }, { | }, { | ||||
| width: 200, | width: 200, | ||||
| search: false, | search: false, | ||||
| render: (_, record) => (<> | render: (_, record) => (<> | ||||
| <Image src={`${Imageprefix}${record.photo}`} width={60} height={60} /> | |||||
| <Image src={`${Imageprefix}${record.photo}`} width={60} height={60} /> | |||||
| </> | </> | ||||
| ) | ) | ||||
| }, | }, | ||||
| setId(record) | setId(record) | ||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | dispatch({ type: 'openModel/getOpenModal', payload: true }) | ||||
| }}>编辑</Button>, | }}>编辑</Button>, | ||||
| <Button size='small' type='link' onClick={() => { | |||||
| <Button size='small' type='link' onClick={() => { | |||||
| Modal.confirm({ | Modal.confirm({ | ||||
| title: '更换图片', | title: '更换图片', | ||||
| content: (<> | content: (<> | ||||
| </ProForm> | </ProForm> | ||||
| </>), | </>), | ||||
| async onOk() { | async onOk() { | ||||
| // let info = await GetCompanyInfo({ id: record.id }); | |||||
| // let res = await updateCompany({ ...info.data, license_path: uploadedFilelicenseNameRef.current }); | |||||
| // setUploadedFilelicenseName(''); | |||||
| let res = await PostRecruitmentUpdate({ ...record, photo: uploadedFilephotoNameRef.current }); | |||||
| setUploadedFilephotoName(''); | |||||
| actionRef.current?.reload(); | actionRef.current?.reload(); | ||||
| }, | }, | ||||
| onCancel() { | onCancel() { | ||||
| setId(record) | setId(record) | ||||
| dispatch({ type: 'openModel/getOpenFairDetailModal', payload: true }) | dispatch({ type: 'openModel/getOpenFairDetailModal', payload: true }) | ||||
| }}>参与企业</Button> | |||||
| }}>参与企业</Button>, | |||||
| <Popconfirm | |||||
| title="是否删除" | |||||
| onConfirm={(e) => { | |||||
| PostRecruitmentDel({ id: record.id }).then(res => { | |||||
| message.success('删除成功') | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| }} | |||||
| okText="删除" | |||||
| cancelText="取消" | |||||
| > | |||||
| <Button danger type='link'>删除</Button> | |||||
| </Popconfirm>, | |||||
| ], | ], | ||||
| }, | }, | ||||
| ]} | ]} | ||||
| setTotal(res.data.total) | setTotal(res.data.total) | ||||
| }) | }) | ||||
| } | } | ||||
| toolBarRender={() => [<Button type="primary" onClick={() => { | |||||
| Modal.confirm({ | |||||
| title: '请选择对批量数据进行何种操作', | |||||
| content: (<> | |||||
| <div>参数:id, status, open_date, close_date</div> | |||||
| <h4 style={{ fontWeight: 'bold' }}>状态:</h4> | |||||
| <Radio.Group size='small' onChange={async (e) => { | |||||
| actionRef.current?.reload(); | |||||
| }}> | |||||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>开启</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>关闭</Radio> | |||||
| </Col> | |||||
| </Row> | |||||
| </Radio.Group> | |||||
| <h4 style={{ fontWeight: 'bold' }}>时长:</h4> | |||||
| <Radio.Group size='small' onChange={async (e) => { | |||||
| actionRef.current?.reload(); | |||||
| }}> | |||||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>1天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>3天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>7天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>15天</Radio> | |||||
| </Col> | |||||
| <Col span={12}> | |||||
| <Radio value={1}>30天</Radio> | |||||
| </Col> | |||||
| </Row> | |||||
| </Radio.Group> | |||||
| </>), | |||||
| onOk() { | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '保存', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| }}> | |||||
| 批量管理招聘会 | |||||
| </Button>, | |||||
| <Button type="primary" onClick={() => { | |||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||||
| }}> | |||||
| 添加招聘会 | |||||
| </Button> | |||||
| toolBarRender={() => [ | |||||
| <Button type="primary" onClick={() => { | |||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||||
| }}> | |||||
| 添加招聘会 | |||||
| </Button> | |||||
| ]} | ]} | ||||
| headerTitle="招聘会列表" | headerTitle="招聘会列表" | ||||
| /> | /> | ||||
| <Modal | |||||
| open={openMultieditPreview} | |||||
| title='请选择对批量数据进行何种操作' | |||||
| centered | |||||
| maskClosable={false} | |||||
| destroyOnClose | |||||
| width={400} | |||||
| onCancel={() => { | |||||
| setOpenMultieditPreview(false) | |||||
| }} | |||||
| onOk={() => { | |||||
| if (status) { | |||||
| const promises = ids.map(item => { | |||||
| return PostRecruitmentUpdate({ ...item, status: status, open_date: startDate ? startDate : '', close_date: endDate ? endDate : '' }); | |||||
| }); | |||||
| // 等待所有请求完成 | |||||
| Promise.all(promises) | |||||
| .then(() => { | |||||
| setOpenMultieditPreview(false); | |||||
| message.success('批量操作成功'); | |||||
| actionRef.current?.clearSelected(); | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| .catch(error => { | |||||
| console.error('批量操作失败:', error); | |||||
| message.error('批量操作失败'); | |||||
| }); | |||||
| } else { | |||||
| message.error('请完成表单') | |||||
| return false | |||||
| } | |||||
| } | |||||
| } | |||||
| > | |||||
| <Flex vertical justify='center' style={{ minHeight: 100 }}> | |||||
| <Space direction='vertical'> | |||||
| <h4 style={{ fontWeight: 'bold' }}>类型:</h4> | |||||
| <Radio.Group size='small' value={status} onChange={(e) => { | |||||
| setStatus(e.target.value) | |||||
| }}> | |||||
| <Radio value={1}>开启</Radio> | |||||
| <Radio value={2}>关闭</Radio> | |||||
| </Radio.Group> | |||||
| { | |||||
| status === 1 && ( | |||||
| <> | |||||
| <h4 style={{ fontWeight: 'bold' }}>活动时间:</h4> | |||||
| <DatePicker.RangePicker showTime format='YYYY-MM-DD HH:mm:ss' onChange={(date, dateString) => { | |||||
| setStartDate(dateString[0]); | |||||
| setEndDate(dateString[1]); | |||||
| }} /> | |||||
| </> | |||||
| ) | |||||
| } | |||||
| </Space> | |||||
| </Flex> | |||||
| </Modal > | |||||
| </ConfigProvider> | </ConfigProvider> | ||||
| </> | </> | ||||
| ); | ); |
| onConfirm={(e) => { | onConfirm={(e) => { | ||||
| delArticle({ id: record.id }).then(res => { | delArticle({ id: record.id }).then(res => { | ||||
| message.success('删除成功') | message.success('删除成功') | ||||
| actionRef.current.reload(); | |||||
| actionRef.current?.reload(); | |||||
| }) | }) | ||||
| }} | }} | ||||
| okText="删除" | okText="删除" | ||||
| cancelText="取消" | cancelText="取消" | ||||
| > | > | ||||
| <Button | |||||
| type='link' | |||||
| key="delete" | |||||
| > | |||||
| 删除 | |||||
| </Button> | |||||
| </Popconfirm> | |||||
| <Button danger type='link'>删除</Button> | |||||
| </Popconfirm>, | |||||
| ], | ], | ||||
| }, | }, | ||||
| ]} | ]} |
| import { | import { | ||||
| ProTable, ProForm | ProTable, ProForm | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { Button, Image, ConfigProvider, Popconfirm, message, Modal,Radio, Row, Col} from 'antd'; | |||||
| import { Button, Image, ConfigProvider, Popconfirm, message, Modal, Radio, Row, Col } from 'antd'; | |||||
| import { listSection, delSection } from '@/apis/api'; | import { listSection, delSection } from '@/apis/api'; | ||||
| import { Imageprefix } from '@/constants'; | import { Imageprefix } from '@/constants'; | ||||
| import UploadModel from '@/components/Common/upload'; | import UploadModel from '@/components/Common/upload'; | ||||
| onConfirm={(e) => { | onConfirm={(e) => { | ||||
| delSection({ id: record.id }).then(res => { | delSection({ id: record.id }).then(res => { | ||||
| message.success('删除成功') | message.success('删除成功') | ||||
| actionRef.current.reload(); | |||||
| actionRef.current?.reload(); | |||||
| }) | }) | ||||
| }} | }} | ||||
| okText="删除" | okText="删除" | ||||
| cancelText="取消" | cancelText="取消" | ||||
| > | > | ||||
| <Button | |||||
| danger | |||||
| type='link' | |||||
| key="delete" | |||||
| > | |||||
| 删除 | |||||
| </Button> | |||||
| <Button danger type='link'>删除</Button> | |||||
| </Popconfirm> | </Popconfirm> | ||||
| ], | ], | ||||
| }, | }, | ||||
| }) | }) | ||||
| } | } | ||||
| headerTitle="栏目/频道" | headerTitle="栏目/频道" | ||||
| toolBarRender={() => [<Button type="primary" onClick={() => { | |||||
| Modal.confirm({ | |||||
| title: '请选择对批量数据进行何种操作', | |||||
| content: (<> | |||||
| <div>参数:id, display</div> | |||||
| <Radio.Group size='small' onChange={async (e) => { | |||||
| actionRef.current?.reload(); | |||||
| }}> | |||||
| <Radio value={1}>可见</Radio> | |||||
| <Radio value={1}>不可见</Radio> | |||||
| </Radio.Group> | |||||
| </>), | |||||
| onOk() { | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '保存', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| }}> | |||||
| 批量管理可见状态 | |||||
| </Button>, | |||||
| <Button type="primary" onClick={() => { | |||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||||
| }}> | |||||
| 添加栏目/频道 | |||||
| </Button> | |||||
| toolBarRender={() => [ | |||||
| <Button type="primary" onClick={() => { | |||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||||
| }}> | |||||
| 添加栏目/频道 | |||||
| </Button> | |||||
| ]} | ]} | ||||
| expandable={{ | expandable={{ | ||||
| childrenColumnName: 'childs', // 指定子节点数据的字段名 | childrenColumnName: 'childs', // 指定子节点数据的字段名 |
| }) | }) | ||||
| } | } | ||||
| headerTitle="简历列表" | headerTitle="简历列表" | ||||
| toolBarRender={() => [ | |||||
| <Button type="primary" onClick={() => { | |||||
| Modal.confirm({ | |||||
| title: '请选择对批量数据进行何种操作', | |||||
| content: (<> | |||||
| <div>参数:id, status</div> | |||||
| <Radio.Group size='small' onChange={async (e) => { | |||||
| actionRef.current?.reload(); | |||||
| }}> | |||||
| <Radio value={1}>开通</Radio> | |||||
| <Radio value={2}>禁用</Radio> | |||||
| </Radio.Group> | |||||
| </>), | |||||
| onOk() { | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '保存', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| }}> | |||||
| 批量管理账号 | |||||
| </Button>, | |||||
| ]} | |||||
| /> | /> | ||||
| </ConfigProvider> | </ConfigProvider> | ||||
| import { | import { | ||||
| ProTable, ProForm, ProFormSelect, ProFormText, ProFormDependency | ProTable, ProForm, ProFormSelect, ProFormText, ProFormDependency | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { Button, ConfigProvider, Image, message, Modal, Input, Row, Col, Space, Radio, Descriptions } from 'antd'; | |||||
| import { Button, ConfigProvider, Image, message, Modal, Input, Row, Flex, Space, Radio, Descriptions } from 'antd'; | |||||
| import { PostJobseekerList, PostJobseekerExport, PostJobapplicantUpdate } from '@/apis/api'; | import { PostJobseekerList, PostJobseekerExport, PostJobapplicantUpdate } from '@/apis/api'; | ||||
| import { Imageprefix } from '@/constants'; | import { Imageprefix } from '@/constants'; | ||||
| import DragUpload from '@/components/Common/dragupload'; | import DragUpload from '@/components/Common/dragupload'; | ||||
| const [total, setTotal] = useState<number>(0) | const [total, setTotal] = useState<number>(0) | ||||
| const [page, setPage] = useState<number>(1) | const [page, setPage] = useState<number>(1) | ||||
| const [pageSize, setPageSize] = useState<number>(10) | const [pageSize, setPageSize] = useState<number>(10) | ||||
| const [openMultieditPreview, setOpenMultieditPreview] = useState(false); | |||||
| const [ids, setIds] = useState<number[]>([]) | |||||
| const [status, setStatus] = useState<number>(2) | |||||
| const [auditMemo, setAuditMemo] = useState<string>('') | |||||
| const setId = (id: number) => { | const setId = (id: number) => { | ||||
| getId(id) | getId(id) | ||||
| actionRef={actionRef} | actionRef={actionRef} | ||||
| dataSource={list} | dataSource={list} | ||||
| search={{ span: 8, labelWidth: 'auto' }} | search={{ span: 8, labelWidth: 'auto' }} | ||||
| tableAlertRender={({ | |||||
| selectedRowKeys, | |||||
| selectedRows, | |||||
| onCleanSelected, | |||||
| }) => { | |||||
| setIds(selectedRows) | |||||
| return ( | |||||
| <Space size={24}> | |||||
| <span> | |||||
| 已选 {selectedRows.length} 项 | |||||
| <a style={{ marginInlineStart: 8 }} onClick={onCleanSelected}> | |||||
| 取消选择 | |||||
| </a> | |||||
| </span> | |||||
| </Space> | |||||
| ); | |||||
| }} | |||||
| tableAlertOptionRender={() => { | |||||
| return ( | |||||
| <Space size={16}> | |||||
| <Button type="primary" onClick={(record) => { | |||||
| if (ids.length === 0) { | |||||
| message.error('请选择要操作的数据') | |||||
| } else { | |||||
| setOpenMultieditPreview(true) | |||||
| } | |||||
| }}> | |||||
| 批量审核 | |||||
| </Button>, | |||||
| </Space> | |||||
| ); | |||||
| }} | |||||
| rowSelection={{ | rowSelection={{ | ||||
| type: 'checkbox' | type: 'checkbox' | ||||
| }} | }} | ||||
| setTotal(res.data.total) | setTotal(res.data.total) | ||||
| }) | }) | ||||
| } | } | ||||
| toolBarRender={() => [<Button type="primary" onClick={(record) => { | |||||
| Modal.confirm({ | |||||
| title: '请选择对批量数据审核', | |||||
| content: (<> | |||||
| <Space direction='vertical' style={{ width: '100%', padding: 20 }}> | |||||
| <div>参数:id, customer_id, status, audit_memo</div> | |||||
| <Radio.Group size='small' onChange={async (e) => { | |||||
| actionRef.current?.reload(); | |||||
| }}> | |||||
| <Radio value={2}>通过</Radio> | |||||
| <Radio value={3}>不通过</Radio> | |||||
| </Radio.Group> | |||||
| <h4>如不通过请输入原因,按回车键保存,也可不填</h4> | |||||
| <Input style={{ width: '100%' }} placeholder='此处不通过原因' defaultValue={record.status_txt} onPressEnter={async (e) => { | |||||
| let res = await PostJobapplicantUpdate({ customer_id: record.customer_id, id: record.id, status: 3, audit_memo: e.target.value }); | |||||
| actionRef.current?.reload(); | |||||
| }}></Input> | |||||
| </Space> | |||||
| </>), | |||||
| onOk() { | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '保存', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| }}> | |||||
| 批量审核 | |||||
| </Button>, | |||||
| <Button type="primary" onClick={() => { | |||||
| message.info('数据导出需要时间,请耐心等待') | |||||
| PostJobseekerExport().then(res => { | |||||
| let url = Imageprefix + res.data.excel_url; | |||||
| window.open(url); | |||||
| message.info('数据导出完毕') | |||||
| }) | |||||
| }}> | |||||
| 导出数据 | |||||
| </Button>, | |||||
| <Button type="primary" onClick={() => { | |||||
| Modal.confirm({ | |||||
| title: '导入文件', | |||||
| content: (<> | |||||
| <DragUpload form_name="doc_url" uploadTxt="导入文件"></DragUpload> | |||||
| </>), | |||||
| onOk() { | |||||
| toolBarRender={() => [ | |||||
| <Button type="primary" onClick={() => { | |||||
| message.info('数据导出需要时间,请耐心等待') | |||||
| PostJobseekerExport().then(res => { | |||||
| let url = Imageprefix + res.data.excel_url; | |||||
| window.open(url); | |||||
| message.info('数据导出完毕') | |||||
| }) | |||||
| }}> | |||||
| 导出数据 | |||||
| </Button>, | |||||
| <Button type="primary" onClick={() => { | |||||
| Modal.confirm({ | |||||
| title: '导入文件', | |||||
| content: (<> | |||||
| <DragUpload form_name="doc_url" uploadTxt="导入文件"></DragUpload> | |||||
| </>), | |||||
| onOk() { | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '确定', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| }}> | |||||
| 导入数据 | |||||
| </Button >, | |||||
| }, | |||||
| onCancel() { | |||||
| console.log('Cancel'); | |||||
| }, | |||||
| okText: '确定', | |||||
| cancelText: '取消', | |||||
| centered: true | |||||
| }); | |||||
| }}> | |||||
| 导入数据 | |||||
| </Button >, | |||||
| ]} | ]} | ||||
| headerTitle="简历列表" | headerTitle="简历列表" | ||||
| /> | /> | ||||
| <Modal | |||||
| open={openMultieditPreview} | |||||
| title='请选择对批量数据进行何种操作' | |||||
| centered | |||||
| maskClosable={false} | |||||
| destroyOnClose | |||||
| width={400} | |||||
| onCancel={() => { | |||||
| setOpenMultieditPreview(false) | |||||
| }} | |||||
| onOk={async () => { | |||||
| if (status) { | |||||
| const promises = ids.map(item => { | |||||
| return PostJobapplicantUpdate({ id: item.id, customer_id: item.customer_id, status: status, audit_memo: auditMemo }); | |||||
| }); | |||||
| // 等待所有请求完成 | |||||
| Promise.all(promises) | |||||
| .then(() => { | |||||
| setOpenMultieditPreview(false); | |||||
| message.success('批量操作成功'); | |||||
| actionRef.current?.clearSelected(); | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| .catch(error => { | |||||
| console.error('批量操作失败:', error); | |||||
| message.error('批量操作失败'); | |||||
| }); | |||||
| } else { | |||||
| message.error('请完成表单') | |||||
| return false | |||||
| } | |||||
| } | |||||
| } | |||||
| > | |||||
| <Flex vertical justify='center' style={{ minHeight: 100 }}> | |||||
| <Space direction='vertical'> | |||||
| <h4 style={{ fontWeight: 'bold' }}>状态:</h4> | |||||
| <Radio.Group size='small' value={status} onChange={(e) => { | |||||
| setStatus(e.target.value) | |||||
| }}> | |||||
| <Radio value={1}>待审核</Radio> | |||||
| <Radio value={2}>审核通过</Radio> | |||||
| <Radio value={3}>审核不通过</Radio> | |||||
| </Radio.Group> | |||||
| { | |||||
| status === 3 && ( | |||||
| <> | |||||
| <h4>如不通过请输入原因,按回车键保存,也可不填</h4> | |||||
| <Input style={{ width: '100%' }} placeholder='此处不通过原因' onChange={(e) => { | |||||
| setAuditMemo(e.target.value) | |||||
| }}></Input> | |||||
| </> | |||||
| ) | |||||
| } | |||||
| </Space> | |||||
| </Flex> | |||||
| </Modal > | |||||
| </ConfigProvider> | </ConfigProvider> | ||||
| </> | </> |
| import { | import { | ||||
| ProTable, TableDropdown | ProTable, TableDropdown | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { Button, Image, ConfigProvider, Tag } from 'antd'; | |||||
| import { Button, Image, ConfigProvider, Popconfirm } from 'antd'; | |||||
| import { getAccount } from '@/apis/api'; | import { getAccount } from '@/apis/api'; | ||||
| import { Imageprefix } from '@/constants'; | import { Imageprefix } from '@/constants'; | ||||
| setId(record.id) | setId(record.id) | ||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | dispatch({ type: 'openModel/getOpenModal', payload: true }) | ||||
| }}>编辑</Button>, | }}>编辑</Button>, | ||||
| <Button key='2' type='link' onClick={() => { | |||||
| }}>删除</Button> | |||||
| <Popconfirm | |||||
| title="是否删除" | |||||
| onConfirm={(e) => { | |||||
| PostActivityaddressDel({ id: record.id }).then(res => { | |||||
| message.success('删除成功') | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| }} | |||||
| okText="删除" | |||||
| cancelText="取消" | |||||
| > | |||||
| <Button danger type='link'>删除</Button> | |||||
| </Popconfirm> | |||||
| ], | ], | ||||
| }, | }, | ||||
| ]} | ]} |
| import { | import { | ||||
| ProTable, TableDropdown | ProTable, TableDropdown | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { Button, Image, ConfigProvider, Tag, Badge } from 'antd'; | |||||
| import { Button, Image, ConfigProvider, Popconfirm, Badge } from 'antd'; | |||||
| import { getPermissionListWithchilds } from '@/apis/api'; | import { getPermissionListWithchilds } from '@/apis/api'; | ||||
| import { Imageprefix } from '@/constants'; | import { Imageprefix } from '@/constants'; | ||||
| search: false, | search: false, | ||||
| width: 200, | width: 200, | ||||
| }, | }, | ||||
| { | |||||
| { | |||||
| title: '上级菜单id', | title: '上级菜单id', | ||||
| dataIndex: 'parent_id', | dataIndex: 'parent_id', | ||||
| search: false, | search: false, | ||||
| width: 200, | width: 200, | ||||
| render: (_, record) => (<> | render: (_, record) => (<> | ||||
| {record.parent_id == -1 ? <Badge status="processing" text='顶级菜单' /> : <Badge status="error" text={record.parent_id}/> } | |||||
| {record.parent_id == -1 ? <Badge status="processing" text='顶级菜单' /> : <Badge status="error" text={record.parent_id} />} | |||||
| </> | </> | ||||
| ) | ) | ||||
| }, { | }, { | ||||
| setId(record) | setId(record) | ||||
| dispatch({ type: 'openModel/getOpenParentModal', payload: true }) | dispatch({ type: 'openModel/getOpenParentModal', payload: true }) | ||||
| }}>更换父级</Button>, | }}>更换父级</Button>, | ||||
| <Button key='4' type='link' onClick={() => { | |||||
| }}>删除</Button>, | |||||
| <Popconfirm | |||||
| title="是否删除" | |||||
| onConfirm={(e) => { | |||||
| PostActivityaddressDel({ id: record.id }).then(res => { | |||||
| message.success('删除成功') | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| }} | |||||
| okText="删除" | |||||
| cancelText="取消" | |||||
| > | |||||
| <Button danger type='link'>删除</Button> | |||||
| </Popconfirm> | |||||
| ], | ], | ||||
| }, | }, | ||||
| ]} | ]} |
| import { | import { | ||||
| ProTable, TableDropdown | ProTable, TableDropdown | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { Button, Image, ConfigProvider, Tag } from 'antd'; | |||||
| import { Button, Image, ConfigProvider, Popconfirm } from 'antd'; | |||||
| import { GetRoleList } from '@/apis/api'; | import { GetRoleList } from '@/apis/api'; | ||||
| import { Imageprefix } from '@/constants'; | import { Imageprefix } from '@/constants'; | ||||
| setId(record.id) | setId(record.id) | ||||
| dispatch({ type: 'openModel/getOpenDispenseModal', payload: true }) | dispatch({ type: 'openModel/getOpenDispenseModal', payload: true }) | ||||
| }}>分配权限</Button>, | }}>分配权限</Button>, | ||||
| <Button key='3' type='link' onClick={() => { | |||||
| }}>删除</Button> | |||||
| <Popconfirm | |||||
| title="是否删除" | |||||
| onConfirm={(e) => { | |||||
| PostActivityaddressDel({ id: record.id }).then(res => { | |||||
| message.success('删除成功') | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| }} | |||||
| okText="删除" | |||||
| cancelText="取消" | |||||
| > | |||||
| <Button danger type='link'>删除</Button> | |||||
| </Popconfirm> | |||||
| ], | ], | ||||
| }, | }, | ||||
| ]} | ]} |
| import { | import { | ||||
| ProTable, TableDropdown | ProTable, TableDropdown | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { Button, Image, ConfigProvider, Tag } from 'antd'; | |||||
| import { Button, Image, ConfigProvider, Popconfirm } from 'antd'; | |||||
| import { GetDictList } from '@/apis/api'; | import { GetDictList } from '@/apis/api'; | ||||
| import { Imageprefix } from '@/constants'; | import { Imageprefix } from '@/constants'; | ||||
| useEffect(() => { | useEffect(() => { | ||||
| if (!openModel.openModal) { | if (!openModel.openModal) { | ||||
| actionRef.current.reload(); | |||||
| actionRef.current?.reload(); | |||||
| } | } | ||||
| }, [openModel.openModal]) | }, [openModel.openModal]) | ||||
| 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>, | |||||
| <Popconfirm | |||||
| title="是否删除" | |||||
| onConfirm={(e) => { | |||||
| PostActivityaddressDel({ id: record.id }).then(res => { | |||||
| message.success('删除成功') | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| }} | |||||
| okText="删除" | |||||
| cancelText="取消" | |||||
| > | |||||
| <Button danger type='link'>删除</Button> | |||||
| </Popconfirm> | |||||
| ], | ], | ||||
| }, | }, | ||||
| ]} | ]} |
| import { | import { | ||||
| ProTable, TableDropdown | ProTable, TableDropdown | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { Button, Image, ConfigProvider, Typography } from 'antd'; | |||||
| import { Button, Image, ConfigProvider, Popconfirm } from 'antd'; | |||||
| import { GetSysconfigList } from '@/apis/api'; | import { GetSysconfigList } from '@/apis/api'; | ||||
| import { Imageprefix } from '@/constants'; | import { Imageprefix } from '@/constants'; | ||||
| import he from 'he'; | import he from 'he'; | ||||
| setId(record.id) | setId(record.id) | ||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | dispatch({ type: 'openModel/getOpenModal', payload: true }) | ||||
| }}>编辑</Button>, | }}>编辑</Button>, | ||||
| <Button key='2' type='link' onClick={() => { | |||||
| }}>删除</Button> | |||||
| <Popconfirm | |||||
| title="是否删除" | |||||
| onConfirm={(e) => { | |||||
| PostActivityaddressDel({ id: record.id }).then(res => { | |||||
| message.success('删除成功') | |||||
| actionRef.current?.reload(); | |||||
| }) | |||||
| }} | |||||
| okText="删除" | |||||
| cancelText="取消" | |||||
| > | |||||
| <Button danger type='link'>删除</Button> | |||||
| </Popconfirm> | |||||
| ], | ], | ||||
| }, | }, | ||||
| ]} | ]} |