This commit is contained in:
2025-12-24 16:59:05 +08:00
parent b52a51c09b
commit b68946fe79
218 changed files with 10790 additions and 3878 deletions
+16 -7
View File
@@ -106,15 +106,20 @@ define(['jquery', 'bootstrap', 'layer','lightyear'], function ($, undefined, Lay
Fast.events.onAjaxError(ret, error);
}
}, options);
options.url = Fast.api.fixurl(options.url);
return $.ajax(options);
},
//修复URL
fixurl: function (url) {
if (url.substr(0, 1) !== "/") {
var r = new RegExp('^(?:[a-z]+:)?//', 'i');
if (!r.test(url)) {
url = Config.moduleurl + "/" + url;
}
if (url.substr(0, 1) == "/") {
return url;
}
if (url.substr(0, 4) == "http") {
return url;
}
var r = new RegExp('^(?:[a-z]+:)?//', 'i');
if (!r.test(url)) {
url = Config.moduleurl + "/" + url;
}
return url;
},
@@ -148,12 +153,16 @@ define(['jquery', 'bootstrap', 'layer','lightyear'], function ($, undefined, Lay
},
//打开一个弹出窗口
open: function (url, title, options) {
if(options && options.area && (typeof options.area == 'string' && options.area.indexOf(','))){
options.area = options.area.split(',');
}
title = options && options.title ? options.title : (title ? title : "");
url = Fast.api.fixurl(url);
url = url + (url.indexOf("?") > -1 ? "&" : "?") + "dialog=1";
//var area = Fast.config.openArea != undefined ? Fast.config.openArea : [$(window).width() > 800 ? '800px' : '95%', $(window).height() > 600 ? '600px' : '95%'];
var area = Fast.config.openArea != undefined ? Fast.config.openArea : ['95%', '90%'];
var area = Fast.config.openArea != undefined ? Fast.config.openArea : (options.area || ['95%', '90%']);
//console.log(options,area)
options = $.extend({
type: 2,
title: title,
@@ -332,7 +341,7 @@ define(['jquery', 'bootstrap', 'layer','lightyear'], function ($, undefined, Lay
return self == parent;
},
isMainIframe:function(){
return parent.location.pathname.toLocaleLowerCase() == '/app/admin/index/index';
return parent.location.pathname.toLocaleLowerCase() == Config.admin_path+'/index/index';
},
isPopIframe:function(){
if(Fast.isTopWindow()){