Commit 5be2d7ef authored by 涂伟's avatar 涂伟

fix: '事件删除交互改为弹窗'

parent b0c35094
......@@ -40,6 +40,7 @@ import {
FormOutlined,
ImportOutlined,
ExportOutlined,
ExclamationCircleOutlined
} from '@ant-design/icons';
import {
GetCM_Event_LoadEventTable,
......@@ -63,6 +64,7 @@ import ViewModal from './ViewModal';
import { LoadEventFields } from '@/services/tablemanager/tablemanager';
const { Search } = Input;
const { confirm } = Modal;
const incident = () => {
const history = useHistory();
......@@ -97,6 +99,7 @@ const incident = () => {
const [addForm] = Form.useForm();
const [file, setFile] = useState(); // 上传文件信息
const [caseCount, setCaseCount] = useState(0); // 事件相关工单数量
const [showDeletePop, setShowDeletePop] = useState(false); // 事件删除提示展示
const columns = [
{
......@@ -244,26 +247,38 @@ const incident = () => {
/>
</Tooltip>
<Tooltip title="删除事件">
<Popconfirm
// visible={showDeletePop}
{/* <Popconfirm
placement="bottomRight"
title={<p>{caseCount?`此事件有${caseCount}条工单,删除事件后会删除对应的工单,请谨慎操作。`: `即将删除事件类型表,是否确认删除?`}</p>}
okText="确认"
cancelText="取消"
onConfirm={() => deleteEventType(record)}
>
<DeleteOutlined onClick={() => getCaseCount(record.name)} style={{ fontSize: '16px', color: '#e86060' }} />
</Popconfirm>
> */}
<DeleteOutlined onClick={() => getCaseCount(record.name, record)} style={{ fontSize: '16px', color: '#e86060' }} />
{/* </Popconfirm> */}
</Tooltip>
</Space>
),
},
];
const getCaseCount = async (eventName) => {
const getCaseCount = async (eventName,record) => {
let res = await GetFlowCaseNum({eventName})
if(res.code === 0) {
setCaseCount(res.data)
confirm({
title: '确定要删除当前事件吗?',
icon: <ExclamationCircleOutlined />,
content: <p>{res.data?`此事件有${res.data}条工单,删除事件后会删除对应的工单,请谨慎操作。`: `即将删除事件类型表,是否确认删除?`}</p>,
okText: '是',
okType: 'danger',
cancelText: '否',
onOk() {
deleteEventType(record)
},
onCancel() { },
});
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment