import React, { useState } from 'react';
import { Button, Popconfirm } from 'antd';
const Deletecheck = props => {
const { name, type, text, clickfn, pop, btnType } = props;
//点击删除按钮,若需要调取接口进行校验,需要传btnType,且值为deleteCheck
const [title, ct] = useState(btnType == "deleteCheck" ? "" : pop?.title),
[visible, cv] = useState(false);
let { buttonPerm } = { buttonPerm: [] };//单独运行
let res = buttonPerm && buttonPerm.length > 0 ? buttonPerm.filter((it) => { return it.typeName == name }) : [];
if (res.length == 1) {
res = res[0]
} else {
res = {}
}
let ifs = name === false ? false : true;
if (type == "ifs") {
return ifs
}
return pop ? {
if (!ifs) {
return
}
pop.onConfirm();
cv(false);
}}
visible={visible}
onCancel={() => {
cv(false)
}}
>
:
}
export default Deletecheck;