ctxt.del(8, ctxt.getApi().unit.unit.del)
const del = (id,delFn) => {

    const p = () => {
        delFn({id}).then(res => {
            if (res.code === 0) {
                console.log(res)
                getMessage().success(res.msg);
            } else {
                console.error(res)
                getMessage().error(res.msg);
            }
        })
    }

    const ok = confirm("你确定要删除吗?", p)
}
const confirm = async (prompt, process) => {
    const isConfirm = await getMessageBox().confirm(prompt ? prompt : "确认提交此次编辑吗?", "提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning",
    })

    if (isConfirm && process) {
        process();
    }
    return isConfirm
}
Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐