From 80b9c2f288d703eb78ed33228bc6f86d60bc1fe1 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 28 Dec 2022 17:06:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=AE=80=E5=8E=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/personnelResume.js | 8 + .../components/resource/PersonnelResume.js | 346 ++++++++++++++++++ pc4mobx/organization/index.js | 3 + pc4mobx/organization/public/i18n.js | 1 + pc4mobx/organization/stores/index.js | 2 + .../organization/stores/personnelResume.js | 265 ++++++++++++++ pc4mobx/organization/style/resume.less | 27 ++ 7 files changed, 652 insertions(+) create mode 100644 pc4mobx/organization/apis/personnelResume.js create mode 100644 pc4mobx/organization/components/resource/PersonnelResume.js create mode 100644 pc4mobx/organization/stores/personnelResume.js create mode 100644 pc4mobx/organization/style/resume.less diff --git a/pc4mobx/organization/apis/personnelResume.js b/pc4mobx/organization/apis/personnelResume.js new file mode 100644 index 0000000..7ca85a3 --- /dev/null +++ b/pc4mobx/organization/apis/personnelResume.js @@ -0,0 +1,8 @@ + +import { + WeaTools +} from 'ecCom' + +export const getHasRight = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/personnelresume/hasRight', 'GET', params); +} \ No newline at end of file diff --git a/pc4mobx/organization/components/resource/PersonnelResume.js b/pc4mobx/organization/components/resource/PersonnelResume.js new file mode 100644 index 0000000..eaa2b8d --- /dev/null +++ b/pc4mobx/organization/components/resource/PersonnelResume.js @@ -0,0 +1,346 @@ +import React from 'react' +import * as mobx from 'mobx' +import { + inject, + observer, +} from 'mobx-react' +import { + WeaTop, + WeaTab, + WeaFormItem, + WeaRightMenu, + WeaLeftRightLayout, + WeaOrgTree +} from 'ecCom' +import { + Row, + Col, + Spin, + Modal, + Button, + message, + Switch, + Menu, Dropdown, Icon, Select +} from 'antd' +import { + WeaSwitch, + WeaTableNew +} from 'comsMobx' +import { + i18n +} from '../../public/i18n'; + +import '../../style/resume.less'; +import { renderNoright } from '../../util'; + + +const toJS = mobx.toJS; +const confirm = Modal.confirm; + + +@inject('personnelResume') +@observer +export default class PersonnelResume extends React.Component { + constructor(props) { + super(props); + } + + componentWillMount() { + } + + componentDidMount() { + this.init(); + } + + componentWillReceiveProps(nextProps) { + const { + personnelResume + } = this.props; + + if (this.props.location.key !== nextProps.location.key) { + this.init(); + } + } + + init() { + const { + personnelResume + } = this.props; + let { hash } = window.location; + hash = hash.split("?")[0]; + let id = hash.match("[^/]+(?=/$|$)")[0]; + personnelResume.resourceId = id;; + personnelResume.getHasRight(); + } + + //左侧树 + getTree = () => { + const { + personnelResume + } = this.props; + const { + companysId, + } = personnelResume + + let tree = ( + ${i18n.label.organization()}`} + treeNodeClick={this.treeNodeClick} + expandAllChildrenOnSearch={true} + renderNode={item => this.renderNode(item)} + /> + ) + return tree; + } + + renderNode(item) { + return
+ + {item.name} + {item.canceled && ({i18n.label.forbidden()})} +
+ } + + treeNodeClick = (event, ids, nodeids, nodes) => { + const { + personnelResume + } = this.props; + const { + companysId + } = personnelResume; + const type = event.node.props.type || '0'; + const id = event.node.props.id || ''; + personnelResume.nodeType = type; + if (type == '4') { + personnelResume.resourceId = id; + personnelResume.getPersonnelResume(); + } + } + + getTopMenuBtns() { + const { + personnelResume + } = this.props; + const { + topMenu, + tableStore + } = personnelResume; + + let btns = []; + + btns.push() + + topMenu.map((item, i) => { + btns.push(); + }); + + + + return btns; + } + + handleClick(item) { + this[item.menuFun] && this[item.menuFun](); + } + + handleChange(value) { + + } + + // log = () => { + // window.setLogViewProp({ + // logMoudleType: 11, + // keys: new Date().getTime(), + // }); + // } + + + getDropMenuDatas() { + const { + personnelResume + } = this.props; + const { + rightMenu + } = personnelResume; + + let menus = []; + toJS(rightMenu).map((item, index) => { + let obj = { + key: item.menuFun, + icon: , + content: item.menuName, + } + if (item.menuFun == 'collection' || item.menuFun == 'help' || item.menuFun == 'pageAddress') { + obj.disabled = true; + } + menus.push(obj); + }) + return menus; + } + + handleMenuClick(key) { + this[key] && this[key](); + } + + isEmptyObject(obj) { + for (let key in obj) { + return false; + } + return true; + } + + + render() { + + const { + personnelResume + } = this.props; + const { + hasRight, defaultShowLeft, resumeList + } = personnelResume; + + if (hasRight === false) { + return renderNoright(); + } + + + return ( + hasRight &&
+ this.handleMenuClick(key)} + > + } + iconBgcolor='#217346' + loading={true} + buttons={this.getTopMenuBtns()} + showDropIcon={true} + dropMenuDatas={this.getDropMenuDatas()} + onDropMenuClick={(e) => this.handleMenuClick(e)} + > + +
+
+

人员简历信息

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + resumeList.tables.map((item, index) => { + return ( + + + + + + { + item.columns.map(column => { + return ( + + ) + }) + } + + + { + item.datas.map(data => { + return ( + + { + data.map((row, index) => { + return ( + + ) + }) + } + + ) + }) + } + + + ) + }) + } + + + + + +
一、基本信息
姓名{resumeList.lastName}性别{resumeList.sex}出生年月{resumeList.birthday}
籍贯{resumeList.native}政治面貌{resumeList.politics}部门{resumeList.department}
婚姻状况{resumeList.marriage}岗位{resumeList.jobtitle}入职时间{resumeList.companystartdate}
参加工作时间{resumeList.workstartdate}身份证号{resumeList.idCard}
家庭地址{resumeList.address}联系电话{resumeList.telephone}
E-mail{resumeList.email}
{item.title}
{column.name}
{row.value}
个人自述{resumeList.selfStatement}
+ +
+ +
+
+
+
+
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index c09a712..de71a75 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -34,6 +34,7 @@ import ResourceBasicInfo from "./components/resource/ResourceBasicInfo"; import ResourceCard from "./components/resource/ResourceCard"; import ManagerDetach from "./components/detach/ManagerDetach"; import ColumnSetting from "./components/columnSetting"; +import PersonnelResume from "./components/resource/PersonnelResume" import stores from "./stores"; import "./style/index"; @@ -100,6 +101,8 @@ const Routes = ( + + ); diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index 5dc7667..82db8c0 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -171,6 +171,7 @@ export const i18n = { columnPermission:() => getLabel(386247, '栏目权限管理'), columnCustom:() => getLabel(386247, '栏目功能定义'), cardColumnSet:() => getLabel(386247, '人员卡片栏目设置'), + personnelResume:() => getLabel(386247, '人员简历'), diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index 32418fb..0fe47d4 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -28,6 +28,7 @@ import {ImportDialogStore} from "./importDialog"; import {ResourceCardStore} from "./resourceCard"; import {ManagerDetachStore} from "./managerDetach"; import {ColumnSetting} from './columnSetting'; +import {PersonnelResumeStore} from './personnelResume' module.exports = { @@ -61,4 +62,5 @@ module.exports = { resourceCard:new ResourceCardStore(), managerDetach: new ManagerDetachStore(), columnSetting: new ColumnSetting(), + personnelResume:new PersonnelResumeStore() }; diff --git a/pc4mobx/organization/stores/personnelResume.js b/pc4mobx/organization/stores/personnelResume.js new file mode 100644 index 0000000..e3114b3 --- /dev/null +++ b/pc4mobx/organization/stores/personnelResume.js @@ -0,0 +1,265 @@ +import { + observable, + action +} from 'mobx'; +import * as mobx from 'mobx'; +import * as Api from '../apis/personnelResume'; +import { + WeaForm +} from 'comsMobx'; +import { + WeaTableNew +} from 'comsMobx'; +import { + Modal, + message, +} from 'antd' +import { + i18n +} from '../public/i18n'; + +const toJS = mobx.toJS; +const { + TableStore +} = WeaTableNew; + + +export class PersonnelResumeStore { + + @observable topMenu = [] + @observable rightMenu = []; + @observable condition = []; + @observable form = new WeaForm(); + @observable loading = true; + @observable resourceId = ''; + @observable resumeList = { + lastName: '徐凤年', + sex: '男', + birthday: '1999-10-10', + image: '/weaver/weaver.file.FileDownload?fileid=1538', + native: '上海', + politics: '党员', + department: '财务部', + marriage: '已婚', + jobtitle: '剑道第一人', + companystartdate: '2020-12-31', + workstartdate: '2011-10-10', + idCard: '3409871298377483992', + address: '江苏省南京市雨花台区润和创智中心', + telephone: '19823045643', + email: '16378324@163.com', + selfStatement:'本人性格开朗,秦武大帝转世,世间武道的第一人', + tables: [ + { + title: '二、社会保险及住房公积金缴纳情况(单位/元)', + columns: [ + { + name: '首次参保时间', + colspans: 2, + rowspans: 1 + }, + { + name: '养老保险', + colspans: 1, + rowspans: 1 + }, + { + name: '医疗保险', + colspans: 1, + rowspans: 1 + }, + { + name: '失业保险', + colspans: 1, + rowspans: 1 + }, + { + name: '住房公积金', + colspans: 1, + rowspans: 1 + }, + { + name: '企业年金', + colspans: 1, + rowspans: 1 + }, + ], + datas: [ + [{ + value: '2022-10-02', + colspans: 2, + rowspans: 1 + }, { + value: '80', + colspans: 1, + rowspans: 1 + }, + { + value: '36', + colspans: 1, + rowspans: 1 + }, { + value: '360', + colspans: 1, + rowspans: 1 + }, { + value: '180', + colspans: 1, + rowspans: 1 + }, { + value: '20000', + colspans: 2, + rowspans: 1 + }] + ] + }, + { + title: '三、家庭成员信息(包括父母、配偶、子女)', + columns: [ + { + name: '关系', + colspans: 2, + rowspans: 1 + }, + { + name: '姓名', + colspans: 1, + rowspans: 1 + }, + { + name: '工作单位及职务', + colspans: 1, + rowspans: 1 + }, + { + name: '联系电话', + colspans: 1, + rowspans: 1 + }, + { + name: '住址', + colspans: 2, + rowspans: 1 + } + ], + datas: [ + [ + { + value: '父子', + colspans: 2, + rowspans: 1 + }, { + value: '徐晓', + colspans: 1, + rowspans: 1 + }, + { + value: '北凉王', + colspans: 1, + rowspans: 1 + }, { + value: '1589756859', + colspans: 1, + rowspans: 1 + }, { + value: '江苏省南京市北凉军营', + colspans: 2, + rowspans: 1 + } + ], + [ + { + value: '母子', + colspans: 2, + rowspans: 1 + }, { + value: '吴素', + colspans: 1, + rowspans: 1 + }, + { + value: '北凉王妃', + colspans: 1, + rowspans: 1 + }, { + value: '15897566487', + colspans: 1, + rowspans: 1 + }, { + value: '江苏省南京市北凉龙雀军团', + colspans: 2, + rowspans: 1 + } + ], + [ + { + value: '女儿', + colspans: 2, + rowspans: 1 + }, { + value: '徐念凉', + colspans: 1, + rowspans: 1 + }, + { + value: '北凉公主', + colspans: 1, + rowspans: 1 + }, { + value: '15897566587', + colspans: 1, + rowspans: 1 + }, { + value: '莽荒之地', + colspans: 2, + rowspans: 1 + } + ] + ] + + } + ] + + + } + + + @observable defaultShowLeft = true; + @observable companysId = 1 + @observable hasRight = ''; + + + + @action("获取操作按钮") getHasRight() { + Api.getHasRight().then(res => { + if (res.code === 200) { + this.setHasRight(res.data.hasRight); + res.data.rightMenu && this.setRightMenu(res.data.rightMenu); + res.data.topMenu && this.setTopMenu(res.data.topMenu); + res.data.hasRight && this.getPersonnelResume(); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + @action("获取人员简历") getPersonnelResume() { + + + } + + setTopMenu(topMenu) { + this.topMenu = topMenu; + } + + setRightMenu(rightMenu) { + this.rightMenu = rightMenu; + } + + setHasRight(bool) { + this.hasRight = bool; + } + +} \ No newline at end of file diff --git a/pc4mobx/organization/style/resume.less b/pc4mobx/organization/style/resume.less new file mode 100644 index 0000000..f7b8d15 --- /dev/null +++ b/pc4mobx/organization/style/resume.less @@ -0,0 +1,27 @@ +// 人员简历 +.code-box-demo .ant-select { + margin: 0 8px 10px 0; + } + + #components-select-demo-search-box .code-box-demo .ant-select { + margin: 0; + } + + #personnel-resume { + background-color: #dadce0; + padding: 0 60px; + .content{ + height: 100%; + background-color: #FFFFFF; + box-shadow: 2px 2px 10px #909090; + padding: 20px 40px; + .title{ + font-size: 18px; + font-weight: 900; + text-align: center; + } + .resume-table { + margin-top: 20px; + } + } + } \ No newline at end of file