Compare commits
1 Commits
master
...
feature/cl
| Author | SHA1 | Date |
|---|---|---|
|
|
4a630310f5 |
|
|
@ -7,7 +7,7 @@
|
||||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
*/
|
*/
|
||||||
import React from 'react';
|
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 styles from './index.less';
|
||||||
import leftTreeShow from './img/leftTree-show.png';
|
import leftTreeShow from './img/leftTree-show.png';
|
||||||
import leftHide from './img/leftTree-hide.png';
|
import leftHide from './img/leftTree-hide.png';
|
||||||
|
|
@ -20,6 +20,8 @@ export default class TimeLine extends React.Component {
|
||||||
this.state = {
|
this.state = {
|
||||||
timelineList: [],
|
timelineList: [],
|
||||||
open: true,
|
open: true,
|
||||||
|
timeName: '',
|
||||||
|
fclass: 0,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,10 +55,16 @@ export default class TimeLine extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
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)
|
fetch(url)
|
||||||
.then((res) => res.json())
|
.then((res) => res.json())
|
||||||
.then((data) => {
|
.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() {
|
render() {
|
||||||
const { labelData } = this.props;
|
const { labelData } = this.props;
|
||||||
|
|
||||||
|
|
@ -103,6 +118,12 @@ export default class TimeLine extends React.Component {
|
||||||
onClick={this.setOpen}
|
onClick={this.setOpen}
|
||||||
></div>
|
></div>
|
||||||
<div className={styles.lineWrapper} style={showStyle}>
|
<div className={styles.lineWrapper} style={showStyle}>
|
||||||
|
<Input
|
||||||
|
placeholder="关键字搜索"
|
||||||
|
value={this.state.timeName}
|
||||||
|
onChange={(e) => this.setState({ timeName: e.target.value })}
|
||||||
|
onKeyDown={this.handleEnterPress} // 监听回车键事件
|
||||||
|
/>
|
||||||
<Timeline>
|
<Timeline>
|
||||||
{this.state.timelineList.map((item) => {
|
{this.state.timelineList.map((item) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,11 @@
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
|
padding-right: 5px;
|
||||||
|
|
||||||
|
input {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.timeline {
|
.timeline {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
|
||||||
|
|
@ -421,9 +421,7 @@ export default function companyPage() {
|
||||||
*/
|
*/
|
||||||
const handleChange = (requestData) => {
|
const handleChange = (requestData) => {
|
||||||
setTimelineId(0);
|
setTimelineId(0);
|
||||||
timeLine.searchTimeLines(
|
timeLine.searchTimeLines(requestData.fclass);
|
||||||
`/api/bs/hrmorganization/orgchart/timeLines?fclass=${requestData.fclass}`,
|
|
||||||
);
|
|
||||||
requestData = { ...requestData, id: 0 };
|
requestData = { ...requestData, id: 0 };
|
||||||
handleSearch(requestData, false);
|
handleSearch(requestData, false);
|
||||||
};
|
};
|
||||||
|
|
@ -495,7 +493,6 @@ export default function companyPage() {
|
||||||
onClick={(timeline) => {
|
onClick={(timeline) => {
|
||||||
timeLineSearch(timeline);
|
timeLineSearch(timeline);
|
||||||
}}
|
}}
|
||||||
url={'/api/bs/hrmorganization/orgchart/timeLines?fclass=0'}
|
|
||||||
labelData={labelData}
|
labelData={labelData}
|
||||||
/>
|
/>
|
||||||
<Spin size="large" spinning={spinning}>
|
<Spin size="large" spinning={spinning}>
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ export default function userPage() {
|
||||||
// 获取数据
|
// 获取数据
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.cookie =
|
document.cookie =
|
||||||
'ecology_JSessionid=aaaLiDqzA0rZHgPBdxGez; JSESSIONID=aaaLiDqzA0rZHgPBdxGez; Systemlanguid=7; languageidweaver=7; loginuuids=1; loginidweaver=sysadmin; __randcode__=7b9b3b9b-a780-4d6a-b8d5-22d0f8aaf11a';
|
'ecology_JSessionid=aaaimqoOmNl-h8fHABnpz; JSESSIONID=aaaimqoOmNl-h8fHABnpz; Systemlanguid=7; languageidweaver=7; loginuuids=1; loginidweaver=sysadmin; __randcode__=f58cd90c-d187-4c90-bd38-0981bf5232e0';
|
||||||
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…
Reference in New Issue