组织架构图个性化需求

中国民用航空华北地区空中交通管理局
Chengliang 6 months ago
parent c9005b9a08
commit b851f5e2b9

@ -22,10 +22,9 @@ const { TextArea } = Input;
import moment from 'moment';
import 'moment/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');
import { getLabel } from '../../util/i18n.js';
import { SmileOutlined } from '@ant-design/icons';
export class TopBar extends React.Component {
constructor(props) {
@ -116,7 +115,11 @@ export class TopBar extends React.Component {
arr = [...data.companyTree];
}
arr.map((item, index) => {
item.icon = <HomeOutlined />;
if (item.type == '1') {
item.icon = <HomeOutlined />;
} else {
item.icon = <FolderOpenOutlined />;
}
});
this.setState({
rootTreeData: arr,
@ -165,7 +168,11 @@ export class TopBar extends React.Component {
.then((res) => res.json())
.then((data) => {
data.companyTree.map((item, index) => {
item.icon = <HomeOutlined />;
if (item.type == '1') {
item.icon = <HomeOutlined />;
} else {
item.icon = <FolderOpenOutlined />;
}
});
this.setState({
fclasslist: data.fclasslist,
@ -197,7 +204,7 @@ export class TopBar extends React.Component {
return (
<div className={style.topbarWrapper}>
<Row>
<Col span={6}>
{/* <Col span={6}>
{getLabel(547293, labelData)}
<Select
defaultValue="0"
@ -228,7 +235,7 @@ export class TopBar extends React.Component {
</Option>
))}
</Select>
</Col>
</Col> */}
<Col span={6}>
{getLabel(547294, labelData)}
<TreeSelect
@ -280,8 +287,6 @@ export class TopBar extends React.Component {
<Option value="4">{getLabel(547465, labelData)}</Option>
</Select>
</Col>
</Row>
<Row style={{ marginTop: '15px' }}>
<Col span={6}>
<Checkbox
style={{ marginTop: '5px' }}
@ -304,8 +309,10 @@ export class TopBar extends React.Component {
/>
</Tooltip>
</Col>
</Row>
<Row style={{ marginTop: '15px' }}>
<Col span={16}>
{this.state.requestData.fclass == '0' && (
{/* {this.state.requestData.fclass == '0' && (
<span>
<Button
type="primary"
@ -336,7 +343,7 @@ export class TopBar extends React.Component {
{getLabel(547313, labelData)}
</Button>
</span>
)}
)} */}
<Button
type="primary"

@ -44,13 +44,16 @@ export default function companyPage() {
//
const onNodeClick = (node) => {
if (node.ftype == '2') {
const params = {
rootId: node.id,
fclass: topbar.state.requestData.fclass,
id: infoRef.current,
};
drawerCom.showDrawer(params);
if (node.ftype == '1') {
window.open(
`/spa/organization/static/index.html#/main/organization/companyExtend/${node.fobjid}`,
'_blank',
);
} else {
window.open(
`/spa/organization/static/index.html#/main/organization/departmentExtend/${node.fobjid}`,
'_blank',
);
}
};
@ -164,6 +167,7 @@ export default function companyPage() {
const nodeContentRender = (d, i, arr, state) => {
let fclass = topbar.state.requestData.fclass;
let statisticsStyle = fclass == 0 ? 'block' : 'none';
let staffStyle = d.data.staffNum == 0 ? 'none' : 'inline-block';
if (d.data.ftype == 0) {
return `<div style="text-align: center;">
<div style="display: inline-block; margin-left: 5px;">
@ -175,7 +179,8 @@ export default function companyPage() {
line-height: 28px;
letter-spacing: 1px;
margin-top: 10px;
">${d.data.fname}</div>
">${d.data.fname}(${d.data.staffNum}/${d.data.onJobNum})</div>
</div>
</div>`;
} else if (d.data.ftype == 1) {
@ -192,7 +197,9 @@ export default function companyPage() {
</div>
<div style="display: ${statisticsStyle}">
<span style="color:red">${d.data.staffNum}</span> /
<span style="color:red;display: ${staffStyle}">${
d.data.staffNum
} /</span>
<span style="color:green">${d.data.onJobNum}</span>
</div>
</div>
@ -214,7 +221,9 @@ export default function companyPage() {
</div>
<div style="display: ${statisticsStyle}">
<span style="color:red">${d.data.staffNum}</span> /
<span style="color:red;display: ${staffStyle}">${
d.data.staffNum
} /</span>
<span style="color:green">${d.data.onJobNum}</span>
</div>
</div>
@ -488,14 +497,14 @@ export default function companyPage() {
onZoomIn={(progressBtn) => handleZoomIn(progressBtn)}
onZoomBehavior={(value) => handleZoomBehavior(value)}
/>
<TimeLine
{/* <TimeLine
ref={(r) => (timeLine = r)}
onClick={(timeline) => {
timeLineSearch(timeline);
}}
url={'/api/bs/hrmorganization/orgchart/timeLines?fclass=0'}
labelData={labelData}
/>
/> */}
<Spin size="large" spinning={spinning}>
<OrgChartComponent
setChart={(chart) => (orgChart = chart)}

@ -99,7 +99,7 @@ export default function userPage() {
//
useEffect(() => {
document.cookie =
'ecology_JSessionid=aaav03Zyuvq3A9TG0PEdz; JSESSIONID=aaav03Zyuvq3A9TG0PEdz; Systemlanguid=7; languageidweaver=7; loginuuids=1; loginidweaver=sysadmin; __randcode__=62316935-a99b-4cbf-a23f-0ac9c37db0da';
'ecology_JSessionid=aaaqP0tTaKbFM9rJ6fQjz; JSESSIONID=aaaqP0tTaKbFM9rJ6fQjz; Systemlanguid=7; languageidweaver=7; loginuuids=1; __randcode__=811e5b8d-968b-4847-99ed-e0aa22b0ad4e; loginidweaver=sysadmin';
d3.json(
'/api/bs/hrmorganization/orgchart/userData?fclass=0&fisvitual=0&root=0&level=3&id=0',
).then((data) => {

Loading…
Cancel
Save