From d7fdf2d0ddf101070118a6a3909eee2efcf2d307 Mon Sep 17 00:00:00 2001 From: deartibers <947466799@qq.com> Date: Wed, 26 Oct 2022 08:54:26 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/humanAffairs/containers/personnelFiles.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx b/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx index 56f6e6e..7d50b2d 100644 --- a/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx +++ b/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx @@ -25,6 +25,7 @@ const Rest = (props) => { vacate: '请假', inOffice: '在岗', dayoff: '放假', + rest: '休息中', } let [typeChoose, setTypeChoose] = useState(''); useEffect(() => { From 163a0270e45cc0a4fba86872e98d8b1d3cad7366 Mon Sep 17 00:00:00 2001 From: katarina <774141367@qq.com> Date: Fri, 28 Oct 2022 14:08:47 +0800 Subject: [PATCH 2/5] gou --- web/client/src/app.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client/src/app.jsx b/web/client/src/app.jsx index 37d0ba7..f88df63 100644 --- a/web/client/src/app.jsx +++ b/web/client/src/app.jsx @@ -14,7 +14,7 @@ const App = props => { document.title = projectName; console.log(` - _ _ +        />  フ       |  _  _ l       /\` ミ_xノ From 5d8e28bc395abd386b8589d1d47aec5be71327a7 Mon Sep 17 00:00:00 2001 From: katarina <774141367@qq.com> Date: Fri, 28 Oct 2022 14:15:39 +0800 Subject: [PATCH 3/5] go --- web/client/src/app.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client/src/app.jsx b/web/client/src/app.jsx index f88df63..9a64fd6 100644 --- a/web/client/src/app.jsx +++ b/web/client/src/app.jsx @@ -14,7 +14,7 @@ const App = props => { document.title = projectName; console.log(` - + _ _------        />  フ       |  _  _ l       /\` ミ_xノ From fc7266798657fbdf9f11d00de7645c7b70825b62 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Fri, 28 Oct 2022 17:59:32 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BA=BA=E5=8A=9B=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=91=A8=E6=8A=A5=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 67 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..21effbe --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,67 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "启动 API", + "program": "${workspaceRoot}/api/server.js", + "env": { + "NODE_ENV": "development" + }, + "args": [ + "-p 4700", + "-f http://localhost:4700", + // 研发 + "-g postgres://postgres:123@10.8.30.166:5432/hr-dev", + "--redisHost 10.8.30.112", + "--redisPort 6379", + // "--apiEmisUrl http://10.8.30.112:14000", + // 测试 + "--apiEmisUrl http://10.8.30.161:1111", + "--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5", + "--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa", + "--qnbkt dev-hr", + // "--qndmn http://resources.anxinyun.cn", + "--qndmn http://rjkwed13l.hn-bkt.clouddn.com", + + // 似乎不能传空 先注释 * 2 + // "--clickHouseUser ", + // "--clickHousePassword ", + + "--clickHousePort 30123", + + // 开发 + // "--clickHouseUrl http://10.8.30.71", + // "--clickHousePepEmis pepca_dev", + // "--clickHouseCamworkflow camworkflow", + // "--clickHouseHr hr_dev", + + // 测试 + "--clickHouseUrl http://10.8.30.161", + "--clickHousePepEmis pepca8", + "--clickHouseCamworkflow camworkflow", + "--clickHouseHr hrm", + ] + }, + { + "type": "node", + "request": "launch", + "name": "run mocha", + "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", + "stopOnEntry": false, + "args": [ + "app/test/*.test.js", + "--no-timeouts" + ], + "cwd": "${workspaceRoot}", + "runtimeExecutable": null, + "env": { + "NODE_ENV": "development" + } + } + ] + } \ No newline at end of file From 402bb8598712635c8c0b9693cec5b91fe1834434 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Fri, 28 Oct 2022 17:59:57 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BA=BA=E5=8A=9B=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=91=A8=E6=8A=A5=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/client/index.ejs | 3 +- web/client/index.html | 3 +- .../sections/humanAffairs/actions/service.js | 14 + .../sections/humanAffairs/containers/index.js | 3 +- .../containers/weeklyManagement.jsx | 410 ++++++++++++++++++ .../src/sections/humanAffairs/nav-item.jsx | 16 +- .../src/sections/humanAffairs/routes.js | 12 +- web/client/src/utils/webapi.js | 1 + web/config.js | 8 + web/package.json | 4 +- web/routes/services/weekly.js | 18 + 11 files changed, 481 insertions(+), 11 deletions(-) create mode 100644 web/client/src/sections/humanAffairs/actions/service.js create mode 100644 web/client/src/sections/humanAffairs/containers/weeklyManagement.jsx create mode 100644 web/routes/services/weekly.js diff --git a/web/client/index.ejs b/web/client/index.ejs index 035b7fb..f54e38a 100644 --- a/web/client/index.ejs +++ b/web/client/index.ejs @@ -9,7 +9,8 @@ - + + diff --git a/web/client/index.html b/web/client/index.html index f4c42b1..f72c8b8 100644 --- a/web/client/index.html +++ b/web/client/index.html @@ -7,8 +7,7 @@ - + diff --git a/web/client/src/sections/humanAffairs/actions/service.js b/web/client/src/sections/humanAffairs/actions/service.js new file mode 100644 index 0000000..6ec0e10 --- /dev/null +++ b/web/client/src/sections/humanAffairs/actions/service.js @@ -0,0 +1,14 @@ +'use strict'; +import { RouteTable, RouteRequest } from '$utils' + +export function getServiceUrl() { + return dispatch => { + return RouteRequest.get(RouteTable.getWeeklyService) + .then(res => { + return dispatch({ + type: "SERVER_WEEKLY_URL", + payload: res + }) + }); + } +} \ No newline at end of file diff --git a/web/client/src/sections/humanAffairs/containers/index.js b/web/client/src/sections/humanAffairs/containers/index.js index 477c609..654d302 100644 --- a/web/client/src/sections/humanAffairs/containers/index.js +++ b/web/client/src/sections/humanAffairs/containers/index.js @@ -3,8 +3,9 @@ import PersonnelFiles from './personnelFiles'; import PersonnelFilesDetail from './personnelFilesDetail'; import EmployeeInformation from './employeeInformation'; +import WeeklyManagement from './weeklyManagement'; import LeaveStatistics from './leaveStatistics'; import OvertimeStatistics from './overtimeStatistics'; -export { PersonnelFiles, PersonnelFilesDetail, EmployeeInformation, LeaveStatistics,OvertimeStatistics }; \ No newline at end of file +export { PersonnelFiles, PersonnelFilesDetail, EmployeeInformation, WeeklyManagement, LeaveStatistics, OvertimeStatistics }; \ No newline at end of file diff --git a/web/client/src/sections/humanAffairs/containers/weeklyManagement.jsx b/web/client/src/sections/humanAffairs/containers/weeklyManagement.jsx new file mode 100644 index 0000000..d7ad186 --- /dev/null +++ b/web/client/src/sections/humanAffairs/containers/weeklyManagement.jsx @@ -0,0 +1,410 @@ +import React, { useEffect, useState, useRef, useMemo } from 'react'; +import { connect } from 'react-redux'; +import { Table, Button, Pagination, Skeleton, Form, Tooltip, Banner } from '@douyinfe/semi-ui'; +import { IconSearch } from '@douyinfe/semi-icons'; +import { SkeletonScreen } from "$components"; +import '../style.less' +import { Setup } from "$components"; +import moment from 'moment' +import { getServiceUrl } from '../actions/service'; + +const WeeklyManagement = (props) => { + const { dispatch, actions, history, user, loading, socket, xqMembers } = props; + + const form = useRef();//表单 + + const [setup, setSetup] = useState(false);//表格设置是否显现 + const [setupp, setSetupp] = useState([]);//实际显示的表格列表 + const [lookup, setLookup] = useState({});//搜索 + const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 + const [order, setOrder] = useState({ orderBy: 'hiredate', orderDirection: 'DESC' }); //页码信息 + const [limits, setLimits] = useState(0)//每页实际条数 + const [downloadUrl, setDownloadUrl] = useState('')//下载pdf; + const [warningBanner, setWarningBanner] = useState(null); + const WEEKLYMANAGEMENT = "weeklyManagement"; + const page = useRef(query.page);//哪一页 + + let btnDisable = false; + const tableList = [//表格属性 + { + title: '基础信息', + list: [ + { name: "姓名", value: "userName" }, + { name: "所属部门", value: "departmrnt" }, + { name: "职位", value: "roleName" }, + { name: "应提交次数", value: "idNumber" }, + { name: "实际提交次述", value: "number" }, + { name: "延期次数", value: "yqNumber" }, + { name: "未提交次数", value: "noNumber" }, + { name: "未及时审批次数", value: "noAuditNumber" }, + { name: "审批人", value: "auditUser" }, + { name: "操作", value: "action" } + ] + } + ]; + useEffect(() => { + localStorage.getItem(WEEKLYMANAGEMENT) == null + ? localStorage.setItem( + WEEKLYMANAGEMENT, + JSON.stringify(['userName', 'departmrnt', 'roleName', 'idNumber', 'number', 'yqNumber', 'noNumber', 'noAuditNumber', 'auditUser', + 'action']) + ) + : ""; + attribute(); + }, []) + + useEffect(() => { + if (form && form.current && form.current.setValue) { + form.current.setValue("weeklyRange", [moment().startOf('isoWeek').format('YYYY-MM-DD'), moment().endOf('isoWeek').format('YYYY-MM-DD')]) + } + }, []) + + const columns = [ + { + title: ( + + 员工编号 + + ), + 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 : '-'); + }, + }, + ]; + //获取表格属性设置 + function attribute() { + const arr = localStorage.getItem(WEEKLYMANAGEMENT) + ? JSON.parse(localStorage.getItem(WEEKLYMANAGEMENT)) + : []; + + const column = [ + { + title: ( +
+ 姓名 +
+ ), + dataIndex: "userName", + key: "userName", + render: (_, r, index) => { + return (r.userName ? r.userName : '-'); + }, + }, { + title: ( +
+ 所属部门 +
+ ), + dataIndex: "departmrnt", + key: "departmrnt", + render: (_, r, index) => { + return ( +
+ { + r.departmrnt.map((ite, idx) => { + let departmentsArr = [] + for (let i = 0; i < r.departmrnt.length; i++) { + departmentsArr.push(r.departmrnt[i].name) + } + return ( +
+ {idx == 0 ? + (
+ {ite.name} +
) : ('') + + } + { + r.departmrnt.length > 1 && idx == 1 ? ( + +
+ +{r.departmrnt.length - 1} +
+
+ ) : ('') + } +
+ ) + }) + } +
+ ) + }, + }, { + title: ( +
+ 职位 +
+ ), + dataIndex: "roleName", + key: "roleName", + render: (_, r, index) => { + return ( +
+ { + r.role.map((ite, idx) => { + let roleArr = [] + for (let i = 0; i < r.role.length; i++) { + roleArr.push(r.role[i].name) + } + return ( +
+ {idx == 0 ? + (ite.name) : ('') + } + { + r.role.length > 1 && idx == 1 ? ( + +
+ +{r.role.length - 1} +
+
+ ) : ('') + } +
+ ) + }) + } +
); + }, + }, { + title: '应提交次数', + dataIndex: "idNumber", + key: "idNumber", + render: (_, r, index) => { + return (r.idNumber ? r.idNumber : '-'); + }, + }, { + title: '实际提交次述', + dataIndex: "number", + key: "number", + render: (_, r, index) => { + return (r.gender ? r.gender : '-'); + }, + }, { + title: '延期次数', + dataIndex: "yqNumber", + key: "yqNumber", + render: (_, r, index) => { + return (r.nativePlace ? r.nativePlace : '-'); + }, + }, { + title: '未提交次数', + dataIndex: "noNumber", + key: "noNumber", + render: (_, r, index) => { + return (r.birthday ? r.birthday : '-'); + }, + }, { + title: '未及时审批次数', + dataIndex: "noAuditNumber", + key: "noAuditNumber", + render: (_, r, index) => { + return (r.marital ? r.marital : '-'); + }, + }, { + title: '审批人', + dataIndex: "auditUser", + key: "auditUser", + render: (_, r, index) => { + return (r.politicsStatus ? r.politicsStatus : '-'); + }, + }, { + title: '操作', + dataIndex: "action", + key: "action", + render: (_, r, index) => { + return (r.vitae ? 下载 : '-') + }, + }, + ]; + 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); + } + function handleRow(record, index) {//斑马条纹 + // 给偶数行设置斑马纹 + if (index % 2 === 0) { + return { + style: { + background: '#FAFCFF', + } + }; + } else { + return {}; + } + } + const scroll = useMemo(() => ({}), []); + + return ( + <> +
+
+
人事管理
+
/
+
基本动作
+
/
+
周报管理
+
+
+
+
+
+
周报管理
+
WEEKLY MANAGEMENT
+
+
+
+
(form.current = formApi)} + > +
+
+
+ +
+
+
+ + {/* */} + { + downloadUrl ?