diff --git a/web/client/src/sections/humanAffairs/containers/index.js b/web/client/src/sections/humanAffairs/containers/index.js index b883323..800d487 100644 --- a/web/client/src/sections/humanAffairs/containers/index.js +++ b/web/client/src/sections/humanAffairs/containers/index.js @@ -13,6 +13,7 @@ import PersonnelDistribution from './salersDistribution/personnelDistribution'; //培训 import ResourceRepository from './resourceRepository'; import DepartmentTrainRecord from './departmentTrainRecord'; +import PersonalTrainRecord from './personalTrainRecord'; //绩效考核 import WeeklyManagement from './weeklyManagement'; import SaleLog from './saleLog'; @@ -28,8 +29,6 @@ import EmployeeAuth from './employeeAuth'; import FormMaintenance from './formMaintenance'; //其它 import PersonnelFilesDetail from './personnelFilesDetail'; -//培训管理 -import PersonalTrainRecord from './personalTrainRecord'; diff --git a/web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx b/web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx index 311c706..0c00bdb 100644 --- a/web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx +++ b/web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx @@ -1,10 +1,120 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect, useState, useMemo } from 'react'; import { connect } from 'react-redux'; -import Empty from '../components/empty'; +import { Table, Pagination, Skeleton } from '@douyinfe/semi-ui'; +import { SkeletonScreen } from "$components"; import '../style.less' const PersonalTrainRecord = (props) => { const { dispatch, actions } = props + const [limits, setLimits] = useState()//每页实际条数 + const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 + const [tableData, setTableData] = useState([{ id: 1, personalName: '张三', departmentName: '营销第一军团', trainingType: '内部培训', topic: '新员工入职培训', trainer: '李四', trainDate: '2022-12-30 18:30', trainTime: '1小时', trainMethod: '线下', attendanceScore: '95', appraisalMethod: '笔试', appraisalScore: '86', totalScore: '80' }, { id: 2, personalName: '张三', departmentName: '营销第一军团', trainingType: '内部培训', topic: '新员工入职培训', trainer: '李四', trainDate: '2022-12-30 18:30', trainTime: '1小时', trainMethod: '线下', attendanceScore: '95', appraisalMethod: '笔试', appraisalScore: '86', totalScore: '80' }, { id: 3, personalName: '张三', departmentName: '营销第一军团', trainingType: '内部培训', topic: '新员工入职培训', trainer: '李四', trainDate: '2022-12-30 18:30', trainTime: '1小时', trainMethod: '线下', attendanceScore: '95', appraisalMethod: '笔试', appraisalScore: '86', totalScore: '80' }, { id: 4, personalName: '张三', departmentName: '营销第一军团', trainingType: '内部培训', topic: '新员工入职培训', trainer: '李四', trainDate: '2022-12-30 18:30', trainTime: '1小时', trainMethod: '线下', attendanceScore: '95', appraisalMethod: '笔试', appraisalScore: '86', totalScore: '80' }]); + + + function handleRow(record, index) {// 给偶数行设置斑马纹 + if (index % 2 === 0) { + return { + style: { + background: '#FAFCFF', + } + }; + } else { + return {}; + } + } + + const download = () => { + //表头 + let head = []; + let headData = { index: '序号', personalName: '姓名', departmentName: '部门', trainingType: '培训类型', topic: '课程主题', trainer: '培训讲师', trainDate: '培训时间', trainTime: '培训时长', trainMethod: '培训方式', attendanceScore: '考勤分数', appraisalMethod: '考核形式', appraisalScore: '考核分数', totalScore: '总分' } + Object.keys(headData).map(key => { + head.push(headData[key]); + }) + head = head.join(',') + "\n"; + //数据 + let templateCsv = "data:text/csv;charset=utf-8,\ufeff" + head; + //创建一个a标签 + let link = document.createElement("a"); + //为a标签设置属性 + link.setAttribute("href", templateCsv); + link.setAttribute("download", "个人培训表单.csv"); + //点击a标签 + link.click(); + } + + const columns = [{ + title: '序号', + dataIndex: 'id', + key: 'id', + width: 60, + render: (text, record, index) => index + 1 + }, { + title: '姓名', + dataIndex: 'personalName', + key: 'personalName', + width: 80 + }, { + title: '部门名称', + dataIndex: 'departmentName', + key: 'departmentName', + width: 200 + }, { + title: '培训类型', + dataIndex: 'trainingType', + key: 'trainingType', + width: 120 + }, { + title: '课程主题', + dataIndex: 'topic', + key: 'topic', + width: 200 + }, { + title: '培训讲师', + dataIndex: 'trainer', + key: 'trainer', + width: 100 + }, { + title: '培训时间', + dataIndex: 'trainDate', + key: 'trainDate', + width: 200 + }, { + title: '培训时长', + dataIndex: 'trainTime', + key: 'trainTime', + width: 100 + }, { + title: '培训方式', + dataIndex: 'trainMethod', + key: 'trainMethod', + width: 100 + }, { + title: '考勤分数', + dataIndex: 'attendanceScore', + key: 'attendanceScore', + width: 100 + }, { + title: '考核形式', + dataIndex: 'appraisalMethod', + key: 'appraisalMethod', + width: 100 + }, { + title: '考核分数', + dataIndex: 'appraisalScore', + key: 'appraisalScore', + width: 100 + }, { + title: '总分', + dataIndex: 'totalScore', + key: 'totalScore', + width: 100 + }, { + title: '操作', + dataIndex: 'action', + width: 120 + }]; + + const scroll = useMemo(() => ({}), []); return ( <> @@ -24,7 +134,61 @@ const PersonalTrainRecord = (props) => {