diff --git a/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx b/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx index 825e7fe..88734e0 100644 --- a/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx +++ b/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx @@ -21,6 +21,7 @@ const employeeInformation = (props) => { const [setup, setSetup] = useState(false);//表格设置是否显现 const [setupp, setSetupp] = useState([]);//实际显示的表格列表 const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 + const [order, setOrder] = useState({ orderBy: 'hiredate', orderDirection: 'DESC' }); //页码信息 const [limits, setLimits] = useState()//每页实际条数 const [downloadUrl, setDownloadUrl] = useState('')//下载pdf const EMPLOYEEINFORMATION = "employeeInformation"; @@ -84,7 +85,7 @@ const employeeInformation = (props) => { }, []) useEffect(() => { getMemberSearchList()//查询人员列表 - }, [query]) + }, [query, order]) function getMemberSearchList () {//查询人员列表 @@ -97,7 +98,7 @@ const employeeInformation = (props) => { obj.hiredateStart = '' obj.hiredateEnd = '' } - dispatch(humanAffairs.getMemberList({ ...obj, ...query })).then((res) => {//查询人员列表 + dispatch(humanAffairs.getMemberList({ ...obj, ...query, ...order })).then((res) => {//查询人员列表 if (res.success) { setArchivesList(res.payload?.data?.rows) setLimits(res.payload?.data?.count) @@ -121,13 +122,15 @@ const employeeInformation = (props) => { const columns = [ { title: ( -
+ 员工编号 -
+ ), - width: 120, + width: 200, dataIndex: "userCode", key: "userCode", + sorter: (a, b) => { }, + // sorter: (a, b) => a.name.length - b.name.length > 0 ? 1 : -1, render: (_, r, index) => { return (r.userCode ? r.userCode : '-'); }, @@ -235,6 +238,7 @@ const employeeInformation = (props) => { width: 120, dataIndex: "birthday", key: "birthday", + sorter: (a, b) => { }, render: (_, r, index) => { return (r.birthday ? r.birthday : '-'); }, @@ -307,6 +311,7 @@ const employeeInformation = (props) => { width: 120, dataIndex: "hiredate", key: "hiredate", + sorter: (a, b) => { }, render: (_, r, index) => { return (r.hiredate ? r.hiredate : '-'); }, @@ -339,6 +344,7 @@ const employeeInformation = (props) => { width: 120, dataIndex: "employmentLife", key: "employmentLife", + sorter: (a, b) => { }, render: (_, r, index) => { return (r.hiredate ? {moment(new Date()).diff(r.hiredate, 'years') + '年'} : '-') }, @@ -520,12 +526,16 @@ const employeeInformation = (props) => {
- { setDownloadUrl(`members/export?token=${user.token}×tamp=${moment().valueOf()}`) }} - /> - { - downloadUrl ?