|
|
@ -10,38 +10,31 @@ import '../../style.less' |
|
|
|
const EmployeeCommunication = (props) => { |
|
|
|
const { dispatch, actions } = props |
|
|
|
const { humanAffairs } = actions; |
|
|
|
const [keywordTarget, setKeywordTarget] = useState('person'); |
|
|
|
const [keywordTarget, setKeywordTarget] = useState('personalName'); |
|
|
|
const [keyword, setKeyword] = useState('');//搜索内容 |
|
|
|
const [limits, setLimits] = useState()//每页实际条数 |
|
|
|
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 |
|
|
|
const [modalV, setModalV] = useState(false); |
|
|
|
const [dataToDetail, setDataToDetail] = useState(null); |
|
|
|
const [tableData, setTableData] = useState([{ id: 1, personalName: '危大伟', job: '软件前端开发工程师', departmentName: '软件开发部,软件开发部,软件开发部,软件开发部,软件开发部', communicateDate: '2022-12-29 14:21:33', communicateContent: '阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴', communicateResult: '啊啊啊啊啊啊啊啊啊啊是大大说所所所', valuation: '123当前时区无无群', communicateCondition: '驱蚊器翁群的法人', nextPlan: '呜呜呜呜呜呜呜呜呜呜呜我' }]); |
|
|
|
const [tableData, setTableData] = useState([]); |
|
|
|
const page = useRef(query.page); |
|
|
|
function seachValueChange(value) { |
|
|
|
setKeyword(value) |
|
|
|
} |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
// dispatch(humanAffairs.getMemberList()) |
|
|
|
// getMemberSearchList() |
|
|
|
getEmployeeCommunicateData(); |
|
|
|
}, []); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
// getMemberSearchList()//查询人员列表 |
|
|
|
}, [query]) |
|
|
|
|
|
|
|
// function getMemberSearchList() { |
|
|
|
// let kt = keywordTarget == 'place' ? '' : keywordTarget; |
|
|
|
// let k = keywordTarget == 'place' ? '' : keyword; |
|
|
|
// let placeSearch = keywordTarget == 'place' ? keyword : ''; |
|
|
|
// dispatch(humanAffairs.getSalesList({ keywordTarget: kt, keyword: k, placeSearch, ...query })).then(r => { |
|
|
|
// if (r.success) { |
|
|
|
// setTableData(r.payload?.data?.rows); |
|
|
|
// setLimits(r.payload?.data?.count) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } |
|
|
|
function getEmployeeCommunicateData(param) { |
|
|
|
let queryParam = param || query; |
|
|
|
dispatch(humanAffairs.getEmployeeCommunicate({ keywordTarget, keyword, ...queryParam })).then(r => { |
|
|
|
if (r.success) { |
|
|
|
setTableData(r.payload?.data?.rows); |
|
|
|
setLimits(r.payload?.data?.count); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function handleRow(record, index) {// 给偶数行设置斑马纹 |
|
|
|
if (index % 2 === 0) { |
|
|
@ -218,9 +211,9 @@ const EmployeeCommunication = (props) => { |
|
|
|
<div style={{ display: 'flex' }}> |
|
|
|
<div> |
|
|
|
<Select value={keywordTarget} onChange={setKeywordTarget} style={{ width: 120 }} > |
|
|
|
<Select.Option value='person'>被沟通人</Select.Option> |
|
|
|
<Select.Option value='post'>岗位</Select.Option> |
|
|
|
<Select.Option value='dept'>部门</Select.Option> |
|
|
|
<Select.Option value='personalName'>被沟通人</Select.Option> |
|
|
|
<Select.Option value='job'>岗位</Select.Option> |
|
|
|
<Select.Option value='departmentName'>部门</Select.Option> |
|
|
|
</Select> |
|
|
|
</div> |
|
|
|
<div style={{ margin: '0px 18px' }}> |
|
|
@ -241,6 +234,7 @@ const EmployeeCommunication = (props) => { |
|
|
|
<Button theme='solid' type='primary' style={{ width: 80, borderRadius: 2, height: 32, background: '#DBECFF', color: '#005ABD' }} |
|
|
|
onClick={() => { |
|
|
|
setQuery({ limit: 10, page: 0 }) |
|
|
|
getEmployeeCommunicateData({ limit: 10, page: 0 }); |
|
|
|
}}>查询</Button> |
|
|
|
</div> |
|
|
|
<div style={{ display: 'flex', marginRight: 20 }}> |
|
|
@ -283,6 +277,7 @@ const EmployeeCommunication = (props) => { |
|
|
|
pageSizeOpts={[10, 20, 30, 40]} |
|
|
|
onChange={(currentPage, pageSize) => { |
|
|
|
setQuery({ limit: pageSize, page: currentPage - 1 }); |
|
|
|
getEmployeeCommunicateData({ limit: pageSize, page: currentPage - 1 }); |
|
|
|
page.current = currentPage - 1 |
|
|
|
}} |
|
|
|
/> |
|
|
|