@ibiz-template/model-helper 0.7.15 → 0.7.16
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.
|
@@ -92,6 +92,15 @@ export declare class ServicePathUtil {
|
|
|
92
92
|
* @type {Map<string, ServicePathItem[][]>}
|
|
93
93
|
*/
|
|
94
94
|
protected entityRsPathMap: Map<string, ServicePathItem[][]>;
|
|
95
|
+
/**
|
|
96
|
+
* 实体资源加载状态关系
|
|
97
|
+
*
|
|
98
|
+
* @author tony001
|
|
99
|
+
* @date 2024-05-20 16:05:41
|
|
100
|
+
* @protected
|
|
101
|
+
* @type {Map<string, boolean>}
|
|
102
|
+
*/
|
|
103
|
+
protected entityRsLoadMap: Map<string, boolean>;
|
|
95
104
|
constructor(appDataEntities: IModel[], allDERss: IAppDERS[], modelUtil: ModelUtil);
|
|
96
105
|
/**
|
|
97
106
|
* 根据应用主实体过滤从关系集合
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-path-util.d.ts","sourceRoot":"","sources":["../../../src/utils/service-path-util/service-path-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAgB,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"service-path-util.d.ts","sourceRoot":"","sources":["../../../src/utils/service-path-util/service-path-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAgB,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,eAAe;IAgCxB,SAAS,CAAC,eAAe,EAAE,MAAM,EAAE;IACnC,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE;IAC9B,SAAS,CAAC,SAAS,EAAE,SAAS;IAjChC;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAa;IAE3D;;;;;;;OAOG;IACH,SAAS,CAAC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,EAAE,EAAE,CAAC,CAAa;IAExE;;;;;;;OAOG;IACH,SAAS,CAAC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAa;gBAGhD,eAAe,EAAE,MAAM,EAAE,EACzB,QAAQ,EAAE,QAAQ,EAAE,EACpB,SAAS,EAAE,SAAS;IAGhC;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,EAAE;IAgB7C;;;;;;;OAOG;IACG,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAOrD;;;;;;;;OAQG;cACa,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;IAkCnE;;;;;;;;;;OAUG;IACH,SAAS,CAAC,YAAY,CACpB,GAAG,EAAE,MAAM,EAAE,EACb,KAAK,EAAE,QAAQ,EAAE,EACjB,GAAG,GAAE,MAAU,GACd,eAAe,EAAE;IAyBpB;;;;;;;;;OASG;cACa,YAAY,CAC1B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EAAE,EACnB,KAAK,EAAE,eAAe,EAAE,GACvB,OAAO,CAAC,IAAI,CAAC;IAsDhB;;;;;;;;OAQG;IACH,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,GAAG,eAAe,EAAE,EAAE;IAMnE;;;;;;;;OAQG;cACa,kBAAkB,CAChC,SAAS,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,cAAc,EAAE,CAAC;CA2B7B"}
|
|
@@ -30,6 +30,15 @@ export class ServicePathUtil {
|
|
|
30
30
|
* @type {Map<string, ServicePathItem[][]>}
|
|
31
31
|
*/
|
|
32
32
|
this.entityRsPathMap = new Map();
|
|
33
|
+
/**
|
|
34
|
+
* 实体资源加载状态关系
|
|
35
|
+
*
|
|
36
|
+
* @author tony001
|
|
37
|
+
* @date 2024-05-20 16:05:41
|
|
38
|
+
* @protected
|
|
39
|
+
* @type {Map<string, boolean>}
|
|
40
|
+
*/
|
|
41
|
+
this.entityRsLoadMap = new Map();
|
|
33
42
|
}
|
|
34
43
|
/**
|
|
35
44
|
* 根据应用主实体过滤从关系集合
|
|
@@ -84,7 +93,12 @@ export class ServicePathUtil {
|
|
|
84
93
|
throw new Error(`未找到实体 ${id}`);
|
|
85
94
|
}
|
|
86
95
|
const { codeName } = entityRef;
|
|
87
|
-
if (this.
|
|
96
|
+
if (!this.entityRsLoadMap.has(codeName)) {
|
|
97
|
+
this.entityRsLoadMap.set(codeName, false);
|
|
98
|
+
}
|
|
99
|
+
// 需要处理完成才能获取
|
|
100
|
+
if (this.entityRsPathMap.has(codeName) &&
|
|
101
|
+
this.entityRsLoadMap.get(codeName)) {
|
|
88
102
|
return this.entityRsPathMap.get(codeName);
|
|
89
103
|
}
|
|
90
104
|
const deRss = this.filterDERSs(id);
|
|
@@ -97,9 +111,11 @@ export class ServicePathUtil {
|
|
|
97
111
|
if (paths) {
|
|
98
112
|
paths = this.sortPath(paths);
|
|
99
113
|
this.entityRsPathMap.set(codeName, paths);
|
|
114
|
+
this.entityRsLoadMap.set(codeName, true);
|
|
100
115
|
return paths;
|
|
101
116
|
}
|
|
102
117
|
}
|
|
118
|
+
this.entityRsLoadMap.set(codeName, true);
|
|
103
119
|
return [];
|
|
104
120
|
}
|
|
105
121
|
/**
|
|
@@ -157,7 +173,7 @@ export class ServicePathUtil {
|
|
|
157
173
|
const rsServiceApiItems = await this.getServiceApiItems([
|
|
158
174
|
rs.majorDECodeName,
|
|
159
175
|
]);
|
|
160
|
-
|
|
176
|
+
const tempArr = [
|
|
161
177
|
...pathNames.map((pathName, index) => {
|
|
162
178
|
return {
|
|
163
179
|
codeName: pathName,
|
|
@@ -170,7 +186,22 @@ export class ServicePathUtil {
|
|
|
170
186
|
lower: rs.majorDECodeName.toLowerCase(),
|
|
171
187
|
plural: rsServiceApiItems[0].deApiCodeName2,
|
|
172
188
|
},
|
|
173
|
-
].reverse()
|
|
189
|
+
].reverse();
|
|
190
|
+
const targetIndex = arr.findIndex(ele => {
|
|
191
|
+
return (ele
|
|
192
|
+
.map(val => {
|
|
193
|
+
return val.codeName;
|
|
194
|
+
})
|
|
195
|
+
.join('/') ===
|
|
196
|
+
tempArr
|
|
197
|
+
.map(temp => {
|
|
198
|
+
return temp.codeName;
|
|
199
|
+
})
|
|
200
|
+
.join('/'));
|
|
201
|
+
});
|
|
202
|
+
if (targetIndex === -1) {
|
|
203
|
+
arr.push(tempArr);
|
|
204
|
+
}
|
|
174
205
|
}
|
|
175
206
|
}
|
|
176
207
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/model-helper",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.16",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"types": "out/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"ramda": "^0.29.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@ibiz-template/runtime": "^0.7.
|
|
41
|
+
"@ibiz-template/runtime": "^0.7.16",
|
|
42
42
|
"@types/pluralize": "^0.0.33",
|
|
43
43
|
"@types/ramda": "^0.29.10"
|
|
44
44
|
},
|