diff --git a/src/assets/empty.png b/src/assets/empty.png new file mode 100644 index 0000000..d3cbad0 Binary files /dev/null and b/src/assets/empty.png differ diff --git a/src/assets/logo.png b/src/assets/logo.png deleted file mode 100644 index c6ed343..0000000 Binary files a/src/assets/logo.png and /dev/null differ diff --git a/src/pages/DataStatistics/data.d.ts b/src/pages/DataStatistics/data.d.ts index bd5ee4c..80524d0 100644 --- a/src/pages/DataStatistics/data.d.ts +++ b/src/pages/DataStatistics/data.d.ts @@ -4,6 +4,9 @@ export interface TableListItem { educationList?: any[], ptqList?: any[], skillLevelList?: any[], + sexList?: any[], + departmentList?: any[], + ageList?: any[], } export interface TableListPagination { diff --git a/src/pages/DataStatistics/index.tsx b/src/pages/DataStatistics/index.tsx index 4a0890a..8d50ad6 100644 --- a/src/pages/DataStatistics/index.tsx +++ b/src/pages/DataStatistics/index.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import { Card, Button, Row, Col, Form, Select, Checkbox, Spin } from "antd"; import { TableListItem } from "./data"; import { queryRule } from "./service"; -import { getAllInfoSettingValueBySettingName } from "../Employee/service"; +import { getAllInfoSettingValueBySettingName, getPostListByDept } from "../Employee/service"; const { Option } = Select; @@ -25,13 +25,14 @@ const UserList: React.FC<{}> = () => { } const [postList, setPostList] = useState([]); + const [departmentList, setDepartmentList] = useState([]); const [form] = Form.useForm(); useEffect(() => { async function fetchData() { handleLoadChange(true) - const res = await handleTableChange({isEdu: 1, isPtq: 1, isSkill: 1}) + const res = await handleTableChange({isEdu: 1, isPtq: 1, isSkill: 1, isSex: 1, isDepartment: 1, isAge: 1}) handleLoadChange(false) handleDataChange(res.data) } @@ -40,6 +41,11 @@ const UserList: React.FC<{}> = () => { setPostList(res.data); } }); + getAllInfoSettingValueBySettingName({ settingName: '部门' }).then((res) => { + if (res.retcode && res.data) { + setDepartmentList(res.data); + } + }); fetchData() }, []); return ( @@ -49,8 +55,26 @@ const UserList: React.FC<{}> = () => {
- - { + getPostListByDept({departments: e}).then(res => { + const arr = res.data.map((item: any) => { + return { + settingValue: item + } + }) + setPostList(arr) + }) + }} allowClear> + {departmentList.map((item) => ( + + ))} + + + + + + 性别分析 + + + 年龄分析 + + + 部门人数分析 + - 学历分享 + 学历分析 技能等级分析 @@ -75,6 +108,9 @@ const UserList: React.FC<{}> = () => { const param = { ...values, isEdu: values.isEdu ? 1 : 0, + isDepartment: values.isDepartment ? 1 : 0, + isSex: values.isSex ? 1 : 0, + isAge: values.isAge ? 1 : 0, isSkill: values.isSkill ? 1 : 0, isPtq: values.isPtq ? 1 : 0 } @@ -86,6 +122,24 @@ const UserList: React.FC<{}> = () => { {data.map(e => + {e.sexList && e.sexList?.length > 0 ? <> +
性别分析
+ + {e.sexList?.map(item => {item.analysisName == 1 ? '男' : item.analysisName == 2 ? '女' : ''}: {item.analysisCount}人 占比 {(item.analysisCount/item.postCount * 100).toFixed(2)}%)} + + :null} + {e.ageList && e.ageList?.length > 0 ? <> +
年龄分析
+ + {e.ageList?.map(item => {item.analysisName}: {item.analysisCount}人 占比 {(item.analysisCount/item.postCount * 100).toFixed(2)}%)} + + :null} + {e.departmentList && e.departmentList?.length > 0 ? <> +
部门人数分析
+ + {e.departmentList?.map(item => 总人数: {item.postCount}人 占比 {(item.analysisCount/item.postCount * 100).toFixed(2)}%)} + + :null} {e.educationList && e.educationList?.length > 0 ? <>
学历分析
diff --git a/src/pages/Employee/components/UpdateEducationResumeForm.tsx b/src/pages/Employee/components/UpdateEducationResumeForm.tsx index c4f7ebf..6dcb555 100644 --- a/src/pages/Employee/components/UpdateEducationResumeForm.tsx +++ b/src/pages/Employee/components/UpdateEducationResumeForm.tsx @@ -6,6 +6,9 @@ export interface FormValueType extends Partial { education?: string; school?: string; speciality?: string; + highestEducation?: string; + undergraduateSchools?: string; + undergraduateMajor?: string; intake?: string; graduationTime?: string; } @@ -25,6 +28,9 @@ const UpdateEducationResumeForm: React.FC = (props) => { education: props.values.education, school: props.values.school, speciality: props.values.speciality, + highestEducation: props.values.highestEducation, + undergraduateSchools: props.values.undergraduateSchools, + undergraduateMajor: props.values.undergraduateMajor, intake: props.values.intake, graduationTime: props.values.graduationTime, }); @@ -86,29 +92,46 @@ const UpdateEducationResumeForm: React.FC = (props) => { - - + + - - + + + + + + + + + + + + + + + + + + + + + - - diff --git a/src/pages/Employee/components/UpdateForm.tsx b/src/pages/Employee/components/UpdateForm.tsx index 7bcab3e..ffdf2bd 100644 --- a/src/pages/Employee/components/UpdateForm.tsx +++ b/src/pages/Employee/components/UpdateForm.tsx @@ -11,6 +11,8 @@ import { Modal, Popconfirm, message, + Image, + InputNumber, } from 'antd'; import { TableListItem } from '../data'; import { @@ -18,6 +20,7 @@ import { delFamilyMembers, delHonor, delWorkExperience, + exportEmployeeDetail, getAllEducationResume, getAllFamilyMembers, getAllHonor, @@ -36,6 +39,7 @@ import UpdateHonorForm from './UpdateHonorForm'; import { useReactToPrint } from 'react-to-print'; //@ts-ignore import Html2Pdf from 'js-html2pdf'; +import EmptyImage from '@/assets/empty.png' const { Option } = Select; export interface FormValueType extends Partial {} @@ -47,6 +51,23 @@ export interface UpdateFormProps { values: Partial; } +/** + * 批量导出 + * @param selectedRows + */ +const handleExportEmployeeDetail = async ({ ...params }: any) => { + const hide = message.loading('正在导出'); + try { + await exportEmployeeDetail(params); + hide(); + return true; + } catch (error) { + hide(); + message.error('处理失败,请重试'); + return false; + } +}; + /** * 更新节点 * @param fields @@ -175,6 +196,10 @@ const UpdateForm: React.FC = (props) => { employeeName: props.values.employeeName, employeeNo: props.values.employeeNo, unitId: props.values.unitId, + age: props.values.age, + departmentId: props.values.departmentId, + sex: props.values.sex, + photo: props.values.photo, postId: props.values.postId, groupsId: props.values.groupsId, ptqId: props.values.ptqId, @@ -192,6 +217,7 @@ const UpdateForm: React.FC = (props) => { const [ptqList, setPtqList] = useState([]); const [skillLevelList, setSkillLevelList] = useState([]); const [highestEducationList, setHighestEducationList] = useState([]); + const [departmentList, setDepartmentList] = useState([]); const [educationResumeList, setEducationResumeList] = useState([]); const [familyMembersList, setFamilyMembersList] = useState([]); @@ -207,17 +233,29 @@ const UpdateForm: React.FC = (props) => { const educationResumeColumns: ColumnsType = [ { - title: '学历', - dataIndex: 'education', + title: '最高学历', + dataIndex: 'highestEducation', }, { - title: '学校', + title: '最高学历学校', dataIndex: 'school', }, { title: '专业', dataIndex: 'speciality', }, + { + title: '就业学历', + dataIndex: 'education', + }, + { + title: '本科学历学校', + dataIndex: 'undergraduateSchools', + }, + { + title: '本科学历专业', + dataIndex: 'undergraduateMajor', + }, { title: '时间', dataIndex: 'intake', @@ -228,17 +266,29 @@ const UpdateForm: React.FC = (props) => { ]; const educationResumeColumns1: ColumnsType = [ { - title: '学历', - dataIndex: 'education', + title: '最高学历', + dataIndex: 'highestEducation', }, { - title: '学校', + title: '最高学历学校', dataIndex: 'school', }, { title: '专业', dataIndex: 'speciality', }, + { + title: '就业学历', + dataIndex: 'education', + }, + { + title: '本科学历学校', + dataIndex: 'undergraduateSchools', + }, + { + title: '本科学历专业', + dataIndex: 'undergraduateMajor', + }, { title: '入学时间', dataIndex: 'intake', @@ -457,10 +507,14 @@ const UpdateForm: React.FC = (props) => { let ptq; let skillLevel; let highestEducation; + let department; if (fieldsValue.unitId) { unit = unitList.find((e) => e.id === fieldsValue.unitId).settingValue; } + if (fieldsValue.departmentId) { + department = departmentList.find((e) => e.id === fieldsValue.departmentId).settingValue; + } if (fieldsValue.postId) { post = postList.find((e) => e.id === fieldsValue.postId).settingValue; } @@ -490,6 +544,7 @@ const UpdateForm: React.FC = (props) => { ptq, skillLevel, highestEducation, + department }); }; @@ -524,6 +579,11 @@ const UpdateForm: React.FC = (props) => { setUnitList(res.data); } }); + getAllInfoSettingValueBySettingName({ settingName: '部门' }).then((res) => { + if (res.retcode && res.data) { + setDepartmentList(res.data); + } + }); }, []); const getData = (employeeNo: string, type: number) => { @@ -652,6 +712,11 @@ const UpdateForm: React.FC = (props) => { 导出PDF ) : null} + {values.id ? ( + + ) : null} @@ -660,6 +725,13 @@ const UpdateForm: React.FC = (props) => { >
员工基本信息
+
+ +
@@ -697,9 +769,24 @@ const UpdateForm: React.FC = (props) => { - - + + + + + + + + + + + + + + + - {groupsList.map((item) => ( + + - {ptqList.map((item) => ( + + + {ptqList.map((item) => ( + + ))} + + + + {values.id ? ( <> @@ -787,6 +887,9 @@ const UpdateForm: React.FC = (props) => { = () => { title: '手机号', dataIndex: 'mobile', }, + { + title: '性别', + dataIndex: 'sex', + valueType: 'select', + fieldProps: { + mode: "multiple" + }, + formItemProps: { + name: 'sexes' + }, + valueEnum: { + 1: '男', + 2: '女' + } + }, + { + title: '年龄', + dataIndex: 'age', + fieldProps: { + mode: "multiple" + }, + formItemProps: { + name: 'ages' + }, + renderFormItem: (_, { type }, form) => { + if (type === 'form') { + return null; + } + let value1 = form.getFieldValue('ages') ? form.getFieldValue('ages')[0] : ''; + let value2 = form.getFieldValue('ages') ? form.getFieldValue('ages')[1] : ''; + return ( + + { + value1 = e; + const newValues: any = {}; + newValues.ages = [value1, value2]; + form.setFieldsValue(newValues); + }, + }} + style={{ width: 100, textAlign: 'center' }} + /> + + { + value2 = e; + const newValues: any = {}; + newValues.ages = [value1, value2]; + form.setFieldsValue(newValues); + }, + }} + style={{ + width: 100, + textAlign: 'center', + }} + /> + + ); + }, + }, + { + title: '部门', + dataIndex: 'departmentId', + valueType: 'select', + fieldProps: { + mode: "multiple" + }, + formItemProps: { + name: 'departmentIds' + }, + request: async () => { + const msg = await getAllInfoSettingValueBySettingName({settingName: '部门'}) + if (msg.retcode && msg.data) { + return msg.data.map((e: any) => { + return { + label: e.settingValue, + value: e.id + } + }) + } + return [] + } + }, { title: '单位', dataIndex: 'unitId', valueType: 'select', + fieldProps: { + mode: "multiple" + }, + formItemProps: { + name: 'unitIds' + }, request: async () => { const msg = await getAllInfoSettingValueBySettingName({settingName: '单位'}) if (msg.retcode && msg.data) { @@ -141,6 +245,12 @@ const UserList: React.FC<{}> = () => { title: '现岗位', dataIndex: 'postId', valueType: 'select', + fieldProps: { + mode: "multiple" + }, + formItemProps: { + name: 'postIds' + }, request: async () => { const msg = await getAllInfoSettingValueBySettingName({settingName: '岗位'}) if (msg.retcode && msg.data) { @@ -158,6 +268,12 @@ const UserList: React.FC<{}> = () => { title: '班组', dataIndex: 'groupsId', valueType: 'select', + fieldProps: { + mode: "multiple" + }, + formItemProps: { + name: 'groupsIds' + }, request: async () => { const msg = await getAllInfoSettingValueBySettingName({settingName: '班组'}) if (msg.retcode && msg.data) { @@ -175,6 +291,12 @@ const UserList: React.FC<{}> = () => { title: '最高学历', dataIndex: 'highestEducationId', valueType: 'select', + fieldProps: { + mode: "multiple" + }, + formItemProps: { + name: 'highestEducationIds' + }, request: async () => { const msg = await getAllInfoSettingValueBySettingName({settingName: '学历'}) if (msg.retcode && msg.data) { @@ -215,6 +337,12 @@ const UserList: React.FC<{}> = () => { title: '技能等级', dataIndex: 'skillLevelId', valueType: 'select', + fieldProps: { + mode: "multiple" + }, + formItemProps: { + name: 'skillLevelIds' + }, request: async () => { const msg = await getAllInfoSettingValueBySettingName({settingName: '技能等级'}) if (msg.retcode && msg.data) { @@ -232,6 +360,12 @@ const UserList: React.FC<{}> = () => { title: '奖惩等级', dataIndex: 'honorLevel', valueType: 'select', + fieldProps: { + mode: "multiple" + }, + formItemProps: { + name: 'honorLevels' + }, hideInTable: true, request: async () => { const msg = await getAllInfoSettingValueBySettingName({settingName: '奖惩等级'}) @@ -279,6 +413,9 @@ const UserList: React.FC<{}> = () => { rowKey="id" options={false} formRef={ref} + search={{ + labelWidth: 'auto' + }} toolBarRender={() => [