中远重工初版架构图完成
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 485 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 238 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 737 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 978 B |
|
After Width: | Height: | Size: 981 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 997 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 945 B |
|
After Width: | Height: | Size: 271 KiB |
|
After Width: | Height: | Size: 978 B |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 835 B |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 140 B |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 232 B |
|
After Width: | Height: | Size: 233 B |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
|
||||
/>
|
||||
<link rel="stylesheet" href="./umi.c64b754c.css" />
|
||||
<script>
|
||||
window.routerBase = "/spa/orgChart/";
|
||||
</script>
|
||||
<script>
|
||||
//! umi version: 3.5.32
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
<script src="./umi.1df510d5.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 485 KiB |
|
After Width: | Height: | Size: 271 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
|
@ -24,6 +24,7 @@
|
|||
"@types/d3": "^7.4.0",
|
||||
"d3": "7.4.4",
|
||||
"d3-org-chart": "2.6.0",
|
||||
"jquery": "^3.7.1",
|
||||
"js-export-excel": "^1.1.4",
|
||||
"jspdf": "^2.5.1",
|
||||
"moment": "^2.29.3",
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
|
@ -8,6 +8,8 @@ import {
|
|||
Table,
|
||||
Spin,
|
||||
Checkbox,
|
||||
Row,
|
||||
Col,
|
||||
} from 'antd';
|
||||
import { OrgChartComponent } from '@/components/orgChart';
|
||||
import * as d3 from 'd3';
|
||||
|
|
@ -33,11 +35,22 @@ export default class DrawerComponents extends React.Component {
|
|||
columns: [],
|
||||
spinning: true,
|
||||
showJob: false,
|
||||
nbOptions: [],
|
||||
defaultNbValue: [],
|
||||
wbOptions: [],
|
||||
defaultWbValue: [],
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {}
|
||||
|
||||
componentDidUpdate(prevProps, prevState, snapshotValue) {
|
||||
// 组件更新后的操作
|
||||
// if (orgChart != null) {
|
||||
// orgChart.getChartState().svgHeight = 3000;
|
||||
// }
|
||||
}
|
||||
|
||||
// 点击节点
|
||||
onNodeClick(node) {}
|
||||
|
||||
|
|
@ -62,18 +75,38 @@ export default class DrawerComponents extends React.Component {
|
|||
: `./img/user-card/user-card-blue.png`;
|
||||
}
|
||||
|
||||
//查询条件
|
||||
getDeatilCondition() {
|
||||
return new Promise((resolve) => {
|
||||
d3.json('/api/bs/hrmorganization/orgchart/getDeptDetailCondition?').then(
|
||||
(data) => {
|
||||
this.setState({
|
||||
nbOptions: data.nbCondition,
|
||||
wbOptions: data.wbCondition,
|
||||
defaultNbValue: data.nbValue,
|
||||
});
|
||||
resolve();
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
//获取数据
|
||||
getDeatilDatas(params, type = 'chart', showJob = '0') {
|
||||
this.setState({ spinning: true });
|
||||
this.setState({ spinning: true, data: [] });
|
||||
d3.json(
|
||||
'/api/bs/hrmorganization/orgchart/getDepartmentDetail?' +
|
||||
qs.stringify({ detauleType: type, ...params, showJob }),
|
||||
qs.stringify({ detailType: type, ...params, showJob }),
|
||||
).then((data) => {
|
||||
//
|
||||
if (type == 'chart') {
|
||||
this.setState({ data: data.data, spinning: false });
|
||||
} else {
|
||||
this.setState({ dataSource: data.dataSource, columns: data.columns });
|
||||
this.setState({
|
||||
dataSource: data.dataSource,
|
||||
columns: data.columns,
|
||||
spinning: false,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -304,22 +337,74 @@ export default class DrawerComponents extends React.Component {
|
|||
}
|
||||
};
|
||||
|
||||
showDrawer = (params) => {
|
||||
this.getDeatilDatas(params, 'chart', '0');
|
||||
showDrawer = async (params) => {
|
||||
this.setState({ open: true, params: params });
|
||||
await this.getDeatilCondition();
|
||||
const { defaultNbValue } = this.state;
|
||||
params = {
|
||||
...params,
|
||||
nbValue: defaultNbValue.join(','),
|
||||
};
|
||||
this.getDeatilDatas(params, 'chart', '0');
|
||||
};
|
||||
|
||||
onClose = () => {
|
||||
this.setState({ open: false, detailType: 'chart', showJob: false });
|
||||
this.setState({
|
||||
open: false,
|
||||
detailType: 'chart',
|
||||
showJob: false,
|
||||
data: [],
|
||||
dataSource: [],
|
||||
defaultNbValue: [],
|
||||
defaultWbValue: [],
|
||||
});
|
||||
};
|
||||
|
||||
changeDetail = () => {
|
||||
const { detailType, params } = this.state;
|
||||
const {
|
||||
defaultNbValue,
|
||||
defaultWbValue,
|
||||
detailType,
|
||||
params,
|
||||
data,
|
||||
dataSource,
|
||||
} = this.state;
|
||||
let type = detailType == 'chart' ? 'table' : 'chart';
|
||||
this.setState({
|
||||
detailType: type,
|
||||
});
|
||||
this.getDeatilDatas(params, type, '0');
|
||||
const nParam = {
|
||||
...params,
|
||||
nbValue: defaultNbValue.join(','),
|
||||
wbValue: defaultWbValue.join(','),
|
||||
};
|
||||
this.getDeatilDatas(nParam, type, '0');
|
||||
};
|
||||
|
||||
onNbChange = (checkedValues) => {
|
||||
this.setState({
|
||||
defaultNbValue: checkedValues,
|
||||
});
|
||||
const { defaultWbValue, params, detailType } = this.state;
|
||||
const nParam = {
|
||||
...params,
|
||||
nbValue: checkedValues.join(','),
|
||||
wbValue: defaultWbValue.join(','),
|
||||
};
|
||||
this.getDeatilDatas(nParam, detailType, '0');
|
||||
};
|
||||
|
||||
onWbChange = (checkedValues) => {
|
||||
this.setState({
|
||||
defaultWbValue: checkedValues,
|
||||
});
|
||||
const { defaultNbValue, params, detailType } = this.state;
|
||||
const nParam = {
|
||||
...params,
|
||||
nbValue: defaultNbValue.join(','),
|
||||
wbValue: checkedValues.join(','),
|
||||
};
|
||||
this.getDeatilDatas(nParam, detailType, '0');
|
||||
};
|
||||
|
||||
render() {
|
||||
|
|
@ -332,8 +417,13 @@ export default class DrawerComponents extends React.Component {
|
|||
columns,
|
||||
spinning,
|
||||
showJob,
|
||||
nbOptions,
|
||||
defaultNbValue,
|
||||
wbOptions,
|
||||
defaultWbValue,
|
||||
} = this.state;
|
||||
let arr = [];
|
||||
|
||||
if (detailType == 'chart') {
|
||||
arr.push({ label: '导出图片', key: '1' });
|
||||
//arr.push({ label: '导出PDF', key: '2' });
|
||||
|
|
@ -358,9 +448,6 @@ export default class DrawerComponents extends React.Component {
|
|||
width={1200}
|
||||
onClose={this.onClose}
|
||||
open={open}
|
||||
bodyStyle={{
|
||||
paddingBottom: 80,
|
||||
}}
|
||||
extra={
|
||||
<Space>
|
||||
<Dropdown overlay={menu}>
|
||||
|
|
@ -372,40 +459,71 @@ export default class DrawerComponents extends React.Component {
|
|||
</Space>
|
||||
}
|
||||
>
|
||||
{detailType == 'chart' ? (
|
||||
data.length > 0 && (
|
||||
<Spin size="large" spinning={spinning}>
|
||||
<OrgChartComponent
|
||||
setChart={(chart) => (orgChart = chart)}
|
||||
setClick={(click) => (addNodeChildFunc = click)}
|
||||
onNodeClick={this.onNodeClick}
|
||||
onButtonClick={this.onButtonClick}
|
||||
data={data}
|
||||
buttonContent={this.buttonContentRender}
|
||||
nodeWidth={this.nodeWidthRender}
|
||||
nodeHeight={this.nodeHeightRender}
|
||||
nodeContent={this.nodeContentRender}
|
||||
<>
|
||||
<Row style={{ margin: '20px 20px' }}>
|
||||
<Col span={2}>内部职工:</Col>{' '}
|
||||
<Col span={22}>
|
||||
{' '}
|
||||
<Checkbox.Group
|
||||
options={nbOptions}
|
||||
value={defaultNbValue}
|
||||
onChange={this.onNbChange}
|
||||
/>
|
||||
</Spin>
|
||||
)
|
||||
) : (
|
||||
<div style={{ padding: '0 20px' }}>
|
||||
<Table
|
||||
dataSource={dataSource}
|
||||
columns={columns}
|
||||
scroll={{ y: 500 }}
|
||||
pagination={{
|
||||
locale: {
|
||||
// 翻页文本替换
|
||||
items_per_page: '条/页',
|
||||
jump_to: '跳至',
|
||||
page: '页',
|
||||
},
|
||||
showTotal: (total) => `共 ${dataSource.length} 条`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{ margin: '0px 20px' }}>
|
||||
<Col span={2}>外部人员:</Col>
|
||||
<Col span={22}>
|
||||
{' '}
|
||||
<Checkbox.Group
|
||||
options={wbOptions}
|
||||
value={defaultWbValue}
|
||||
onChange={this.onWbChange}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
{detailType == 'chart' ? (
|
||||
<div className="svg-container">
|
||||
<Spin
|
||||
size="large"
|
||||
spinning={spinning}
|
||||
tip="正在读取数据...."
|
||||
className="loading-center"
|
||||
/>
|
||||
{data.length > 0 && (
|
||||
<OrgChartComponent
|
||||
setChart={(chart) => (orgChart = chart)}
|
||||
setClick={(click) => (addNodeChildFunc = click)}
|
||||
onNodeClick={this.onNodeClick}
|
||||
onButtonClick={this.onButtonClick}
|
||||
data={data}
|
||||
buttonContent={this.buttonContentRender}
|
||||
nodeWidth={this.nodeWidthRender}
|
||||
nodeHeight={this.nodeHeightRender}
|
||||
nodeContent={this.nodeContentRender}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div style={{ padding: '0 20px' }}>
|
||||
<Table
|
||||
dataSource={dataSource}
|
||||
columns={columns}
|
||||
scroll={{ y: 500 }}
|
||||
loading={spinning}
|
||||
pagination={{
|
||||
locale: {
|
||||
// 翻页文本替换
|
||||
items_per_page: '条/页',
|
||||
jump_to: '跳至',
|
||||
page: '页',
|
||||
},
|
||||
showTotal: (total) => `共 ${dataSource.length} 条`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
</Drawer>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,3 +2,11 @@
|
|||
width: 500px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.loading-center {
|
||||
position: absolute;
|
||||
top: 50vh;
|
||||
left: 50%;
|
||||
margin-left: -8px;
|
||||
margin-top: -8px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -230,8 +230,8 @@ export class OrgChart {
|
|||
top: {
|
||||
nodeLeftX: (node) => -node.width / 2,
|
||||
nodeRightX: (node) => node.width / 2,
|
||||
nodeTopY: (node) => 0,
|
||||
//nodeTopY: (node) => node.height / 0.3,
|
||||
//nodeTopY: (node) => 0,
|
||||
nodeTopY: (node) => node.height / 0.4,
|
||||
nodeBottomY: (node) => node.height,
|
||||
nodeJoinX: (node) => node.x - node.width / 2,
|
||||
nodeJoinY: (node) => node.y + node.height,
|
||||
|
|
|
|||
|
|
@ -99,8 +99,8 @@ export default function companyPage() {
|
|||
};
|
||||
|
||||
// 获取部门图片
|
||||
function getDepartmentImage(fisvitual) {
|
||||
return fisvitual == '0' ? `./img/back/level4.png` : `./img/back/level8.png`;
|
||||
function getDepartmentImage(level) {
|
||||
return `./img/department/dept${level}.png`;
|
||||
}
|
||||
|
||||
// 获取分部图片
|
||||
|
|
@ -191,7 +191,7 @@ export default function companyPage() {
|
|||
<div style="width: 100%; height: 100%; background-size: 100% 100%;">
|
||||
<div style='position:absolute;height:100%'>
|
||||
<img style='width:144px;height:106px' src="${getDepartmentImage(
|
||||
d.data.fisvitual,
|
||||
d.data.deptLevel,
|
||||
)}"/>
|
||||
</div>
|
||||
<div style="width: 144px;height: 80px;top: 35px;position: relative;font-weight: 400;font-size: 14px;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@
|
|||
}
|
||||
|
||||
.ant-drawer-body {
|
||||
padding: 0px;
|
||||
padding: 0px !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
|
@ -129,3 +129,21 @@
|
|||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.svg-container {
|
||||
overflow-y: auto;
|
||||
//height: calc(~'100% - 100px');;
|
||||
}
|
||||
|
||||
.svg-container::-webkit-scrollbar {
|
||||
/*滚动条整体样式*/
|
||||
width: 10px;
|
||||
/*高宽分别对应横竖滚动条的尺寸*/
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.svg-container::-webkit-scrollbar-thumb {
|
||||
/*滚动条里面小方块 #c1c1c1*/
|
||||
border-radius: 10px;
|
||||
background-color: #c1c1c1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ export default function userPage() {
|
|||
// 获取数据
|
||||
useEffect(() => {
|
||||
document.cookie =
|
||||
'ecology_JSessionid=aaahTt6JHXEIM-HoSW-Xy; JSESSIONID=aaahTt6JHXEIM-HoSW-Xy; Systemlanguid=7; languageidweaver=7; loginuuids=2773; __randcode__=a8294fa0-56d7-430f-a35b-139d73474682; loginidweaver=zhangxy16';
|
||||
'ecology_JSessionid=aaaSjdYP0FDFSd1hMbt8y; JSESSIONID=aaaSjdYP0FDFSd1hMbt8y; Systemlanguid=7; languageidweaver=7; loginuuids=1; loginidweaver=sysadmin;';
|
||||
d3.json(
|
||||
'/api/bs/hrmorganization/orgchart/userData?fclass=0&fisvitual=0&root=0&level=3&id=0',
|
||||
).then((data) => {
|
||||
|
|
|
|||