From 16ce2985d4035c6b608f5e67abbaf7df0f26d75a Mon Sep 17 00:00:00 2001 From: zhangminghua Date: Wed, 28 Dec 2022 10:21:07 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E5=91=98=E5=B7=A5=E6=B2=9F=E9=80=9A?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/employeeCommunication.js | 15 +++++++ .../sections/humanAffairs/actions/index.js | 4 +- .../communication/employeeCommunication.jsx | 39 ++++++++----------- web/client/src/utils/webapi.js | 6 ++- 4 files changed, 39 insertions(+), 25 deletions(-) create mode 100644 web/client/src/sections/humanAffairs/actions/employeeCommunication.js diff --git a/web/client/src/sections/humanAffairs/actions/employeeCommunication.js b/web/client/src/sections/humanAffairs/actions/employeeCommunication.js new file mode 100644 index 0000000..ba11e9a --- /dev/null +++ b/web/client/src/sections/humanAffairs/actions/employeeCommunication.js @@ -0,0 +1,15 @@ +'use strict'; + +import { ApiTable, basicAction } from '$utils' + +export function getEmployeeCommunicate(query) {//查询 + return (dispatch) => basicAction({ + type: "get", + dispatch: dispatch, + actionType: "GET_EMPLOYEE_COMMUNICATE", + query: query, + url: `${ApiTable.getEmployeeCommunicate}`, + msg: { option: "查询员工沟通统计数据" }, + reducer: { name: "employeeCommunicate", params: { noClear: true } }, + }); +} diff --git a/web/client/src/sections/humanAffairs/actions/index.js b/web/client/src/sections/humanAffairs/actions/index.js index b583f67..f304452 100644 --- a/web/client/src/sections/humanAffairs/actions/index.js +++ b/web/client/src/sections/humanAffairs/actions/index.js @@ -6,6 +6,7 @@ import * as salesDistribution from './salesDistribution' import * as departmentTrain from './departmentTrain' import * as personalTrainRecord from './personalTrainRecord' import * as resourceRepository from './resourceRepository' +import * as employeeCommunication from './employeeCommunication' export default { ...personnelFiles, @@ -13,5 +14,6 @@ export default { ...salesDistribution, ...departmentTrain, ...personalTrainRecord, - ...resourceRepository + ...resourceRepository, + ...employeeCommunication } \ No newline at end of file diff --git a/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx b/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx index b4148f7..61ee2a6 100644 --- a/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx +++ b/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx @@ -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) => {
@@ -241,6 +234,7 @@ const EmployeeCommunication = (props) => {
@@ -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 }} /> diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 1dee153..d4610c2 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -58,8 +58,10 @@ export const ApiTable = { delResourceClassify: 'train/trainFiles/resourceRepository/classify', getResourceFileList: 'train/trainFiles/resourceRepository/fileList', postResourceFile: 'train/trainFiles/resourceRepository/file', - delResourceFile: 'train/trainFiles/resourceRepository/file/{id}' - + delResourceFile: 'train/trainFiles/resourceRepository/file/{id}', + + //员工沟通统计 + getEmployeeCommunicate:'employee/communicate/list' }; export const RouteTable = {