|
|
@ -7,10 +7,12 @@
|
|
|
|
* @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 } from 'antd';
|
|
|
|
import { Timeline, Drawer, Popconfirm, message } 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';
|
|
|
|
|
|
|
|
import { CloseCircleOutlined } from '@ant-design/icons';
|
|
|
|
|
|
|
|
import { getLabel } from '../../util/i18n.js';
|
|
|
|
|
|
|
|
|
|
|
|
export default class TimeLine extends React.Component {
|
|
|
|
export default class TimeLine extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
constructor(props) {
|
|
|
@ -35,6 +37,21 @@ export default class TimeLine extends React.Component {
|
|
|
|
this.props.onClick(data);
|
|
|
|
this.props.onClick(data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleDelete(key) {
|
|
|
|
|
|
|
|
const { labelData } = this.props;
|
|
|
|
|
|
|
|
let api = `/api/bs/hrmorganization/orgchart/versionDelete?versionId=${key}`;
|
|
|
|
|
|
|
|
fetch(api)
|
|
|
|
|
|
|
|
.then((res) => res.json())
|
|
|
|
|
|
|
|
.then((data) => {
|
|
|
|
|
|
|
|
if (data.api_status) {
|
|
|
|
|
|
|
|
message.success(`${getLabel(547484, labelData)}`, 2, 3);
|
|
|
|
|
|
|
|
window.location.reload(true);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
message.error(`${getLabel(547483, labelData)}`, 2, 3);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
this.searchTimeLines(this.props.url);
|
|
|
|
this.searchTimeLines(this.props.url);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -56,6 +73,8 @@ export default class TimeLine extends React.Component {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
|
|
|
|
const { labelData } = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
let showStyle = {};
|
|
|
|
let showStyle = {};
|
|
|
|
let positionStyle = {};
|
|
|
|
let positionStyle = {};
|
|
|
|
if (this.state.open) {
|
|
|
|
if (this.state.open) {
|
|
|
@ -89,14 +108,27 @@ export default class TimeLine extends React.Component {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Timeline.Item
|
|
|
|
<Timeline.Item
|
|
|
|
key={item.key}
|
|
|
|
key={item.key}
|
|
|
|
onClick={this.handleLineClick.bind(this, item)}
|
|
|
|
|
|
|
|
className={styles.timeline}
|
|
|
|
className={styles.timeline}
|
|
|
|
color={item.color}
|
|
|
|
color={item.color}
|
|
|
|
style={{
|
|
|
|
style={{
|
|
|
|
color: item.color == 'blue' ? '#1890ff' : 'dimgray',
|
|
|
|
color: item.color == 'blue' ? '#1890ff' : 'dimgray',
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div>{item.title}</div>
|
|
|
|
<div onClick={this.handleLineClick.bind(this, item)}>
|
|
|
|
|
|
|
|
{item.title}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{item.key != 0 && (
|
|
|
|
|
|
|
|
<Popconfirm
|
|
|
|
|
|
|
|
title={`${getLabel(547491, labelData)}[${item.title}]?`}
|
|
|
|
|
|
|
|
onConfirm={this.handleDelete.bind(this, item.key)}
|
|
|
|
|
|
|
|
okText={getLabel(547319, labelData)}
|
|
|
|
|
|
|
|
cancelText={getLabel(547318, labelData)}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div className={styles.delete}>
|
|
|
|
|
|
|
|
<CloseCircleOutlined />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</Popconfirm>
|
|
|
|
|
|
|
|
)}
|
|
|
|
<div className={styles.time}>{item.time}</div>
|
|
|
|
<div className={styles.time}>{item.time}</div>
|
|
|
|
</Timeline.Item>
|
|
|
|
</Timeline.Item>
|
|
|
|
);
|
|
|
|
);
|
|
|
|