Compare commits

...

3 Commits

Binary file not shown.

@ -7,7 +7,7 @@
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import React from 'react';
import { Timeline, Drawer, Popconfirm, message } from 'antd';
import { Timeline, Drawer, Popconfirm, message, Input } from 'antd';
import styles from './index.less';
import leftTreeShow from './img/leftTree-show.png';
import leftHide from './img/leftTree-hide.png';
@ -20,6 +20,8 @@ export default class TimeLine extends React.Component {
this.state = {
timelineList: [],
open: true,
timeName: '',
fclass: 0,
};
}
@ -53,10 +55,16 @@ export default class TimeLine extends React.Component {
}
componentDidMount() {
this.searchTimeLines(this.props.url);
this.searchTimeLines();
}
searchTimeLines(url) {
searchTimeLines(fclass = 0) {
const { timeName } = this.state;
this.setState({ fclass: fclass });
if (fclass != 0) {
this.setState({ timeName: '' });
}
let url = `/api/bs/hrmorganization/orgchart/timeLines?fclass=${fclass}&timeName=${timeName}`;
fetch(url)
.then((res) => res.json())
.then((data) => {
@ -72,6 +80,13 @@ export default class TimeLine extends React.Component {
});
};
handleEnterPress = (e) => {
if (e.key === 'Enter') {
//
this.searchTimeLines(this.state.fclass);
}
};
render() {
const { labelData } = this.props;
@ -103,6 +118,12 @@ export default class TimeLine extends React.Component {
onClick={this.setOpen}
></div>
<div className={styles.lineWrapper} style={showStyle}>
<Input
placeholder="关键字搜索"
value={this.state.timeName}
onChange={(e) => this.setState({ timeName: e.target.value })}
onKeyDown={this.handleEnterPress} //
/>
<Timeline>
{this.state.timelineList.map((item) => {
return (

@ -10,6 +10,11 @@
padding-top: 20px;
padding-bottom: 20px;
padding-left: 20px;
padding-right: 5px;
input {
margin-bottom: 20px;
}
.timeline {
cursor: pointer;

@ -26,6 +26,15 @@ export default class ToolBar extends React.Component {
};
}
// componentDidMount() {
// // API onFullscreen onClick componentDidMount useEffect
// setTimeout(() => {
// debugger;
// const fullscreenBtn = document.querySelector(`.${styles.toolBarItem}[src*="fullscreen"]`);
// if (fullscreenBtn) fullscreenBtn.click();
// }, 1000);
// }
handleMouseDown(e) {
this.clientY = e.clientY;
this.originalY = e.clientY;

@ -225,11 +225,11 @@ export class TopBar extends React.Component {
return (
<div className={style.topbarWrapper}>
<Row>
<Col span={6}>
<Col span={8}>
{getLabel(547293, labelData)}
<Select
defaultValue="0"
style={{ width: 140 }}
style={{ width: 240 }}
value={this.state.requestData.fclass}
onChange={(value) => {
const requestData = {
@ -274,9 +274,26 @@ export class TopBar extends React.Component {
treeIcon
/>
</Col>
<Col span={5}>
<Col span={8}>
{getLabel(547299, labelData)}
<Select
defaultValue="3"
style={{ width: 140 }}
value={this.state.requestData.level}
onChange={(value) => this.handleFormChange({ level: value })}
>
<Option value="1">{getLabel(547301, labelData)}</Option>
<Option value="2">{getLabel(547463, labelData)}</Option>
<Option value="3">{getLabel(547464, labelData)}</Option>
<Option value="4">{getLabel(547465, labelData)}</Option>
</Select>
</Col>
</Row>
<Row style={{ marginTop: '15px' }}>
<Col span={8}>
<Checkbox
style={{ marginTop: '5px', marginLeft: 100 }}
style={{ marginTop: '5px' }}
checked={this.state.requestData.hidedept == '1'}
onChange={(e) =>
this.handleFormChange({
@ -296,23 +313,8 @@ export class TopBar extends React.Component {
/>
</Tooltip>
</Col>
<Col span={5}>
{getLabel(547299, labelData)}
<Select
defaultValue="3"
style={{ width: 140 }}
value={this.state.requestData.level}
onChange={(value) => this.handleFormChange({ level: value })}
>
<Option value="1">{getLabel(547301, labelData)}</Option>
<Option value="2">{getLabel(547463, labelData)}</Option>
<Option value="3">{getLabel(547464, labelData)}</Option>
<Option value="4">{getLabel(547465, labelData)}</Option>
</Select>
</Col>
</Row>
<Row style={{ marginTop: '15px' }}>
<Col span={6}>
<Col span={8}>
<Checkbox
style={{ marginTop: '5px' }}
checked={this.state.requestData.fisvitual == '1'}
@ -335,39 +337,39 @@ export class TopBar extends React.Component {
</Tooltip>
</Col>
<Col span={10}>
{this.state.requestData.fclass == '0' && (
<span>
<Button
type="primary"
style={{ marginRight: '10px' }}
disabled={disabled}
onClick={() => {
this.setState({ open: true });
}}
>
{getLabel(547305, labelData)}
</Button>
<Button
type="primary"
style={{ marginRight: '10px' }}
onClick={() => {
window.open('#/dragtree', 'blank');
}}
>
{getLabel(547310, labelData)}
</Button>
<Button
type="primary"
style={{ marginRight: '10px' }}
onClick={() => {
window.open('#/statistics', 'blank');
}}
>
{getLabel(547313, labelData)}
</Button>
</span>
)}
<Col span={8}>
{/* {this.state.requestData.fclass == '0' && (
<span>
<Button
type="primary"
style={{ marginRight: '10px' }}
disabled={disabled}
onClick={() => {
this.setState({ open: true });
}}
>
{getLabel(547305, labelData)}
</Button>
<Button
type="primary"
style={{ marginRight: '10px' }}
onClick={() => {
window.open('#/dragtree', 'blank');
}}
>
{getLabel(547310, labelData)}
</Button>
<Button
type="primary"
style={{ marginRight: '10px' }}
onClick={() => {
window.open('#/statistics', 'blank');
}}
>
{getLabel(547313, labelData)}
</Button>
</span>
)} */}
<Button
type="primary"

@ -109,11 +109,11 @@ export default function companyPage() {
d3.json('/api/bs/hrmorganization/orgchart/i18n').then((res) => {
setLabelData(res.data);
setLabelCompleted(true);
notification.open({
message: `${getLabel(547283, res.data)}`,
description: `${getLabel(547292, res.data)}`,
icon: <SmileOutlined style={{ color: '#108ee9' }} />,
});
// notification.open({
// message: `${getLabel(547283, res.data)}`,
// description: `${getLabel(547292, res.data)}`,
// icon: <SmileOutlined style={{ color: '#108ee9' }} />,
// });
});
}, []);
@ -166,7 +166,7 @@ export default function companyPage() {
let statisticsStyle = fclass == 0 ? 'block' : 'none';
if (d.data.ftype == 0) {
return `<div style="text-align: center;">
<div style="display: inline-block; margin-left: 5px;">
<div style="display: inline-block;margin-top: 10px; width: 230px;">
<div style="
font-size: 24px;
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
@ -192,7 +192,6 @@ export default function companyPage() {
</div>
<div style="display: ${statisticsStyle}">
<span style="color:red">${d.data.staffNum}</span> /
<span style="color:green">${d.data.onJobNum}</span>
</div>
</div>
@ -214,7 +213,6 @@ export default function companyPage() {
</div>
<div style="display: ${statisticsStyle}">
<span style="color:red">${d.data.staffNum}</span> /
<span style="color:green">${d.data.onJobNum}</span>
</div>
</div>
@ -421,9 +419,7 @@ export default function companyPage() {
*/
const handleChange = (requestData) => {
setTimelineId(0);
timeLine.searchTimeLines(
`/api/bs/hrmorganization/orgchart/timeLines?fclass=${requestData.fclass}`,
);
timeLine.searchTimeLines(requestData.fclass);
requestData = { ...requestData, id: 0 };
handleSearch(requestData, false);
};
@ -490,14 +486,13 @@ 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)}

@ -129,9 +129,9 @@
}
.tooltip .tooltitle {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
// overflow: hidden;
// white-space: nowrap;
// text-overflow: ellipsis;
}
.tooltip .tooltiptext {

@ -99,7 +99,7 @@ export default function userPage() {
//
useEffect(() => {
document.cookie =
'ecology_JSessionid=aaaLiDqzA0rZHgPBdxGez; JSESSIONID=aaaLiDqzA0rZHgPBdxGez; Systemlanguid=7; languageidweaver=7; loginuuids=1; loginidweaver=sysadmin; __randcode__=7b9b3b9b-a780-4d6a-b8d5-22d0f8aaf11a';
'ecology_JSessionid=aaaPFXzAh9afa9ho8YPAz; JSESSIONID=aaaPFXzAh9afa9ho8YPAz; Systemlanguid=7; languageidweaver=7; loginuuids=1; loginidweaver=sysadmin;';
d3.json(
'/api/bs/hrmorganization/orgchart/userData?fclass=0&fisvitual=0&root=0&level=3&id=0',
).then((data) => {

Loading…
Cancel
Save