1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-16 06:03:35 +00:00
seahub/frontend/src/components/dialog/import-work-weixin-department-dialog.js
sniper-py d6bba483be Import work weixin dep (#3803)
* dropdown import work weixin department

* API import work weixin department

* admin check group name conflict

* work weixin department batch import

* work weixin department import update return msg

* work weixin department import not support batch

* react work weixin department import

* add IsProVersion work weixin department import

* change style

* check group name conflict
2019-07-16 15:16:22 +08:00

55 lines
1.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react';
import PropTypes from 'prop-types';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import Loading from '../loading';
const propTypes = {
importDepartmentDialogToggle: PropTypes.func.isRequired,
onImportDepartmentSubmit: PropTypes.func.isRequired,
departmentsCount: PropTypes.number.isRequired,
membersCount: PropTypes.number.isRequired,
departmentName: PropTypes.string.isRequired,
};
class ImportWorkWeixinDepartmentDialog extends React.Component {
constructor(props) {
super(props);
this.state = {
isLoading : false,
};
}
toggle = () => {
this.props.importDepartmentDialogToggle(null);
};
handleSubmit = () => {
this.props.onImportDepartmentSubmit();
this.setState({ isLoading : true });
};
render() {
const { departmentsCount, membersCount, departmentName } = this.props;
return (
<Modal isOpen={true} toggle={this.toggle}>
<ModalHeader toggle={this.toggle}>
<span>{'导入部门 '}</span><span className="op-target" title={departmentName}>{departmentName}</span>
</ModalHeader>
<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>
);
}
}
ImportWorkWeixinDepartmentDialog.propTypes = propTypes;
export default ImportWorkWeixinDepartmentDialog;