Compare commits

..

2 Commits

Binary file not shown.

@ -367,7 +367,6 @@ export default class DrawerComponents extends React.Component {
}; };
onStatusChange = (checkedValues) => { onStatusChange = (checkedValues) => {
const { labelData } = this.props;
if (checkedValues.length === 0) { if (checkedValues.length === 0) {
return message.error(`${getLabel(547728, labelData)}`, 2); return message.error(`${getLabel(547728, labelData)}`, 2);
} }
@ -385,7 +384,6 @@ export default class DrawerComponents extends React.Component {
}; };
onTypeChange = (checkedValues) => { onTypeChange = (checkedValues) => {
const { labelData } = this.props;
if (this.state.showJob) { if (this.state.showJob) {
return message.error(`${getLabel(547729, labelData)}`, 2); return message.error(`${getLabel(547729, labelData)}`, 2);
} }

@ -7,12 +7,10 @@
* @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 } 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) {
@ -37,21 +35,6 @@ 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);
} }
@ -73,8 +56,6 @@ 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) {
@ -108,30 +89,14 @@ 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}
>
<div
className={styles.title}
style={{ style={{
color: item.color == 'blue' ? '#1890ff' : 'dimgray', color: item.color == 'blue' ? '#1890ff' : 'dimgray',
}} }}
onClick={this.handleLineClick.bind(this, item)}
> >
{item.title} <div>{item.title}</div>
</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>
); );

@ -15,25 +15,21 @@
cursor: pointer; cursor: pointer;
} }
// .timeline .title:hover { .timeline :hover {
// color: #1890ff; color: #1890ff;
// } }
.time { .time {
color: dimgray; color: dimgray;
} }
.delete :hover {
color: red;
}
} }
.leftRightLayoutBtn { .leftRightLayoutBtn {
width: 18px; width: 18px;
height: 60px; height: 60px;
position: fixed; position: absolute;
top: 50%; top: 50%;
// margin-top: -30px; margin-top: -30px;
z-index: 101; z-index: 101;
cursor: pointer; cursor: pointer;
} }

@ -22,7 +22,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, FolderOutlined } from '@ant-design/icons'; import { HomeOutlined } from '@ant-design/icons';
moment.locale('zh-cn'); moment.locale('zh-cn');
import { getLabel } from '../../util/i18n.js'; import { getLabel } from '../../util/i18n.js';
import { SmileOutlined } from '@ant-design/icons'; import { SmileOutlined } from '@ant-design/icons';
@ -45,8 +45,6 @@ export class TopBar extends React.Component {
open: false, open: false,
confirmLoading: false, confirmLoading: false,
description: '', description: '',
timelineId: '0',
treeKey: 1,
}; };
} }
@ -59,29 +57,10 @@ export class TopBar extends React.Component {
this.setState({ requestData }); this.setState({ requestData });
} }
handleTreeData(treeData = [], timelineId) {
this.setState({
rootTreeData: treeData,
timelineId: timelineId,
treeKey: this.state.treeKey + 1,
});
}
onChange = (e) => { onChange = (e) => {
this.setState({ description: e.target.value }); this.setState({ description: e.target.value });
}; };
generateKey = (
length = 5,
chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
) => {
let result = '';
for (let i = 0; i < length; i++) {
result += chars.charAt(Math.floor(Math.random() * chars.length));
}
return result;
};
/** /**
* 弹窗确认 * 弹窗确认
*/ */
@ -138,9 +117,6 @@ export class TopBar extends React.Component {
} }
arr.map((item, index) => { arr.map((item, index) => {
item.icon = <HomeOutlined />; item.icon = <HomeOutlined />;
if (item.type == 2) {
item.icon = <FolderOutlined />;
}
}); });
this.setState({ this.setState({
rootTreeData: arr, rootTreeData: arr,
@ -159,14 +135,11 @@ export class TopBar extends React.Component {
const { id } = treeNode; const { id } = treeNode;
setTimeout(() => { setTimeout(() => {
const { fclass } = this.state.requestData; const { fclass } = this.state.requestData;
const { timelineId } = this.state;
let api = let api =
'/api/bs/hrmorganization/orgchart/getSubCompanyTree?subcompany=' + '/api/bs/hrmorganization/orgchart/getSubCompanyTree?subcompany=' +
id + id +
'&fclass=' + '&fclass=' +
fclass + fclass;
'&id=' +
timelineId;
this.getNodeTreeNode(api); this.getNodeTreeNode(api);
resolve(undefined); resolve(undefined);
}, 500); }, 500);
@ -219,8 +192,7 @@ export class TopBar extends React.Component {
render() { render() {
const { disabled, type, labelData } = this.props; const { disabled, type, labelData } = this.props;
const { rootTreeData, open, confirmLoading, treeExpandedKeys, treeKey } = const { rootTreeData, open, confirmLoading, treeExpandedKeys } = this.state;
this.state;
return ( return (
<div className={style.topbarWrapper}> <div className={style.topbarWrapper}>
@ -228,6 +200,7 @@ export class TopBar extends React.Component {
<Col span={6}> <Col span={6}>
{getLabel(547293, labelData)} {getLabel(547293, labelData)}
<Select <Select
disabled
defaultValue="0" defaultValue="0"
style={{ width: 140 }} style={{ width: 140 }}
value={this.state.requestData.fclass} value={this.state.requestData.fclass}
@ -257,11 +230,9 @@ export class TopBar extends React.Component {
))} ))}
</Select> </Select>
</Col> </Col>
{/* <Col span={6}>
<Col span={8}>
{getLabel(547294, labelData)} {getLabel(547294, labelData)}
<TreeSelect <TreeSelect
key={treeKey}
treeDataSimpleMode treeDataSimpleMode
allowClear allowClear
style={{ width: '65%' }} style={{ width: '65%' }}
@ -273,16 +244,20 @@ export class TopBar extends React.Component {
treeData={rootTreeData} treeData={rootTreeData}
treeIcon treeIcon
/> />
</Col> </Col> */}
<Col span={5}> <Col span={6}>
<Checkbox <Checkbox
style={{ marginTop: '5px', marginLeft: 100 }} style={{ marginTop: '5px', marginLeft: 100 }}
checked={this.state.requestData.hidedept == '1'} checked={this.state.requestData.hidedept == '1'}
onChange={(e) => onChange={(e) => {
this.handleFormChange({ this.handleFormChange({
hidedept: e.target.checked ? '1' : '0', hidedept: e.target.checked ? '1' : '0',
}) });
} this.props.onSearch({
...this.state.requestData,
hidedept: e.target.checked ? '1' : '0',
});
}}
> >
{getLabel(547296, labelData)} {getLabel(547296, labelData)}
</Checkbox> </Checkbox>
@ -296,7 +271,7 @@ export class TopBar extends React.Component {
/> />
</Tooltip> </Tooltip>
</Col> </Col>
<Col span={5}> {/* <Col span={6}>
{getLabel(547299, labelData)} {getLabel(547299, labelData)}
<Select <Select
defaultValue="3" defaultValue="3"
@ -309,10 +284,10 @@ export class TopBar extends React.Component {
<Option value="3">{getLabel(547464, labelData)}</Option> <Option value="3">{getLabel(547464, labelData)}</Option>
<Option value="4">{getLabel(547465, labelData)}</Option> <Option value="4">{getLabel(547465, labelData)}</Option>
</Select> </Select>
</Col> </Col> */}
</Row> {/* </Row> */}
<Row style={{ marginTop: '15px' }}> {/* <Row style={{ marginTop: '15px' }}> */}
<Col span={6}> {/* <Col span={6}>
<Checkbox <Checkbox
style={{ marginTop: '5px' }} style={{ marginTop: '5px' }}
checked={this.state.requestData.fisvitual == '1'} checked={this.state.requestData.fisvitual == '1'}
@ -333,9 +308,8 @@ export class TopBar extends React.Component {
style={{ color: '#0082fb', cursor: 'pointer', fontSize: 16 }} style={{ color: '#0082fb', cursor: 'pointer', fontSize: 16 }}
/> />
</Tooltip> </Tooltip>
</Col> </Col> */}
<Col span={12}>
<Col span={10}>
{this.state.requestData.fclass == '0' && ( {this.state.requestData.fclass == '0' && (
<span> <span>
<Button <Button
@ -365,7 +339,7 @@ export class TopBar extends React.Component {
}} }}
> >
{getLabel(547313, labelData)} {getLabel(547313, labelData)}
</Button> </Button>{' '}
</span> </span>
)} )}

@ -351,10 +351,6 @@ export default function companyPage() {
*/ */
const handleExport = (type) => { const handleExport = (type) => {
if (type == 'png') { if (type == 'png') {
const hiddenElements = document.querySelectorAll('.tooltitle');
const hiddenElementsArray = Array.from(hiddenElements);
// DOM
hiddenElementsArray.forEach((el) => (el.style.display = 'none'));
orgChart && orgChart.exportImg({ full: true }); orgChart && orgChart.exportImg({ full: true });
} else { } else {
orgChart && downloadPdf(orgChart); orgChart && downloadPdf(orgChart);
@ -375,8 +371,6 @@ export default function companyPage() {
hidedept: '0', hidedept: '0',
}; };
topbar.handleFormChange({ ...resetParams }); topbar.handleFormChange({ ...resetParams });
//
topbar.handleTreeData([], timeline.id);
topbar.getNodeTreeNode( topbar.getNodeTreeNode(
`/api/bs/hrmorganization/orgchart/getSubCompanyTree?fclass=${fclass}&id=${timeline.id}`, `/api/bs/hrmorganization/orgchart/getSubCompanyTree?fclass=${fclass}&id=${timeline.id}`,
false, false,
@ -496,7 +490,6 @@ export default function companyPage() {
timeLineSearch(timeline); timeLineSearch(timeline);
}} }}
url={'/api/bs/hrmorganization/orgchart/timeLines?fclass=0'} url={'/api/bs/hrmorganization/orgchart/timeLines?fclass=0'}
labelData={labelData}
/> />
<Spin size="large" spinning={spinning}> <Spin size="large" spinning={spinning}>
<OrgChartComponent <OrgChartComponent

@ -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=aaa5JLqrHUV6R9P1cmTbz; JSESSIONID=aaa5JLqrHUV6R9P1cmTbz; loginuuids=1; languageidweaver=7; Systemlanguid=7; loginidweaver=sysadmin; __randcode__=72a0b641-7599-4301-a47f-61620f350ec5';
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…
Cancel
Save