巴林闲侠
2 years ago
14 changed files with 650 additions and 200 deletions
After Width: | Height: | Size: 554 B |
After Width: | Height: | Size: 838 B |
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,344 @@ |
|||
import React, { useEffect, useState, useRef } from 'react'; |
|||
import { connect } from 'react-redux'; |
|||
import { Select, SkeletonScreen, Button, Pagination, Skeleton, Form } from '@douyinfe/semi-ui'; |
|||
import { IconSearch } from '@douyinfe/semi-icons'; |
|||
import '../style.less' |
|||
import { Setup } from "$components"; |
|||
import moment from 'moment' |
|||
import { set } from 'nprogress'; |
|||
|
|||
const employeeInformation = (props) => { |
|||
const { dispatch, actions, history, user, loading, socket, xqMembers } = props |
|||
|
|||
const { humanAffairs } = actions; |
|||
|
|||
const form = useRef();//表单 |
|||
let [archivesList, setArchivesList] = useState([]); |
|||
const [personnelModal, setPersonnelModal] = useState(false);//档案弹框 |
|||
const [exportModalVs, setExportModalVs] = useState(false); |
|||
const [keyword, setKeyword] = useState('');//搜索内容 |
|||
const [keywordTarget, setKeywordTarget] = useState('');//搜索类型 |
|||
const [downloadUrl, setDownloadUrl] = useState('') |
|||
let [typeChoose, setTypeChoose] = useState(''); |
|||
|
|||
const [setup, setSetup] = useState(false);//表格设置是否显现 |
|||
const [setupp, setSetupp] = useState([]);//实际显示的表格列表 |
|||
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 |
|||
const [limits, setLimits] = useState()//每页实际条数 |
|||
|
|||
const EMPLOYEEINFORMATION = "employeeInformation"; |
|||
const tableList = [//表格属性 |
|||
{ |
|||
title: '推送信息', |
|||
list: [ |
|||
{ name: "策略类型", value: "pushWay" }, |
|||
{ name: "推送机制", value: "noticeWay" }, |
|||
{ name: "监听设备数量", value: "monitorCount" }, |
|||
{ name: "累计推送次数", value: "logCount" }, |
|||
] |
|||
} |
|||
]; |
|||
useEffect(() => { |
|||
getMemberSearchList() |
|||
|
|||
|
|||
// attribute(); |
|||
// localStorage.getItem(EMPLOYEEINFORMATION) == null |
|||
// ? localStorage.setItem( |
|||
// EMPLOYEEINFORMATION, |
|||
// JSON.stringify(['pushWay','noticeWay','logCount','monitorCount']) |
|||
// ) |
|||
// : ""; |
|||
}, [typeChoose]) |
|||
|
|||
function getMemberSearchList () {//搜索项企用户 |
|||
dispatch(humanAffairs.getMemberList({ keywordTarget, keyword, state: typeChoose })).then((res) => {//搜索项企用户 |
|||
if (res.success) { |
|||
setArchivesList(res.payload?.data?.rows) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
function typeOnChange (e) {//角色选择 |
|||
setTypeChoose(e.target.value); |
|||
} |
|||
function seachValueChange (value) { |
|||
setKeyword(value) |
|||
} |
|||
//获取表格属性设置 |
|||
function attribute () { |
|||
const arr = localStorage.getItem(EMPLOYEEINFORMATION) |
|||
? JSON.parse(localStorage.getItem(EMPLOYEEINFORMATION)) |
|||
: []; |
|||
|
|||
const column = [ |
|||
{ |
|||
title: "关联项目", |
|||
dataIndex: "noticeWay", |
|||
key: "noticeWay", |
|||
render: (_, r, index) => { |
|||
return r.noticeWay; |
|||
}, |
|||
}, |
|||
{ |
|||
title: "创建时间", |
|||
dataIndex: "logCount", |
|||
key: "logCount", |
|||
render: (_, r, index) => { |
|||
return (r.logCount + '次') |
|||
}, |
|||
}, |
|||
{ |
|||
title: "接收人", |
|||
dataIndex: "monitorCount", |
|||
key: "monitorCount", |
|||
render: (_, r, index) => { |
|||
return r.monitorCount |
|||
}, |
|||
}, |
|||
{ |
|||
title: "监听问题", |
|||
dataIndex: "pushWay", |
|||
key: "pushWay", |
|||
render: (_, r, index) => { |
|||
return r.pushWay == 'email' ? '邮件通知' : '短信通知'; |
|||
}, |
|||
}, |
|||
{ |
|||
title: "通知时效", |
|||
dataIndex: "text1", |
|||
key: "text1", |
|||
render: (_, r, index) => { |
|||
return r.text1 |
|||
}, |
|||
}, |
|||
{ |
|||
title: "启用状态", |
|||
dataIndex: "text2", |
|||
key: "text2", |
|||
render: (_, r, index) => { |
|||
return r.text2 |
|||
}, |
|||
}, |
|||
{ |
|||
title: "推送次数", |
|||
dataIndex: "time", |
|||
key: "time", |
|||
render: (_, r, index) => { |
|||
return r.time |
|||
}, |
|||
}, |
|||
]; |
|||
for (let i = 0; i < arr.length; i++) { |
|||
let colum = column.filter((item) => { |
|||
return item.key === arr[i]; |
|||
}); |
|||
columns.splice(i + 2, 0, colum[0]); |
|||
} |
|||
setSetupp(columns); |
|||
} |
|||
return ( |
|||
<> |
|||
<div style={{ padding: '0px 12px' }}> |
|||
<div style={{ display: 'flex' }}> |
|||
<div style={{ color: 'rgba(0,0,0,0.45)', fontSize: 14 }}>人事管理</div> |
|||
<div style={{ color: 'rgba(0,0,0,0.45)', fontSize: 14, margin: '0px 8px' }}>/</div> |
|||
<div style={{ color: 'rgba(0,0,0,0.45)', fontSize: 14 }}>档案中心</div> |
|||
<div style={{ color: '#033C9A', fontSize: 14, margin: '0px 8px' }}>/</div> |
|||
<div style={{ color: '#033C9A', fontSize: 14 }}>人员档案</div> |
|||
</div> |
|||
<div style={{ background: '#FFFFFF', boxShadow: '0px 0px 12px 2px rgba(220,222,224,0.2)', borderRadius: 2, padding: '20px 0px 20px 19px ', marginTop: 12 }}> |
|||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}> |
|||
<div style={{ display: 'flex', alignItems: 'baseline' }}> |
|||
<div style={{ width: 0, height: 20, borderLeft: '3px solid #0F7EFB', borderTop: '3px solid transparent', borderBottom: '3px solid transparent' }}></div> |
|||
<div style={{ fontFamily: "YouSheBiaoTiHei", fontSize: 24, color: '#033C9A', marginLeft: 8 }}>员工信息</div> |
|||
<div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>EMPLOYEE INFORMATION</div> |
|||
</div> |
|||
</div> |
|||
<div style={{ marginRight: 20, marginTop: 18 }}> |
|||
<Form |
|||
labelPosition="left" |
|||
labelAlign="right" |
|||
labelWidth="80px" |
|||
onValueChange={(values, field) => { |
|||
console.log('values', values); |
|||
}} |
|||
getFormApi={(formApi) => (form.current = formApi)} |
|||
> |
|||
<div> |
|||
<div style={{ display: 'flex', alignItems: 'center' }}> |
|||
<Form.Select value={keywordTarget} |
|||
pure onChange={setKeywordTarget} placeholder='请选择搜索类型' style={{ width: 200 }} showClear> |
|||
<Select.Option value='role'>职位</Select.Option> |
|||
<Select.Option value='dep'>部门</Select.Option> |
|||
<Select.Option value='number'>编号</Select.Option> |
|||
<Select.Option value='name'>姓名</Select.Option> |
|||
</Form.Select> |
|||
<Form.Input suffix={<IconSearch />} |
|||
pure |
|||
showClear |
|||
placeholder='请输入或选择关键词' |
|||
value={keyword} |
|||
style={{ width: 346, marginLeft: 12, marginRight: 12 }} |
|||
onChange={seachValueChange}> |
|||
</Form.Input> |
|||
<Form.DatePicker |
|||
label='入职时间:' |
|||
field='enableType' type="dateRange" density="compact" showClear style={{ width: 370, color: "#F9F9F9" }} /> |
|||
</div> |
|||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}> |
|||
<div style={{ display: 'flex', alignItems: 'center' }}> |
|||
<Form.Select |
|||
label='婚姻状况:' |
|||
labelPosition="left" |
|||
field='enableType' |
|||
style={{ width: 246, marginRight: 20, color: "#F9F9F9", }} |
|||
placeholder="全部" |
|||
filter |
|||
showClear |
|||
> |
|||
{/* {.map((item) => { |
|||
return ( |
|||
<Form.Select.Option key={item.value} value={item.value}> |
|||
{item.name} |
|||
</Form.Select.Option> |
|||
); |
|||
})} */} |
|||
</Form.Select> |
|||
<Form.Select |
|||
label='户籍地:' |
|||
labelPosition="left" |
|||
field='enableType' |
|||
style={{ width: 246, marginRight: 20, color: "#F9F9F9", }} |
|||
placeholder="全部" |
|||
filter |
|||
showClear |
|||
> |
|||
{/* {.map((item) => { |
|||
return ( |
|||
<Form.Select.Option key={item.value} value={item.value}> |
|||
{item.name} |
|||
</Form.Select.Option> |
|||
); |
|||
})} */} |
|||
</Form.Select> |
|||
<Form.Select |
|||
label='工作地点:' |
|||
labelPosition="left" |
|||
field='enableType' |
|||
style={{ width: 246, marginRight: 20, color: "#F9F9F9", }} |
|||
placeholder="全部" |
|||
filter |
|||
showClear |
|||
> |
|||
{/* {.map((item) => { |
|||
return ( |
|||
<Form.Select.Option key={item.value} value={item.value}> |
|||
{item.name} |
|||
</Form.Select.Option> |
|||
); |
|||
})} */} |
|||
</Form.Select> |
|||
</div> |
|||
<div style={{ display: 'flex', alignItems: 'center' }}> |
|||
<img src="/assets/images/hrImg/export.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} |
|||
// onClick={() => setSetup(true)} |
|||
/> |
|||
<img src="/assets/images/hrImg/setup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} |
|||
onClick={() => setSetup(true)} |
|||
/> |
|||
<Button theme='solid' type='primary' style={{ width: 80, borderRadius: 2, height: 32, background: '#DBECFF', color: '#005ABD' }} |
|||
onClick={() => { |
|||
// dispatch(humanAffairs.getMemberList({ keywordTarget, keyword, state: typeChoose })).then((res) => {//搜索项企用户 |
|||
// if (res.success) { |
|||
// setArchivesList(res.payload.data.rows) |
|||
// } |
|||
// }) |
|||
}}>查询</Button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</Form> |
|||
<div style={{ border: '1px solid #C7E1FF', background: '#F4F8FF', borderRadius: 2, height: 32, width: 669, padding: '8px 0px 7px 12px', display: 'flex', alignItems: 'center', color: '#0F7EFB', fontSize: 12 }}> |
|||
<img src="/assets/images/hrImg/!.png" alt="" style={{ width: 14, height: 14, marginRight: 8 }} /> |
|||
表格中带有认证标识" |
|||
<img src="/assets/images/hrImg/V.png" alt="" style={{ width: 14, height: 14 }} /> |
|||
"信息的为系统基础数据,来源于项企PEP、钉钉等系统,其他数据均为导入或自定义数据 |
|||
</div> |
|||
{/* <div style={{ marginTop: 20 }}> |
|||
<Skeleton |
|||
// loading={loading} |
|||
loading={false} |
|||
active={true} |
|||
placeholder={SkeletonScreen()} |
|||
> |
|||
<Table |
|||
columns={setupp.filter((s) => s)} |
|||
dataSource={tableData} |
|||
bordered={false} |
|||
empty="暂无数据" |
|||
pagination={false} |
|||
onRow={handleRow} |
|||
rowSelection={rowSelection} |
|||
/> |
|||
</Skeleton> |
|||
<div |
|||
style={{ |
|||
display: "flex", |
|||
justifyContent: "space-between", |
|||
padding: "20px 20px", |
|||
}} |
|||
> |
|||
<div> |
|||
</div> |
|||
<div style={{ display: 'flex', }}> |
|||
<span style={{ lineHeight: "30px", fontSize: 13, color: 'rgba(0,90,189,0.8)' }}> |
|||
共{limits}条信息 |
|||
</span> |
|||
<Pagination |
|||
className="22" |
|||
total={limits} |
|||
showSizeChanger |
|||
currentPage={query.page + 1} |
|||
pageSizeOpts={[10, 20, 30, 40]} |
|||
onChange={(currentPage, pageSize) => { |
|||
setQuery({ limit: pageSize, page: currentPage - 1 }); |
|||
page.current = currentPage - 1 |
|||
}} |
|||
/> |
|||
</div> |
|||
</div> |
|||
</div> */} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{setup ? ( |
|||
<Setup |
|||
tableType={EMPLOYEEINFORMATION} |
|||
tableList={tableList} |
|||
length={25} |
|||
close={() => { |
|||
setSetup(false); |
|||
attribute(); |
|||
// setcameraSetup(false); |
|||
}} |
|||
/> |
|||
) : ( |
|||
"" |
|||
)} |
|||
</> |
|||
) |
|||
} |
|||
|
|||
function mapStateToProps (state) { |
|||
const { auth, global, MemberSearch, webSocket } = state; |
|||
return { |
|||
// loading: members.isRequesting, |
|||
user: auth.user, |
|||
actions: global.actions, |
|||
xqMembers: MemberSearch.data, |
|||
// socket: webSocket.socket |
|||
}; |
|||
} |
|||
|
|||
export default connect(mapStateToProps)(employeeInformation); |
Loading…
Reference in new issue