Explorar o código

feat: 人资通讯录不完整版

outaozhen %!s(int64=4) %!d(string=hai) anos
pai
achega
0a9dd08b66

+ 0 - 1
config/routes.js

@@ -260,7 +260,6 @@ export default [
         name: 'contacts',
         icon: 'icon-tongxunlu',
         component: './Hr/Contacts'
-        // access: 'authRouteFilter'
       },
       {
         path: '/hr/employee',

+ 1 - 1
src/pages/Hr/Contacts/components/Organization/index.tsx

@@ -47,7 +47,7 @@ const Organization = props => {
   }
   return (
     <div className="w-12rem rounded-4px flex flex-col">
-      <div className="w-full p-4 border-b-1 border-solid border-black border-opacity-10 bg-hex-f7f9fa flex justify-around items-center flex-row">
+      <div className="w-full p-4 border-b-1 border-solid border-black border-opacity-10 bg-hex-f7f9fa">
         <span className="text-[0.9375rem]">组织架构</span>
       </div>
       <div className="py-4 bg-white flex-1">

+ 10 - 9
src/pages/Hr/Contacts/index.tsx

@@ -2,7 +2,7 @@ import BasicTable from '@/components/Table'
 import { PageContainer } from '@ant-design/pro-layout'
 import { Input, List, Popover, Space, Tag } from 'antd'
 import type { ColumnsType } from 'antd/lib/table'
-import React, { useEffect, useMemo, useState } from 'react'
+import React, { useEffect, useMemo, useRef, useState } from 'react'
 import { connect } from '@@/plugin-dva'
 import Organization from './components/Organization'
 
@@ -53,13 +53,14 @@ const content = (
 
 const Contacts: React.FC<ContactsProps> = props => {
   const { dispatch, allStaffList = [] } = props
+  const tRef = useRef()
   const [state, setState] = useState({
     departmentId: '0',
     params: {
-      projectType: 1,
       search: null
     }
   })
+
   const initData = () => {
     dispatch({
       type: 'staff/fetchStaffList'
@@ -128,12 +129,6 @@ const Contacts: React.FC<ContactsProps> = props => {
       search: false,
       width: 100
     },
-    // {
-    //   title: '生日',
-    //   dataIndex: 'birthday',
-    //   search: false,
-    //   width: 150
-    // },
     {
       title: '入职时间',
       dataIndex: 'hiredate',
@@ -149,8 +144,10 @@ const Contacts: React.FC<ContactsProps> = props => {
           {allStaffList.length ? (
             <BasicTable
               rowKey="id"
+              actionRef={tRef}
               columns={columns}
               dataSource={dataSource}
+              params={state.params}
               search={false}
               toolbar={{
                 multipleLine: true,
@@ -181,7 +178,11 @@ const Contacts: React.FC<ContactsProps> = props => {
                       <Popover content={content} title={'本月寿星:'} trigger="click" placement="bottomLeft">
                         <span>
                           {character?.map(item => {
-                            return <span key={item.id}>{item.name}</span>
+                            return (
+                              <span style={{ marginLeft: -2 }} key={item.id}>
+                                {item.name}
+                              </span>
+                            )
                           })}
                         </span>
                       </Popover>