2020-03-19 12:15:26 +00:00
|
|
|
|
import React from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
2024-12-24 03:20:40 +00:00
|
|
|
|
import { Button, Modal, ModalBody, ModalFooter } from 'reactstrap';
|
2020-03-19 12:15:26 +00:00
|
|
|
|
import Loading from '../loading';
|
2024-12-24 03:20:40 +00:00
|
|
|
|
import SeahubModalHeader from '@/components/common/seahub-modal-header';
|
2020-03-19 12:15:26 +00:00
|
|
|
|
|
|
|
|
|
const propTypes = {
|
|
|
|
|
importDepartmentDialogToggle: PropTypes.func.isRequired,
|
|
|
|
|
onImportDepartmentSubmit: PropTypes.func.isRequired,
|
|
|
|
|
departmentsCount: PropTypes.number.isRequired,
|
|
|
|
|
membersCount: PropTypes.number.isRequired,
|
|
|
|
|
departmentName: PropTypes.string.isRequired,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ImportDingtalkDepartmentDialog extends React.Component {
|
|
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
2024-07-18 03:58:42 +00:00
|
|
|
|
isLoading: false,
|
2020-03-19 12:15:26 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
toggle = () => {
|
|
|
|
|
this.props.importDepartmentDialogToggle(null);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handleSubmit = () => {
|
|
|
|
|
this.props.onImportDepartmentSubmit();
|
2024-07-18 03:58:42 +00:00
|
|
|
|
this.setState({ isLoading: true });
|
2020-03-19 12:15:26 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const { departmentsCount, membersCount, departmentName } = this.props;
|
|
|
|
|
return (
|
|
|
|
|
<Modal isOpen={true} toggle={this.toggle}>
|
2024-12-24 03:20:40 +00:00
|
|
|
|
<SeahubModalHeader toggle={this.toggle}>
|
2020-03-19 12:15:26 +00:00
|
|
|
|
<span>{'导入部门 '}</span><span className="op-target" title={departmentName}>{departmentName}</span>
|
2024-12-24 03:20:40 +00:00
|
|
|
|
</SeahubModalHeader>
|
2020-03-19 12:15:26 +00:00
|
|
|
|
<ModalBody>
|
|
|
|
|
<p>{'将要导入 '}<strong>{departmentsCount}</strong>{' 个部门,其中包括 '}<strong>{membersCount}</strong>{' 个成员'}</p>
|
|
|
|
|
{this.state.isLoading && <Loading/>}
|
|
|
|
|
</ModalBody>
|
|
|
|
|
<ModalFooter>
|
|
|
|
|
<Button color="secondary" onClick={this.toggle}>{'取消'}</Button>
|
|
|
|
|
<Button color="primary" onClick={this.handleSubmit}>{'导入'}</Button>
|
|
|
|
|
</ModalFooter>
|
|
|
|
|
</Modal>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ImportDingtalkDepartmentDialog.propTypes = propTypes;
|
|
|
|
|
|
|
|
|
|
export default ImportDingtalkDepartmentDialog;
|