|
|
@ -21,6 +21,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 } from '@ant-design/icons';
|
|
|
|
moment.locale('zh-cn');
|
|
|
|
moment.locale('zh-cn');
|
|
|
|
|
|
|
|
|
|
|
|
export class TopBar extends React.Component {
|
|
|
|
export class TopBar extends React.Component {
|
|
|
@ -29,6 +30,7 @@ export class TopBar extends React.Component {
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
|
fclasslist: [],
|
|
|
|
fclasslist: [],
|
|
|
|
rootTreeData: [], //根节点异步树
|
|
|
|
rootTreeData: [], //根节点异步树
|
|
|
|
|
|
|
|
treeLoadedKeys: [],
|
|
|
|
treeExpandedKeys: [],
|
|
|
|
treeExpandedKeys: [],
|
|
|
|
requestData: {
|
|
|
|
requestData: {
|
|
|
|
fclass: '0',
|
|
|
|
fclass: '0',
|
|
|
@ -65,10 +67,6 @@ export class TopBar extends React.Component {
|
|
|
|
return message.error('请填写描述信息');
|
|
|
|
return message.error('请填写描述信息');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.setState({ confirmLoading: true });
|
|
|
|
this.setState({ confirmLoading: true });
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
|
|
// this.setState({ open: false, confirmLoading: false, description: '' });
|
|
|
|
|
|
|
|
// message.success('版本记录成功,请重新刷新页面');
|
|
|
|
|
|
|
|
// }, 2000);
|
|
|
|
|
|
|
|
let api =
|
|
|
|
let api =
|
|
|
|
'/api/bs/hrmorganization/orgchart/versionRecord?fclass=' +
|
|
|
|
'/api/bs/hrmorganization/orgchart/versionRecord?fclass=' +
|
|
|
|
requestData.fclass +
|
|
|
|
requestData.fclass +
|
|
|
@ -81,7 +79,6 @@ export class TopBar extends React.Component {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
open: false,
|
|
|
|
open: false,
|
|
|
|
confirmLoading: false,
|
|
|
|
confirmLoading: false,
|
|
|
|
description: '',
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
message.success('版本记录成功,请重新刷新页面', 2, 3);
|
|
|
|
message.success('版本记录成功,请重新刷新页面', 2, 3);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -114,6 +111,9 @@ export class TopBar extends React.Component {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
arr = [...data.companyTree];
|
|
|
|
arr = [...data.companyTree];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
arr.map((item, index) => {
|
|
|
|
|
|
|
|
item.icon = <HomeOutlined />;
|
|
|
|
|
|
|
|
});
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
rootTreeData: arr,
|
|
|
|
rootTreeData: arr,
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -128,7 +128,7 @@ export class TopBar extends React.Component {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
onRootLoadData = (treeNode) =>
|
|
|
|
onRootLoadData = (treeNode) =>
|
|
|
|
new Promise((resolve) => {
|
|
|
|
new Promise((resolve) => {
|
|
|
|
const { id } = treeNode.props;
|
|
|
|
const { id } = treeNode;
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
const { fclass } = this.state.requestData;
|
|
|
|
const { fclass } = this.state.requestData;
|
|
|
|
let api =
|
|
|
|
let api =
|
|
|
@ -160,6 +160,9 @@ export class TopBar extends React.Component {
|
|
|
|
fetch(url)
|
|
|
|
fetch(url)
|
|
|
|
.then((res) => res.json())
|
|
|
|
.then((res) => res.json())
|
|
|
|
.then((data) => {
|
|
|
|
.then((data) => {
|
|
|
|
|
|
|
|
data.companyTree.map((item, index) => {
|
|
|
|
|
|
|
|
item.icon = <HomeOutlined />;
|
|
|
|
|
|
|
|
});
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
fclasslist: data.fclasslist,
|
|
|
|
fclasslist: data.fclasslist,
|
|
|
|
rootTreeData: data.companyTree,
|
|
|
|
rootTreeData: data.companyTree,
|
|
|
@ -185,7 +188,7 @@ export class TopBar extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const { disabled, type } = this.props;
|
|
|
|
const { disabled, type } = this.props;
|
|
|
|
const { rootTreeData, open, confirmLoading } = this.state;
|
|
|
|
const { rootTreeData, open, confirmLoading, treeExpandedKeys } = this.state;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className={style.topbarWrapper}>
|
|
|
|
<div className={style.topbarWrapper}>
|
|
|
@ -205,6 +208,9 @@ export class TopBar extends React.Component {
|
|
|
|
hidedept: '0',
|
|
|
|
hidedept: '0',
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.handleFormChange(requestData);
|
|
|
|
this.handleFormChange(requestData);
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
rootTreeData: [],
|
|
|
|
|
|
|
|
});
|
|
|
|
this.getNodeTreeNode(
|
|
|
|
this.getNodeTreeNode(
|
|
|
|
`/api/bs/hrmorganization/orgchart/getSubCompanyTree?fclass=${value}`,
|
|
|
|
`/api/bs/hrmorganization/orgchart/getSubCompanyTree?fclass=${value}`,
|
|
|
|
false,
|
|
|
|
false,
|
|
|
@ -231,6 +237,7 @@ export class TopBar extends React.Component {
|
|
|
|
onChange={this.onRootChange}
|
|
|
|
onChange={this.onRootChange}
|
|
|
|
loadData={this.onRootLoadData}
|
|
|
|
loadData={this.onRootLoadData}
|
|
|
|
treeData={rootTreeData}
|
|
|
|
treeData={rootTreeData}
|
|
|
|
|
|
|
|
treeIcon
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
<Col span={6}>
|
|
|
|
<Col span={6}>
|
|
|
|