@@ -8,6 +8,6 @@ | |||
</head> | |||
<body> | |||
<div id="root"></div> | |||
<script src="/umi.d33b65e9.js"></script> | |||
<script src="/umi.1ea9be75.js"></script> | |||
</body> | |||
</html> |
@@ -0,0 +1 @@ | |||
"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)}}]); |
@@ -50,17 +50,26 @@ export const GetCompanyVipInfo = GetModel(url.companyVipInfo); | |||
export const PostCompanyMultiClose = PostModel(url.companyMultiClose); | |||
export const PostCompanyMultiOpen = PostModel(url.companyMultiOpen); | |||
export const PostCompanyFeechange = PostModel(url.companyFeechange); | |||
export const PostCompanyMultiopenvip = PostModel(url.CompanyMultiopenvip); | |||
export const PostCompanyEdit = PostModel(url.companyEdit); | |||
export const PostCompanyViplist = GetModel(url.companyViplist); | |||
export const PostCompanyJobAdd = PostModel(url.companyJobAdd); | |||
export const PostcompanyJobDel = PostModel(url.companyJobDel); | |||
export const PostCompanyJobEdit = PostModel(url.companyJobEdit); | |||
export const GetCompanyJobList = GetModel(url.companyJobList); | |||
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 PostcompanyDepartmentDel= PostModel(url.companyDepartmentDel); | |||
export const PostCompanyDepartmentEdit = PostModel(url.companyDepartmentEdit); | |||
export const GetCompanyDepartmentList = GetModel(url.CompanyDepartmentList); | |||
export const GetCompanyDepartmentInfo = GetModel(url.companyDepartmentInfo); | |||
export const PostcompanyDepartmentsDel = PostModel(url.companyDepartmentsDel); | |||
// 类型 | |||
export const PostHousekeepingtypeAdd = PostModel(url.HousekeepingtypeAdd); |
@@ -37,19 +37,25 @@ declare namespace urlType { | |||
companyEdit: String, | |||
companyVipmanage: String, | |||
companyViplist: String, | |||
CompanyMultiopenvip: String, | |||
companyJobAdd: String, | |||
companyJobEdit: String, | |||
companyJobDel: String, | |||
companyJobList: String, | |||
companyJobInfo: String, | |||
companymMultieditPulishJob: String, | |||
companymMultieditstatusjob: String, | |||
CompanyRecruiters: String, | |||
CompanyTurnJobseeker: String, | |||
CompanyMultieditstatus: String, | |||
companyDepartmentAdd: String, | |||
companyDepartmentDel: String, | |||
companyDepartmentEdit: String, | |||
CompanyDepartmentList: String, | |||
companyDepartmentInfo: String, | |||
companyDepartmentsDel: String, | |||
// 类型 | |||
HousekeepingtypeAdd: String, | |||
HousekeepingtypeDel: String, |
@@ -43,17 +43,25 @@ export const url: urlType.url = { | |||
companyViplist: admin + '/company/viplist', | |||
companyJobAdd: admin + '/company/job_add', | |||
companyJobDel: admin + '/company/job_del', | |||
companyJobEdit: admin + '/company/job_edit', | |||
companyJobList: admin + '/company/job_list', | |||
companyJobInfo: admin + '/company/job_info', | |||
companymMultieditPulishJob: admin + '/company/multieditpulishjob', | |||
companymMultieditstatusjob: admin + '/company/multieditstatusjob', | |||
CompanyRecruiters: admin + '/company/recruiters', | |||
CompanyTurnJobseeker: admin + '/company/turn_jobseeker', | |||
CompanyMultieditstatus: admin + '/company/multieditstatus', | |||
companyDepartmentAdd: admin + '/company/department_add', | |||
companyDepartmentDel: admin + '/company/department_del', | |||
companyDepartmentEdit: admin + '/company/department_edit', | |||
CompanyDepartmentList: admin + '/company/department_list', | |||
companyDepartmentInfo: admin + '/company/department_info', | |||
companyDepartmentsDel: admin + '/company/departments_del', | |||
CompanyMultiopenvip: admin + '/company/multiopenvip', | |||
// 家政 | |||
// 类型 | |||
HousekeepingtypeAdd: admin + '/housekeepingtype/add', |
@@ -106,17 +106,13 @@ const PagesMainActivityListTable: React.FC = ({ dispatch, openModel, getId }: an | |||
onConfirm={(e) => { | |||
PostActivityaddressDel({ id: record.id }).then(res => { | |||
message.success('删除成功') | |||
actionRef.current.reload(); | |||
actionRef.current?.reload(); | |||
}) | |||
}} | |||
okText="删除" | |||
cancelText="取消" | |||
> | |||
<a | |||
key="delete" | |||
> | |||
删除 | |||
</a> | |||
<Button danger type='link'>删除</Button> | |||
</Popconfirm> | |||
], | |||
}, |
@@ -4,7 +4,7 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
import { | |||
ProTable, TableDropdown | |||
} 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'; | |||
const PagesMainAdvertisementListTable: React.FC = ({ dispatch, openModel, getId }: any) => { | |||
@@ -88,9 +88,19 @@ const PagesMainAdvertisementListTable: React.FC = ({ dispatch, openModel, getId | |||
setId(record.id) | |||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
}}>编辑</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> | |||
], | |||
}, | |||
]} |
@@ -149,23 +149,42 @@ const PagesMainAdvertisementPutinTable: React.FC = ({ dispatch, openModel, getId | |||
setId(record.id) | |||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
}}>编辑</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 | |||
title="是否删除" | |||
onConfirm={(e) => { | |||
PostAdvertscheduleDel({ id: record.id }).then(res => { | |||
message.success('删除成功') | |||
actionRef.current.reload(); | |||
actionRef.current?.reload(); | |||
}) | |||
}} | |||
okText="删除" | |||
cancelText="取消" | |||
> | |||
<a | |||
key="delete" | |||
> | |||
删除 | |||
</a> | |||
<Button danger type='link'>删除</Button> | |||
</Popconfirm> | |||
], | |||
}, | |||
]} |
@@ -5,8 +5,8 @@ import type { ActionType } from '@ant-design/pro-components'; | |||
import { | |||
ProTable, ProFormSelect | |||
} 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 PagesMainCompanyDepartmentTable: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
const actionRef = useRef<ActionType>(); | |||
@@ -15,6 +15,8 @@ const PagesMainCompanyDepartmentTable: React.FC = ({ dispatch, getId, openModel | |||
const [page, setPage] = useState<number>(1) | |||
const [pageSize, setPageSize] = useState<number>(10) | |||
const [companyId, setCompanyId] = useState<number>(0); | |||
const [ids, setIds] = useState<number[]>([]) | |||
const setId = (id: number) => { | |||
getId(id) | |||
} | |||
@@ -42,6 +44,12 @@ const PagesMainCompanyDepartmentTable: React.FC = ({ dispatch, getId, openModel | |||
colorPrimary: '#4FBE70', | |||
colorLink: '#4FBE70', | |||
}, | |||
components: { | |||
Modal: { | |||
colorPrimary: '#4FBE70', | |||
} | |||
} | |||
}} | |||
> | |||
@@ -53,6 +61,52 @@ const PagesMainCompanyDepartmentTable: React.FC = ({ dispatch, getId, openModel | |||
actionRef={actionRef} | |||
dataSource={list} | |||
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={{ | |||
type: 'checkbox' | |||
}} | |||
@@ -134,10 +188,20 @@ const PagesMainCompanyDepartmentTable: React.FC = ({ dispatch, getId, openModel | |||
setId(record.id) | |||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
}}>编辑</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>, | |||
], | |||
}, | |||
]} | |||
@@ -178,28 +242,12 @@ const PagesMainCompanyDepartmentTable: React.FC = ({ dispatch, getId, openModel | |||
actionRef.current?.reload(); | |||
}} | |||
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>, | |||
]} | |||
/> | |||
@@ -1,4 +1,8 @@ | |||
import { useRef, useState, useEffect } from 'react'; | |||
import { connect, history, Link } from '@umijs/max'; | |||
import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
@@ -6,7 +10,7 @@ import { | |||
ProTable, ProFormRadio, ProForm | |||
} 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 { Imageprefix } from '@/constants'; | |||
@@ -22,8 +26,9 @@ const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any | |||
const [page, setPage] = useState<number>(1) | |||
const [pageSize, setPageSize] = useState<number>(10) | |||
const [expandedRowKeys, setExpandedRowKeys] = useState<string[]>([]) | |||
const [openMultieditPreview, setOpenMultieditPreview] = useState(false); | |||
const [ids, setIds] = useState<number[]>([]) | |||
const [status, setStatus] = useState<number>(0) | |||
const [status, setStatus] = useState<number>(1) | |||
@@ -209,11 +214,40 @@ const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any | |||
actionRef={actionRef} | |||
dataSource={list} | |||
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={{ | |||
type: 'checkbox', | |||
onChange: (selectedRowKeys, selectedRows) => { | |||
setIds(selectedRowKeys) | |||
}, | |||
type: 'checkbox' | |||
}} | |||
expandable={{ | |||
expandedRowRender | |||
@@ -397,68 +431,7 @@ const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any | |||
} | |||
headerTitle="企业列表" | |||
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={() => { | |||
message.info('数据导出需要时间,请耐心等待') | |||
PostCompanyExport().then(res => { | |||
@@ -499,6 +472,68 @@ const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any | |||
</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 > | |||
</> | |||
); |
@@ -4,8 +4,8 @@ import type { ActionType } from '@ant-design/pro-components'; | |||
import { | |||
ProTable, ProFormSelect | |||
} 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'; | |||
const selectfieldNames = { label: 'full_name', value: 'id' }; | |||
const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
@@ -16,6 +16,12 @@ const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any | |||
const [pageSize, setPageSize] = useState<number>(10) | |||
const [companyId, setCompanyId] = useState<number>(0); | |||
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) => { | |||
getId(id) | |||
} | |||
@@ -33,7 +39,25 @@ const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any | |||
}; | |||
}, [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 ( | |||
<> | |||
@@ -42,7 +66,6 @@ const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any | |||
token: { | |||
colorPrimary: '#4FBE70', | |||
colorLink: '#4FBE70', | |||
} | |||
}} | |||
> | |||
@@ -54,6 +77,81 @@ const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any | |||
actionRef={actionRef} | |||
dataSource={list} | |||
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={{ | |||
type: 'checkbox' | |||
}} | |||
@@ -167,11 +265,26 @@ const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any | |||
title: '操作', | |||
key: 'option', | |||
valueType: 'option', | |||
width: 200, | |||
render: (_, record, action) => [ | |||
<Button key='1' type='link' onClick={() => { | |||
setId(record.id) | |||
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>, | |||
], | |||
}, | |||
]} | |||
@@ -217,112 +330,111 @@ const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any | |||
}} | |||
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> | |||
</> |
@@ -4,8 +4,8 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
import { | |||
ProTable | |||
} 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'; | |||
@@ -18,7 +18,11 @@ const CompanyListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
const [page, setPage] = useState<number>(1) | |||
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 [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) => { | |||
getId(id) | |||
} | |||
@@ -43,6 +47,31 @@ const CompanyListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
} | |||
}, [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) => { | |||
return ( | |||
<> | |||
@@ -59,6 +88,9 @@ const CompanyListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
); | |||
}; | |||
return ( | |||
<> | |||
<ConfigProvider | |||
@@ -67,6 +99,12 @@ const CompanyListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
colorPrimary: '#4FBE70', | |||
colorLink: '#4FBE70', | |||
}, | |||
components: { | |||
Modal: { | |||
colorPrimary: '#4FBE70', | |||
} | |||
} | |||
}} | |||
> | |||
@@ -78,6 +116,38 @@ const CompanyListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
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={() => { | |||
return ( | |||
<Space size={16}> | |||
<Button type="primary" onClick={() => { | |||
if (ids.length === 0) { | |||
message.error('请选择要操作的数据') | |||
} else { | |||
setOpenMultieditPreview(true) | |||
} | |||
}}> | |||
批量开通会员 | |||
</Button>, | |||
</Space> | |||
); | |||
}} | |||
rowSelection={{ | |||
type: 'checkbox' | |||
}} | |||
@@ -213,76 +283,54 @@ const CompanyListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
actionRef.current?.reload(); | |||
}} | |||
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> | |||
</> | |||
); |
@@ -4,9 +4,9 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
import { | |||
ProTable, ProForm | |||
} 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 { listRecruitment, GetRecruitmentDetail } from '@/apis/api'; | |||
import { listRecruitment, GetRecruitmentDetail, PostRecruitmentUpdate, PostRecruitmentDel } from '@/apis/api'; | |||
import UploadModel from '@/components/Common/upload'; | |||
@@ -17,7 +17,11 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
const [total, setTotal] = useState<number>(0) | |||
const [page, setPage] = useState<number>(1) | |||
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) => { | |||
getId(id) | |||
} | |||
@@ -38,7 +42,6 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
uploadedFilephotoNameRef.current = uploadedFilephotoName; | |||
}, [uploadedFilephotoName]) | |||
const expandedRowRender = (record) => { | |||
return ( | |||
<> | |||
@@ -73,6 +76,70 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
actionRef={actionRef} | |||
dataSource={list} | |||
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={{ | |||
type: 'checkbox' | |||
}} | |||
@@ -98,27 +165,27 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
dataIndex: 'open_date', | |||
width: 200, | |||
search: false | |||
}, { | |||
title: '结束时间', | |||
dataIndex: 'close_date', | |||
width: 200, | |||
search: false | |||
}, { | |||
title: '开启状态', | |||
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', | |||
valueEnum: { | |||
0: { text: '全部' }, | |||
1: { | |||
text: '已开启', | |||
status: 'Processing' | |||
}, | |||
2: { | |||
text: '已关闭', | |||
status: 'Error' | |||
} | |||
}, | |||
}, { | |||
@@ -127,7 +194,7 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
width: 200, | |||
search: false, | |||
render: (_, record) => (<> | |||
<Image src={`${Imageprefix}${record.photo}`} width={60} height={60} /> | |||
<Image src={`${Imageprefix}${record.photo}`} width={60} height={60} /> | |||
</> | |||
) | |||
}, | |||
@@ -140,7 +207,7 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
setId(record) | |||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
}}>编辑</Button>, | |||
<Button size='small' type='link' onClick={() => { | |||
<Button size='small' type='link' onClick={() => { | |||
Modal.confirm({ | |||
title: '更换图片', | |||
content: (<> | |||
@@ -149,9 +216,8 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
</ProForm> | |||
</>), | |||
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(); | |||
}, | |||
onCancel() { | |||
@@ -171,7 +237,20 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
setId(record) | |||
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>, | |||
], | |||
}, | |||
]} | |||
@@ -204,69 +283,77 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
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="招聘会列表" | |||
/> | |||
<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> | |||
</> | |||
); |
@@ -182,19 +182,15 @@ const PagesMainInformationArticleTable: React.FC = ({ dispatch, openModel, getId | |||
onConfirm={(e) => { | |||
delArticle({ id: record.id }).then(res => { | |||
message.success('删除成功') | |||
actionRef.current.reload(); | |||
actionRef.current?.reload(); | |||
}) | |||
}} | |||
okText="删除" | |||
cancelText="取消" | |||
> | |||
<Button | |||
type='link' | |||
key="delete" | |||
> | |||
删除 | |||
</Button> | |||
</Popconfirm> | |||
<Button danger type='link'>删除</Button> | |||
</Popconfirm>, | |||
], | |||
}, | |||
]} |
@@ -4,7 +4,7 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
import { | |||
ProTable, ProForm | |||
} 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 { Imageprefix } from '@/constants'; | |||
import UploadModel from '@/components/Common/upload'; | |||
@@ -146,19 +146,13 @@ const PagesMainInformationSectionTable: React.FC = ({ dispatch, openModel, getId | |||
onConfirm={(e) => { | |||
delSection({ id: record.id }).then(res => { | |||
message.success('删除成功') | |||
actionRef.current.reload(); | |||
actionRef.current?.reload(); | |||
}) | |||
}} | |||
okText="删除" | |||
cancelText="取消" | |||
> | |||
<Button | |||
danger | |||
type='link' | |||
key="delete" | |||
> | |||
删除 | |||
</Button> | |||
<Button danger type='link'>删除</Button> | |||
</Popconfirm> | |||
], | |||
}, | |||
@@ -193,38 +187,12 @@ const PagesMainInformationSectionTable: React.FC = ({ dispatch, openModel, getId | |||
}) | |||
} | |||
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={{ | |||
childrenColumnName: 'childs', // 指定子节点数据的字段名 |
@@ -154,34 +154,7 @@ const PagesMainJobseekerAccountTable: React.FC = ({ dispatch, getId, dictModel, | |||
}) | |||
} | |||
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> | |||
@@ -4,7 +4,7 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
import { | |||
ProTable, ProForm, ProFormSelect, ProFormText, ProFormDependency | |||
} 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 { Imageprefix } from '@/constants'; | |||
import DragUpload from '@/components/Common/dragupload'; | |||
@@ -24,6 +24,11 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
const [total, setTotal] = useState<number>(0) | |||
const [page, setPage] = useState<number>(1) | |||
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) => { | |||
getId(id) | |||
@@ -108,6 +113,38 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
actionRef={actionRef} | |||
dataSource={list} | |||
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={{ | |||
type: 'checkbox' | |||
}} | |||
@@ -319,72 +356,101 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
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="简历列表" | |||
/> | |||
<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> | |||
</> |
@@ -4,7 +4,7 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
import { | |||
ProTable, TableDropdown | |||
} 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 { Imageprefix } from '@/constants'; | |||
@@ -74,9 +74,19 @@ const PagesPermissionAccountTable: React.FC = ({ dispatch, openModel, getId }: a | |||
setId(record.id) | |||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
}}>编辑</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> | |||
], | |||
}, | |||
]} |
@@ -4,7 +4,7 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
import { | |||
ProTable, TableDropdown | |||
} 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 { Imageprefix } from '@/constants'; | |||
@@ -93,13 +93,13 @@ const PagesPermissionListTable: React.FC = ({ dispatch, openModel, getId }: any) | |||
search: false, | |||
width: 200, | |||
}, | |||
{ | |||
{ | |||
title: '上级菜单id', | |||
dataIndex: 'parent_id', | |||
search: false, | |||
width: 200, | |||
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} />} | |||
</> | |||
) | |||
}, { | |||
@@ -126,9 +126,19 @@ const PagesPermissionListTable: React.FC = ({ dispatch, openModel, getId }: any) | |||
setId(record) | |||
dispatch({ type: 'openModel/getOpenParentModal', payload: true }) | |||
}}>更换父级</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> | |||
], | |||
}, | |||
]} |
@@ -4,7 +4,7 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
import { | |||
ProTable, TableDropdown | |||
} 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 { Imageprefix } from '@/constants'; | |||
@@ -76,9 +76,20 @@ const PagesPermissionRoleTable: React.FC = ({ dispatch, openModel, getId }: any) | |||
setId(record.id) | |||
dispatch({ type: 'openModel/getOpenDispenseModal', payload: true }) | |||
}}>分配权限</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> | |||
], | |||
}, | |||
]} |
@@ -4,7 +4,7 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
import { | |||
ProTable, TableDropdown | |||
} 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 { Imageprefix } from '@/constants'; | |||
@@ -21,7 +21,7 @@ const PagesSettingDictionaryTable: React.FC = ({ dispatch, openModel, getId }: a | |||
useEffect(() => { | |||
if (!openModel.openModal) { | |||
actionRef.current.reload(); | |||
actionRef.current?.reload(); | |||
} | |||
}, [openModel.openModal]) | |||
@@ -73,9 +73,19 @@ const PagesSettingDictionaryTable: React.FC = ({ dispatch, openModel, getId }: a | |||
setId(record) | |||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
}}>添加下级字典</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> | |||
], | |||
}, | |||
]} |
@@ -4,7 +4,7 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
import { | |||
ProTable, TableDropdown | |||
} 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 { Imageprefix } from '@/constants'; | |||
import he from 'he'; | |||
@@ -74,9 +74,19 @@ const PagesSettingSystemTable: React.FC = ({ dispatch, openModel, getId }: any) | |||
setId(record.id) | |||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
}}>编辑</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> | |||
], | |||
}, | |||
]} |