From 445aa1f00c93f1b217910ba59d96140212e419d8 Mon Sep 17 00:00:00 2001
From: Chengliang <1546584672@qq.com>
Date: Tue, 2 Apr 2024 15:27:12 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A1=BA=E8=83=9C=E9=A1=B9=E7=9B=AE=E7=BB=84?=
=?UTF-8?q?=E7=BB=87=E6=9E=B6=E6=9E=84=E5=9B=BE=E4=BA=8C=E5=BC=80=201.?=
=?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF=E9=BB=98=E8=AE=A4=E5=B1=95?=
=?UTF-8?q?=E5=BC=80=202.=E4=BA=BA=E5=91=98=E5=8D=A1=E7=89=87=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E5=B2=97=E4=BD=8D=203.=E4=BA=BA=E5=91=98=E5=8D=A1?=
=?UTF-8?q?=E7=89=87=E7=82=B9=E5=87=BB=E5=B1=95=E7=A4=BA=E5=B7=A5=E4=BD=9C?=
=?UTF-8?q?=E8=81=8C=E8=B4=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/drawer/index.jsx | 47 ++++++++++++++++++++++++++++++---
src/components/topBar/index.jsx | 41 ----------------------------
src/pages/company.jsx | 16 ++++-------
src/pages/user.jsx | 2 +-
4 files changed, 49 insertions(+), 57 deletions(-)
diff --git a/src/components/drawer/index.jsx b/src/components/drawer/index.jsx
index bea0e32..b816dc0 100644
--- a/src/components/drawer/index.jsx
+++ b/src/components/drawer/index.jsx
@@ -8,6 +8,8 @@ import {
Table,
Spin,
Checkbox,
+ Modal,
+ Input,
} from 'antd';
import { OrgChartComponent } from '@/components/orgChart';
import * as d3 from 'd3';
@@ -32,13 +34,22 @@ export default class DrawerComponents extends React.Component {
columns: [],
spinning: true,
showJob: true,
+ isModalOpen: false,
+ jobResponsibility: '',
};
}
componentDidMount() {}
// 点击节点
- onNodeClick(node) {}
+ onNodeClick = (node) => {
+ if (node.ftype == '4') {
+ this.setState({
+ jobResponsibility: node.jobResponsibility,
+ isModalOpen: true,
+ });
+ }
+ };
onButtonClick(event, d) {
if (d.children) {
@@ -289,8 +300,9 @@ export default class DrawerComponents extends React.Component {
d.data.fname
}
-
+
司龄: ${d.data.companyWorkYear} 年
+
岗位: ${d.data.jobTitle}
@@ -305,13 +317,23 @@ export default class DrawerComponents extends React.Component {
};
onClose = () => {
- this.setState({ open: false, detailType: 'chart', showJob: true });
+ const { params } = this.state;
+ this.setState({
+ open: false,
+ detailType: 'chart',
+ showJob: params.fclass == '0' ? 'true' : 'false',
+ });
};
changeDetail = () => {
const { detailType, params } = this.state;
let type = detailType == 'chart' ? 'table' : 'chart';
- const showJob = this.state.showJob ? '1' : '0';
+ var showJob = '1';
+ if (params.fclass == '0') {
+ showJob = this.state.showJob ? '1' : '0';
+ } else {
+ showJob = '0';
+ }
this.setState({
detailType: type,
});
@@ -328,6 +350,8 @@ export default class DrawerComponents extends React.Component {
columns,
spinning,
showJob,
+ jobResponsibility,
+ isModalOpen,
} = this.state;
let arr = [];
if (detailType == 'chart') {
@@ -414,6 +438,21 @@ export default class DrawerComponents extends React.Component {
/>
)}
+ this.setState({ isModalOpen: false })}
+ footer={[
+ ,
+ ]}
+ >
+ {jobResponsibility}
+
);
}
diff --git a/src/components/topBar/index.jsx b/src/components/topBar/index.jsx
index fa3b8d7..bc46d83 100644
--- a/src/components/topBar/index.jsx
+++ b/src/components/topBar/index.jsx
@@ -301,17 +301,6 @@ export class TopBar extends React.Component {
-
-
-