|
|
|
@ -8,6 +8,8 @@ import {
|
|
|
|
|
Table,
|
|
|
|
|
Spin,
|
|
|
|
|
Checkbox,
|
|
|
|
|
Row,
|
|
|
|
|
Col,
|
|
|
|
|
} from 'antd';
|
|
|
|
|
import { OrgChartComponent } from '@/components/orgChart';
|
|
|
|
|
import * as d3 from 'd3';
|
|
|
|
@ -33,6 +35,9 @@ export default class DrawerComponents extends React.Component {
|
|
|
|
|
columns: [],
|
|
|
|
|
spinning: true,
|
|
|
|
|
showJob: false,
|
|
|
|
|
defaultTypeValue: ['isBelongTo'],
|
|
|
|
|
defaultStatusValue: [0, 1, 2, 3],
|
|
|
|
|
disabled: false,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -70,7 +75,7 @@ export default class DrawerComponents extends React.Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取数据
|
|
|
|
|
getDeatilDatas(params, type = 'chart', showJob = '0') {
|
|
|
|
|
getDeatilDatas(params, type = 'chart', showJob = '1') {
|
|
|
|
|
this.setState({ spinning: true, data: [], dataSource: [] });
|
|
|
|
|
d3.json(
|
|
|
|
|
'/api/bs/hrmorganization/orgchart/getDepartmentDetail?' +
|
|
|
|
@ -304,22 +309,19 @@ 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" />
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: inline-block; margin-left: 6px;width: 55%;height:100%">
|
|
|
|
|
<div style="display: inline-block;width: 55%;height:100%">
|
|
|
|
|
<div style='display:flex;align-items:center;height: 25px;line-height: 25px;margin-top:2px'>
|
|
|
|
|
<div style="font-weight: bold;font-size: 15px;ont-family: Microsoft YaHei-Bold, Microsoft YaHei;color: #333333;">${
|
|
|
|
|
d.data.fname
|
|
|
|
|
}</div>
|
|
|
|
|
<div style="font-weight: bold;font-size: 14px;ont-family: Microsoft YaHei-Bold, Microsoft YaHei;color: #333333;">
|
|
|
|
|
${d.data.fname}
|
|
|
|
|
<span style='color: red;'>(${d.data.accountType})</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="font-size: 13px;font-family: Microsoft YaHei-Regular, Microsoft YaHei;font-weight: 400;color: #333333;display: flex;line-height: 25px;">
|
|
|
|
|
<div style="font-size: 13px;margin-top: 5px;font-family: Microsoft YaHei-Regular, Microsoft YaHei;font-weight: 400;color: #333333;display: flex;height: 25px;line-height: 25px;">
|
|
|
|
|
<span>${getLabel(547324, labelData)}: ${
|
|
|
|
|
d.data.companyWorkYear
|
|
|
|
|
} ${getLabel(547526, labelData)}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="font-size: 13px;font-family: Microsoft YaHei-Regular, Microsoft YaHei;font-weight: 400;color: #333333;display: flex;line-height: 25px;">
|
|
|
|
|
<span>${getLabel(547333, labelData)}: ${
|
|
|
|
|
d.data.jobName
|
|
|
|
|
}</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>`;
|
|
|
|
@ -327,22 +329,78 @@ export default class DrawerComponents extends React.Component {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
showDrawer = (params) => {
|
|
|
|
|
const { defaultStatusValue, defaultTypeValue } = this.state;
|
|
|
|
|
params = {
|
|
|
|
|
...params,
|
|
|
|
|
typeValue: defaultTypeValue.join(','),
|
|
|
|
|
statusValue: defaultStatusValue.join(','),
|
|
|
|
|
};
|
|
|
|
|
this.getDeatilDatas(params, 'chart', '0');
|
|
|
|
|
this.setState({ open: true, params: params });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onClose = () => {
|
|
|
|
|
this.setState({ open: false, detailType: 'chart', showJob: false });
|
|
|
|
|
this.setState({
|
|
|
|
|
open: false,
|
|
|
|
|
detailType: 'chart',
|
|
|
|
|
showJob: false,
|
|
|
|
|
defaultStatusValue: [0, 1, 2, 3],
|
|
|
|
|
defaultTypeValue: ['isBelongTo'],
|
|
|
|
|
disabled: false,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
changeDetail = () => {
|
|
|
|
|
const { detailType, params } = this.state;
|
|
|
|
|
const { detailType, params, defaultTypeValue, defaultStatusValue } =
|
|
|
|
|
this.state;
|
|
|
|
|
const newParam = {
|
|
|
|
|
...params,
|
|
|
|
|
typeValue: defaultTypeValue.join(','),
|
|
|
|
|
statusValue: defaultStatusValue.join(','),
|
|
|
|
|
};
|
|
|
|
|
let type = detailType == 'chart' ? 'table' : 'chart';
|
|
|
|
|
const showJob = '0';
|
|
|
|
|
const showJob = this.state.showJob ? '1' : '0';
|
|
|
|
|
this.setState({
|
|
|
|
|
detailType: type,
|
|
|
|
|
});
|
|
|
|
|
this.getDeatilDatas(params, type, showJob);
|
|
|
|
|
this.getDeatilDatas(newParam, type, showJob);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onStatusChange = (checkedValues) => {
|
|
|
|
|
const { labelData } = this.props;
|
|
|
|
|
if (checkedValues.length === 0) {
|
|
|
|
|
return message.error(`${getLabel(547728, labelData)}`, 2);
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
defaultStatusValue: checkedValues,
|
|
|
|
|
});
|
|
|
|
|
const { defaultTypeValue, params, detailType } = this.state;
|
|
|
|
|
const showJob = this.state.showJob ? '1' : '0';
|
|
|
|
|
const nParam = {
|
|
|
|
|
...params,
|
|
|
|
|
statusValue: checkedValues.join(','),
|
|
|
|
|
typeValue: defaultTypeValue.join(','),
|
|
|
|
|
};
|
|
|
|
|
this.getDeatilDatas(nParam, detailType, showJob);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onTypeChange = (checkedValues) => {
|
|
|
|
|
const { labelData } = this.props;
|
|
|
|
|
if (this.state.showJob) {
|
|
|
|
|
return message.error(`${getLabel(547729, labelData)}`, 2);
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
defaultTypeValue: checkedValues,
|
|
|
|
|
disabled: checkedValues.includes('isManager') ? true : false,
|
|
|
|
|
});
|
|
|
|
|
const { defaultStatusValue, params, detailType } = this.state;
|
|
|
|
|
const showJob = this.state.showJob ? '1' : '0';
|
|
|
|
|
const nParam = {
|
|
|
|
|
...params,
|
|
|
|
|
statusValue: defaultStatusValue.join(','),
|
|
|
|
|
typeValue: checkedValues.join(','),
|
|
|
|
|
};
|
|
|
|
|
this.getDeatilDatas(nParam, detailType, showJob);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
@ -355,11 +413,30 @@ export default class DrawerComponents extends React.Component {
|
|
|
|
|
columns,
|
|
|
|
|
spinning,
|
|
|
|
|
showJob,
|
|
|
|
|
defaultStatusValue,
|
|
|
|
|
defaultTypeValue,
|
|
|
|
|
disabled,
|
|
|
|
|
} = this.state;
|
|
|
|
|
let arr = [];
|
|
|
|
|
|
|
|
|
|
const { labelData } = this.props;
|
|
|
|
|
|
|
|
|
|
const optionsType = [
|
|
|
|
|
{ label: `${getLabel(547715, labelData)}`, value: 'isManager' },
|
|
|
|
|
{ label: `${getLabel(547716, labelData)}`, value: 'isBelongTo' },
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const optionsStatus = [
|
|
|
|
|
{ label: `${getLabel(547718, labelData)}`, value: 0 },
|
|
|
|
|
{ label: `${getLabel(547719, labelData)}`, value: 1 },
|
|
|
|
|
{ label: `${getLabel(547720, labelData)}`, value: 2 },
|
|
|
|
|
{ label: `${getLabel(547721, labelData)}`, value: 3 },
|
|
|
|
|
{ label: `${getLabel(547722, labelData)}`, value: 4 },
|
|
|
|
|
{ label: `${getLabel(547723, labelData)}`, value: 5 },
|
|
|
|
|
{ label: `${getLabel(547724, labelData)}`, value: 6 },
|
|
|
|
|
{ label: `${getLabel(547725, labelData)}`, value: 7 },
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
if (detailType == 'chart') {
|
|
|
|
|
arr.push({ label: `${getLabel(547315, labelData)}`, key: '1' });
|
|
|
|
|
//arr.push({ label: '导出PDF', key: '2' });
|
|
|
|
@ -372,7 +449,7 @@ export default class DrawerComponents extends React.Component {
|
|
|
|
|
return (
|
|
|
|
|
<Drawer
|
|
|
|
|
title={getLabel(547321, labelData)}
|
|
|
|
|
width={1100}
|
|
|
|
|
width={1200}
|
|
|
|
|
onClose={this.onClose}
|
|
|
|
|
open={open}
|
|
|
|
|
bodyStyle={{
|
|
|
|
@ -380,6 +457,30 @@ export default class DrawerComponents extends React.Component {
|
|
|
|
|
}}
|
|
|
|
|
extra={
|
|
|
|
|
<Space>
|
|
|
|
|
{detailType == 'chart' && params && params.fclass == '0' && (
|
|
|
|
|
<Checkbox
|
|
|
|
|
style={{ marginTop: '5px', marginLeft: 100 }}
|
|
|
|
|
checked={showJob}
|
|
|
|
|
disabled={disabled}
|
|
|
|
|
onChange={(e) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
showJob: e.target.checked,
|
|
|
|
|
});
|
|
|
|
|
const newParam = {
|
|
|
|
|
...params,
|
|
|
|
|
statusValue: defaultStatusValue.join(','),
|
|
|
|
|
typeValue: defaultTypeValue.join(','),
|
|
|
|
|
};
|
|
|
|
|
this.getDeatilDatas(
|
|
|
|
|
newParam,
|
|
|
|
|
detailType,
|
|
|
|
|
e.target.checked ? '1' : '0',
|
|
|
|
|
);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{getLabel(547447, labelData)}
|
|
|
|
|
</Checkbox>
|
|
|
|
|
)}
|
|
|
|
|
<Dropdown overlay={menu}>
|
|
|
|
|
<Button type="primary">{getLabel(547314, labelData)}</Button>
|
|
|
|
|
</Dropdown>
|
|
|
|
@ -389,44 +490,68 @@ export default class DrawerComponents extends React.Component {
|
|
|
|
|
</Space>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
{detailType == 'chart' ? (
|
|
|
|
|
<div className="svg-container">
|
|
|
|
|
<Spin
|
|
|
|
|
size="large"
|
|
|
|
|
spinning={spinning}
|
|
|
|
|
tip={getLabel(547320, labelData)}
|
|
|
|
|
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}
|
|
|
|
|
<>
|
|
|
|
|
{detailType == 'chart' && (
|
|
|
|
|
<Row style={{ margin: '20px 20px 0px 20px' }}>
|
|
|
|
|
<Col span={2}>{getLabel(547714, labelData)}:</Col>
|
|
|
|
|
<Col span={22}>
|
|
|
|
|
<Checkbox.Group
|
|
|
|
|
options={optionsType}
|
|
|
|
|
value={defaultTypeValue}
|
|
|
|
|
onChange={this.onTypeChange}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
)}
|
|
|
|
|
<Row style={{ margin: '10px 20px 10px 20px' }}>
|
|
|
|
|
<Col span={2}>{getLabel(547717, labelData)}:</Col>
|
|
|
|
|
<Col span={22}>
|
|
|
|
|
<Checkbox.Group
|
|
|
|
|
options={optionsStatus}
|
|
|
|
|
value={defaultStatusValue}
|
|
|
|
|
onChange={this.onStatusChange}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<div style={{ padding: '0 20px' }}>
|
|
|
|
|
<Table
|
|
|
|
|
dataSource={dataSource}
|
|
|
|
|
columns={columns}
|
|
|
|
|
loading={spinning}
|
|
|
|
|
pagination={{
|
|
|
|
|
showSizeChanger: false,
|
|
|
|
|
showTotal: (total) =>
|
|
|
|
|
`${getLabel(547523, labelData)} ${
|
|
|
|
|
dataSource.length
|
|
|
|
|
} ${getLabel(547524, labelData)}`,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
{detailType == 'chart' ? (
|
|
|
|
|
<div className="svg-container">
|
|
|
|
|
<Spin
|
|
|
|
|
size="large"
|
|
|
|
|
spinning={spinning}
|
|
|
|
|
tip={getLabel(547320, labelData)}
|
|
|
|
|
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}
|
|
|
|
|
loading={spinning}
|
|
|
|
|
pagination={{
|
|
|
|
|
showSizeChanger: false,
|
|
|
|
|
showTotal: (total) =>
|
|
|
|
|
`${getLabel(547523, labelData)} ${
|
|
|
|
|
dataSource.length
|
|
|
|
|
} ${getLabel(547524, labelData)}`,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
</Drawer>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|