欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 教育 > 培训 > fastadmin后端添加页面,自主控制弹出框关闭,关闭父页面弹框

fastadmin后端添加页面,自主控制弹出框关闭,关闭父页面弹框

2025/12/18 8:53:46 来源:https://blog.csdn.net/qq_31340657/article/details/147131420  浏览:    关键词:fastadmin后端添加页面,自主控制弹出框关闭,关闭父页面弹框

Form.api.bindevent($(“form[role=form]”), (data, ret) => { 重写绑定事件,返回false即可

注意:只有返回code=1才能拦截,其他值不进行拦截

        add: function () {//获取当前search里面的type值var type = location.search.split('type=')[1];Form.api.bindevent($("form[role=form]"), (data, ret) => {console.log(data, ret);if (ret.data) {let index = Layer.confirm(ret.msg, {btn: ['继续', '取消'], icon: 1, yes: () => {Layer.close(index)$.post(`appdevice/add?type=${type}&force=1`, $("form[role=form]").serialize(), (data) => {if (data.code != 1) {return false;}parent.Layer.closeAll(); // 关闭所有对话框类型弹窗parent.Layer.msg(data.msg || __('Operation Success'), {icon: 1});parent.location.reload();})}, btn2: () => {}});} else {Layer.msg(ret.msg || __('Operation Failed'));}return false;});}

关闭父窗口的弹出框

                                parent.Layer.closeAll(); // 关闭所有对话框类型弹窗parent.Layer.msg(data.msg || __('Operation Success'), {icon: 1});parent.location.reload();

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词