@ibiz-template/model-helper 0.7.41-alpha.13 → 0.7.41-alpha.130
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 +9770 -3196
- package/dist/index.system.min.js +1 -1
- package/out/index.d.ts +2 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -1
- package/out/interface/i-model-handler.d.ts +20 -0
- package/out/interface/i-model-handler.d.ts.map +1 -0
- package/out/interface/i-model-handler.js +1 -0
- package/out/interface/index.d.ts +2 -0
- package/out/interface/index.d.ts.map +1 -0
- package/out/interface/index.js +1 -0
- package/out/locale/en/index.d.ts +4 -0
- package/out/locale/en/index.d.ts.map +1 -1
- package/out/locale/en/index.js +4 -0
- package/out/locale/zh-CN/index.d.ts +4 -0
- package/out/locale/zh-CN/index.d.ts.map +1 -1
- package/out/locale/zh-CN/index.js +4 -0
- package/out/model-helper.d.ts +13 -1
- package/out/model-helper.d.ts.map +1 -1
- package/out/model-helper.js +47 -4
- package/out/model-loader.d.ts +3 -1
- package/out/model-loader.d.ts.map +1 -1
- package/out/model-loader.js +6 -0
- package/out/model-util.d.ts +3 -2
- package/out/model-util.d.ts.map +1 -1
- package/out/model-util.js +28 -20
- package/out/utils/index.d.ts +3 -0
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +3 -0
- package/out/utils/merge-model/merge-app-codelist.d.ts +8 -0
- package/out/utils/merge-model/merge-app-codelist.d.ts.map +1 -0
- package/out/utils/merge-model/merge-app-codelist.js +35 -0
- package/out/utils/merge-model/merge-app-menu.d.ts.map +1 -1
- package/out/utils/merge-model/merge-app-menu.js +8 -3
- package/out/utils/merge-model/merge-app-uiaction-group.d.ts +7 -0
- package/out/utils/merge-model/merge-app-uiaction-group.d.ts.map +1 -1
- package/out/utils/merge-model/merge-app-uiaction-group.js +54 -2
- package/out/utils/merge-model/merge-de-drcontrol.d.ts +8 -0
- package/out/utils/merge-model/merge-de-drcontrol.d.ts.map +1 -1
- package/out/utils/merge-model/merge-de-drcontrol.js +87 -4
- package/out/utils/merge-model/merge-de-form.d.ts +15 -0
- package/out/utils/merge-model/merge-de-form.d.ts.map +1 -1
- package/out/utils/merge-model/merge-de-form.js +56 -0
- package/out/utils/merge-model/merge-model-helper.d.ts +15 -1
- package/out/utils/merge-model/merge-model-helper.d.ts.map +1 -1
- package/out/utils/merge-model/merge-model-helper.js +101 -9
- package/out/utils/merge-model/merge-treeview.d.ts.map +1 -1
- package/out/utils/merge-model/merge-treeview.js +142 -6
- package/out/utils/model-transformer/model-handler.d.ts +32 -0
- package/out/utils/model-transformer/model-handler.d.ts.map +1 -0
- package/out/utils/model-transformer/model-handler.js +24 -0
- package/out/utils/model-transformer/model-register.d.ts +9 -0
- package/out/utils/model-transformer/model-register.d.ts.map +1 -0
- package/out/utils/model-transformer/model-register.js +10 -0
- package/out/utils/model-transformer/model-transformer.d.ts +63 -0
- package/out/utils/model-transformer/model-transformer.d.ts.map +1 -0
- package/out/utils/model-transformer/model-transformer.js +125 -0
- package/package.json +8 -6
- package/src/index.ts +12 -0
- package/src/interface/i-model-handler.ts +19 -0
- package/src/interface/index.ts +1 -0
- package/src/locale/en/index.ts +24 -0
- package/src/locale/index.ts +2 -0
- package/src/locale/zh-CN/index.ts +20 -0
- package/src/model/PSSYSAPP.ts +12 -0
- package/src/model-helper.ts +804 -0
- package/src/model-loader.ts +95 -0
- package/src/model-util.ts +483 -0
- package/src/utils/format-path/format-path.ts +9 -0
- package/src/utils/index.ts +12 -0
- package/src/utils/merge-model/merge-app-codelist.ts +42 -0
- package/src/utils/merge-model/merge-app-menu.ts +136 -0
- package/src/utils/merge-model/merge-app-uiaction-group.ts +85 -0
- package/src/utils/merge-model/merge-de-drcontrol.ts +175 -0
- package/src/utils/merge-model/merge-de-form.ts +326 -0
- package/src/utils/merge-model/merge-model-helper.ts +602 -0
- package/src/utils/merge-model/merge-model.ts +20 -0
- package/src/utils/merge-model/merge-treeview.ts +197 -0
- package/src/utils/model-transformer/model-handler.ts +36 -0
- package/src/utils/model-transformer/model-register.ts +15 -0
- package/src/utils/model-transformer/model-transformer.ts +147 -0
- package/src/utils/plural/plural.ts +30 -0
- package/src/utils/service-path-util/service-path-util.ts +361 -0
package/out/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import '@ibiz/model-core';
|
|
2
2
|
import '@ibiz-template/runtime';
|
|
3
|
+
export type { IModelHandler } from './interface';
|
|
3
4
|
export * from './model-helper';
|
|
4
5
|
export * from './locale';
|
|
5
6
|
export { ModelHelper } from './model-helper';
|
|
6
|
-
export { MergeSubModelHelper } from './utils';
|
|
7
|
+
export { MergeSubModelHelper, registerModelHandler, ModelHandler, } from './utils';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,wBAAwB,CAAC;AAEhC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,wBAAwB,CAAC;AAEhC,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,GACb,MAAM,SAAS,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -3,4 +3,4 @@ import '@ibiz-template/runtime';
|
|
|
3
3
|
export * from './model-helper';
|
|
4
4
|
export * from './locale';
|
|
5
5
|
export { ModelHelper } from './model-helper';
|
|
6
|
-
export { MergeSubModelHelper } from './utils';
|
|
6
|
+
export { MergeSubModelHelper, registerModelHandler, ModelHandler, } from './utils';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 模型处理器
|
|
3
|
+
* @export
|
|
4
|
+
* @interface IModelHandler
|
|
5
|
+
*/
|
|
6
|
+
export interface IModelHandler {
|
|
7
|
+
/**
|
|
8
|
+
* @description 执行模型处理
|
|
9
|
+
*
|
|
10
|
+
* 调用约定:
|
|
11
|
+
* - 入参 `model` 为当前已处理的模型对象,处理器可就地修改该对象,也可返回一个新的模型对象。
|
|
12
|
+
* - 返回值将作为下一个处理器的入参,并最终作为该路径模型的最终结果被缓存。
|
|
13
|
+
* - 若返回 `null`、`undefined` 等假值,将中断当前路径后续处理器的执行,并回退到原始模型。
|
|
14
|
+
* - 处理器抛出异常时同样会中断后续执行,并回退到原始模型。
|
|
15
|
+
* @param {IModel} model 当前待处理的模型对象
|
|
16
|
+
* @returns {IModel} 处理后的模型对象
|
|
17
|
+
*/
|
|
18
|
+
execute(model: IModel): IModel;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=i-model-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-model-handler.d.ts","sourceRoot":"","sources":["../../src/interface/i-model-handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/out/locale/en/index.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ export declare const en: {
|
|
|
5
5
|
maximumTier: string;
|
|
6
6
|
circularRecursive: string;
|
|
7
7
|
calculatedEntities: string;
|
|
8
|
+
transformNoModelData: string;
|
|
9
|
+
transformException: string;
|
|
10
|
+
tryGetModel: string;
|
|
11
|
+
invalidPathPattern: string;
|
|
8
12
|
};
|
|
9
13
|
noInitialized: string;
|
|
10
14
|
noFoundEntity: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/locale/en/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/locale/en/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;CAuBd,CAAC"}
|
package/out/locale/en/index.js
CHANGED
|
@@ -5,6 +5,10 @@ export const en = {
|
|
|
5
5
|
maximumTier: 'Service path calculation exceeds maximum tier 10',
|
|
6
6
|
circularRecursive: 'A circular recursive reference appears in the computational resource relationship path, triggering the entity:',
|
|
7
7
|
calculatedEntities: 'Current list of calculated entities. ',
|
|
8
|
+
transformNoModelData: '[{dynaModelFilePath}] model transformation exception, no model data returned',
|
|
9
|
+
transformException: '[{dynaModelFilePath}] model transformation exception',
|
|
10
|
+
tryGetModel: '[Custom extension model data] Try to get the extension model of path [{dynaModelFilePath}]',
|
|
11
|
+
invalidPathPattern: '[Model handler path validation failed]: wildcards are not allowed in even-position path segments, [{pathPattern}] registration skipped',
|
|
8
12
|
},
|
|
9
13
|
noInitialized: '[{appId}] is not initialized, please call initModelUtil method to initialize it first',
|
|
10
14
|
noFoundEntity: 'Application [{appId}] data entity not found [{tag}]',
|
|
@@ -5,6 +5,10 @@ export declare const zhCn: {
|
|
|
5
5
|
maximumTier: string;
|
|
6
6
|
circularRecursive: string;
|
|
7
7
|
calculatedEntities: string;
|
|
8
|
+
transformNoModelData: string;
|
|
9
|
+
transformException: string;
|
|
10
|
+
tryGetModel: string;
|
|
11
|
+
invalidPathPattern: string;
|
|
8
12
|
};
|
|
9
13
|
noInitialized: string;
|
|
10
14
|
noFoundEntity: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/locale/zh-CN/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/locale/zh-CN/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;CAmBhB,CAAC"}
|
|
@@ -5,6 +5,10 @@ export const zhCn = {
|
|
|
5
5
|
maximumTier: '服务路径计算超过最大层级 10',
|
|
6
6
|
circularRecursive: '计算资源关系路径出现循环递归引用,触发实体:',
|
|
7
7
|
calculatedEntities: '当前已计算过实体清单: ',
|
|
8
|
+
transformNoModelData: '[{dynaModelFilePath}]模型转化异常,未返回模型数据',
|
|
9
|
+
transformException: '[{dynaModelFilePath}]模型转化异常',
|
|
10
|
+
tryGetModel: '[自定义扩展模型数据] 尝试获取路径[{dynaModelFilePath}]的扩展模型',
|
|
11
|
+
invalidPathPattern: '[模型处理器校验路径失败],偶数位路径段不允许使用通配符,[{pathPattern}]已跳过注册',
|
|
8
12
|
},
|
|
9
13
|
noInitialized: '[{appId}]未初始化,请先调用 initModelUtil 方法初始化',
|
|
10
14
|
noFoundEntity: '应用[{appId}]未找到数据实体[{tag}]',
|
package/out/model-helper.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAppDataEntity, IAppView, IApplication, IAppLan, ISubAppRef, IAppBIScheme, IAppBICube, IAppBIReport } from '@ibiz/model-core';
|
|
1
|
+
import { IAppCodeList, IAppDataEntity, IAppView, IApplication, IAppLan, ISubAppRef, IAppBIScheme, IAppBICube, IAppBIReport } from '@ibiz/model-core';
|
|
2
2
|
import { DSLHelper } from '@ibiz/rt-model-api';
|
|
3
3
|
import { ModelUtil } from './model-util';
|
|
4
4
|
import { MergeSubModelHelper } from './utils';
|
|
@@ -136,6 +136,13 @@ export declare class ModelHelper {
|
|
|
136
136
|
* @return {*} {(Promise<string | null>)}
|
|
137
137
|
*/
|
|
138
138
|
getAppStyle(appId?: string | IObject): Promise<string | null>;
|
|
139
|
+
/**
|
|
140
|
+
* @description 计算应用实体需要合并的子应用模型
|
|
141
|
+
* @protected
|
|
142
|
+
* @param {IAppDataEntity} appDataEntity
|
|
143
|
+
* @memberof ModelHelper
|
|
144
|
+
*/
|
|
145
|
+
protected calcAppDataEntitySubAppModel(appDataEntity: IAppDataEntity): void;
|
|
139
146
|
/**
|
|
140
147
|
* 根据应用实体 codeName 获取应用实体模型
|
|
141
148
|
*
|
|
@@ -247,5 +254,10 @@ export declare class ModelHelper {
|
|
|
247
254
|
* @return {*} {string}
|
|
248
255
|
*/
|
|
249
256
|
protected calcAppId(data?: IObject | string): string;
|
|
257
|
+
/**
|
|
258
|
+
* 合并子应用代码表
|
|
259
|
+
* @param codeList
|
|
260
|
+
*/
|
|
261
|
+
mergeSubAppCodeList(codeList: IAppCodeList): void;
|
|
250
262
|
}
|
|
251
263
|
//# sourceMappingURL=model-helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-helper.d.ts","sourceRoot":"","sources":["../src/model-helper.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"model-helper.d.ts","sourceRoot":"","sources":["../src/model-helper.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,UAAU,EACV,YAAY,EACZ,UAAU,EACV,YAAY,EACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAiB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,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E,MAAM,EACb,GAAG,GAAE,MAAM,EAAO,GACjB,OAAO,CAAC,YAAY,EAAE,CAAC;IAuC1B;;;;;;;;OAQG;IACG,gBAAgB,CACpB,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,MAAM,EAAO,GACjB,OAAO,CAAC,UAAU,EAAE,CAAC;IAuCxB;;;;;;;;OAQG;IACG,eAAe,CACnB,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,MAAM,EAAO,GACjB,OAAO,CAAC,YAAY,EAAE,CAAC;IAuC1B;;;;;;;;OAQG;IACG,qBAAqB,CACzB,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,aAAa,GAC1D,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC;IAiB7B;;;;;;;;OAQG;IACH,SAAS,CAAC,YAAY,CACpB,OAAO,GAAE,OAAO,GAAG,MAA0B,GAC5C,SAAS;IAQZ;;;;;;;;OAQG;IACH,SAAS,CAAC,SAAS,CAAC,IAAI,GAAE,OAAO,GAAG,MAA0B,GAAG,MAAM;IAUvE;;;OAGG;IACH,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;CAGlD"}
|
package/out/model-helper.js
CHANGED
|
@@ -156,7 +156,7 @@ export class ModelHelper {
|
|
|
156
156
|
}
|
|
157
157
|
// 模型扩展标准视图布局面板
|
|
158
158
|
const subViewRefs = app.model.appSubViewTypeRefs || [];
|
|
159
|
-
subViewRefs.forEach(item => {
|
|
159
|
+
subViewRefs.forEach((item) => {
|
|
160
160
|
if (item.replaceDefault) {
|
|
161
161
|
ibiz.util.layoutPanel.register(`${item.viewType}_DEFAULT`, item.viewLayoutPanel);
|
|
162
162
|
}
|
|
@@ -168,8 +168,18 @@ export class ModelHelper {
|
|
|
168
168
|
for (let i = 0; i < subAppRefs.length; i++) {
|
|
169
169
|
const subApp = subAppRefs[i];
|
|
170
170
|
const sourceSubApp = getAllPSSubAppRefs[i];
|
|
171
|
-
//
|
|
172
|
-
|
|
171
|
+
// 控制插件应用访问权限、通过应用样式参数SUBAPPACCESSKEY定义权限标识
|
|
172
|
+
if (subApp.accessKey) {
|
|
173
|
+
const mianApp = await ibiz.hub.getApp(ibiz.env.appId);
|
|
174
|
+
await mianApp.authority.init();
|
|
175
|
+
const permitted = mianApp.authority.calcByResCode(subApp.accessKey);
|
|
176
|
+
if (permitted) {
|
|
177
|
+
await this.initSubApp(app, subApp, sourceSubApp);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
await this.initSubApp(app, subApp, sourceSubApp);
|
|
182
|
+
}
|
|
173
183
|
}
|
|
174
184
|
}
|
|
175
185
|
}
|
|
@@ -232,7 +242,12 @@ export class ModelHelper {
|
|
|
232
242
|
const drCtrls = this.dsl.controls(sourceSubApp.getAllPSDEDRControls || []);
|
|
233
243
|
drCtrlIds.forEach((id, index) => {
|
|
234
244
|
const drCtrl = drCtrls[index];
|
|
235
|
-
|
|
245
|
+
if (drCtrl.controlType === 'TABEXPPANEL') {
|
|
246
|
+
ibiz.hub.registerSubAppTabExpPanel(subApp.id || ibiz.env.appId, drCtrl);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
ibiz.hub.registerSubAppDrControls(subApp.id || ibiz.env.appId, drCtrl);
|
|
250
|
+
}
|
|
236
251
|
});
|
|
237
252
|
// 设置界面行为组到hub中
|
|
238
253
|
const appDEUIActionGroupIds = subApp.appDEUIActionGroupIds || [];
|
|
@@ -258,6 +273,14 @@ export class ModelHelper {
|
|
|
258
273
|
this.deepFillSubAppId(appControl, subApp.id);
|
|
259
274
|
ibiz.hub.registerSubAppControls(subApp.id || ibiz.env.appId, this.dsl.control(appControl));
|
|
260
275
|
});
|
|
276
|
+
// 设置代码表模型到hub中
|
|
277
|
+
const appCodeLists = sourceSubApp.getAllPSAppCodeLists || [];
|
|
278
|
+
if (subApp.id) {
|
|
279
|
+
appCodeLists.forEach((appCodeList) => {
|
|
280
|
+
this.deepFillSubAppId(appCodeList, subApp.id);
|
|
281
|
+
ibiz.hub.registerSubAppCodeList(subApp.id, this.dsl.appCodeList(appCodeList));
|
|
282
|
+
});
|
|
283
|
+
}
|
|
261
284
|
// 实现子应用借助主应用独立打开,srfembsubapp的值为ref三段式的第一段哈希值,条件触发手动加载目标子应用
|
|
262
285
|
if (this.appContext.srfembsubapp &&
|
|
263
286
|
subApp.id &&
|
|
@@ -331,6 +354,16 @@ export class ModelHelper {
|
|
|
331
354
|
getAppStyle(appId) {
|
|
332
355
|
return this.getModelUtil(appId).getAppStyle();
|
|
333
356
|
}
|
|
357
|
+
/**
|
|
358
|
+
* @description 计算应用实体需要合并的子应用模型
|
|
359
|
+
* @protected
|
|
360
|
+
* @param {IAppDataEntity} appDataEntity
|
|
361
|
+
* @memberof ModelHelper
|
|
362
|
+
*/
|
|
363
|
+
calcAppDataEntitySubAppModel(appDataEntity) {
|
|
364
|
+
// 合并AC模式界面行为组
|
|
365
|
+
this.merge.mergeSubAppDEACModesActionGroup(appDataEntity.appDEACModes, this.subAppRefs);
|
|
366
|
+
}
|
|
334
367
|
/**
|
|
335
368
|
* 根据应用实体 codeName 获取应用实体模型
|
|
336
369
|
*
|
|
@@ -345,6 +378,9 @@ export class ModelHelper {
|
|
|
345
378
|
const util = this.getModelUtil(appId);
|
|
346
379
|
const model = await util.getAppDataEntityModel(name, isId, true);
|
|
347
380
|
const dsl = this.dsl.appDataEntity(model);
|
|
381
|
+
if (!appId || appId === ibiz.env.appId) {
|
|
382
|
+
this.calcAppDataEntitySubAppModel(dsl);
|
|
383
|
+
}
|
|
348
384
|
const list = await util.servicePathUtil.calcRequestPaths(dsl.id);
|
|
349
385
|
dsl.requestPaths = list;
|
|
350
386
|
dsl.codeName2 = plural(dsl.codeName.toLowerCase());
|
|
@@ -634,4 +670,11 @@ export class ModelHelper {
|
|
|
634
670
|
}
|
|
635
671
|
return appId;
|
|
636
672
|
}
|
|
673
|
+
/**
|
|
674
|
+
* 合并子应用代码表
|
|
675
|
+
* @param codeList
|
|
676
|
+
*/
|
|
677
|
+
mergeSubAppCodeList(codeList) {
|
|
678
|
+
this.merge.mergeSubAppCodeList(codeList, this.subAppRefs);
|
|
679
|
+
}
|
|
637
680
|
}
|
package/out/model-loader.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModelLoaderProvider } from '@ibiz-template/runtime';
|
|
2
|
-
import { IApplication, IAppView, IAppDataEntity, IAppBIScheme, IAppBICube, IAppBIReport, ISubAppRef } from '@ibiz/model-core';
|
|
2
|
+
import { IApplication, IAppView, IAppDataEntity, IAppBIScheme, IAppBICube, IAppBIReport, ISubAppRef, IAppCodeList, IAppLan } from '@ibiz/model-core';
|
|
3
3
|
import { ModelHelper } from './model-helper';
|
|
4
4
|
/**
|
|
5
5
|
* 模型加载适配器
|
|
@@ -19,11 +19,13 @@ export declare class ModelLoader implements ModelLoaderProvider {
|
|
|
19
19
|
getAppView(appId: string, codeName: string): Promise<IAppView>;
|
|
20
20
|
getAppDataEntity(appId: string, id: string): Promise<IAppDataEntity>;
|
|
21
21
|
getAppDataEntityByCodeName(appId: string, codeName: string): Promise<IAppDataEntity>;
|
|
22
|
+
getPSAppLang(language: string, appId?: string | IObject): Promise<IAppLan | null>;
|
|
22
23
|
getAppStyle(appId: string): Promise<string | null>;
|
|
23
24
|
loadAppView(appId: string, viewId: string, params: IParams): Promise<IAppView>;
|
|
24
25
|
getAppBISchemes(appId: string, ids: string[]): Promise<IAppBIScheme[]>;
|
|
25
26
|
getAppAppBICubes(appId: string, ids: string[]): Promise<IAppBICube[]>;
|
|
26
27
|
getAppBIReports(appId: string, ids: string[]): Promise<IAppBIReport[]>;
|
|
27
28
|
translationModelToDsl(data: IData, type: 'APP' | 'VIEW' | 'CTRL' | 'APPENTITY' | 'APPBIREPORT'): Promise<IModel | undefined>;
|
|
29
|
+
mergeSubAppCodeList(codeList: IAppCodeList): void;
|
|
28
30
|
}
|
|
29
31
|
//# sourceMappingURL=model-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-loader.d.ts","sourceRoot":"","sources":["../src/model-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,UAAU,
|
|
1
|
+
{"version":3,"file":"model-loader.d.ts","sourceRoot":"","sources":["../src/model-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,OAAO,EACR,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;;GAQG;AACH,qBAAa,WAAY,YAAW,mBAAmB;IACzC,SAAS,CAAC,MAAM,EAAE,WAAW;gBAAnB,MAAM,EAAE,WAAW;IAEzC,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAItC,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAI1C,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAI5D,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAI9D,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAIpE,0BAA0B,CACxB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,cAAc,CAAC;IAIpB,YAAY,CAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GACvB,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAI1B,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIlD,WAAW,CACT,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,QAAQ,CAAC;IAIpB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAItE,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAIrE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAItE,qBAAqB,CACnB,IAAI,EAAE,KAAK,EACX,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,aAAa,GAC1D,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI9B,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;CAGlD"}
|
package/out/model-loader.js
CHANGED
|
@@ -29,6 +29,9 @@ export class ModelLoader {
|
|
|
29
29
|
getAppDataEntityByCodeName(appId, codeName) {
|
|
30
30
|
return this.helper.getAppDataEntityModel(codeName, appId, false);
|
|
31
31
|
}
|
|
32
|
+
async getPSAppLang(language, appId) {
|
|
33
|
+
return this.helper.getPSAppLang(language, appId);
|
|
34
|
+
}
|
|
32
35
|
getAppStyle(appId) {
|
|
33
36
|
return this.helper.getAppStyle(appId);
|
|
34
37
|
}
|
|
@@ -47,4 +50,7 @@ export class ModelLoader {
|
|
|
47
50
|
translationModelToDsl(data, type) {
|
|
48
51
|
return this.helper.translationModelToDsl(data, type);
|
|
49
52
|
}
|
|
53
|
+
mergeSubAppCodeList(codeList) {
|
|
54
|
+
this.helper.mergeSubAppCodeList(codeList);
|
|
55
|
+
}
|
|
50
56
|
}
|
package/out/model-util.d.ts
CHANGED
|
@@ -164,14 +164,15 @@ export declare class ModelUtil {
|
|
|
164
164
|
*/
|
|
165
165
|
getModel(modelPath: string, params?: IParams, isDynamic?: boolean): Promise<IModel>;
|
|
166
166
|
/**
|
|
167
|
-
*
|
|
167
|
+
* 递归填充模型,包括填充模型appId、变换模型
|
|
168
168
|
*
|
|
169
169
|
* @author chitanda
|
|
170
170
|
* @date 2023-08-21 10:08:41
|
|
171
171
|
* @protected
|
|
172
172
|
* @param {IModel} model
|
|
173
|
+
* @return {*} {IModel} 返回处理后的模型,若处理器返回新对象则替换原引用
|
|
173
174
|
*/
|
|
174
|
-
protected
|
|
175
|
+
protected deepFillModel(model: IModel): IModel;
|
|
175
176
|
/**
|
|
176
177
|
* 计算应用模型请求路径
|
|
177
178
|
*
|
package/out/model-util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-util.d.ts","sourceRoot":"","sources":["../src/model-util.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"model-util.d.ts","sourceRoot":"","sources":["../src/model-util.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,eAAe,EAChB,MAAM,SAAS,CAAC;AAGjB;;;;;;;GAOG;AACH,qBAAa,SAAS;IA0ClB,SAAS,CAAC,KAAK,EAAE,MAAM;IACvB,SAAS,CAAC,QAAQ,EAAE,MAAM;IAC1B,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC;IACjE,SAAS,CAAC,GAAG,EAAE,OAAO;IACtB,SAAS,CAAC,UAAU,EAAE,OAAO;IAC7B,SAAS,CAAC,UAAU,EAAE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,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAWlE;;;;;;;OAOG;IACG,gBAAgB,CAAC,KAAK,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAW/D;;;;;;;OAOG;IACG,eAAe,CAAC,KAAK,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAW9D;;;;;;;;;OASG;IACG,QAAQ,CACZ,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,OAAO,EAChB,SAAS,CAAC,EAAE,OAAO,GAClB,OAAO,CAAC,MAAM,CAAC;IAmBlB;;;;;;;;OAQG;IACH,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IA6B9C;;;;;;;;;OASG;IACH,SAAS,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,GAAE,OAAe,GAAG,MAAM;IAW5E;;;;;;;;;OASG;IACH,SAAS,CAAC,cAAc,CACtB,SAAS,EAAE,MAAM,EACjB,SAAS,GAAE,OAAe,GACzB,MAAM;CAQV"}
|
package/out/model-util.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { calcUniqueTag } from '@ibiz/rt-model-api';
|
|
2
2
|
import { isEmpty } from 'ramda';
|
|
3
|
-
import { formatPath, mergeModel, ServicePathUtil } from './utils';
|
|
3
|
+
import { formatPath, mergeModel, ModelTransformer, ServicePathUtil, } from './utils';
|
|
4
4
|
import { PSSysApp } from './model/PSSYSAPP';
|
|
5
5
|
/**
|
|
6
6
|
* 全动模型处理工具类,每个App一个实例
|
|
@@ -86,13 +86,6 @@ export class ModelUtil {
|
|
|
86
86
|
item.minorAppDataEntityId = calcUniqueTag(minor, false);
|
|
87
87
|
});
|
|
88
88
|
this.servicePathUtil = new ServicePathUtil(allDataEntities, allAppDERSs, this);
|
|
89
|
-
if (this.appModel.getAllPSAppLans &&
|
|
90
|
-
this.appModel.getAllPSAppLans.length > 0) {
|
|
91
|
-
ibiz.env.isEnableMultiLan = true;
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
ibiz.env.isEnableMultiLan = false;
|
|
95
|
-
}
|
|
96
89
|
}
|
|
97
90
|
/**
|
|
98
91
|
* 特殊处理应用模型
|
|
@@ -230,7 +223,14 @@ export class ModelUtil {
|
|
|
230
223
|
const langs = app.getAllPSAppLans;
|
|
231
224
|
const lang = langs.find(item => item.language === language);
|
|
232
225
|
if (lang) {
|
|
233
|
-
|
|
226
|
+
try {
|
|
227
|
+
const result = await this.getModel(lang.path || lang.dynaModelFilePath);
|
|
228
|
+
return result;
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
ibiz.log.error(error);
|
|
232
|
+
return {};
|
|
233
|
+
}
|
|
234
234
|
}
|
|
235
235
|
ibiz.log.error(ibiz.i18n.t('modelHelper.noSupported', { language }));
|
|
236
236
|
}
|
|
@@ -331,38 +331,46 @@ export class ModelUtil {
|
|
|
331
331
|
return this.modelCache.get(url);
|
|
332
332
|
}
|
|
333
333
|
const model = await this.get(url, params);
|
|
334
|
+
const filledModel = this.deepFillModel(model);
|
|
334
335
|
if (!isParams) {
|
|
335
|
-
this.modelCache.set(url,
|
|
336
|
+
this.modelCache.set(url, filledModel);
|
|
336
337
|
}
|
|
337
|
-
|
|
338
|
-
return model;
|
|
338
|
+
return filledModel;
|
|
339
339
|
}
|
|
340
340
|
/**
|
|
341
|
-
*
|
|
341
|
+
* 递归填充模型,包括填充模型appId、变换模型
|
|
342
342
|
*
|
|
343
343
|
* @author chitanda
|
|
344
344
|
* @date 2023-08-21 10:08:41
|
|
345
345
|
* @protected
|
|
346
346
|
* @param {IModel} model
|
|
347
|
+
* @return {*} {IModel} 返回处理后的模型,若处理器返回新对象则替换原引用
|
|
347
348
|
*/
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
349
|
+
deepFillModel(model) {
|
|
350
|
+
// 变换模型
|
|
351
|
+
let result = model;
|
|
352
|
+
if (model.dynaModelFilePath) {
|
|
353
|
+
result = ModelTransformer.getInstance().transform(model.dynaModelFilePath, model);
|
|
354
|
+
}
|
|
355
|
+
// 填充模型appId
|
|
356
|
+
result.appId = this.appId;
|
|
357
|
+
const keys = Object.keys(result);
|
|
351
358
|
keys.forEach(key => {
|
|
352
|
-
const value =
|
|
359
|
+
const value = result[key];
|
|
353
360
|
if (value && typeof value === 'object') {
|
|
354
361
|
if (Array.isArray(value)) {
|
|
355
|
-
value.forEach(item => {
|
|
362
|
+
value.forEach((item, index) => {
|
|
356
363
|
if (item && typeof item === 'object') {
|
|
357
|
-
this.
|
|
364
|
+
value[index] = this.deepFillModel(item);
|
|
358
365
|
}
|
|
359
366
|
});
|
|
360
367
|
}
|
|
361
368
|
else {
|
|
362
|
-
this.
|
|
369
|
+
result[key] = this.deepFillModel(value);
|
|
363
370
|
}
|
|
364
371
|
}
|
|
365
372
|
});
|
|
373
|
+
return result;
|
|
366
374
|
}
|
|
367
375
|
/**
|
|
368
376
|
* 计算应用模型请求路径
|
package/out/utils/index.d.ts
CHANGED
|
@@ -3,4 +3,7 @@ export { mergeModel } from './merge-model/merge-model';
|
|
|
3
3
|
export { plural, pluralLower } from './plural/plural';
|
|
4
4
|
export { ServicePathDeep, ServicePathItem, ServicePathUtil, } from './service-path-util/service-path-util';
|
|
5
5
|
export { MergeSubModelHelper } from './merge-model/merge-model-helper';
|
|
6
|
+
export { ModelHandler } from './model-transformer/model-handler';
|
|
7
|
+
export { ModelTransformer } from './model-transformer/model-transformer';
|
|
8
|
+
export { registerModelHandler } from './model-transformer/model-register';
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
package/out/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,GAChB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,GAChB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC"}
|
package/out/utils/index.js
CHANGED
|
@@ -3,3 +3,6 @@ export { mergeModel } from './merge-model/merge-model';
|
|
|
3
3
|
export { plural, pluralLower } from './plural/plural';
|
|
4
4
|
export { ServicePathUtil, } from './service-path-util/service-path-util';
|
|
5
5
|
export { MergeSubModelHelper } from './merge-model/merge-model-helper';
|
|
6
|
+
export { ModelHandler } from './model-transformer/model-handler';
|
|
7
|
+
export { ModelTransformer } from './model-transformer/model-transformer';
|
|
8
|
+
export { registerModelHandler } from './model-transformer/model-register';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IAppCodeList } from '@ibiz/model-core';
|
|
2
|
+
/**
|
|
3
|
+
* 合并应用代码表,子应用代码表需开启支持动态模式和配置用户标记,合并规则:dynamic_overlay:replace|merge,replace表示子应用代码表完全覆盖主应用代码表,merge表示子应用代码表项合并到主应用代码表项中(前提条件:主应用代码表和子应用代码表均是静态代码表),其他情况不做处理
|
|
4
|
+
* @param mainCodeList - 主应用代码表
|
|
5
|
+
* @param subCodeList - 子应用代码表
|
|
6
|
+
*/
|
|
7
|
+
export declare function mergeAppCodeList(mainCodeList: IAppCodeList, subCodeList: IAppCodeList): void;
|
|
8
|
+
//# sourceMappingURL=merge-app-codelist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-app-codelist.d.ts","sourceRoot":"","sources":["../../../src/utils/merge-model/merge-app-codelist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,YAAY,GACxB,IAAI,CA+BN"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 合并应用代码表,子应用代码表需开启支持动态模式和配置用户标记,合并规则:dynamic_overlay:replace|merge,replace表示子应用代码表完全覆盖主应用代码表,merge表示子应用代码表项合并到主应用代码表项中(前提条件:主应用代码表和子应用代码表均是静态代码表),其他情况不做处理
|
|
3
|
+
* @param mainCodeList - 主应用代码表
|
|
4
|
+
* @param subCodeList - 子应用代码表
|
|
5
|
+
*/
|
|
6
|
+
export function mergeAppCodeList(mainCodeList, subCodeList) {
|
|
7
|
+
const { userTag } = subCodeList;
|
|
8
|
+
if (!userTag)
|
|
9
|
+
return;
|
|
10
|
+
const [mergeTag, mergeWay] = userTag.split(':');
|
|
11
|
+
if (!mergeTag ||
|
|
12
|
+
!mergeWay ||
|
|
13
|
+
mergeTag !== 'dynamic_overlay' ||
|
|
14
|
+
(mergeWay !== 'replace' && mergeWay !== 'merge'))
|
|
15
|
+
return;
|
|
16
|
+
switch (mergeWay) {
|
|
17
|
+
case 'replace':
|
|
18
|
+
mainCodeList = subCodeList;
|
|
19
|
+
break;
|
|
20
|
+
case 'merge':
|
|
21
|
+
if (mainCodeList.codeListType === 'STATIC' &&
|
|
22
|
+
subCodeList.codeListType === 'STATIC') {
|
|
23
|
+
if (!mainCodeList.codeItems)
|
|
24
|
+
mainCodeList.codeItems = [];
|
|
25
|
+
if (subCodeList.codeItems && subCodeList.codeItems.length > 0) {
|
|
26
|
+
subCodeList.codeItems.forEach(codeItem => {
|
|
27
|
+
mainCodeList.codeItems.push(codeItem);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-app-menu.d.ts","sourceRoot":"","sources":["../../../src/utils/merge-model/merge-app-menu.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"merge-app-menu.d.ts","sourceRoot":"","sources":["../../../src/utils/merge-model/merge-app-menu.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAkD/D;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,aAAa,EACnB,GAAG,EAAE,aAAa,EAClB,SAAS,GAAE,OAAe,GACzB,IAAI,CAmBN;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CA2C1E"}
|
|
@@ -16,9 +16,14 @@ function mergeMenuItem(mainItem, subItem, isReverse = false) {
|
|
|
16
16
|
}
|
|
17
17
|
else {
|
|
18
18
|
// 子菜单项也没有下级菜单的时候覆盖(不应合并,场景:主菜单项隐藏,有hidden:true的数据,子菜单项显示,无hidden字段,合并还是会隐藏)
|
|
19
|
-
Object.keys(mainItem).forEach(
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
Object.keys(mainItem).forEach((key) => {
|
|
20
|
+
// 1.合并动态字段场景:如,accessKey,子应用有的话以子应用为准,子应用没有的话,主应用数据为准
|
|
21
|
+
if (key === 'accessKey' && !subItem[key]) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
// 2. 常规场景:以子应用为准即可
|
|
25
|
+
delete mainItem[key];
|
|
26
|
+
});
|
|
22
27
|
Object.assign(mainItem, subItem);
|
|
23
28
|
}
|
|
24
29
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { IUIActionGroup } from '@ibiz/model-core';
|
|
2
|
+
/**
|
|
3
|
+
* 合并两个界面行为组
|
|
4
|
+
*
|
|
5
|
+
* @param dst 目标界面行为组,用于接收合并结果
|
|
6
|
+
* @param src 源界面行为组,提供要合并的数据
|
|
7
|
+
* @returns 无返回值,直接修改目标对象
|
|
8
|
+
*/
|
|
2
9
|
export declare function mergeAppDEUIActionGroup(dst: IUIActionGroup | undefined, src: IUIActionGroup | undefined): void;
|
|
3
10
|
//# sourceMappingURL=merge-app-uiaction-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-app-uiaction-group.d.ts","sourceRoot":"","sources":["../../../src/utils/merge-model/merge-app-uiaction-group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAwB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"merge-app-uiaction-group.d.ts","sourceRoot":"","sources":["../../../src/utils/merge-model/merge-app-uiaction-group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAwB,MAAM,kBAAkB,CAAC;AAwBxE;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,cAAc,GAAG,SAAS,EAC/B,GAAG,EAAE,cAAc,GAAG,SAAS,GAC9B,IAAI,CAiDN"}
|
|
@@ -1,14 +1,66 @@
|
|
|
1
|
+
// dynamic_overlay:before|after|replace|delete:detailid
|
|
2
|
+
/**
|
|
3
|
+
* 解析动态覆盖标签字符串,提取位置信息和目标ID
|
|
4
|
+
*
|
|
5
|
+
* @param tag - 要解析的标签字符串,格式应为 "dynamic_overlay:position:targetId"
|
|
6
|
+
* @returns 如果解析成功,返回包含position和targetId的对象;否则返回null
|
|
7
|
+
*/
|
|
8
|
+
function parseDynamicOverlay(tag) {
|
|
9
|
+
if (!tag) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const match = tag.match(/^dynamic_overlay:(before|after|replace|delete):(.+)$/);
|
|
13
|
+
if (match) {
|
|
14
|
+
return { position: match[1], targetId: match[2] };
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 合并两个界面行为组
|
|
20
|
+
*
|
|
21
|
+
* @param dst 目标界面行为组,用于接收合并结果
|
|
22
|
+
* @param src 源界面行为组,提供要合并的数据
|
|
23
|
+
* @returns 无返回值,直接修改目标对象
|
|
24
|
+
*/
|
|
1
25
|
export function mergeAppDEUIActionGroup(dst, src) {
|
|
2
26
|
if (!dst || !src) {
|
|
3
27
|
return;
|
|
4
28
|
}
|
|
5
|
-
//
|
|
29
|
+
// 合并界面行为组项,根据界面行为组成员用户标记(格式如:dynamic_overlay:before|after|replace|delete:detailid)进行合并,如格式不满足则添加到末尾,如没有用户标记,则直接添加到末尾
|
|
6
30
|
if (src.uiactionGroupDetails) {
|
|
7
31
|
if (!dst.uiactionGroupDetails) {
|
|
8
32
|
dst.uiactionGroupDetails = [];
|
|
9
33
|
}
|
|
10
34
|
src.uiactionGroupDetails.forEach((item) => {
|
|
11
|
-
|
|
35
|
+
const overlayInfo = parseDynamicOverlay(item.userTag);
|
|
36
|
+
if (overlayInfo && overlayInfo.position && overlayInfo.targetId) {
|
|
37
|
+
const targetIndex = dst.uiactionGroupDetails.findIndex((x) => x.id === overlayInfo.targetId);
|
|
38
|
+
if (targetIndex !== -1) {
|
|
39
|
+
switch (overlayInfo.position) {
|
|
40
|
+
case 'before':
|
|
41
|
+
dst.uiactionGroupDetails.splice(targetIndex, 0, item);
|
|
42
|
+
break;
|
|
43
|
+
case 'after':
|
|
44
|
+
dst.uiactionGroupDetails.splice(targetIndex + 1, 0, item);
|
|
45
|
+
break;
|
|
46
|
+
case 'replace':
|
|
47
|
+
dst.uiactionGroupDetails[targetIndex] = item;
|
|
48
|
+
break;
|
|
49
|
+
case 'delete':
|
|
50
|
+
dst.uiactionGroupDetails.splice(targetIndex, 1);
|
|
51
|
+
break;
|
|
52
|
+
default:
|
|
53
|
+
dst.uiactionGroupDetails.push(item);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
dst.uiactionGroupDetails.push(item);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
dst.uiactionGroupDetails.push(item);
|
|
63
|
+
}
|
|
12
64
|
});
|
|
13
65
|
}
|
|
14
66
|
}
|