文档章节

easyui各种dialog

ivan-Zhao
 ivan-Zhao
发布于 2015/10/17 10:08
字数 3347
阅读 57
收藏 1
var dynamicLoading = {
    js : function(src) {
        $.ajax({
            url : src,
            dataType : "script",
            async : false
        /* 同步操作 */
        });
    },
    css : function(path) {
        if (!path || path.length == 0) {
            throw new Error('argument "path" is required !');
        }
        var head = document.getElementsByTagName('head')[0];
        var link = document.createElement('link');
        link.href = path;
        link.rel = 'stylesheet';
        link.type = 'text/css';
        head.appendChild(link);
    }
}
/*******************************************************************************
 * 弹出层
 ******************************************************************************/
var dialog = {
    
    // 确认删除
    confirmDelete : function(pWidth, pHeight, pTitle, pContent) {
        var html = '<div class="dialog" id="dlg2">'
                + '  <div class="ui-icon ui-icon-alert" style="margin-top:30px;margin-left:20px;">'
                + pContent + '  </div>' + '</div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog(
                {
                    title : pTitle,
                    modal : true,
                    // top :$("#center").offset().top+50,
                    iconCls : "icon-edit",
                    width : pWidth,
                    height : pHeight,
                    buttons : [
                            {
                                text : '确定',
                                id : 'delSure',
                                iconCls : 'icon-ok',
                                handler : function() {
                                    $("#form1").attr(
                                            "action",
                                            $("#form1").attr("action")
                                                    + "/delete");
                                    $("#form1").submit();
                                }
                            }, {
                                text : '取消',
                                iconCls : 'icon-cancel',
                                handler : function() {
                                    $("#dlg2").dialog("close");
                                    $("#dlg2").dialog("destroy");
                                }
                            } ],
                    close : function(event, ui) {
                        $(this).dialog("destroy"); // 关闭时销毁
                    }
                });
    },
    // 确认删除
    confirmcalc : function(pTitle, pContent,url) {
        var html = '<div class="dialog" id="dlg2">'    + '  <div class="ui-icon ui-icon-alert" style="margin-top:30px;margin-left:20px;">'    + pContent + '  </div>' + '</div>';
        $(html).dialog({
            title :pTitle,
            modal : false
            width : 300,
            height : 150,
            buttons : [{
                text : '确定',
                id : 'delSure',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                    $.ajax({
                        async : true,
                        type : "POST",
                        contentType : "application/json; charset=utf-8",
                        url : url,
                        dataType : 'text',
                        success : function(result) {
                            dialog.autoCloss(300, 110, "系统提醒", result);
                            $(".datagrid-mask,.datagrid-mask-msg").hide(); 
                            $('#tbList').datagrid('uncheckAll');
                        },
                        beforeSend:function(){
                            dialog.loadding(320, 120, "正在批量计算,请勿关闭或刷新窗口!");
                        }
                    });        
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                }
            }],
            close : function(event, ui) {
                $(this).dialog("destroy"); // 关闭时销毁
            }
        });
    },
    // 确认删除
    confirmAjax : function(pTitle, pContent,pUrl,ajaxType) {
        var html = '<div class="dialog" id="dlg2">'    + '  <div class="ui-icon ui-icon-alert" style="margin-top:30px;margin-left:20px;">'    + pContent + '  </div>' + '</div>';
        $(html).dialog({
            title :pTitle,
            modal : false
            width : 300,
            height : 150,
            buttons : [{
                text : '确定',
                id : 'delSure',
                handler : function() {{
                    $.ajax({
                        type :ajaxType,
                        url : pUrl,
                        dataType : 'text',
                        success : function(data) {
                            $("#dlg2").dialog("close");
                            $("#dlg2").dialog("destroy");    
                            //dialog.autoCloss(300, 110, "操作提醒", data);
                            if(data.indexOf("成功")>-1){
                                $("#tbList").datagrid('reload');
                            }
                        }
                    });
                }                
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                }
            } ],
            close : function(event, ui) {
                $(this).dialog("destroy"); // 关闭时销毁
            }
        });
    },
    confirmCopy : function(pWidth, pHeight, pTitle, pContent) {
        var html = '<div class="dialog" id="dlg2">'
            + '  <div class="ui-icon ui-icon-alert" style="margin-top:30px;margin-left:20px;">'
            + pContent + '  </div>' + '</div>';
    $("#dlg2").dialog("close");
    $("#dlg2").dialog("destroy");
    $(html).dialog(
            {
                title : pTitle,
                modal : true,
                iconCls : "icon-edit",
                width : pWidth,
                height : pHeight,
                buttons : [
                        {
                            text : '确定',
                            id : 'delSure',
                            iconCls : 'icon-ok',
                            handler : function() {
                                $("#form1").attr("action","/flood/copy");
                                $("#form1").submit();
                            }
                        }, {
                            text : '取消',
                            iconCls : 'icon-cancel',
                            handler : function() {
                                $("#dlg2").dialog("close");
                                $("#dlg2").dialog("destroy");
                            }
                        } ],
                close : function(event, ui) {
                    $(this).dialog("destroy"); // 关闭时销毁
                }
            });
},
    // 相关数据确认删除
    confirmlinkDelete : function(pWidth, pHeight, pTitle, pContent) {
        var html = '<div class="dialog" id="dlg2">'
                + '  <div class="ui-icon ui-icon-alert" style="margin-top:30px;margin-left:10px;">'
                + pContent + '  </div>' + '</div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog(
                {
                    title : pTitle,
                    modal : true,
                    top : $("#center").offset().top + 50,
                    iconCls : "icon-edit",
                    width : pWidth,
                    buttons : [
                            {
                                text : '确定',
                                id : 'delSure',
                                iconCls : 'icon-ok',
                                handler : function() {
                                    $("#form1").attr(
                                            "action",
                                            $("#form1").attr("action")+ "/delete");
                                    $("#form1").submit();
                                }
                            }, {
                                text : '取消',
                                iconCls : 'icon-cancel',
                                handler : function() {
                                    $("#dlg2").dialog("close");
                                    $("#dlg2").dialog("destroy");
                                }
                            } ],
                    close : function(event, ui) {
                        $(this).dialog("destroy"); // 关闭时销毁
                    }
                });
    },
    // 确认删除
    doubleconfirmDelete : function(pWidth, pHeight, pTitle, pContent) {
        var html = '<div class="dialog" id="dlg2">'
                + '  <div class="ui-icon ui-icon-alert" style="margin-top:30px;margin-left:60px;">'
                + pContent + '  </div>' + '</div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            top : $("#center").offset().top + 50,
            iconCls : "icon-edit",
            width : pWidth,
            buttons : [ {
                text : '确定',
                id : 'delSure',
                iconCls : 'icon-ok',
                handler : function() {
                    text = '请再次确认是否要删除?谨慎操作!';
                    dialog.confirmDelete(pWidth, pHeight, "再次确认", text);
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                }
            } ],
            close : function(event, ui) {
                $(this).dialog("destroy"); // 关闭时销毁
            }
        });
    },
    // 单个删除
    singleDelete : function(pWidth, pHeight, pTitle, pContent, id) {
        var html = '<div class="dialog" id="dlg2">'
                + '  <div class="ui-icon ui-icon-alert" style="margin-top:30px;margin-left:60px;">'
                + pContent + '  </div>' + '</div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog(
                {
                    title : pTitle,
                    modal : true,
                    top : $("#center").offset().top + 50,
                    iconCls : "icon-edit",
                    width : pWidth,
                    buttons : [
                            {
                                text : '确定',
                                id : 'delSure',
                                iconCls : 'icon-ok',
                                handler : function() {
                                    window.location.href = $("#form1").attr(
                                            "action")
                                            + "/delete?ckId=" + id;
                                }
                            }, {
                                text : '取消',
                                iconCls : 'icon-cancel',
                                handler : function() {
                                    $("#dlg2").dialog("close");
                                    $("#dlg2").dialog("destroy");
                                }
                            } ],
                    close : function(event, ui) {
                        $(this).dialog("destroy"); // 关闭时销毁
                    }
                });
    },
    /***************************************************************************
     * 确认操作 pWidth:对话框宽度 pHeight:对话框高度 pTitle:显示的标题 pContent:显示的内容
     * pAction:操作的action(全称)
     **************************************************************************/
    confirm : function(pWidth, pHeight, pTitle, pContent, pAction) {
        var html = '<div class="dialog" id="dlg2">'
                + '  <div class="ui-icon ui-icon-alert" style="margin-top:20px;margin-left:60px;margin-bottom:10px;">'
                + pContent + '  </div>' + '</div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            top : $("#center").offset().top + 50,
            iconCls : "icon-edit",
            width : pWidth,
            buttons : [ {
                text : '确定',
                id : 'delSure',
                iconCls : 'icon-ok',
                handler : function() {
                    $("#form1").attr("action", pAction);
                    $("#form1").submit();
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                }
            } ],
            close : function(event, ui) {
                $(this).dialog("destroy"); // 关闭时销毁
            }
        });
    },prompt : function (pContent,formAction,action1,action2) {
        var html = '<div class="dialog" id="prompt">'
            + '  <div class="ui-icon ui-icon-alert" style="margin-top:20px;margin-left:20px;margin-bottom:10px;">'
            + pContent + '  </div>' + '</div>';
        $("#prompt").dialog("close");
        $("#prompt").dialog("destroy");
        $(html).dialog({
            title : "操作提示",
            modal : true,
            iconCls : "icon-edit",
            width : 320,
            height: 130,
            buttons : [ {
                text : '确定',
                id : 'delSure',
                iconCls : 'icon-ok',
                handler : function() {
                    if(formAction != "")
                        $("#form1").attr("action",formAction);
                    $("#form1").ajaxSubmit(function(data) {
                        if (data != "")
                            dialog.autoCloss1(300,120,"操作提示",data,true,action1);
                         else
                            window.location.href = action2;
                    });
                    $("#prompt").dialog("close");
                    $("#prompt").dialog("destroy");
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#prompt").dialog("close");
                    $("#prompt").dialog("destroy");
                }
            } ],
            close : function(event, ui) {
                $(this).dialog("destroy"); // 关闭时销毁
            }
        });
    },
    /**
     * 弹出层选择框 pWidth:对话框宽度 pHeight:对话框高度 pTitle:显示的标题 id:按钮id pUrl:显示的页面地址
     */
    selectDialog : function(pWidth, pHeight, pTitle, id, pUrl) {
        var html = '<div id="dlgselect" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlgselect").dialog("close");
        $("#dlgselect").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            top : $("#center").offset().top,
            iconCls : "icon-save",
            width : pWidth,
            buttons : [{
                text : '确定',
                id : 'select',
                handler : function() {
                    $('#' + id).click();
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlgselect").dialog("close");
                    $("#dlgselect").dialog("destroy");
                }
            }]
        });
    },
    /**
     * 弹出层选择框 pWidth:对话框宽度 pHeight:对话框高度 pTitle:显示的标题 id:按钮id pUrl:显示的页面地址
     */
    selectDialogForZone : function(pWidth, pHeight, pTitle, id, pUrl) {
        var html = '<div id="dlgselect" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlgselect").dialog("close");
        $("#dlgselect").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            top : $("#center").offset().top,
            iconCls : "icon-save",
            width : pWidth,
            buttons : [{
                text:"<span id=\"spremark\" style=\"color:red;font-weight: bold;float:left;margin-top:4px;\">注:修改选择的分区信息,会覆盖机组下的分区信息,请谨慎修改!</span>"
            }, {
                text : '确定',
                id : 'select',
                handler : function() {
                    $('#' + id).click();
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlgselect").dialog("close");
                    $("#dlgselect").dialog("destroy");
                }
            }]
        });
    },
    //离顶部高度与上一个selectDialog不一样
    selectDialog2 : function(pWidth, pHeight, pTitle, id, pUrl) {
        var html = '<div id="dlgselect" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlgselect").dialog("close");
        $("#dlgselect").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            top : $("#center").offset().top+50,
            iconCls : "icon-save",
            width : pWidth,
            buttons : [ {
                text : '确定',
                id : 'select',
                handler : function() {
                    $('#' + id).click();
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlgselect").dialog("close");
                    $("#dlgselect").dialog("destroy");
                }
            } ]
        });
    },
    selectDialog3 : function(pWidth, pHeight, pTitle, id, pUrl) {
        var html = '<div id="dlgselect" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlgselect").dialog("close");
        $("#dlgselect").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            top : $("#center").offset().top+50,
            iconCls : "icon-save",
            width : pWidth,
            height : pHeight,
            buttons : [ {
                text : '确定',
                id : 'select',
                handler : function() {
                    $('#' + id).click();
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlgselect").dialog("close");
                    $("#dlgselect").dialog("destroy");
                }
            } ]
        });
    },
    /**
     * 全屏弹出层选择框 pTitle:显示的标题 id:按钮id pUrl:显示的页面地址
     */
    noButtonDialog : function(pTitle, width, height, pUrl) {
        var html = '<div id="dlgselect" class="easyui-dialog" style="padding: 10px;"></div>';
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            iconCls : "icon-save",
            width : width != 0 ? width : $(window).width(),
            height : height != 0 ? height : $(window).height(),
            onBeforeClose : function() {
                return false;
            }
        });
    },
    DialogWin : function(width,height,pTitle, pUrl) {
        var html = '<div id="dlgselect" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlgselect").dialog("close");
        $("#dlgselect").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            iconCls : "icon-save",
            width : width != 0 ? width : $(window).width(),
            height : height != 0 ? height : $(window).height(),
            buttons : [ {
                text : '确定',
                id : 'submit1',
                handler : function() {
                    $('#submit').click();
                    $("#dlgselect").dialog("close");
                    $("#dlgselect").dialog("destroy");
                }
            },
            {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlgselect").dialog("close");
                    $("#dlgselect").dialog("destroy");
                }
            }],
            close : function(event, ui) {
                $("#dlgselect").dialog("close");
                $("#dlgselect").dialog("destroy");
            }
        });
    },
    /**
     * 新增、编辑表单 pWidth:对话框宽度 pHeight:对话框高度 pTitle:显示的标题 pUrl:显示的页面地址
     * pCloseLocation: 关闭后跳转的地址
     */
    addDialog : function(pWidth, pHeight, pTitle, pUrl, pCloseLocation) {
        var html = '<div id="dlg2" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            top : $("#center").offset().top + 50,
            iconCls : "icon-save",
            width : pWidth,
            buttons : [ {
                text : '提交',
                id : 'submit1',
                handler : function() {
                    $('#submittype').val('0');
                    $('#submit').click();
                }
            }, {
                text : '提交并继续',
                id : 'submit2',
                handler : function() {
                    $('#submittype').val(2 + parseInt($('#submittype').val()));
                    $('#submit').click();
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                    if ($('#submittype').val() >= 2) {
                        location.href = pCloseLocation;
                        $('#submittype').val('0');
                    }
                }
            } ],
            onClose : function() {
                if ($('#submittype').val() >= 2) {
                    location.href = pCloseLocation;
                    $('#submittype').val('0');
                }
            }
        });
    },
    roleditDialog : function(pWidth, pHeight, pTitle, pUrl, pCloseLocation) {
        var html = '<div id="dlg2" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            iconCls : "icon-save",
            width : pWidth,
            height : pHeight,
            buttons : [ {
                text : '提交',
                id : 'submit1',
                handler : function() {
                    $('#submittype').val('0');
                    $('#submit').click();
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                    if ($('#submittype').val() >= 2) {
                        location.href = pCloseLocation;
                        $('#submittype').val('0');
                    }
                }
            } ],
            close : function(event, ui) {
                $(this).dialog("close");
                $(this).dialog("destroy");
            }
        });
    },
    editDialog : function(pWidth, pHeight, pTitle, pUrl, pCloseLocation) {
        var html = '<div id="dlg2" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            top : $("#center").offset().top + 50,
            iconCls : "icon-save",
            width : pWidth,
            buttons : [ {
                text : '提交',
                id : 'submit1',
                handler : function() {
                    $('#submittype').val('0');
                    $('#submit').click();
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                    if ($('#submittype').val() >= 2) {
                        location.href = pCloseLocation;
                        $('#submittype').val('0');
                    }
                }
            } ],
            close : function(event, ui) {
                $(this).dialog("close");
                $(this).dialog("destroy");
            }
        });
    },
    editDialog3 : function(pWidth, pHeight, pTitle, pUrl, pCloseLocation) {
        var html = '<div id="dlg2" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            top : $("#center").offset().top + 50,
            iconCls : "icon-save",
            width : pWidth,
            buttons : [ {
                text : '提交',
                id : 'submit1',
                handler : function() {
                     $('#btnSubmit').click();
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                }
            } ],
            close : function(event, ui) {
                $(this).dialog("close");
                $(this).dialog("destroy");
            }
        });
    },
    // 首次登录弹出密码修改框
    pwdDialog : function(pWidth, pHeight, pTitle, pUrl, pCloseLocation) {
        var html = '<div id="dlg3"  class="easyui-dialog" style="padding: 10px;"></div>';
        $(html).dialog({
            title : pTitle,
            modal : true,
            closeOnEscape : false,
            href : pUrl,
            iconCls : "icon-save",
            width : pWidth,
            buttons : [ {
                text : '提交',
                id : 'submit1',
                handler : function() {
                    $('#submittype').val('0');
                    $('#submit').click();
                }
            } ]
        });
    },
    viewDialog : function(pWidth, pHeight, pTitle, pUrl, pCloseLocation) {
        var html = '<div id="dlg2" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            height:pHeight,
            top : $("#center").offset().top + 50,
            iconCls : "icon-save",
            width : pWidth,
            buttons : [ {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                }
            } ],
            close : function(event, ui) {
                $(this).dialog("close");
                $(this).dialog("destroy");
            }
        });
    },
    viewDialog2 : function(pWidth, pHeight, pTitle, pUrl, pCloseLocation) {
        var html = '<div id="dlg2" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            iconCls : "icon-save",
            width : pWidth,
            height : pHeight,
            buttons : [ {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                }
            } ],
            close : function(event, ui) {
                $(this).dialog("close");
                $(this).dialog("destroy");
            }
        });
    },
    viewDialog1 : function(pWidth, pTitle, pUrl) {
        var html = '<div id="dlg2" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            top : 10,
            iconCls : "icon-save",
            width : pWidth,
            buttons : [ {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                }
            } ],
            close : function(event, ui) {
                $(this).dialog("close");
                $(this).dialog("destroy");
            }
        });
    },
    viewDialog3 : function(pWidth,pHeight,  pTitle, pUrl) {
        var html = '<div id="dlg2" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            top : $("#center").offset().top + 50,
            href : pUrl,
            iconCls : "icon-save",
            width : pWidth,
            close : function(event, ui) {
                $(this).dialog("close");
                $(this).dialog("destroy");
            }
        });
    },
    // 弹出层显示查看消息
    alertDialog : function(pWidth, pHeight, pTitle, pContent, pCloseLocation,
            isClose) {
        var html = '<div class="dialog" id="dlg">'
                + '  <div class="ui-icon ui-icon-alert" style="margin-top:10px;margin-left:40px;margin-bottom:10px;">'
                + pContent + '  </div>' + '</div>';
        $("#dlg").dialog("close");
        $("#dlg").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            top : $("#center").offset().top + 50,
            iconCls : "icon-save",
            width : pWidth,
            buttons : [ {
                text : '关闭',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg").dialog("close");
                    $("#dlg").dialog("destroy");
                    if (isClose || typeof (isClose) == "undefined") {
                        if ($('#submittype').val() == 0) {
                            location.href = pCloseLocation;
                            $('#submittype').val('');
                        }
                    }
                }
            } ],
            close : function(event, ui) {
                $(this).dialog("close");
                $(this).dialog("destroy");
            }
        });
    },
    // 弹出层自动消失
    autoCloss : function(pWidth, pHeight, pTitle, pContent) {
//        var html = '<div class="dialog" id="dlg">'
//                + '  <div class="ui-icon ui-icon-alert" style="margin-top:20px;margin-left:40px;margin-bottom:10px;">'
//                + pContent + '  </div>' + '</div>';
//        $(html).dialog({
//            title : pTitle,
//            modal : true,
//            iconCls : "icon-edit",
//            width : pWidth,
//            height : pHeight,
//            // top :$("#center").offset().top+50,
//            timeout : 1300,
//            close : function(event, ui) {
//                $(this).dialog("destroy"); // 关闭时销毁
//            }
//        });
        var t = 1000; 
        $(".datagrid-mask,.datagrid-mask-msg").hide(); 
        dialog.loadding(320, 120, pContent); 
        
        var timer = window.setInterval(function() { 
            $(".datagrid-mask,.datagrid-mask-msg").hide(); 
            $("#dlg2").dialog("close");
            $("#dlg2").dialog("destroy");
            $("#dlg2").dialog("close");
            $("#dlg2").dialog("destroy");
            $("#dlg3").dialog("close");
            $("#dlg3").dialog("destroy");
            window.clearInterval(timer); // 时间到了清除计时器
        }, t);
    },
    // 弹出层自动消失并且刷新页面
    autoCloss1 : function(pWidth, pHeight, pTitle, pContent, flag,
            pCloseLocation, isClose) {
//        var html = '<div class="dialog" id="dlg">'
//                + '  <div class="ui-icon ui-icon-alert" style="margin-top:20px;margin-left:40px;margin-bottom:10px;">'
//                + pContent + '  </div>' + '</div>';
//        $(html).dialog({
//            title : pTitle,
//            modal : true,
//            iconCls : "icon-edit",
//            width : pWidth,
//            height : pHeight,
//            // top :$("#center").offset().top+50,
//            timeout : 500,
//            close : function(event, ui) {
//                $(this).dialog("destroy"); // 关闭时销毁
//            }
//        });  
        var types=$("#submittype").val();
        if (types != "0" && types!=undefined && types.length!=0 ) { // 是否是提交并继续
            resetFormAndClearValidate(".registerform");  
        }else{
            if (false) {
                $("#dlg2").dialog("close");
                $("#dlg2").dialog("destroy");
                $("#dlg2").dialog("close");
                $("#dlg2").dialog("destroy");
                $("#dlg3").dialog("close");
                $("#dlg3").dialog("destroy");
            } 
            $("#dlg").dialog("close");
            $("#dlg").dialog("destroy"); 
            var timer = window.setInterval(function() {
                if(pContent!=null && pContent.indexOf("成功")==-1)
                    dialog.loadding(320, 120, pContent);
                $(".datagrid-mask,.datagrid-mask-msg").hide(); 
                window.clearInterval(timer); // 时间到了清除计时器
                if (flag) { 
                    if ($("#submittype").val() == "0" || $("#submittype").length==0) { // 是否是提交并继续
                        location.href = pCloseLocation;
                    } else {
                        resetFormAndClearValidate(".registerform");
                    }
                }
            }, 1000);
        }
    },
    autoCloss3 : function(pWidth, pHeight, pTitle, pContent, flag,pCloseLocation) {
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $("#dlg3").dialog("close");
        $("#dlg3").dialog("destroy");            
        $("#dlg").dialog("close");
        $("#dlg").dialog("destroy"); 
        dialog.loadding(320, 120, pContent);
        var timer = window.setInterval(function() {        
            $(".datagrid-mask,.datagrid-mask-msg").hide(); 
            window.clearInterval(timer); // 时间到了清除计时器
            if (flag) 
                location.href = pCloseLocation;
        }, 1000);
    },
    // 修改密码弹出层自动消失
    autoCloss2 : function(pWidth, pHeight, pTitle, pContent) {
        var html = '<div class="dialog" id="dlg">'
                + '  <div class="ui-icon ui-icon-alert" style="margin-top:20px;margin-left:40px;margin-bottom:10px;">'
                + pContent + '  </div>' + '</div>';
        $(html).dialog({
            title : pTitle,
            modal : true,
            iconCls : "icon-warning",
            width : pWidth,
            height : pHeight,
            // top :$("#center").offset().top+50,
            timeout : 500,
            close : function(event, ui) {
                $(this).dialog("destroy"); // 关闭时销毁
            }
        });
        var timer = window.setInterval(function() {
            $("#dlg").dialog("close");
            $("#dlg").dialog("destroy");
            $("#dlg2").dialog("close");
            $("#dlg2").dialog("destroy");
            $("#dlg3").dialog("close");
            $("#dlg3").dialog("destroy");
            window.clearInterval(timer); // 时间到了清除计时器
        }, 2000);
    },
    confirmLock : function(pWidth, pHeight, pTitle, pContent, pId) {
        var html = '<div class="dialog" id="dlg2">'
                + '  <div class="ui-icon ui-icon-alert" style="margin-top:30px;margin-left:60px;margin-bottom:10px;">'
                + pContent + '  </div>' + '</div>';
        $(html).dialog(
                {
                    title : pTitle,
                    modal : true,
                    iconCls : "icon-edit",
                    top : $("#center").offset().top + 50,
                    width : pWidth,
                    buttons : [
                            {
                                text : '确定',
                                id : 'delSure',
                                iconCls : 'icon-ok',
                                handler : function() {
                                    $("#form1").attr(
                                            "action",
                                            $("#form1").attr("action")
                                                    + "/lock/" + pId);
                                    $("#form1").submit();
                                }
                            }, {
                                text : '取消',
                                iconCls : 'icon-cancel',
                                handler : function() {
                                    $("#dlg2").dialog("close");
                                    $("#dlg2").dialog("destroy");
                                }
                            } ],
                    close : function(event, ui) {
                        $(this).dialog("destroy"); // 关闭时销毁
                    }
                });
    },
    viewpermissions:function(pWidth, pHeight, pTitle, pUrl) {        
        var html ='<div id="dlg3" class="easyui-dialog" style="padding: 10px;"></div>';            
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl, 
            iconCls : "icon-save",
            width : pWidth,
            height: pHeight,
            buttons : [{
                text : '关闭',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg3").dialog("close");
                    $("#dlg3").dialog("destroy");                        
                }
            }],
            close: function(event, ui) {
                $(this).dialog("close");
                $(this).dialog("destroy");
            }
        });
    },
    importDialog : function(pWidth, pHeight, pTitle, pUrl, pCloseLocation) {
        var html = '<div id="dlg2" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            top : $("#center").offset().top + 50,
            iconCls : "icon-save",
            width : pWidth,
            buttons : [ {
                text : '提交',
                id : 'submit1',
                handler : function() {
                    $('.submit').click();
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                    if ($('#submittype').val() >= 2) {
                        location.href = pCloseLocation;
                        $('#submittype').val('0');
                    }
                }
            } ],
            close : function(event, ui) {
                $(this).dialog("close");
                $(this).dialog("destroy");
            }
        });
    },
    releaseDialog : function(pWidth, pHeight, pTitle, pUrl) {
        var html = '<div id="dlg2" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            top : $("#center").offset().top + 50,
            iconCls : "icon-save",
            width : pWidth,
            buttons : [ {
                text : '上传并发布',
                id : 'submit1',
                handler : function() {
                    $('.submit').click();
                }
            }, {
                text : '取消',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy");
                }
            } ],
            close : function(event, ui) {
                $(this).dialog("close");
                $(this).dialog("destroy");
            }
        });
    },
    forgotDialog : function(pWidth, pHeight, pTitle, pUrl) {
        var html = '<div id="dlg2" class="easyui-dialog" style="padding: 10px;"></div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            top : $("#center").offset().top + 50,
            iconCls : "icon-save",
            width : pWidth,
            close : function(event, ui) {
                $(this).dialog("close");
                $(this).dialog("destroy");
            }
        });
    },loadding : function (pWidth, pHeight, content) {
        $("<div class=\"datagrid-mask\"></div>").css({display:"block",width:"100%",height:$(window).height()}).appendTo("body");
        $("<div class=\"datagrid-mask-msg\"></div>").html(content).appendTo("body")
        .css({display:"block",left:($(document.body).outerWidth(true) - 190) / 2,"z-index":9999,top:($(window).height() - 45) / 2});
    },Lock : function(pContent,ID) {
        var html = '<div class="dialog" id="dlg2" data=\'123123123123123123\'>'
            + '  <div class="ui-icon ui-icon-alert" style="margin-top:30px;margin-left:20px;">'
            +pContent+ '  </div>' + '</div>';
            $("#dlg2").dialog("close");
            $("#dlg2").dialog("destroy");
            $(html).dialog(
            {
                title : '操作提示',
                modal : true,
                iconCls : "icon-edit",
                width : 300,
                height : 150,
                buttons : [
                        {
                            text : '确定',
                            id : 'delSure',
                            iconCls : 'icon-ok',
                            handler : function() {
                                lock(ID);
                            }
                        }, {
                            text : '取消',
                            iconCls : 'icon-cancel',
                            handler : function() {
                                $("#dlg2").dialog("close");
                                $("#dlg2").dialog("destroy");
                            }
                        } ],
                close : function(event, ui) {
                    $(this).dialog("destroy"); // 关闭时销毁
                }
            });
    },
    showFlash:function(pWidth, pHeight, pTitle, pUrl) {        
        var html ='<div id="dlg2" class="easyui-dialog"></div>';
        $("#dlg2").dialog("close");
        $("#dlg2").dialog("destroy");
        $(html).dialog({
            title : pTitle,
            modal : true,
            href : pUrl,
            height:pHeight,
            iconCls : "icon-edit",
            width : pWidth, 
            buttons : [{
                text:'不再提醒',
                id:'submit1',
                handler:function(){ 
                    $('#submit').click();
                }                
            }, {
                text : '关闭',
                iconCls : 'icon-cancel',
                handler : function() {
                    $("#dlg2").dialog("close");
                    $("#dlg2").dialog("destroy"); 
                }
            }],
            close: function(event, ui) {
                $(this).dialog("close");
                $(this).dialog("destroy");
            }
        });
    }
}

© 著作权归作者所有

ivan-Zhao
粉丝 10
博文 33
码字总数 29110
作品 0
深圳
程序员
私信 提问
jQuery-EasyUI 1.2.3 发布

Current Version: 1.2.3 ChangeLog: Bug window: Cannot resize the window with iframe content. fixed. tree: The node will be removed when dragging to its child. fixed. combogrid: T......

ejzhang
2011/04/26
6.2K
3
easyui dialog自定义可拖曳

看到标题的朋友一定会觉得本人很奇怪,easyui的dialog不是自带可拖曳的属性吗。是的,dialog继承了Window的一个属性draggable,设为true之后,窗口便可以拖曳。事实是,一,easyui的draggab...

MissGu
2015/04/12
3.2K
0
easyui的datagrid中对记录修改,修改后如何显示在前台??

获取修改的记录,修改后按确定后触发editUser(): function editUser(){ var row = $('#dg').datagrid('getSelected'); if (row){ $('#bian').dialog('open').dialog('setTitle','编辑账户'......

你我共享世界美好
2014/05/12
2.6K
2
jQuery easyui官方文档翻译 - 基础总览

jQuery easyui官方文档翻译web版:http://easydoc.cloudfoundry.com/doc/easyui/1.2.5/ Documentation Each component of easyui has properties, methods and events. Users can extend the......

noday
2012/03/26
778
0
easyui ajax php

easyui使用ajax 提交数据后,后台获取不到form中的值 First Name: Last Name: Phone: Email: ajax 代码 $('#fm').form('submit',{ url: url, onSubmit: function(){ return $(this).form('va......

peihongda
2013/05/24
619
2

没有更多内容

加载失败,请刷新页面

加载更多

PostgreSQL 11.3 locking

rudi
36分钟前
5
0
Mybatis Plus sql注入器

一、继承AbstractMethod /** * @author beth * @data 2019-10-23 20:39 */public class DeleteAllMethod extends AbstractMethod { @Override public MappedStatement injectMap......

一个yuanbeth
今天
8
1
一次写shell脚本的经历记录——特殊字符惹的祸

本文首发于微信公众号“我的小碗汤”,扫码文末二维码即可关注,欢迎一起交流! redis在容器化的过程中,涉及到纵向扩pod实例cpu、内存以及redis实例的maxmemory值,statefulset管理的pod需要...

码农实战
今天
4
0
为什么阿里巴巴Java开发手册中不建议在循环体中使用+进行字符串拼接?

之前在阅读《阿里巴巴Java开发手册》时,发现有一条是关于循环体中字符串拼接的建议,具体内容如下: 那么我们首先来用例子来看看在循环体中用 + 或者用 StringBuilder 进行字符串拼接的效率...

武培轩
今天
8
0
队列-链式(c/c++实现)

队列是在线性表功能稍作修改形成的,在生活中排队是不能插队的吧,先排队先得到对待,慢来得排在最后面,这样来就形成了”先进先出“的队列。作用就是通过伟大的程序员来实现算法解决现实生活...

白客C
今天
78
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部