@ibiz-template/core 0.7.40 → 0.7.41-alpha.101
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 +81 -15
- package/dist/index.system.min.js +1 -1
- package/out/context/index.d.ts.map +1 -1
- package/out/environment/environment.d.ts.map +1 -1
- package/out/environment/environment.js +8 -1
- package/out/error/http-error/http-error.d.ts +2 -2
- package/out/error/http-error/http-error.d.ts.map +1 -1
- package/out/interface/api/chat-message/i-api-chat-message.d.ts +63 -0
- package/out/interface/api/chat-message/i-api-chat-message.d.ts.map +1 -0
- package/out/interface/api/chat-message/i-api-chat-message.js +1 -0
- package/out/interface/api/chat-message/index.d.ts +2 -0
- package/out/interface/api/chat-message/index.d.ts.map +1 -0
- package/out/interface/api/chat-message/index.js +1 -0
- package/out/interface/api/environment/i-devtool-config.d.ts +11 -1
- package/out/interface/api/environment/i-devtool-config.d.ts.map +1 -1
- package/out/interface/api/environment/i-environment.d.ts +138 -1
- package/out/interface/api/environment/i-environment.d.ts.map +1 -1
- package/out/interface/api/ibizsys/i-app-data.d.ts +57 -0
- package/out/interface/api/ibizsys/i-app-data.d.ts.map +1 -0
- package/out/interface/api/ibizsys/i-app-data.js +1 -0
- package/out/interface/api/ibizsys/i-org-data.d.ts +1 -1
- package/out/interface/api/ibizsys/index.d.ts +1 -0
- package/out/interface/api/ibizsys/index.d.ts.map +1 -1
- package/out/interface/api/index.d.ts +1 -0
- package/out/interface/api/index.d.ts.map +1 -1
- package/out/interface/api/index.js +1 -0
- package/out/interface/api/utils/i-api-i18n.d.ts +9 -9
- package/out/interface/api/utils/index.d.ts +1 -0
- package/out/interface/api/utils/index.d.ts.map +1 -1
- package/out/interface/api/utils/message-center/base/i-message-base.d.ts +3 -3
- package/out/interface/api/utils/message-center/command/add-in-changed/i-command-add-in-changed.d.ts +1 -1
- package/out/interface/api/utils/message-center/command/async-action/i-command-async-action.d.ts +1 -1
- package/out/interface/api/utils/message-center/command/i-message-command.d.ts +1 -1
- package/out/interface/api/utils/message-center/command/internal-message/i-command-internal-message.d.ts +1 -1
- package/out/interface/api/utils/message-center/command/mark-open-data/i-command-mark-open-data.d.ts +1 -1
- package/out/interface/api/utils/message-center/common/i-message-center-event.d.ts +5 -0
- package/out/interface/api/utils/message-center/common/i-message-center-event.d.ts.map +1 -1
- package/out/interface/api/utils/message-center/common/i-portal-message.d.ts +3 -3
- package/out/interface/api/utils/message-center/console/i-message-console.d.ts +1 -1
- package/out/interface/api/utils/message-center/error/i-message-error.d.ts +1 -1
- package/out/interface/api/utils/message-center/i-message-center.d.ts +2 -2
- package/out/interface/api/utils/net/i-api-http-error.d.ts +39 -0
- package/out/interface/api/utils/net/i-api-http-error.d.ts.map +1 -0
- package/out/interface/api/utils/net/i-api-http-error.js +1 -0
- package/out/interface/api/utils/net/i-api-net.d.ts +1 -1
- package/out/interface/i-chat-message/i-chat-message.d.ts +2 -49
- package/out/interface/i-chat-message/i-chat-message.d.ts.map +1 -1
- package/out/utils/download-file/download-file.d.ts.map +1 -1
- package/out/utils/download-file/download-file.js +11 -1
- package/out/utils/interceptor/core-interceptor.js +2 -1
- package/out/utils/net/http-response.d.ts +2 -1
- package/out/utils/net/http-response.d.ts.map +1 -1
- package/out/utils/net/http-response.js +5 -1
- package/out/utils/net/net.d.ts +1 -1
- package/out/utils/net/net.d.ts.map +1 -1
- package/out/utils/net/net.js +8 -0
- package/out/utils/recursive/find-recursive-child.d.ts +20 -0
- package/out/utils/recursive/find-recursive-child.d.ts.map +1 -1
- package/out/utils/recursive/find-recursive-child.js +69 -7
- package/out/utils/string-util/string-util.d.ts.map +1 -1
- package/out/utils/string-util/string-util.js +2 -4
- package/package.json +4 -4
|
@@ -4,8 +4,10 @@ import { mergeDeepRight } from 'ramda';
|
|
|
4
4
|
const IterateOpts = {
|
|
5
5
|
/** 子集合属性数组 */
|
|
6
6
|
childrenFields: ['children'],
|
|
7
|
+
/** 是否跳出当前操作 */
|
|
8
|
+
isBreak: false,
|
|
7
9
|
};
|
|
8
|
-
const
|
|
10
|
+
const ReturnError = new Error('中断操作');
|
|
9
11
|
/**
|
|
10
12
|
* @description 获取子属性集合
|
|
11
13
|
* @param {IData} parent
|
|
@@ -20,16 +22,33 @@ function getChildField(parent, fields) {
|
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @description 获取子属性对象
|
|
27
|
+
* @param {IData} parent
|
|
28
|
+
* @param {string[]} fields
|
|
29
|
+
* @returns {*} {(IData[] | undefined)}
|
|
30
|
+
*/
|
|
31
|
+
function getChildFieldObj(parent, fields) {
|
|
32
|
+
for (const field of fields) {
|
|
33
|
+
if (parent[field]) {
|
|
34
|
+
return parent[field];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
23
38
|
function _recursiveIterate(parent, callback, opts) {
|
|
24
39
|
const { childrenFields } = mergeDeepRight(IterateOpts, opts || {});
|
|
25
40
|
const children = getChildField(parent, childrenFields);
|
|
26
41
|
if (children === null || children === void 0 ? void 0 : children.length) {
|
|
27
|
-
for (
|
|
42
|
+
for (let i = 0; i < children.length; i++) {
|
|
43
|
+
const child = children[i];
|
|
28
44
|
// 递归自身的子成员
|
|
29
|
-
const
|
|
30
|
-
//
|
|
31
|
-
if (
|
|
32
|
-
|
|
45
|
+
const result = callback(child, parent);
|
|
46
|
+
// 回调返回true若未启用跳出当次操作则退出,启用跳出当次操作则跳出本次循环
|
|
47
|
+
if (result) {
|
|
48
|
+
if (opts === null || opts === void 0 ? void 0 : opts.isBreak) {
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
throw ReturnError;
|
|
33
52
|
}
|
|
34
53
|
// 递归孙的成员
|
|
35
54
|
recursiveIterate(child, callback, opts);
|
|
@@ -69,7 +88,50 @@ export function recursiveIterate(parent, callback, opts) {
|
|
|
69
88
|
_recursiveIterate(parent, callback, opts);
|
|
70
89
|
}
|
|
71
90
|
catch (error) {
|
|
72
|
-
if (error !==
|
|
91
|
+
if (error !== ReturnError) {
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* @description 递归执行,处理对象结构
|
|
98
|
+
* @export
|
|
99
|
+
* @param {IData} parent
|
|
100
|
+
* @param {((item: any, _parent?: any) => boolean | void)} callback
|
|
101
|
+
* @param {Partial<typeof IterateOpts>} [opts]
|
|
102
|
+
*/
|
|
103
|
+
export function _recursiveExecute(parent, callback, opts) {
|
|
104
|
+
const { childrenFields } = mergeDeepRight(IterateOpts, opts || {});
|
|
105
|
+
const children = getChildFieldObj(parent, childrenFields);
|
|
106
|
+
if (children) {
|
|
107
|
+
for (let i = 0; i < Object.values(children).length; i++) {
|
|
108
|
+
const child = Object.values(children)[i];
|
|
109
|
+
const result = callback(child, parent);
|
|
110
|
+
// 回调返回true若未启用跳出当次操作则退出,启用跳出当次操作则跳出本次循环
|
|
111
|
+
if (result) {
|
|
112
|
+
if (opts === null || opts === void 0 ? void 0 : opts.isBreak) {
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
throw ReturnError;
|
|
116
|
+
}
|
|
117
|
+
// 递归孙的成员
|
|
118
|
+
_recursiveExecute(child, callback, opts);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @description 递归执行,处理对象结构
|
|
124
|
+
* @export
|
|
125
|
+
* @param {IData} parent
|
|
126
|
+
* @param {((item: any, _parent: any) => boolean | void)} callback
|
|
127
|
+
* @param {Partial<typeof IterateOpts>} [opts]
|
|
128
|
+
*/
|
|
129
|
+
export function recursiveExecute(parent, callback, opts) {
|
|
130
|
+
try {
|
|
131
|
+
_recursiveExecute(parent, callback, opts);
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
if (error !== ReturnError) {
|
|
73
135
|
throw error;
|
|
74
136
|
}
|
|
75
137
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-util.d.ts","sourceRoot":"","sources":["../../../src/utils/string-util/string-util.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,qBAAa,UAAU;IACrB;;;;OAIG;IACH,MAAM,CAAC,UAAU,SAAgD;IAEjE;;;;OAIG;IACH,MAAM,CAAC,OAAO,SAA6C;IAE3D;;;;OAIG;IACH,MAAM,CAAC,SAAS,SAA+C;IAE/D;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,CACT,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,QAAQ,EAClB,MAAM,CAAC,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,KAAK,GACX,MAAM;
|
|
1
|
+
{"version":3,"file":"string-util.d.ts","sourceRoot":"","sources":["../../../src/utils/string-util/string-util.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,qBAAa,UAAU;IACrB;;;;OAIG;IACH,MAAM,CAAC,UAAU,SAAgD;IAEjE;;;;OAIG;IACH,MAAM,CAAC,OAAO,SAA6C;IAE3D;;;;OAIG;IACH,MAAM,CAAC,SAAS,SAA+C;IAE/D;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,CACT,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,QAAQ,EAClB,MAAM,CAAC,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,KAAK,GACX,MAAM;CA0BV"}
|
|
@@ -32,10 +32,8 @@ export class StringUtil {
|
|
|
32
32
|
if (notNilEmpty(params)) {
|
|
33
33
|
const strArr = str.match(this.paramsReg);
|
|
34
34
|
strArr === null || strArr === void 0 ? void 0 : strArr.forEach(_key => {
|
|
35
|
-
const key = _key.slice(
|
|
36
|
-
|
|
37
|
-
str = str.replace(`\${params.${key}}`, params[key]);
|
|
38
|
-
}
|
|
35
|
+
const key = _key.slice(9, _key.length - 1);
|
|
36
|
+
str = str.replace(`\${params.${key}}`, params[key] || '');
|
|
39
37
|
});
|
|
40
38
|
}
|
|
41
39
|
if (notNilEmpty(data)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/core",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.41-alpha.101",
|
|
4
4
|
"description": "运行时核心库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@microsoft/fetch-event-source": "^2.0.1",
|
|
35
|
-
"axios": "^1.
|
|
35
|
+
"axios": "^1.8.2",
|
|
36
36
|
"lodash-es": "^4.17.21",
|
|
37
37
|
"loglevel": "^1.8.1",
|
|
38
38
|
"loglevel-plugin-prefix": "^0.8.4",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@types/qs": "^6.9.11"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"axios": "^1.
|
|
47
|
+
"axios": "^1.8.2",
|
|
48
48
|
"lodash-es": "^4.17.21",
|
|
49
49
|
"qs": "^6.11.0",
|
|
50
50
|
"qx-util": "^0.4.8",
|
|
51
51
|
"ramda": "^0.29.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "f9d085280db4778ad952333525a03889fc37e2ab"
|
|
54
54
|
}
|