1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-04-27 11:24:57
* @LastEditors: leizhe
*/
import React from 'react';
import { Modal, notification, message } from 'antd';
import { deleteOrg } from '@/services/userManage/api';
import { Margin } from 'gojs';
const DeleteOrgModal = props => {
const { title, visible, orgID, onCancel, updateTrees, orgTitle } = props;
// 提交-删除机构
const submitDeleteOrg = () =>
deleteOrg(orgID.id)
.then(res => {
if (res.msg === '') {
onCancel();
notification.success({
message: '提交成功',
duration: 2,
});
// 重新获取机构树与用户表
updateTrees();
} else {
notification.error({
message: '提交失败',
description: res.msg,
});
}
})
.catch(err => {
message.error(err);
});
return (
<Modal
title={title}
visible={visible}
onCancel={onCancel}
maskClosable={false}
onOk={submitDeleteOrg}
okText="确认"
cancelText="取消"
>
<p style={{ marginLeft: '17px' }}>
即将删除<span style={{ color: 'red' }}>{orgTitle}</span>,是否确认删除?
</p>
</Modal>
);
};
export default DeleteOrgModal;