|
|
|
@ -10,27 +10,29 @@
|
|
|
|
|
BI.module = BI.module || function (xtype, cls) { |
|
|
|
|
if (moduleInjection[xtype] != null) { |
|
|
|
|
_global.console && console.error("module: [" + xtype + "] 已经注册过了"); |
|
|
|
|
} |
|
|
|
|
if (BI.isFunction(cls)) { |
|
|
|
|
cls = cls(); |
|
|
|
|
} |
|
|
|
|
for (var k in moduleInjectionMap) { |
|
|
|
|
if (cls[k]) { |
|
|
|
|
for (var key in cls[k]) { |
|
|
|
|
if (!moduleInjectionMap[k]) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (!moduleInjectionMap[k][key]) { |
|
|
|
|
moduleInjectionMap[k][key] = []; |
|
|
|
|
} else { |
|
|
|
|
if (BI.isFunction(cls)) { |
|
|
|
|
cls = cls(); |
|
|
|
|
} |
|
|
|
|
for (var k in moduleInjectionMap) { |
|
|
|
|
if (cls[k]) { |
|
|
|
|
for (var key in cls[k]) { |
|
|
|
|
if (!moduleInjectionMap[k]) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (!moduleInjectionMap[k][key]) { |
|
|
|
|
moduleInjectionMap[k][key] = []; |
|
|
|
|
} |
|
|
|
|
moduleInjectionMap[k][key].push({ |
|
|
|
|
version: cls[k][key], |
|
|
|
|
moduleId: xtype |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
moduleInjectionMap[k][key].push({ |
|
|
|
|
version: cls[k][key], |
|
|
|
|
moduleId: xtype |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
moduleInjection[xtype] = cls; |
|
|
|
|
} |
|
|
|
|
moduleInjection[xtype] = cls; |
|
|
|
|
|
|
|
|
|
return function () { |
|
|
|
|
return BI.Modules.getModule(xtype); |
|
|
|
|
}; |
|
|
|
@ -40,8 +42,10 @@
|
|
|
|
|
BI.constant = BI.constant || function (xtype, cls) { |
|
|
|
|
if (constantInjection[xtype] != null) { |
|
|
|
|
_global.console && console.error("constant: [" + xtype + "]已经注册过了"); |
|
|
|
|
} else { |
|
|
|
|
constantInjection[xtype] = cls; |
|
|
|
|
} |
|
|
|
|
constantInjection[xtype] = cls; |
|
|
|
|
|
|
|
|
|
return function () { |
|
|
|
|
return BI.Constants.getConstant(xtype); |
|
|
|
|
}; |
|
|
|
@ -51,8 +55,10 @@
|
|
|
|
|
BI.model = BI.model || function (xtype, cls) { |
|
|
|
|
if (modelInjection[xtype] != null) { |
|
|
|
|
_global.console && console.error("model: [" + xtype + "] 已经注册过了"); |
|
|
|
|
} else { |
|
|
|
|
modelInjection[xtype] = cls; |
|
|
|
|
} |
|
|
|
|
modelInjection[xtype] = cls; |
|
|
|
|
|
|
|
|
|
return function (config) { |
|
|
|
|
return BI.Models.getModel(xtype, config); |
|
|
|
|
}; |
|
|
|
@ -62,8 +68,10 @@
|
|
|
|
|
BI.store = BI.store || function (xtype, cls) { |
|
|
|
|
if (storeInjection[xtype] != null) { |
|
|
|
|
_global.console && console.error("store: [" + xtype + "] 已经注册过了"); |
|
|
|
|
} else { |
|
|
|
|
storeInjection[xtype] = cls; |
|
|
|
|
} |
|
|
|
|
storeInjection[xtype] = cls; |
|
|
|
|
|
|
|
|
|
return function (config) { |
|
|
|
|
return BI.Stores.getStore(xtype, config); |
|
|
|
|
}; |
|
|
|
@ -73,8 +81,10 @@
|
|
|
|
|
BI.service = BI.service || function (xtype, cls) { |
|
|
|
|
if (serviceInjection[xtype] != null) { |
|
|
|
|
_global.console && console.error("service: [" + xtype + "] 已经注册过了"); |
|
|
|
|
} else { |
|
|
|
|
serviceInjection[xtype] = cls; |
|
|
|
|
} |
|
|
|
|
serviceInjection[xtype] = cls; |
|
|
|
|
|
|
|
|
|
return function (config) { |
|
|
|
|
return BI.Services.getService(xtype, config); |
|
|
|
|
}; |
|
|
|
@ -84,8 +94,10 @@
|
|
|
|
|
BI.provider = BI.provider || function (xtype, cls) { |
|
|
|
|
if (providerInjection[xtype] != null) { |
|
|
|
|
_global.console && console.error("provider: [" + xtype + "] 已经注册过了"); |
|
|
|
|
} else { |
|
|
|
|
providerInjection[xtype] = cls; |
|
|
|
|
} |
|
|
|
|
providerInjection[xtype] = cls; |
|
|
|
|
|
|
|
|
|
return function (config) { |
|
|
|
|
return BI.Providers.getProvider(xtype, config); |
|
|
|
|
}; |
|
|
|
@ -390,6 +402,8 @@
|
|
|
|
|
BI.shortcut = BI.component = BI.shortcut || function (xtype, cls) { |
|
|
|
|
if (kv[xtype] != null) { |
|
|
|
|
_global.console && console.error("组件: [" + xtype + "] 已经注册过了"); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (cls) { |
|
|
|
|
cls["xtype"] = xtype; |
|
|
|
|