中远重工组织架构图改造

上海中远重工组织架构图
Chengliang 1 year ago
parent e100a542e1
commit 156e801980

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 B

@ -32,7 +32,7 @@ export default class DrawerComponents extends React.Component {
dataSource: [], dataSource: [],
columns: [], columns: [],
spinning: true, spinning: true,
showJob: true, showJob: false,
}; };
} }
@ -63,7 +63,7 @@ export default class DrawerComponents extends React.Component {
} }
// //
getDeatilDatas(params, type = 'chart', showJob = '1') { getDeatilDatas(params, type = 'chart', showJob = '0') {
this.setState({ spinning: true }); this.setState({ spinning: true });
d3.json( d3.json(
'/api/bs/hrmorganization/orgchart/getDepartmentDetail?' + '/api/bs/hrmorganization/orgchart/getDepartmentDetail?' +
@ -237,7 +237,11 @@ export default class DrawerComponents extends React.Component {
</div> </div>
<div style="display: inline-block; background-size: 100% 100%; width: 35%; height: 90px; text-align:center; vertical-align: top; margin-left: 11px;box-sizing: border;"> <div style="display: inline-block; background-size: 100% 100%; width: 35%; height: 90px; text-align:center; vertical-align: top; margin-left: 11px;box-sizing: border;">
<img src='./img/user-card/avatar-outer.png' style='position:absolute;width:90px;height:90px;left:11px'/> <img src='./img/user-card/avatar-outer.png' style='position:absolute;width:90px;height:90px;left:11px'/>
<img src="./img/department.png" style="width: 58px; height: 58px;position:absolute;left:29px; border-radius: 50%; margin-top: 16px;position:absolute;left:29px;z-index:999"/> <img src="${
d.data.fleaderimg
? d.data.fleaderimg
: './img/department.png'
}" style="width: 58px; height: 58px;position:absolute;left:29px; border-radius: 50%; margin-top: 16px;position:absolute;left:29px;z-index:999"/>
</div> </div>
<div style="display: inline-block; margin-left: 6px;width: 55%"> <div style="display: inline-block; margin-left: 6px;width: 55%">
<div class="dept-box" style="font-size: 15px;font-family: Microsoft YaHei-Regular, Microsoft YaHei;font-weight: 900;color: #333333;height: 25px;line-height: 25px;width:110px,white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"> <div class="dept-box" style="font-size: 15px;font-family: Microsoft YaHei-Regular, Microsoft YaHei;font-weight: 900;color: #333333;height: 25px;line-height: 25px;width:110px,white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">
@ -284,14 +288,15 @@ export default class DrawerComponents extends React.Component {
: './img/default_avator.png' : './img/default_avator.png'
}" style="width: 58px; height: 58px; border-radius: 50%; margin-top: 16px;margin-left: -6px;z-index:999" /> }" style="width: 58px; height: 58px; border-radius: 50%; margin-top: 16px;margin-left: -6px;z-index:999" />
</div> </div>
<div style="display: inline-block; margin-left: 6px;width: 55%;height:100%"> <div style="display: inline-block; margin-left: 6px;width: 55%;height:100%;margin-top: -12px;">
<div style='display:flex;align-items:center;height: 25px;line-height: 25px;margin-top:15px'> <div style='display:flex;align-items:center;height: 25px;line-height: 25px;margin-top:15px'>
<div style="font-weight: bold;font-size: 15px;ont-family: Microsoft YaHei-Bold, Microsoft YaHei;color: #333333;">${ <div style="font-weight: bold;font-size: 15px;ont-family: Microsoft YaHei-Bold, Microsoft YaHei;color: #333333;">${
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.localDeptName} </span>
<div>岗位名称: ${d.data.jobTitle}</div>
</div> </div>
</div> </div>
</div> </div>
@ -300,23 +305,21 @@ 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 = () => {
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';
this.setState({ this.setState({
detailType: type, detailType: type,
}); });
this.getDeatilDatas(params, type, showJob); this.getDeatilDatas(params, type, '0');
}; };
render() { render() {
@ -352,7 +355,7 @@ export default class DrawerComponents extends React.Component {
</span> </span>
</> </>
} }
width={1100} width={1200}
onClose={this.onClose} onClose={this.onClose}
open={open} open={open}
bodyStyle={{ bodyStyle={{
@ -360,25 +363,6 @@ export default class DrawerComponents extends React.Component {
}} }}
extra={ extra={
<Space> <Space>
{detailType == 'chart' && params && params.fclass == '0' && (
<Checkbox
style={{ marginTop: '5px', marginLeft: 100 }}
checked={showJob}
onChange={(e) => {
this.setState({
showJob: e.target.checked,
});
this.getDeatilDatas(
params,
detailType,
e.target.checked ? '1' : '0',
);
}}
>
是否显示岗位
</Checkbox>
)}
<Dropdown overlay={menu}> <Dropdown overlay={menu}>
<Button type="primary">导出</Button> <Button type="primary">导出</Button>
</Dropdown> </Dropdown>

@ -21,7 +21,7 @@ const { TextArea } = Input;
import moment from 'moment'; import moment from 'moment';
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
import locale from 'antd/lib/date-picker/locale/zh_CN'; import locale from 'antd/lib/date-picker/locale/zh_CN';
import { HomeOutlined } from '@ant-design/icons'; import { HomeOutlined, FolderOpenOutlined } from '@ant-design/icons';
moment.locale('zh-cn'); moment.locale('zh-cn');
export class TopBar extends React.Component { export class TopBar extends React.Component {
@ -32,12 +32,15 @@ export class TopBar extends React.Component {
rootTreeData: [], // rootTreeData: [], //
treeLoadedKeys: [], treeLoadedKeys: [],
treeExpandedKeys: [], treeExpandedKeys: [],
deptTreeData: [],
requestData: { requestData: {
fclass: '0', fclass: '0',
root: undefined, root: undefined,
level: '2', department: undefined,
level: '3',
fisvitual: '0', fisvitual: '0',
hidedept: '0', hidedept: '0',
showClass: '0', // 0
}, },
open: false, open: false,
confirmLoading: false, confirmLoading: false,
@ -156,6 +159,29 @@ export class TopBar extends React.Component {
this.getSeatchCondition(this.props.url); this.getSeatchCondition(this.props.url);
} }
/**
* 部门节点树
*/
getDeptTreeData = (url) => {
fetch(url)
.then((res) => res.json())
.then((data) => {
if (data.api_status) {
let arr = [...data.departmentTree];
arr.map((item, index) => {
item.icon = <FolderOpenOutlined />;
});
this.setState({
deptTreeData: arr,
});
}
});
};
onDeptChange = (value, label, extra) => {
this.handleFormChange({ department: value });
};
getSeatchCondition = (url) => { getSeatchCondition = (url) => {
fetch(url) fetch(url)
.then((res) => res.json()) .then((res) => res.json())
@ -163,10 +189,14 @@ export class TopBar extends React.Component {
data.companyTree.map((item, index) => { data.companyTree.map((item, index) => {
item.icon = <HomeOutlined />; item.icon = <HomeOutlined />;
}); });
this.handleFormChange({ root: data.root });
this.setState({ this.setState({
fclasslist: data.fclasslist, fclasslist: data.fclasslist,
rootTreeData: data.companyTree, rootTreeData: data.companyTree,
}); });
this.getDeptTreeData(
`/api/bs/hrmorganization/orgchart/getDepartmentTree?fclass=0&subcompany=${data.root}`,
);
}); });
}; };
@ -188,50 +218,27 @@ export class TopBar extends React.Component {
render() { render() {
const { disabled, type } = this.props; const { disabled, type } = this.props;
const { rootTreeData, open, confirmLoading, treeExpandedKeys } = this.state; const {
rootTreeData,
open,
confirmLoading,
treeExpandedKeys,
requestData,
deptTreeData,
} = this.state;
const { fclass, department, root, showClass } = requestData;
return ( return (
<div className={style.topbarWrapper}> <div className={style.topbarWrapper}>
<Row> <Row>
<Col span={6}> <Col span={6}>
维度 所属分部
<Select
defaultValue="0"
style={{ width: 140 }}
value={this.state.requestData.fclass}
onChange={(value) => {
const requestData = {
fclass: value,
root: undefined,
level: '2',
fisvitual: '0',
hidedept: '0',
};
this.handleFormChange(requestData);
this.setState({
rootTreeData: [],
});
this.getNodeTreeNode(
`/api/bs/hrmorganization/orgchart/getSubCompanyTree?fclass=${value}`,
false,
);
this.props.changeFclass(requestData);
}}
>
{this.state.fclasslist.map((item) => (
<Option key={item.key} value={item.id}>
{item.companyname}
</Option>
))}
</Select>
</Col>
<Col span={6}>
根节点
<TreeSelect <TreeSelect
disabled
treeDataSimpleMode treeDataSimpleMode
allowClear allowClear
style={{ width: '75%' }} style={{ width: '75%' }}
value={this.state.requestData.root} value={root}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }} dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择根节点" placeholder="请选择根节点"
onChange={this.onRootChange} onChange={this.onRootChange}
@ -240,6 +247,29 @@ export class TopBar extends React.Component {
treeIcon treeIcon
/> />
</Col> </Col>
<Col span={6}>
<Checkbox
style={{ marginTop: '5px', marginLeft: 60 }}
checked={showClass == '1'}
onChange={(e) =>
this.handleFormChange({
showClass: e.target.checked ? '1' : '0',
})
}
>
显示班组
</Checkbox>
<Tooltip
title="提示:开启后将显示班组信息"
color="#0082fb"
placement="rightTop"
>
<QuestionCircleOutlined
style={{ color: '#0082fb', cursor: 'pointer', fontSize: 16 }}
/>
</Tooltip>
</Col>
<Col span={6}> <Col span={6}>
<Checkbox <Checkbox
style={{ marginTop: '5px', marginLeft: 100 }} style={{ marginTop: '5px', marginLeft: 100 }}
@ -279,39 +309,20 @@ export class TopBar extends React.Component {
</Row> </Row>
<Row style={{ marginTop: '15px' }}> <Row style={{ marginTop: '15px' }}>
<Col span={6}> <Col span={6}>
<Checkbox 部门节点
style={{ marginTop: '5px' }} <TreeSelect
checked={this.state.requestData.fisvitual == '1'} treeDataSimpleMode
onChange={(e) => allowClear
this.handleFormChange({ style={{ width: '75%' }}
fisvitual: e.target.checked ? '1' : '0', value={department}
}) dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
} placeholder="请选择"
> onChange={this.onDeptChange}
显示虚拟组织 treeData={deptTreeData}
</Checkbox> treeIcon
<Tooltip
title="提示:若启用虚拟组织,需要在分部自定义表增加字段(名称 fblx) 字段类型 下拉框(0实体 1虚拟) 部门自定义表同上(字段名称 bmlx)。"
color="#0082fb"
placement="rightTop"
>
<QuestionCircleOutlined
style={{ color: '#0082fb', cursor: 'pointer', fontSize: 16 }}
/> />
</Tooltip>
</Col> </Col>
<Col span={16}> <Col span={8} style={{ textAlign: 'center' }}>
<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' }}

@ -10,8 +10,10 @@ import OperateDialog from '../components/dialog';
import jsPDF from 'jspdf'; import jsPDF from 'jspdf';
import moment from 'moment'; import moment from 'moment';
import qs from 'qs'; import qs from 'qs';
import { message, Spin, notification } from 'antd'; import { message, Spin, notification, Affix, Button, Tooltip } from 'antd';
import { SmileOutlined } from '@ant-design/icons'; import { SmileOutlined } from '@ant-design/icons';
import remind from '../../public/img/remind.png';
import hand from '../../public/img/hand.gif';
let active = 'top'; let active = 'top';
let drawerCom = null; let drawerCom = null;
@ -109,7 +111,7 @@ export default function companyPage() {
// //
useEffect(() => { useEffect(() => {
d3.json( d3.json(
'/api/bs/hrmorganization/orgchart/companyData?fclass=0&fisvitual=0&hidedept=0&root=0&level=2&id=0', '/api/bs/hrmorganization/orgchart/companyData?fclass=0&fisvitual=0&hidedept=0&root=0&level=3&id=0&showClass=0',
).then((data) => { ).then((data) => {
setData(data.data); setData(data.data);
setHasRight(data?.hasRight); setHasRight(data?.hasRight);
@ -465,13 +467,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)}
@ -491,6 +486,16 @@ export default function companyPage() {
addFolderNode={addFolderNode} addFolderNode={addFolderNode}
deleteNode={deleteNode} deleteNode={deleteNode}
/> />
<Affix style={{ position: 'fixed', top: 200, left: 20 }}>
<Tooltip
title="提示:图中红色数字代表编制数,绿色数字代表在职人数"
color="#0082fb"
placement="rightTop"
>
<img className={styles.remindImage} src={remind} />
</Tooltip>
<img className={styles.handImage} alt="手势" src={hand} />
</Affix>
</div> </div>
) )
); );

@ -117,3 +117,15 @@
padding: 0px; padding: 0px;
overflow: hidden; overflow: hidden;
} }
.remindImage {
cursor: pointer;
width: 30px;
height: 30px;
transition: transform 0.3s ease;
}
.handImage {
width: 40px;
height: 40px;
}

Loading…
Cancel
Save