@ibiz-template/model-helper 0.1.16 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +15 -6
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/model-helper.d.ts +3 -1
- package/out/model-helper.d.ts.map +1 -1
- package/out/model-helper.js +4 -2
- package/out/model-util.d.ts +2 -1
- package/out/model-util.d.ts.map +1 -1
- package/out/model-util.js +10 -2
- package/package.json +3 -3
- package/src/model-helper.ts +3 -0
- package/src/model-util.ts +9 -3
package/dist/index.esm.js
CHANGED
|
@@ -14918,11 +14918,12 @@ var ModelUtil = class {
|
|
|
14918
14918
|
* @param {(url: string) => Promise<IModel>} get 模型加载方法
|
|
14919
14919
|
* @param {boolean} hub 是否为 hub 应用基座
|
|
14920
14920
|
*/
|
|
14921
|
-
constructor(appId, modelTag, get, hub) {
|
|
14921
|
+
constructor(appId, modelTag, get, hub, permission = true) {
|
|
14922
14922
|
this.appId = appId;
|
|
14923
14923
|
this.modelTag = modelTag;
|
|
14924
14924
|
this.get = get;
|
|
14925
14925
|
this.hub = hub;
|
|
14926
|
+
this.permission = permission;
|
|
14926
14927
|
/**
|
|
14927
14928
|
* 模型缓存
|
|
14928
14929
|
*
|
|
@@ -14976,9 +14977,14 @@ var ModelUtil = class {
|
|
|
14976
14977
|
*/
|
|
14977
14978
|
async getAppModel() {
|
|
14978
14979
|
if (!this.appModel) {
|
|
14979
|
-
|
|
14980
|
-
|
|
14981
|
-
|
|
14980
|
+
let appPath = "/PSSYSAPP.json";
|
|
14981
|
+
if (this.hub && ibiz.env.hub) {
|
|
14982
|
+
appPath = "/PSSYSAPP.hub.json";
|
|
14983
|
+
}
|
|
14984
|
+
if (this.permission === false) {
|
|
14985
|
+
appPath = "/PSSYSAPP.simple.json";
|
|
14986
|
+
}
|
|
14987
|
+
this.appModel = await this.getModel(appPath);
|
|
14982
14988
|
this.appModel.id = this.appId;
|
|
14983
14989
|
}
|
|
14984
14990
|
return this.appModel;
|
|
@@ -15164,10 +15170,12 @@ var ModelHelper = class {
|
|
|
15164
15170
|
* @date 2023-04-16 17:04:01
|
|
15165
15171
|
* @param {(url: string) => Promise<IModel>} getModel 模型加载方法
|
|
15166
15172
|
* @param {string} defaultAppId 默认应用标识
|
|
15173
|
+
* @param {boolean} [permission=true] 是否启用权限
|
|
15167
15174
|
*/
|
|
15168
|
-
constructor(getModel, defaultAppId) {
|
|
15175
|
+
constructor(getModel, defaultAppId, permission = true) {
|
|
15169
15176
|
this.getModel = getModel;
|
|
15170
15177
|
this.defaultAppId = defaultAppId;
|
|
15178
|
+
this.permission = permission;
|
|
15171
15179
|
this.dsl = new DSLHelper();
|
|
15172
15180
|
/**
|
|
15173
15181
|
* 模型获取工具类缓存
|
|
@@ -15194,7 +15202,8 @@ var ModelHelper = class {
|
|
|
15194
15202
|
appId,
|
|
15195
15203
|
modelTag,
|
|
15196
15204
|
this.getModel,
|
|
15197
|
-
this.defaultAppId === appId
|
|
15205
|
+
this.defaultAppId === appId,
|
|
15206
|
+
this.permission
|
|
15198
15207
|
);
|
|
15199
15208
|
await modelUtil.init();
|
|
15200
15209
|
this.cache.set(appId, modelUtil);
|