@ibiz-template/core 0.6.0 → 0.6.1-alpha.2
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 +27 -21
- package/dist/index.system.min.js +1 -1
- package/out/interface/i-devtool-config/i-devtool-config.d.ts +7 -0
- package/out/interface/i-devtool-config/i-devtool-config.d.ts.map +1 -1
- package/out/utils/bit-mask/bit-mask.d.ts +27 -0
- package/out/utils/bit-mask/bit-mask.d.ts.map +1 -1
- package/out/utils/bit-mask/bit-mask.js +27 -0
- package/out/utils/color/color.d.ts.map +1 -1
- package/out/utils/color/color.js +8 -4
- package/out/utils/download-file/download-file.js +17 -17
- package/out/utils/string-util/string-util.d.ts +6 -0
- package/out/utils/string-util/string-util.d.ts.map +1 -1
- package/out/utils/string-util/string-util.js +6 -0
- package/out/utils/sync/await-timeout.d.ts +6 -0
- package/out/utils/sync/await-timeout.d.ts.map +1 -1
- package/out/utils/sync/await-timeout.js +6 -0
- package/out/utils/types/types.d.ts +3 -1
- package/out/utils/types/types.d.ts.map +1 -1
- package/out/utils/util/util.d.ts +137 -0
- package/out/utils/util/util.d.ts.map +1 -1
- package/out/utils/util/util.js +137 -0
- package/package.json +4 -5
- package/src/command/command-register.ts +0 -135
- package/src/command/command.ts +0 -79
- package/src/command/index.ts +0 -11
- package/src/command/interface/command/command-option.ts +0 -22
- package/src/command/interface/command/command.ts +0 -86
- package/src/command/interface/disposable/disposable.ts +0 -3
- package/src/command/interface/index.ts +0 -9
- package/src/command/utils/index.ts +0 -2
- package/src/command/utils/linked-list.ts +0 -136
- package/src/command/utils/util.ts +0 -95
- package/src/constant/core/core.ts +0 -63
- package/src/constant/http-status-message/http-status-message.ts +0 -20
- package/src/constant/index.ts +0 -5
- package/src/constant/login-mode/login-mode.ts +0 -23
- package/src/constant/menu-permission-mode/menu-permission-mode.ts +0 -23
- package/src/constant/util/util.ts +0 -5
- package/src/context/index.ts +0 -231
- package/src/environment/environment.ts +0 -39
- package/src/error/http-error/http-error.ts +0 -45
- package/src/error/index.ts +0 -5
- package/src/error/model-error/model-error.ts +0 -26
- package/src/error/notice-error/notice-error.ts +0 -19
- package/src/error/runtime-error/runtime-error.ts +0 -16
- package/src/error/runtime-model-error/runtime-model-error.ts +0 -27
- package/src/ibizsys.ts +0 -78
- package/src/index.ts +0 -14
- package/src/install.ts +0 -15
- package/src/interface/click-outside/click-outside.ts +0 -71
- package/src/interface/i-18n/i-18n.ts +0 -68
- package/src/interface/i-chat-message/i-chat-message.ts +0 -83
- package/src/interface/i-devtool-config/i-devtool-config.ts +0 -16
- package/src/interface/i-environment/i-environment.ts +0 -289
- package/src/interface/i-internal-message/i-internal-message.ts +0 -151
- package/src/interface/i-mark-open-data/i-mark-open-data.ts +0 -39
- package/src/interface/i-portal-async-action/i-portal-async-action.ts +0 -177
- package/src/interface/i-portal-message/i-portal-message.ts +0 -84
- package/src/interface/index.ts +0 -14
- package/src/interface/org-data/org-data.ts +0 -42
- package/src/params/params.ts +0 -134
- package/src/types.ts +0 -110
- package/src/utils/bit-mask/bit-mask.ts +0 -85
- package/src/utils/click-outside/click-outside.ts +0 -110
- package/src/utils/clone/clone.ts +0 -43
- package/src/utils/color/color.ts +0 -84
- package/src/utils/data-type/data-types.ts +0 -99
- package/src/utils/download-file/download-file.ts +0 -109
- package/src/utils/event/event.ts +0 -77
- package/src/utils/history-list/history-item.ts +0 -45
- package/src/utils/history-list/history-list.ts +0 -151
- package/src/utils/index.ts +0 -24
- package/src/utils/interceptor/core-interceptor.ts +0 -40
- package/src/utils/interceptor/index.ts +0 -2
- package/src/utils/interceptor/interceptor.ts +0 -126
- package/src/utils/logger/logger.ts +0 -10
- package/src/utils/message-center/base/message-all.ts +0 -12
- package/src/utils/message-center/base/message-base.ts +0 -86
- package/src/utils/message-center/command/async-action/command-async-action.ts +0 -24
- package/src/utils/message-center/command/change/command-change.ts +0 -12
- package/src/utils/message-center/command/command-base/command-base.ts +0 -30
- package/src/utils/message-center/command/create/command-create.ts +0 -24
- package/src/utils/message-center/command/internal-message/command-internal-message.ts +0 -24
- package/src/utils/message-center/command/mark-open-data/command-mark-open-data.ts +0 -24
- package/src/utils/message-center/command/message-command.ts +0 -158
- package/src/utils/message-center/command/remove/command-remove.ts +0 -24
- package/src/utils/message-center/command/update/command-update.ts +0 -24
- package/src/utils/message-center/console/message-console.ts +0 -31
- package/src/utils/message-center/index.ts +0 -1
- package/src/utils/message-center/interface/i-app-data-entity.ts +0 -19
- package/src/utils/message-center/interface/index.ts +0 -1
- package/src/utils/message-center/message-center.ts +0 -82
- package/src/utils/namespace/namespace.ts +0 -247
- package/src/utils/net/http-response.ts +0 -106
- package/src/utils/net/net.ts +0 -469
- package/src/utils/recursive/find-recursive-child.ts +0 -133
- package/src/utils/string-util/string-util.ts +0 -60
- package/src/utils/style/remote-style.ts +0 -20
- package/src/utils/sync/await-timeout.ts +0 -27
- package/src/utils/sync/count-latch.ts +0 -95
- package/src/utils/sync/index.ts +0 -2
- package/src/utils/types/types.ts +0 -22
- package/src/utils/upload/select-file.ts +0 -86
- package/src/utils/upload/upload-file.ts +0 -208
- package/src/utils/url-helper/url-helper.ts +0 -63
- package/src/utils/util/util.ts +0 -376
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 异步作业信息
|
|
3
|
-
*
|
|
4
|
-
* @author chitanda
|
|
5
|
-
* @date 2023-09-05 15:09:59
|
|
6
|
-
* @export
|
|
7
|
-
* @interface IPortalAsyncAction
|
|
8
|
-
*/
|
|
9
|
-
export interface IPortalAsyncAction {
|
|
10
|
-
/**
|
|
11
|
-
* 异步操作标识
|
|
12
|
-
* @author lxm
|
|
13
|
-
* @date 2023-11-14 02:26:59
|
|
14
|
-
* @type {string}
|
|
15
|
-
*/
|
|
16
|
-
asyncacitonid: string;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* 异步操作名称
|
|
20
|
-
* @author lxm
|
|
21
|
-
* @date 2023-11-14 02:27:18
|
|
22
|
-
* @type {string}
|
|
23
|
-
*/
|
|
24
|
-
asyncacitonname: string;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* 会话标识
|
|
28
|
-
*
|
|
29
|
-
* @author chitanda
|
|
30
|
-
* @date 2023-09-05 15:09:57
|
|
31
|
-
* @type {string}
|
|
32
|
-
*/
|
|
33
|
-
fulltopictag: string;
|
|
34
|
-
|
|
35
|
-
srfdcid: string;
|
|
36
|
-
/**
|
|
37
|
-
* 中心系统标识
|
|
38
|
-
* @author lxm
|
|
39
|
-
* @date 2023-11-14 02:26:15
|
|
40
|
-
* @type {string}
|
|
41
|
-
*/
|
|
42
|
-
dcsystemid: string;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* 异步作业类型
|
|
46
|
-
* - DEIMPORTDATA2: 异步导入
|
|
47
|
-
*
|
|
48
|
-
* @author chitanda
|
|
49
|
-
* @date 2023-09-05 15:09:09
|
|
50
|
-
* @type {string}
|
|
51
|
-
*/
|
|
52
|
-
actiontype: string;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* 作业状态
|
|
56
|
-
*
|
|
57
|
-
* @author chitanda
|
|
58
|
-
* @date 2023-10-10 15:10:59
|
|
59
|
-
* @type {(10 | 20 | 30 | 40)} 未开始 | 执行中 | 已执行 | 执行失败
|
|
60
|
-
*/
|
|
61
|
-
actionstate: 10 | 20 | 30 | 40;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 异步作业执行结果
|
|
65
|
-
*
|
|
66
|
-
* @author chitanda
|
|
67
|
-
* @date 2023-09-05 15:09:33
|
|
68
|
-
* @type {unknown}
|
|
69
|
-
*/
|
|
70
|
-
actionresult?: unknown;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* 步骤信息
|
|
74
|
-
*
|
|
75
|
-
* @author chitanda
|
|
76
|
-
* @date 2023-09-05 15:09:55
|
|
77
|
-
* @type {string}
|
|
78
|
-
*/
|
|
79
|
-
stepinfo?: string;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* 完成百分比
|
|
83
|
-
* @author lxm
|
|
84
|
-
* @date 2023-11-14 05:38:15
|
|
85
|
-
* @type {number}
|
|
86
|
-
*/
|
|
87
|
-
completionrate?: number;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* 异步结果下载路径,目前是留给导出数据使用
|
|
91
|
-
*
|
|
92
|
-
* @author chitanda
|
|
93
|
-
* @date 2023-09-05 15:09:03
|
|
94
|
-
* @type {string}
|
|
95
|
-
*/
|
|
96
|
-
asyncresultdownloadurl?: string;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* 预留参数
|
|
100
|
-
*
|
|
101
|
-
* @author chitanda
|
|
102
|
-
* @date 2023-09-05 15:09:32
|
|
103
|
-
* @type {unknown}
|
|
104
|
-
*/
|
|
105
|
-
actionparam?: unknown;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
*预留参数2
|
|
109
|
-
*
|
|
110
|
-
* @author chitanda
|
|
111
|
-
* @date 2023-09-05 15:09:41
|
|
112
|
-
* @type {unknown}
|
|
113
|
-
*/
|
|
114
|
-
actionparam2?: unknown;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
*预留参数3
|
|
118
|
-
*
|
|
119
|
-
* @author chitanda
|
|
120
|
-
* @date 2023-09-05 15:09:43
|
|
121
|
-
* @type {unknown}
|
|
122
|
-
*/
|
|
123
|
-
actionparam3?: unknown;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
*预留参数4
|
|
127
|
-
*
|
|
128
|
-
* @author chitanda
|
|
129
|
-
* @date 2023-09-05 15:09:45
|
|
130
|
-
* @type {unknown}
|
|
131
|
-
*/
|
|
132
|
-
actionparam4?: unknown;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* 操作开始时间
|
|
136
|
-
* @author lxm
|
|
137
|
-
* @date 2023-11-14 02:24:41
|
|
138
|
-
* @type {string}
|
|
139
|
-
*/
|
|
140
|
-
begintime: string;
|
|
141
|
-
/**
|
|
142
|
-
* 操作结束时间
|
|
143
|
-
* @author lxm
|
|
144
|
-
* @date 2023-11-14 02:24:43
|
|
145
|
-
* @type {string}
|
|
146
|
-
*/
|
|
147
|
-
endtime: string;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* 创建人标识
|
|
151
|
-
* @author lxm
|
|
152
|
-
* @date 2023-11-14 02:24:03
|
|
153
|
-
* @type {string}
|
|
154
|
-
*/
|
|
155
|
-
createman: string;
|
|
156
|
-
/**
|
|
157
|
-
* 创建时间
|
|
158
|
-
* @author lxm
|
|
159
|
-
* @date 2023-11-14 02:24:11
|
|
160
|
-
* @type {string}
|
|
161
|
-
*/
|
|
162
|
-
createdate: string;
|
|
163
|
-
/**
|
|
164
|
-
* 更新人标识
|
|
165
|
-
* @author lxm
|
|
166
|
-
* @date 2023-11-14 02:24:20
|
|
167
|
-
* @type {string}
|
|
168
|
-
*/
|
|
169
|
-
updateman: string;
|
|
170
|
-
/**
|
|
171
|
-
* 更新时间
|
|
172
|
-
* @author lxm
|
|
173
|
-
* @date 2023-11-14 02:24:24
|
|
174
|
-
* @type {string}
|
|
175
|
-
*/
|
|
176
|
-
updatedate: string;
|
|
177
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { IPortalAsyncAction } from '../i-portal-async-action/i-portal-async-action';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 消息数据
|
|
5
|
-
*
|
|
6
|
-
* @author chitanda
|
|
7
|
-
* @date 2023-09-05 15:09:02
|
|
8
|
-
* @export
|
|
9
|
-
* @interface IPortalMessage
|
|
10
|
-
*/
|
|
11
|
-
export interface IPortalMessage {
|
|
12
|
-
/**
|
|
13
|
-
* 消息标识
|
|
14
|
-
*
|
|
15
|
-
* @author chitanda
|
|
16
|
-
* @date 2023-09-05 15:09:43
|
|
17
|
-
* @type {string}
|
|
18
|
-
*/
|
|
19
|
-
messageid: string;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 消息名称
|
|
23
|
-
*
|
|
24
|
-
* @author chitanda
|
|
25
|
-
* @date 2023-09-05 15:09:49
|
|
26
|
-
* @type {string}
|
|
27
|
-
*/
|
|
28
|
-
messagename?: string;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 消息类型
|
|
32
|
-
*
|
|
33
|
-
* @author chitanda
|
|
34
|
-
* @date 2023-09-05 15:09:09
|
|
35
|
-
* @type {('CONSOLE' | 'COMMAND')} 日志消息 | 命令
|
|
36
|
-
*/
|
|
37
|
-
type: 'CONSOLE' | 'COMMAND';
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* 消息子类型
|
|
41
|
-
*
|
|
42
|
-
* @author chitanda
|
|
43
|
-
* @date 2024-01-22 10:01:30
|
|
44
|
-
* @type {('MARKOPENDATA'
|
|
45
|
-
* | 'ASYNCACTION'
|
|
46
|
-
* | 'OBJECTUPDATED'
|
|
47
|
-
* | 'OBJECTREMOVED'
|
|
48
|
-
* | 'OBJECTCREATED')} 标注打开数据 | 异步作业 | 数据更新 | 数据删除 | 数据创建
|
|
49
|
-
*/
|
|
50
|
-
subtype?:
|
|
51
|
-
| 'MARKOPENDATA'
|
|
52
|
-
| 'ASYNCACTION'
|
|
53
|
-
| 'INTERNALMESSAGE'
|
|
54
|
-
| 'OBJECTUPDATED'
|
|
55
|
-
| 'OBJECTREMOVED'
|
|
56
|
-
| 'OBJECTCREATED';
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 内容摘要
|
|
60
|
-
*
|
|
61
|
-
* @author chitanda
|
|
62
|
-
* @date 2023-09-05 15:09:23
|
|
63
|
-
* @type {string}
|
|
64
|
-
*/
|
|
65
|
-
content?: string;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* 消息数据
|
|
69
|
-
*
|
|
70
|
-
* @author chitanda
|
|
71
|
-
* @date 2023-09-05 15:09:55
|
|
72
|
-
* @type {(IPortalAsyncAction | IData | string | unknown)}
|
|
73
|
-
*/
|
|
74
|
-
data?: IPortalAsyncAction | IData | string | unknown;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* 消息路径
|
|
78
|
-
*
|
|
79
|
-
* @author chitanda
|
|
80
|
-
* @date 2023-09-05 15:09:25
|
|
81
|
-
* @type {string}
|
|
82
|
-
*/
|
|
83
|
-
url?: string;
|
|
84
|
-
}
|
package/src/interface/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from './click-outside/click-outside';
|
|
2
|
-
export type { I18n } from './i-18n/i-18n';
|
|
3
|
-
export type { IChatMessage } from './i-chat-message/i-chat-message';
|
|
4
|
-
export type { IEnvironment } from './i-environment/i-environment';
|
|
5
|
-
export type { IPortalAsyncAction } from './i-portal-async-action/i-portal-async-action';
|
|
6
|
-
export type { IPortalMessage } from './i-portal-message/i-portal-message';
|
|
7
|
-
export type { OrgData } from './org-data/org-data';
|
|
8
|
-
export type {
|
|
9
|
-
IInternalMessage,
|
|
10
|
-
InternalMessageContentType,
|
|
11
|
-
InternalMessageStatus,
|
|
12
|
-
} from './i-internal-message/i-internal-message';
|
|
13
|
-
export type { IDevToolConfig } from './i-devtool-config/i-devtool-config';
|
|
14
|
-
export type { IMarkOpenData } from './i-mark-open-data/i-mark-open-data';
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 组织数据
|
|
3
|
-
*
|
|
4
|
-
* @author chitanda
|
|
5
|
-
* @date 2022-07-20 18:07:59
|
|
6
|
-
* @export
|
|
7
|
-
* @interface OrgData
|
|
8
|
-
*/
|
|
9
|
-
export interface OrgData {
|
|
10
|
-
/**
|
|
11
|
-
* 组织标识
|
|
12
|
-
*
|
|
13
|
-
* @author chitanda
|
|
14
|
-
* @date 2022-07-20 18:07:17
|
|
15
|
-
* @type {string}
|
|
16
|
-
*/
|
|
17
|
-
orgid: string;
|
|
18
|
-
/**
|
|
19
|
-
* 组织名称
|
|
20
|
-
*
|
|
21
|
-
* @author chitanda
|
|
22
|
-
* @date 2022-07-20 18:07:31
|
|
23
|
-
* @type {string}
|
|
24
|
-
*/
|
|
25
|
-
orgname: string;
|
|
26
|
-
/**
|
|
27
|
-
* 中心系统标识
|
|
28
|
-
*
|
|
29
|
-
* @author chitanda
|
|
30
|
-
* @date 2022-07-20 18:07:56
|
|
31
|
-
* @type {string}
|
|
32
|
-
*/
|
|
33
|
-
dcsystemid: string;
|
|
34
|
-
/**
|
|
35
|
-
* 系统标识
|
|
36
|
-
*
|
|
37
|
-
* @author chitanda
|
|
38
|
-
* @date 2022-07-20 18:07:47
|
|
39
|
-
* @type {string}
|
|
40
|
-
*/
|
|
41
|
-
systemid: string;
|
|
42
|
-
}
|
package/src/params/params.ts
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-constructor-return */
|
|
2
|
-
/**
|
|
3
|
-
* 视图参数类
|
|
4
|
-
* @author lxm
|
|
5
|
-
* @date 2023-10-27 03:39:12
|
|
6
|
-
* @export
|
|
7
|
-
* @class IBizParams
|
|
8
|
-
* @implements {IParams}
|
|
9
|
-
*/
|
|
10
|
-
export class IBizParams implements IParams {
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
-
[key: string | symbol]: any;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 自身的属性
|
|
16
|
-
* @author lxm
|
|
17
|
-
* @date 2023-10-27 04:09:25
|
|
18
|
-
* @protected
|
|
19
|
-
* @type {IParams}
|
|
20
|
-
*/
|
|
21
|
-
protected declare _params: IParams;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* 父视图参数
|
|
25
|
-
* @author lxm
|
|
26
|
-
* @date 2023-10-27 04:08:59
|
|
27
|
-
* @protected
|
|
28
|
-
* @type {IParams}
|
|
29
|
-
*/
|
|
30
|
-
protected declare _parent?: IParams;
|
|
31
|
-
|
|
32
|
-
constructor(params?: IParams, parent?: IParams) {
|
|
33
|
-
// 定义私有变量,存放父视图参数源对象
|
|
34
|
-
Object.defineProperty(this, '_parent', {
|
|
35
|
-
enumerable: false,
|
|
36
|
-
configurable: true,
|
|
37
|
-
writable: true,
|
|
38
|
-
value: parent,
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
// 定义私有变量,用于存储对父已有视图参数的修改。
|
|
42
|
-
Object.defineProperty(this, '_params', {
|
|
43
|
-
enumerable: false,
|
|
44
|
-
configurable: true,
|
|
45
|
-
writable: true,
|
|
46
|
-
value: params || {},
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
return this.createProxy();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* 创建代理
|
|
54
|
-
*
|
|
55
|
-
* @author lxm
|
|
56
|
-
* @date 2023-10-27 03:53:14
|
|
57
|
-
* @protected
|
|
58
|
-
* @return {*} {IBizParams}
|
|
59
|
-
*/
|
|
60
|
-
protected createProxy(): IBizParams {
|
|
61
|
-
// 更新属性,缺的补充定义
|
|
62
|
-
function updateKeyDefine(target: IParams, keys: string[]): void {
|
|
63
|
-
keys.forEach(key => {
|
|
64
|
-
if (!Object.prototype.hasOwnProperty.call(target, key)) {
|
|
65
|
-
Object.defineProperty(target, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
configurable: true,
|
|
68
|
-
writable: true,
|
|
69
|
-
value: undefined,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return new Proxy(this, {
|
|
76
|
-
set(target: IBizParams, p: string, value: unknown): boolean {
|
|
77
|
-
if (['_params', '_parent'].includes(p)) {
|
|
78
|
-
target[p] = value;
|
|
79
|
-
} else {
|
|
80
|
-
target._params[p] = value;
|
|
81
|
-
}
|
|
82
|
-
return true;
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
get(target: IBizParams, p: string | symbol, _receiver: unknown): unknown {
|
|
86
|
-
if (target[p] !== undefined) {
|
|
87
|
-
return target[p];
|
|
88
|
-
}
|
|
89
|
-
if (target._params[p] !== undefined) {
|
|
90
|
-
return target._params[p];
|
|
91
|
-
}
|
|
92
|
-
if (target._parent && target._parent[p] !== undefined) {
|
|
93
|
-
return target._parent[p];
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
ownKeys(target: IBizParams): ArrayLike<string | symbol> {
|
|
98
|
-
// 整合所有并排重
|
|
99
|
-
const allKeys = [
|
|
100
|
-
...new Set([
|
|
101
|
-
...Object.keys(target._params),
|
|
102
|
-
...Object.keys(target._parent || {}),
|
|
103
|
-
]),
|
|
104
|
-
];
|
|
105
|
-
updateKeyDefine(target, allKeys);
|
|
106
|
-
return allKeys;
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* 在不改变对象引用的情况下,重置视图参数
|
|
113
|
-
* 等效于重新实例化,但是引用不变
|
|
114
|
-
* @author lxm
|
|
115
|
-
* @date 2023-10-27 05:24:45
|
|
116
|
-
* @param {IParams} [params]
|
|
117
|
-
* @param {IParams} [parent]
|
|
118
|
-
*/
|
|
119
|
-
reset(params?: IParams, parent?: IParams): void {
|
|
120
|
-
this._params = params || {};
|
|
121
|
-
this._parent = parent;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* 销毁上下文,避免内存泄漏
|
|
126
|
-
*
|
|
127
|
-
* @author lxm
|
|
128
|
-
* @date 2023-10-27 03:57:44
|
|
129
|
-
*/
|
|
130
|
-
destroy(): void {
|
|
131
|
-
this._params = {};
|
|
132
|
-
this._parent = undefined;
|
|
133
|
-
}
|
|
134
|
-
}
|
package/src/types.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { IBizSys } from './ibizsys';
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
const ibiz: IBizSys;
|
|
6
|
-
|
|
7
|
-
interface Window {
|
|
8
|
-
ibiz: IBizSys;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* 上下文
|
|
13
|
-
*
|
|
14
|
-
* @author chitanda
|
|
15
|
-
* @date 2022-07-14 15:07:52
|
|
16
|
-
* @interface IContext
|
|
17
|
-
*/
|
|
18
|
-
interface IContext {
|
|
19
|
-
[key: string | symbol]: any;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 界面域标识,每个独立路由导航的视图生成
|
|
23
|
-
*
|
|
24
|
-
* @author chitanda
|
|
25
|
-
* @date 2022-07-22 15:07:23
|
|
26
|
-
* @type {string}
|
|
27
|
-
*/
|
|
28
|
-
srfsessionid: string;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 应用标识
|
|
32
|
-
*
|
|
33
|
-
* @author chitanda
|
|
34
|
-
* @date 2022-07-22 15:07:23
|
|
35
|
-
* @type {string}
|
|
36
|
-
*/
|
|
37
|
-
srfappid: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
interface IIBizContext extends IContext {
|
|
41
|
-
/**
|
|
42
|
-
* 返回自身的上下文,独有的和与父有差异的
|
|
43
|
-
*
|
|
44
|
-
* @author chitanda
|
|
45
|
-
* @date 2023-03-13 17:03:10
|
|
46
|
-
* @return {*} {IData}
|
|
47
|
-
*/
|
|
48
|
-
getOwnContext(): IData;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* 销毁当前上下文
|
|
52
|
-
*
|
|
53
|
-
* @author chitanda
|
|
54
|
-
* @date 2023-03-13 17:03:37
|
|
55
|
-
*/
|
|
56
|
-
destroy(): void;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 克隆当前上下文
|
|
60
|
-
*
|
|
61
|
-
* @author chitanda
|
|
62
|
-
* @date 2023-03-13 17:03:45
|
|
63
|
-
* @return {*} {IContext}
|
|
64
|
-
*/
|
|
65
|
-
clone(): IContext;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* 在不改变对象引用的情况下,重置上下文
|
|
69
|
-
* 等效于重新实例化,但是引用不变
|
|
70
|
-
* @author lxm
|
|
71
|
-
* @date 2023-05-24 10:30:40
|
|
72
|
-
* @param {IData} [context={}] 默认值
|
|
73
|
-
* @param {IContext} [parent] 父上下文
|
|
74
|
-
*/
|
|
75
|
-
reset(context?: IData, parent?: IContext): void;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* 参数
|
|
80
|
-
*
|
|
81
|
-
* @author chitanda
|
|
82
|
-
* @date 2022-07-14 15:07:57
|
|
83
|
-
* @interface IParams
|
|
84
|
-
*/
|
|
85
|
-
interface IParams {
|
|
86
|
-
[key: string | symbol]: any;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* 数据
|
|
91
|
-
*
|
|
92
|
-
* @author chitanda
|
|
93
|
-
* @date 2022-07-14 15:07:31
|
|
94
|
-
* @interface IData
|
|
95
|
-
*/
|
|
96
|
-
interface IData {
|
|
97
|
-
[key: string | symbol]: any;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* 任意对象结构
|
|
102
|
-
*
|
|
103
|
-
* @author chitanda
|
|
104
|
-
* @date 2022-09-21 15:09:30
|
|
105
|
-
* @interface IObject
|
|
106
|
-
*/
|
|
107
|
-
interface IObject {
|
|
108
|
-
[key: string | symbol]: any;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/* eslint-disable default-param-last */
|
|
2
|
-
/* eslint-disable no-bitwise */
|
|
3
|
-
|
|
4
|
-
import { RuntimeError } from '../../error';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 检查权限码是否有效
|
|
8
|
-
* @author lxm
|
|
9
|
-
* @date 2023-11-10 10:49:57
|
|
10
|
-
* @static
|
|
11
|
-
* @param {number} permission
|
|
12
|
-
*/
|
|
13
|
-
function validate(permission: number): boolean {
|
|
14
|
-
return !!permission && !(permission & (permission - 1));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* 检查权限码是否有效,无效抛错
|
|
19
|
-
* @author lxm
|
|
20
|
-
* @date 2023-11-10 10:56:00
|
|
21
|
-
* @private
|
|
22
|
-
* @static
|
|
23
|
-
* @param {number} permission
|
|
24
|
-
*/
|
|
25
|
-
function validateAndThrow(permission: number): void {
|
|
26
|
-
const isPowerOf2 = validate(permission);
|
|
27
|
-
if (!isPowerOf2) {
|
|
28
|
-
throw new RuntimeError(`${permission}不是2的幂`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 设置权限
|
|
34
|
-
* @author lxm
|
|
35
|
-
* @date 2023-11-10 10:50:22
|
|
36
|
-
* @static
|
|
37
|
-
* @param {number} [allPermissions=0] 当前所有权限
|
|
38
|
-
* @param {number} permission 要设置的权限
|
|
39
|
-
* @return {*} {number}
|
|
40
|
-
*/
|
|
41
|
-
function setPermission(allPermissions: number = 0, permission: number): number {
|
|
42
|
-
validateAndThrow(permission);
|
|
43
|
-
return allPermissions | permission;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* 移出权限
|
|
48
|
-
* @author lxm
|
|
49
|
-
* @date 2023-11-10 10:50:45
|
|
50
|
-
* @static
|
|
51
|
-
* @param {number} [allPermissions=0] 当前所有权限
|
|
52
|
-
* @param {number} permission 要移出的权限
|
|
53
|
-
* @return {*} {number}
|
|
54
|
-
*/
|
|
55
|
-
function removePermission(
|
|
56
|
-
allPermissions: number = 0,
|
|
57
|
-
permission: number,
|
|
58
|
-
): number {
|
|
59
|
-
validateAndThrow(permission);
|
|
60
|
-
return allPermissions & ~permission;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 检查是否有某个权限
|
|
65
|
-
* @author lxm
|
|
66
|
-
* @date 2023-11-10 10:50:46
|
|
67
|
-
* @static
|
|
68
|
-
* @param {number} [allPermissions=0]
|
|
69
|
-
* @param {number} permission
|
|
70
|
-
* @return {*} {number}
|
|
71
|
-
*/
|
|
72
|
-
function checkPermission(
|
|
73
|
-
allPermissions: number = 0,
|
|
74
|
-
permission: number,
|
|
75
|
-
): boolean {
|
|
76
|
-
validateAndThrow(permission);
|
|
77
|
-
return (allPermissions & permission) !== 0;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export const BitMask = {
|
|
81
|
-
validate,
|
|
82
|
-
setPermission,
|
|
83
|
-
removePermission,
|
|
84
|
-
checkPermission,
|
|
85
|
-
};
|