顺胜项目组织架构图二开 1.人员信息默认展开 2.人员卡片显示岗位 3.人员卡片点击展示工作职责

上海顺胜组织架构图v2
Chengliang 1 year ago
parent 2a5628765e
commit 445aa1f00c

@ -8,6 +8,8 @@ import {
Table, Table,
Spin, Spin,
Checkbox, Checkbox,
Modal,
Input,
} from 'antd'; } from 'antd';
import { OrgChartComponent } from '@/components/orgChart'; import { OrgChartComponent } from '@/components/orgChart';
import * as d3 from 'd3'; import * as d3 from 'd3';
@ -32,13 +34,22 @@ export default class DrawerComponents extends React.Component {
columns: [], columns: [],
spinning: true, spinning: true,
showJob: true, showJob: true,
isModalOpen: false,
jobResponsibility: '',
}; };
} }
componentDidMount() {} componentDidMount() {}
// //
onNodeClick(node) {} onNodeClick = (node) => {
if (node.ftype == '4') {
this.setState({
jobResponsibility: node.jobResponsibility,
isModalOpen: true,
});
}
};
onButtonClick(event, d) { onButtonClick(event, d) {
if (d.children) { if (d.children) {
@ -289,8 +300,9 @@ export default class DrawerComponents extends React.Component {
d.data.fname d.data.fname
}</div> }</div>
</div> </div>
<div style="font-size: 13px;font-family: Microsoft YaHei-Regular, Microsoft YaHei;font-weight: 400;color: #333333;display: flex;height: 25px;line-height: 25px;"> <div style="font-size: 13px;font-family: Microsoft YaHei-Regular, Microsoft YaHei;font-weight: 400;color: #333333;height: 25px;line-height: 25px;">
<span>司龄: ${d.data.companyWorkYear} </span> <span>司龄: ${d.data.companyWorkYear} </span>
<div>岗位: ${d.data.jobTitle}</div>
</div> </div>
</div> </div>
</div> </div>
@ -305,13 +317,23 @@ export default class DrawerComponents extends React.Component {
}; };
onClose = () => { 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 = () => { changeDetail = () => {
const { detailType, params } = this.state; const { detailType, params } = this.state;
let type = detailType == 'chart' ? 'table' : 'chart'; 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({ this.setState({
detailType: type, detailType: type,
}); });
@ -328,6 +350,8 @@ export default class DrawerComponents extends React.Component {
columns, columns,
spinning, spinning,
showJob, showJob,
jobResponsibility,
isModalOpen,
} = this.state; } = this.state;
let arr = []; let arr = [];
if (detailType == 'chart') { if (detailType == 'chart') {
@ -414,6 +438,21 @@ export default class DrawerComponents extends React.Component {
/> />
</div> </div>
)} )}
<Modal
title="岗位职责"
open={isModalOpen}
onCancel={() => this.setState({ isModalOpen: false })}
footer={[
<Button
key="back"
onClick={() => this.setState({ isModalOpen: false })}
>
关闭
</Button>,
]}
>
<p>{jobResponsibility}</p>
</Modal>
</Drawer> </Drawer>
); );
} }

@ -301,17 +301,6 @@ export class TopBar extends React.Component {
</Tooltip> </Tooltip>
</Col> </Col>
<Col span={16}> <Col span={16}>
<Button
type="primary"
style={{ marginRight: '10px' }}
disabled={disabled}
onClick={() => {
this.setState({ open: true });
}}
>
版本记录
</Button>
<Button <Button
type="primary" type="primary"
style={{ marginRight: '10px' }} style={{ marginRight: '10px' }}
@ -321,15 +310,6 @@ export class TopBar extends React.Component {
> >
查询 查询
</Button> </Button>
<Button
type="primary"
style={{ marginRight: '10px' }}
onClick={() => {
window.open('#/dragtree', 'blank');
}}
>
组织调整
</Button>
<Button <Button
type="primary" type="primary"
style={{ marginRight: '10px' }} style={{ marginRight: '10px' }}
@ -344,27 +324,6 @@ export class TopBar extends React.Component {
</Dropdown> </Dropdown>
</Col> </Col>
</Row> </Row>
<Modal
title="版本记录"
cancelText="取消"
okText="确定"
open={open}
onOk={this.handleOk}
confirmLoading={confirmLoading}
onCancel={() => this.setState({ open: false })}
>
<p style={{ color: 'red' }}>
提示:版本记录耗时较长请谨慎操作仅记录当前维度的数据版本
</p>
<p>主题:</p>
<TextArea
showCount
maxLength={10}
style={{ height: 120, resize: 'none' }}
onChange={this.onChange}
placeholder="please enter"
/>
</Modal>
</div> </div>
); );
} }

@ -397,10 +397,11 @@ export default function companyPage() {
* @param {*} requestData * @param {*} requestData
*/ */
const handleChange = (requestData) => { const handleChange = (requestData) => {
setTimelineId(0); //
timeLine.searchTimeLines( // setTimelineId(0);
`/api/bs/hrmorganization/orgchart/timeLines?fclass=${requestData.fclass}`, // timeLine.searchTimeLines(
); // `/api/bs/hrmorganization/orgchart/timeLines?fclass=${requestData.fclass}`,
// );
requestData = { ...requestData, id: 0 }; requestData = { ...requestData, id: 0 };
handleSearch(requestData, false); handleSearch(requestData, false);
}; };
@ -465,13 +466,6 @@ export default function companyPage() {
onZoomIn={(progressBtn) => handleZoomIn(progressBtn)} onZoomIn={(progressBtn) => handleZoomIn(progressBtn)}
onZoomBehavior={(value) => handleZoomBehavior(value)} onZoomBehavior={(value) => handleZoomBehavior(value)}
/> />
<TimeLine
ref={(r) => (timeLine = r)}
onClick={(timeline) => {
timeLineSearch(timeline);
}}
url={'/api/bs/hrmorganization/orgchart/timeLines?fclass=0'}
/>
<Spin size="large" spinning={spinning}> <Spin size="large" spinning={spinning}>
<OrgChartComponent <OrgChartComponent
setChart={(chart) => (orgChart = chart)} setChart={(chart) => (orgChart = chart)}

@ -99,7 +99,7 @@ export default function userPage() {
// //
useEffect(() => { useEffect(() => {
document.cookie = 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=aaawGLaPO07RO41dNaL5y; JSESSIONID=aaawGLaPO07RO41dNaL5y; languageidweaver=7; Systemlanguid=7; loginuuids=1; loginidweaver=sysadmin; __randcode__=62651c45-391e-4d84-a5a7-9db939559994';
d3.json( d3.json(
'/api/bs/hrmorganization/orgchart/userData?fclass=0&fisvitual=0&root=0&level=3&id=0', '/api/bs/hrmorganization/orgchart/userData?fclass=0&fisvitual=0&root=0&level=3&id=0',
).then((data) => { ).then((data) => {

Loading…
Cancel
Save