|
|
|
@ -22,7 +22,7 @@ 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, FolderOutlined } from '@ant-design/icons';
|
|
|
|
|
moment.locale('zh-cn');
|
|
|
|
|
import { getLabel } from '../../util/i18n.js';
|
|
|
|
|
import { SmileOutlined } from '@ant-design/icons';
|
|
|
|
@ -45,6 +45,8 @@ export class TopBar extends React.Component {
|
|
|
|
|
open: false,
|
|
|
|
|
confirmLoading: false,
|
|
|
|
|
description: '',
|
|
|
|
|
timelineId: '0',
|
|
|
|
|
treeKey: 1,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -57,10 +59,29 @@ export class TopBar extends React.Component {
|
|
|
|
|
this.setState({ requestData });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleTreeData(treeData = [], timelineId) {
|
|
|
|
|
this.setState({
|
|
|
|
|
rootTreeData: treeData,
|
|
|
|
|
timelineId: timelineId,
|
|
|
|
|
treeKey: this.state.treeKey + 1,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onChange = (e) => {
|
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 弹窗确认
|
|
|
|
|
*/
|
|
|
|
@ -117,6 +138,9 @@ export class TopBar extends React.Component {
|
|
|
|
|
}
|
|
|
|
|
arr.map((item, index) => {
|
|
|
|
|
item.icon = <HomeOutlined />;
|
|
|
|
|
if (item.type == 2) {
|
|
|
|
|
item.icon = <FolderOutlined />;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.setState({
|
|
|
|
|
rootTreeData: arr,
|
|
|
|
@ -135,11 +159,14 @@ export class TopBar extends React.Component {
|
|
|
|
|
const { id } = treeNode;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
const { fclass } = this.state.requestData;
|
|
|
|
|
const { timelineId } = this.state;
|
|
|
|
|
let api =
|
|
|
|
|
'/api/bs/hrmorganization/orgchart/getSubCompanyTree?subcompany=' +
|
|
|
|
|
id +
|
|
|
|
|
'&fclass=' +
|
|
|
|
|
fclass;
|
|
|
|
|
fclass +
|
|
|
|
|
'&id=' +
|
|
|
|
|
timelineId;
|
|
|
|
|
this.getNodeTreeNode(api);
|
|
|
|
|
resolve(undefined);
|
|
|
|
|
}, 500);
|
|
|
|
@ -192,7 +219,8 @@ export class TopBar extends React.Component {
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const { disabled, type, labelData } = this.props;
|
|
|
|
|
const { rootTreeData, open, confirmLoading, treeExpandedKeys } = this.state;
|
|
|
|
|
const { rootTreeData, open, confirmLoading, treeExpandedKeys, treeKey } =
|
|
|
|
|
this.state;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className={style.topbarWrapper}>
|
|
|
|
@ -229,9 +257,11 @@ export class TopBar extends React.Component {
|
|
|
|
|
))}
|
|
|
|
|
</Select>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={6}>
|
|
|
|
|
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
{getLabel(547294, labelData)}:
|
|
|
|
|
<TreeSelect
|
|
|
|
|
key={treeKey}
|
|
|
|
|
treeDataSimpleMode
|
|
|
|
|
allowClear
|
|
|
|
|
style={{ width: '65%' }}
|
|
|
|
@ -244,7 +274,7 @@ export class TopBar extends React.Component {
|
|
|
|
|
treeIcon
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={6}>
|
|
|
|
|
<Col span={5}>
|
|
|
|
|
<Checkbox
|
|
|
|
|
style={{ marginTop: '5px', marginLeft: 100 }}
|
|
|
|
|
checked={this.state.requestData.hidedept == '1'}
|
|
|
|
@ -266,7 +296,7 @@ export class TopBar extends React.Component {
|
|
|
|
|
/>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={6}>
|
|
|
|
|
<Col span={5}>
|
|
|
|
|
{getLabel(547299, labelData)}:
|
|
|
|
|
<Select
|
|
|
|
|
defaultValue="3"
|
|
|
|
@ -304,7 +334,8 @@ export class TopBar extends React.Component {
|
|
|
|
|
/>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={16}>
|
|
|
|
|
|
|
|
|
|
<Col span={10}>
|
|
|
|
|
{this.state.requestData.fclass == '0' && (
|
|
|
|
|
<span>
|
|
|
|
|
<Button
|
|
|
|
|