|
|
@ -31,14 +31,21 @@ export default class DrawerComponents extends React.Component {
|
|
|
|
dataSource: [],
|
|
|
|
dataSource: [],
|
|
|
|
columns: [],
|
|
|
|
columns: [],
|
|
|
|
spinning: true,
|
|
|
|
spinning: true,
|
|
|
|
showJob: true,
|
|
|
|
showJob: false,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {}
|
|
|
|
componentDidMount() {}
|
|
|
|
|
|
|
|
|
|
|
|
// 点击节点
|
|
|
|
// 点击节点
|
|
|
|
onNodeClick(node) {}
|
|
|
|
onNodeClick(node) {
|
|
|
|
|
|
|
|
if (node.ftype == '4') {
|
|
|
|
|
|
|
|
window.open(
|
|
|
|
|
|
|
|
`/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/${node.id}`,
|
|
|
|
|
|
|
|
'_blank',
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onButtonClick(event, d) {
|
|
|
|
onButtonClick(event, d) {
|
|
|
|
if (d.children) {
|
|
|
|
if (d.children) {
|
|
|
@ -63,7 +70,7 @@ export default class DrawerComponents extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
//获取数据
|
|
|
|
//获取数据
|
|
|
|
getDeatilDatas(params, type = 'chart', showJob = '1') {
|
|
|
|
getDeatilDatas(params, type = 'chart', showJob = '1') {
|
|
|
|
this.setState({ spinning: true });
|
|
|
|
this.setState({ spinning: true, data: [], dataSource: [] });
|
|
|
|
d3.json(
|
|
|
|
d3.json(
|
|
|
|
'/api/bs/hrmorganization/orgchart/getDepartmentDetail?' +
|
|
|
|
'/api/bs/hrmorganization/orgchart/getDepartmentDetail?' +
|
|
|
|
qs.stringify({ detauleType: type, ...params, showJob }),
|
|
|
|
qs.stringify({ detauleType: type, ...params, showJob }),
|
|
|
@ -72,7 +79,11 @@ export default class DrawerComponents extends React.Component {
|
|
|
|
if (type == 'chart') {
|
|
|
|
if (type == 'chart') {
|
|
|
|
this.setState({ data: data.data, spinning: false });
|
|
|
|
this.setState({ data: data.data, spinning: false });
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.setState({ dataSource: data.dataSource, columns: data.columns });
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
dataSource: data.dataSource,
|
|
|
|
|
|
|
|
columns: data.columns,
|
|
|
|
|
|
|
|
spinning: false,
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -299,13 +310,12 @@ export default class DrawerComponents extends React.Component {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
showDrawer = (params) => {
|
|
|
|
showDrawer = (params) => {
|
|
|
|
const showJob = params.fclass == '0' ? '1' : '0';
|
|
|
|
this.getDeatilDatas(params, 'chart', '0');
|
|
|
|
this.getDeatilDatas(params, 'chart', showJob);
|
|
|
|
|
|
|
|
this.setState({ open: true, params: params });
|
|
|
|
this.setState({ open: true, params: params });
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
onClose = () => {
|
|
|
|
onClose = () => {
|
|
|
|
this.setState({ open: false, detailType: 'chart', showJob: true });
|
|
|
|
this.setState({ open: false, detailType: 'chart', showJob: false });
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
changeDetail = () => {
|
|
|
|
changeDetail = () => {
|
|
|
@ -372,17 +382,21 @@ export default class DrawerComponents extends React.Component {
|
|
|
|
<Dropdown overlay={menu}>
|
|
|
|
<Dropdown overlay={menu}>
|
|
|
|
<Button type="primary">导出</Button>
|
|
|
|
<Button type="primary">导出</Button>
|
|
|
|
</Dropdown>
|
|
|
|
</Dropdown>
|
|
|
|
<img
|
|
|
|
<Button type="primary" onClick={this.changeDetail}>
|
|
|
|
style={{ width: 36, height: 36, cursor: 'pointer' }}
|
|
|
|
切换
|
|
|
|
src="./img/change.png"
|
|
|
|
</Button>
|
|
|
|
onClick={this.changeDetail}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</Space>
|
|
|
|
</Space>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{detailType == 'chart' ? (
|
|
|
|
{detailType == 'chart' ? (
|
|
|
|
data.length > 0 && (
|
|
|
|
<div className="svg-container">
|
|
|
|
<Spin size="large" spinning={spinning}>
|
|
|
|
<Spin
|
|
|
|
|
|
|
|
size="large"
|
|
|
|
|
|
|
|
spinning={spinning}
|
|
|
|
|
|
|
|
tip="正在读取数据...."
|
|
|
|
|
|
|
|
className="loading-center"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
{data.length > 0 && (
|
|
|
|
<OrgChartComponent
|
|
|
|
<OrgChartComponent
|
|
|
|
setChart={(chart) => (orgChart = chart)}
|
|
|
|
setChart={(chart) => (orgChart = chart)}
|
|
|
|
setClick={(click) => (addNodeChildFunc = click)}
|
|
|
|
setClick={(click) => (addNodeChildFunc = click)}
|
|
|
@ -394,14 +408,15 @@ export default class DrawerComponents extends React.Component {
|
|
|
|
nodeHeight={this.nodeHeightRender}
|
|
|
|
nodeHeight={this.nodeHeightRender}
|
|
|
|
nodeContent={this.nodeContentRender}
|
|
|
|
nodeContent={this.nodeContentRender}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</Spin>
|
|
|
|
)}
|
|
|
|
)
|
|
|
|
</div>
|
|
|
|
) : (
|
|
|
|
) : (
|
|
|
|
<div style={{ padding: '0 20px' }}>
|
|
|
|
<div style={{ padding: '0 20px' }}>
|
|
|
|
<Table
|
|
|
|
<Table
|
|
|
|
dataSource={dataSource}
|
|
|
|
dataSource={dataSource}
|
|
|
|
columns={columns}
|
|
|
|
columns={columns}
|
|
|
|
scroll={{ y: 500 }}
|
|
|
|
scroll={{ y: 600 }}
|
|
|
|
|
|
|
|
loading={spinning}
|
|
|
|
pagination={{
|
|
|
|
pagination={{
|
|
|
|
locale: {
|
|
|
|
locale: {
|
|
|
|
// 翻页文本替换
|
|
|
|
// 翻页文本替换
|
|
|
|