From 2305d708e1eac35355df752880ed5e0b4e292c86 Mon Sep 17 00:00:00 2001 From: imp Date: Fri, 19 Nov 2021 11:34:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20constant?= =?UTF-8?q?=20es6=E5=86=99=E6=B3=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/6.inject.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/6.inject.js b/src/core/6.inject.js index ed4d1165b..2cdb82caa 100644 --- a/src/core/6.inject.js +++ b/src/core/6.inject.js @@ -39,6 +39,9 @@ _global.console && console.error("constant: [" + xtype + "]已经注册过了"); } constantInjection[xtype] = cls; + return function () { + return BI.Constants.getConstant(xtype); + } }; var modelInjection = {}; @@ -294,7 +297,7 @@ _global.console && console.error("constant: [" + type + "] 未定义"); } runConfigFunction(type); - return constantInjection[type]; + return BI.isFunction(constantInjection[type]) ? constantInjection[type]() : constantInjection[type]; } }; From 3ac34ba081240410bc92c66b069a8be31ce31c18 Mon Sep 17 00:00:00 2001 From: imp Date: Fri, 19 Nov 2021 14:33:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20es6?= =?UTF-8?q?=E5=86=99=E6=B3=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/6.inject.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/6.inject.js b/src/core/6.inject.js index 2cdb82caa..c9f77055b 100644 --- a/src/core/6.inject.js +++ b/src/core/6.inject.js @@ -50,6 +50,9 @@ _global.console && console.error("model: [" + xtype + "] 已经注册过了"); } modelInjection[xtype] = cls; + return function (xtype, config) { + return BI.Models.getModel(xtype, config); + }; }; var storeInjection = {}; @@ -58,6 +61,9 @@ _global.console && console.error("store: [" + xtype + "] 已经注册过了"); } storeInjection[xtype] = cls; + return function (xtype, config) { + return BI.Stores.getStore(xtype, config); + } }; var serviceInjection = {}; @@ -66,6 +72,9 @@ _global.console && console.error("service: [" + xtype + "] 已经注册过了"); } serviceInjection[xtype] = cls; + return function (xtype, config) { + return BI.Services.getService(xtype, config); + } }; var providerInjection = {}; @@ -74,6 +83,9 @@ _global.console && console.error("provider: [" + xtype + "] 已经注册过了"); } providerInjection[xtype] = cls; + return function (xtype, config) { + return BI.Providers.getProvider(xtype, config); + } }; var configFunctions = {};