diff --git a/public/img/hand.gif b/public/img/hand.gif new file mode 100644 index 0000000..205a595 Binary files /dev/null and b/public/img/hand.gif differ diff --git a/public/img/remind.png b/public/img/remind.png new file mode 100644 index 0000000..47675ba Binary files /dev/null and b/public/img/remind.png differ diff --git a/src/components/drawer/index.jsx b/src/components/drawer/index.jsx index b111063..5f072be 100644 --- a/src/components/drawer/index.jsx +++ b/src/components/drawer/index.jsx @@ -32,7 +32,7 @@ export default class DrawerComponents extends React.Component { dataSource: [], columns: [], spinning: true, - showJob: true, + showJob: false, }; } @@ -63,7 +63,7 @@ export default class DrawerComponents extends React.Component { } //获取数据 - getDeatilDatas(params, type = 'chart', showJob = '1') { + getDeatilDatas(params, type = 'chart', showJob = '0') { this.setState({ spinning: true }); d3.json( '/api/bs/hrmorganization/orgchart/getDepartmentDetail?' + @@ -237,8 +237,12 @@ export default class DrawerComponents extends React.Component {
- -
+ +
${d.data.fname} @@ -284,14 +288,15 @@ export default class DrawerComponents extends React.Component { : './img/default_avator.png' }" style="width: 58px; height: 58px; border-radius: 50%; margin-top: 16px;margin-left: -6px;z-index:999" />
-
+
${ d.data.fname }
-
- 司龄: ${d.data.companyWorkYear} 年 +
+ 所属部门: ${d.data.localDeptName} +
岗位名称: ${d.data.jobTitle}
@@ -300,23 +305,21 @@ export default class DrawerComponents extends React.Component { }; showDrawer = (params) => { - const showJob = params.fclass == '0' ? '1' : '0'; - this.getDeatilDatas(params, 'chart', showJob); + this.getDeatilDatas(params, 'chart', '0'); this.setState({ open: true, params: params }); }; onClose = () => { - this.setState({ open: false, detailType: 'chart', showJob: true }); + this.setState({ open: false, detailType: 'chart', showJob: false }); }; changeDetail = () => { const { detailType, params } = this.state; let type = detailType == 'chart' ? 'table' : 'chart'; - const showJob = this.state.showJob ? '1' : '0'; this.setState({ detailType: type, }); - this.getDeatilDatas(params, type, showJob); + this.getDeatilDatas(params, type, '0'); }; render() { @@ -352,7 +355,7 @@ export default class DrawerComponents extends React.Component { } - width={1100} + width={1200} onClose={this.onClose} open={open} bodyStyle={{ @@ -360,25 +363,6 @@ export default class DrawerComponents extends React.Component { }} extra={ - {detailType == 'chart' && params && params.fclass == '0' && ( - { - this.setState({ - showJob: e.target.checked, - }); - - this.getDeatilDatas( - params, - detailType, - e.target.checked ? '1' : '0', - ); - }} - > - 是否显示岗位 - - )} diff --git a/src/components/topBar/index.jsx b/src/components/topBar/index.jsx index fa3b8d7..ea5814c 100644 --- a/src/components/topBar/index.jsx +++ b/src/components/topBar/index.jsx @@ -21,7 +21,7 @@ const { TextArea } = Input; import moment from 'moment'; import 'moment/locale/zh-cn'; import locale from 'antd/lib/date-picker/locale/zh_CN'; -import { HomeOutlined } from '@ant-design/icons'; +import { HomeOutlined, FolderOpenOutlined } from '@ant-design/icons'; moment.locale('zh-cn'); export class TopBar extends React.Component { @@ -32,12 +32,15 @@ export class TopBar extends React.Component { rootTreeData: [], //根节点异步树 treeLoadedKeys: [], treeExpandedKeys: [], + deptTreeData: [], requestData: { fclass: '0', root: undefined, - level: '2', + department: undefined, + level: '3', fisvitual: '0', hidedept: '0', + showClass: '0', //班组显示 0不显示 }, open: false, confirmLoading: false, @@ -156,6 +159,29 @@ export class TopBar extends React.Component { this.getSeatchCondition(this.props.url); } + /** + * 部门节点树 + */ + getDeptTreeData = (url) => { + fetch(url) + .then((res) => res.json()) + .then((data) => { + if (data.api_status) { + let arr = [...data.departmentTree]; + arr.map((item, index) => { + item.icon = ; + }); + this.setState({ + deptTreeData: arr, + }); + } + }); + }; + + onDeptChange = (value, label, extra) => { + this.handleFormChange({ department: value }); + }; + getSeatchCondition = (url) => { fetch(url) .then((res) => res.json()) @@ -163,10 +189,14 @@ export class TopBar extends React.Component { data.companyTree.map((item, index) => { item.icon = ; }); + this.handleFormChange({ root: data.root }); this.setState({ fclasslist: data.fclasslist, rootTreeData: data.companyTree, }); + this.getDeptTreeData( + `/api/bs/hrmorganization/orgchart/getDepartmentTree?fclass=0&subcompany=${data.root}`, + ); }); }; @@ -188,50 +218,27 @@ export class TopBar extends React.Component { render() { const { disabled, type } = this.props; - const { rootTreeData, open, confirmLoading, treeExpandedKeys } = this.state; + const { + rootTreeData, + open, + confirmLoading, + treeExpandedKeys, + requestData, + deptTreeData, + } = this.state; + const { fclass, department, root, showClass } = requestData; return (
- 维度: - - - - 根节点: + 所属分部: + + + this.handleFormChange({ + showClass: e.target.checked ? '1' : '0', + }) + } + > + 显示班组 + + + + + + - - this.handleFormChange({ - fisvitual: e.target.checked ? '1' : '0', - }) - } - > - 显示虚拟组织 - - - - + 部门节点: + - - - +
) ); diff --git a/src/pages/index.less b/src/pages/index.less index bd93022..6ec4e01 100644 --- a/src/pages/index.less +++ b/src/pages/index.less @@ -117,3 +117,15 @@ padding: 0px; overflow: hidden; } + +.remindImage { + cursor: pointer; + width: 30px; + height: 30px; + transition: transform 0.3s ease; +} + +.handImage { + width: 40px; + height: 40px; +}