@ibiz-template/runtime 0.5.3-beta.9 → 0.5.4
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 +300 -106
- package/dist/index.system.min.js +1 -1
- package/out/application.d.ts.map +1 -1
- package/out/application.js +4 -1
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +2 -0
- package/out/controller/control/form/edit-form/edit-form.controller.js +1 -1
- package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.controller.js +2 -1
- package/out/controller/control/search-bar/search-bar.controller.d.ts +8 -1
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +41 -9
- package/out/controller/control/search-bar/search-bar.service.d.ts +4 -4
- package/out/controller/control/search-bar/search-bar.service.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.service.js +38 -19
- package/out/controller/control/tree/tree.controller.d.ts +17 -0
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +22 -0
- package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.d.ts.map +1 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.js +6 -4
- package/out/controller/utils/jsonschema/entity.d.ts.map +1 -1
- package/out/controller/utils/jsonschema/entity.js +4 -1
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +3 -1
- package/out/global/global-util/global-util.d.ts +8 -1
- package/out/global/global-util/global-util.d.ts.map +1 -1
- package/out/global/global-util/global-util.js +8 -1
- package/out/interface/controller/common/i-icon/i-icon.d.ts +1 -0
- package/out/interface/controller/common/i-icon/i-icon.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-search-bar.controller.d.ts +8 -0
- package/out/interface/controller/controller/control/i-search-bar.controller.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-drbar.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-drbar.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-drtab.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-drtab.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-search-bar.state.d.ts +36 -1
- package/out/interface/controller/state/control/i-search-bar.state.d.ts.map +1 -1
- package/out/interface/util/i-view-stack/i-view-stack.d.ts +53 -0
- package/out/interface/util/i-view-stack/i-view-stack.d.ts.map +1 -0
- package/out/interface/util/i-view-stack/i-view-stack.js +1 -0
- package/out/interface/util/index.d.ts +1 -0
- package/out/interface/util/index.d.ts.map +1 -1
- package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts +10 -0
- package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts.map +1 -1
- package/out/register/helper/async-action-register.d.ts.map +1 -1
- package/out/register/helper/async-action-register.js +1 -1
- package/out/service/de-service-util.d.ts +11 -0
- package/out/service/de-service-util.d.ts.map +1 -1
- package/out/service/de-service-util.js +34 -0
- package/out/service/dto/method.dto.d.ts +1 -2
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +0 -7
- package/out/service/mqtt/mqtt.service.d.ts.map +1 -1
- package/out/service/mqtt/mqtt.service.js +1 -4
- package/out/service/service/auth/v7-auth.service.d.ts +1 -2
- package/out/service/service/auth/v7-auth.service.d.ts.map +1 -1
- package/out/service/service/auth/v7-auth.service.js +27 -7
- package/out/service/service/entity/method/method-renturn.d.ts.map +1 -1
- package/out/service/service/entity/method/method-renturn.js +9 -3
- package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
- package/out/service/utils/dynamic-code-list/dynamic-code-list.js +15 -3
- package/out/service/vo/tree-node-data/tree-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-node-data.js +3 -0
- package/out/utils/index.d.ts +1 -0
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +1 -0
- package/out/utils/view-stack/view-stack.d.ts +29 -0
- package/out/utils/view-stack/view-stack.d.ts.map +1 -0
- package/out/utils/view-stack/view-stack.js +47 -0
- package/package.json +5 -5
- package/src/application.ts +6 -1
- package/src/controller/common/view/view.controller.ts +4 -0
- package/src/controller/control/form/edit-form/edit-form.controller.ts +1 -1
- package/src/controller/control/form/form-detail/form-tab-panel/form-tab-panel.controller.ts +1 -1
- package/src/controller/control/search-bar/search-bar.controller.ts +40 -9
- package/src/controller/control/search-bar/search-bar.service.ts +42 -20
- package/src/controller/control/tree/tree.controller.ts +35 -0
- package/src/controller/control/tree-grid-ex/tree-grid-ex.controller.ts +12 -4
- package/src/controller/utils/jsonschema/entity.ts +4 -1
- package/src/engine/md-view.engine.ts +5 -1
- package/src/global/global-util/global-util.ts +9 -0
- package/src/interface/controller/common/i-icon/i-icon.ts +1 -0
- package/src/interface/controller/controller/control/i-search-bar.controller.ts +9 -0
- package/src/interface/controller/state/control/i-drbar.state.ts +8 -0
- package/src/interface/controller/state/control/i-drtab.state.ts +8 -0
- package/src/interface/controller/state/control/i-search-bar.state.ts +41 -1
- package/src/interface/util/i-view-stack/i-view-stack.ts +53 -0
- package/src/interface/util/index.ts +1 -0
- package/src/plugin/remote-plugin-item/remote-plugin-item.ts +8 -0
- package/src/register/helper/async-action-register.ts +3 -1
- package/src/service/de-service-util.ts +43 -0
- package/src/service/dto/method.dto.ts +1 -8
- package/src/service/mqtt/mqtt.service.ts +1 -4
- package/src/service/service/auth/v7-auth.service.ts +37 -19
- package/src/service/service/entity/method/method-renturn.ts +14 -5
- package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +18 -2
- package/src/service/vo/tree-node-data/tree-node-data.ts +3 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/view-stack/view-stack.ts +64 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { IViewController } from '../../controller';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 视图堆栈
|
|
5
|
+
*
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2024-01-18 10:01:16
|
|
8
|
+
* @export
|
|
9
|
+
* @interface IViewStack
|
|
10
|
+
*/
|
|
11
|
+
export interface IViewStack {
|
|
12
|
+
/**
|
|
13
|
+
* 添加视图堆栈信息
|
|
14
|
+
*
|
|
15
|
+
* @author chitanda
|
|
16
|
+
* @date 2024-01-18 10:01:29
|
|
17
|
+
* @param {string} id
|
|
18
|
+
* @param {IViewController} view
|
|
19
|
+
*/
|
|
20
|
+
add(id: string, view: IViewController): void;
|
|
21
|
+
/**
|
|
22
|
+
* 删除视图堆栈信息
|
|
23
|
+
*
|
|
24
|
+
* @author chitanda
|
|
25
|
+
* @date 2024-01-18 10:01:41
|
|
26
|
+
* @param {string} id
|
|
27
|
+
*/
|
|
28
|
+
remove(id: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* 视图激活
|
|
31
|
+
*
|
|
32
|
+
* @author chitanda
|
|
33
|
+
* @date 2024-01-18 10:01:11
|
|
34
|
+
* @param {string} id
|
|
35
|
+
*/
|
|
36
|
+
active(id: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* 视图休眠
|
|
39
|
+
*
|
|
40
|
+
* @author chitanda
|
|
41
|
+
* @date 2024-01-18 10:01:18
|
|
42
|
+
* @param {string} id
|
|
43
|
+
*/
|
|
44
|
+
deactivate(id: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* 当前激活视图清单
|
|
47
|
+
*
|
|
48
|
+
* @author chitanda
|
|
49
|
+
* @date 2024-01-18 14:01:50
|
|
50
|
+
* @return {*} {IViewController[]}
|
|
51
|
+
*/
|
|
52
|
+
getActives(): IViewController[];
|
|
53
|
+
}
|
|
@@ -15,3 +15,4 @@ export type { IOverlayController } from './i-overlay-controller/i-overlay-contro
|
|
|
15
15
|
export type { IOverlayPopoverContainer } from './i-overlay-popover-container/i-overlay-popover-container';
|
|
16
16
|
export type { IScriptFunctionOpts } from './script/i-script-function';
|
|
17
17
|
export type { IExcelUtil } from './i-excel-util/i-excel-util';
|
|
18
|
+
export type { IViewStack } from './i-view-stack/i-view-stack';
|
|
@@ -15,6 +15,14 @@ export interface ISystemImportMap {
|
|
|
15
15
|
* @type {string}
|
|
16
16
|
*/
|
|
17
17
|
baseUrl?: string;
|
|
18
|
+
/**
|
|
19
|
+
* package.json 清单
|
|
20
|
+
*
|
|
21
|
+
* @author chitanda
|
|
22
|
+
* @date 2024-01-11 20:01:57
|
|
23
|
+
* @type {{ [key: string]: string }}
|
|
24
|
+
*/
|
|
25
|
+
packages: { [key: string]: string };
|
|
18
26
|
/**
|
|
19
27
|
* 脚本
|
|
20
28
|
*
|
|
@@ -36,7 +36,9 @@ function getProvider(key: string): IAsyncActionProvider | undefined {
|
|
|
36
36
|
export function getAsyncActionProvider(
|
|
37
37
|
actiontype: string,
|
|
38
38
|
): IAsyncActionProvider {
|
|
39
|
-
const provider: IAsyncActionProvider | undefined = getProvider(
|
|
39
|
+
const provider: IAsyncActionProvider | undefined = getProvider(
|
|
40
|
+
actiontype || 'DEFAULT',
|
|
41
|
+
);
|
|
40
42
|
|
|
41
43
|
// 找异步操作类型
|
|
42
44
|
if (!provider) {
|
|
@@ -135,6 +135,49 @@ export class DEServiceUtil {
|
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
+
/**
|
|
139
|
+
* 清理指定实体的临时数据缓存,并根据关系清理掉子实体的临时数据缓存
|
|
140
|
+
*
|
|
141
|
+
* @author chitanda
|
|
142
|
+
* @date 2024-01-19 14:01:32
|
|
143
|
+
* @param {IContext} context
|
|
144
|
+
* @param {string} entityID
|
|
145
|
+
* @param {string[]} [clearEntities=[]] 已经清理过的实体忽略,避免关系循环引用导致死循环
|
|
146
|
+
* @return {*} {void}
|
|
147
|
+
*/
|
|
148
|
+
clearTempCacheByRs(
|
|
149
|
+
context: IContext,
|
|
150
|
+
entityID: string,
|
|
151
|
+
clearEntities: string[] = [],
|
|
152
|
+
): void {
|
|
153
|
+
if (clearEntities.includes(entityID) === true) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
clearEntities.push(entityID);
|
|
157
|
+
const sandboxId = context.srfsessionid;
|
|
158
|
+
if (!this.cache.has(sandboxId)) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
// 清理当前实体的临时数据缓存
|
|
162
|
+
const map = this.cache.get(sandboxId)!;
|
|
163
|
+
const service = map.get(entityID);
|
|
164
|
+
if (service) {
|
|
165
|
+
service.local.clear();
|
|
166
|
+
}
|
|
167
|
+
// 根据关系清理掉子实体的临时数据缓存
|
|
168
|
+
const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
|
|
169
|
+
if (uiDomain) {
|
|
170
|
+
const configs = uiDomain.getDERConfigByMajor(entityID);
|
|
171
|
+
configs.forEach(config => {
|
|
172
|
+
this.clearTempCacheByRs(
|
|
173
|
+
context,
|
|
174
|
+
config.minorAppDataEntityId!,
|
|
175
|
+
clearEntities,
|
|
176
|
+
);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
138
181
|
/**
|
|
139
182
|
* 执行服务方法
|
|
140
183
|
* @author lxm
|
|
@@ -193,12 +193,6 @@ export class MethodDto {
|
|
|
193
193
|
* @return {*} {Promise<IDataEntity[]>}
|
|
194
194
|
*/
|
|
195
195
|
async sets(context: IContext, data: IData[]): Promise<IDataEntity[]> {
|
|
196
|
-
const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
|
|
197
|
-
if (uiDomain && uiDomain.state.rsInit !== true) {
|
|
198
|
-
await this.calcRs(context);
|
|
199
|
-
uiDomain.calcParentRs();
|
|
200
|
-
uiDomain.state.rsInit = true;
|
|
201
|
-
}
|
|
202
196
|
return Promise.all(
|
|
203
197
|
data.map(async datum => {
|
|
204
198
|
const all = this.fields
|
|
@@ -247,12 +241,11 @@ export class MethodDto {
|
|
|
247
241
|
*
|
|
248
242
|
* @author chitanda
|
|
249
243
|
* @date 2023-12-26 16:12:13
|
|
250
|
-
* @protected
|
|
251
244
|
* @param {IContext} context
|
|
252
245
|
* @param {number} [depth=0] 递归层级,避免进入死循环。最大递归层级为 10
|
|
253
246
|
* @return {*} {Promise<void>}
|
|
254
247
|
*/
|
|
255
|
-
|
|
248
|
+
async calcRs(context: IContext, depth: number = 0): Promise<void> {
|
|
256
249
|
if (depth > 10) {
|
|
257
250
|
return;
|
|
258
251
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IPortalMessage } from '@ibiz-template/core';
|
|
2
2
|
import { MqttClient, IClientOptions } from 'mqtt';
|
|
3
|
-
import { QXEvent, createUUID
|
|
3
|
+
import { QXEvent, createUUID } from 'qx-util';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* mqtt 连接服务
|
|
@@ -63,9 +63,6 @@ export class MqttService {
|
|
|
63
63
|
protected token: string,
|
|
64
64
|
protected appId: string,
|
|
65
65
|
) {
|
|
66
|
-
if (isNilOrEmpty(mqttTopic) || isNilOrEmpty(token)) {
|
|
67
|
-
throw new Error('mqttTopic or token is empty');
|
|
68
|
-
}
|
|
69
66
|
this.options.username = mqttTopic;
|
|
70
67
|
this.options.password = token;
|
|
71
68
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CoreConst, HttpError } from '@ibiz-template/core';
|
|
2
2
|
import { clearCookie, getCookie, setCookie } from 'qx-util';
|
|
3
|
-
import { IAuthService } from '../../../interface';
|
|
4
|
-
import { IAuthInfo } from '../../../interface/service/service/i-auth.service';
|
|
3
|
+
import { IAuthService, IAuthInfo } from '../../../interface';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* 认证服务
|
|
@@ -30,9 +29,13 @@ export class V7AuthService implements IAuthService {
|
|
|
30
29
|
const token = getCookie(CoreConst.TOKEN)!;
|
|
31
30
|
const expirein = getCookie(CoreConst.TOKEN_EXPIRES)!;
|
|
32
31
|
const remember = getCookie(CoreConst.TOKEN_REMEMBER)!;
|
|
32
|
+
const refreshToken = getCookie(CoreConst.REFRESH_TOKEN)!;
|
|
33
33
|
setCookie(CoreConst.TOKEN, token, 0, true);
|
|
34
34
|
setCookie(CoreConst.TOKEN_EXPIRES, expirein, 0, true);
|
|
35
35
|
setCookie(CoreConst.TOKEN_REMEMBER, remember, 0, true);
|
|
36
|
+
if (refreshToken) {
|
|
37
|
+
setCookie(CoreConst.REFRESH_TOKEN, refreshToken, 0, true);
|
|
38
|
+
}
|
|
36
39
|
}
|
|
37
40
|
return result;
|
|
38
41
|
}
|
|
@@ -51,18 +54,22 @@ export class V7AuthService implements IAuthService {
|
|
|
51
54
|
});
|
|
52
55
|
const { data } = res;
|
|
53
56
|
if (data && data.token) {
|
|
57
|
+
const cacheDays = remember ? 7 : 0;
|
|
54
58
|
if (remember) {
|
|
55
|
-
setCookie(CoreConst.TOKEN_REMEMBER, '1',
|
|
59
|
+
setCookie(CoreConst.TOKEN_REMEMBER, '1', cacheDays, true);
|
|
56
60
|
}
|
|
57
|
-
setCookie(CoreConst.TOKEN, data.token,
|
|
61
|
+
setCookie(CoreConst.TOKEN, data.token, cacheDays, true);
|
|
58
62
|
const expiredDate =
|
|
59
63
|
new Date().getTime() + (data.expirein || 7199) * 1000;
|
|
60
|
-
setCookie(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
setCookie(CoreConst.TOKEN_EXPIRES, `${expiredDate}`, cacheDays, true);
|
|
65
|
+
if (data.refresh_token) {
|
|
66
|
+
setCookie(
|
|
67
|
+
CoreConst.REFRESH_TOKEN,
|
|
68
|
+
data.refresh_token,
|
|
69
|
+
cacheDays,
|
|
70
|
+
true,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
66
73
|
clearCookie(CoreConst.IS_ANONYMOUS);
|
|
67
74
|
}
|
|
68
75
|
return true;
|
|
@@ -81,6 +88,7 @@ export class V7AuthService implements IAuthService {
|
|
|
81
88
|
clearCookie(CoreConst.TOKEN);
|
|
82
89
|
clearCookie(CoreConst.TOKEN_EXPIRES);
|
|
83
90
|
clearCookie(CoreConst.TOKEN_REMEMBER);
|
|
91
|
+
clearCookie(CoreConst.REFRESH_TOKEN);
|
|
84
92
|
clearCookie(CoreConst.IS_ANONYMOUS);
|
|
85
93
|
ibiz.appData = undefined;
|
|
86
94
|
ibiz.orgData = undefined;
|
|
@@ -102,24 +110,34 @@ export class V7AuthService implements IAuthService {
|
|
|
102
110
|
|
|
103
111
|
const token = getCookie(CoreConst.TOKEN);
|
|
104
112
|
const expirein = getCookie(CoreConst.TOKEN_EXPIRES);
|
|
105
|
-
const remember = getCookie(CoreConst.TOKEN_REMEMBER);
|
|
106
113
|
if (token && expirein) {
|
|
107
114
|
// 计算到过期时间所需的延时毫秒数,预留提前量
|
|
108
115
|
let wait = Number(expirein) - new Date().getTime();
|
|
109
116
|
const early = 5 * 60 * 1000;
|
|
110
117
|
wait = wait > early ? wait - early : 0;
|
|
111
118
|
setTimeout(async () => {
|
|
112
|
-
const
|
|
119
|
+
const remember = getCookie(CoreConst.TOKEN_REMEMBER);
|
|
120
|
+
const refreshToken = getCookie(CoreConst.REFRESH_TOKEN);
|
|
121
|
+
const cacheDay = remember ? 7 : 0;
|
|
122
|
+
let res;
|
|
123
|
+
if (refreshToken != null && refreshToken !== '') {
|
|
124
|
+
res = await ibiz.net.get(`/uaa/refresh_token/${refreshToken}`);
|
|
125
|
+
} else {
|
|
126
|
+
res = await ibiz.net.get(`/uaa/refreshtoken2`);
|
|
127
|
+
}
|
|
113
128
|
if (res.ok) {
|
|
114
|
-
setCookie(CoreConst.TOKEN, res.data.token,
|
|
129
|
+
setCookie(CoreConst.TOKEN, res.data.token, cacheDay, true);
|
|
115
130
|
const expiredDate =
|
|
116
131
|
new Date().getTime() + (res.data.expirein || 7199) * 1000;
|
|
117
|
-
setCookie(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
132
|
+
setCookie(CoreConst.TOKEN_EXPIRES, `${expiredDate}`, cacheDay, true);
|
|
133
|
+
if (res.data.refresh_token) {
|
|
134
|
+
setCookie(
|
|
135
|
+
CoreConst.REFRESH_TOKEN,
|
|
136
|
+
res.data.refresh_token,
|
|
137
|
+
cacheDay,
|
|
138
|
+
true,
|
|
139
|
+
);
|
|
140
|
+
}
|
|
123
141
|
}
|
|
124
142
|
// 下一次延时做准备
|
|
125
143
|
this.extendLogin();
|
|
@@ -58,11 +58,20 @@ export class MethodReturn {
|
|
|
58
58
|
async handle(context: IContext, data: IData): Promise<IDataEntity> {
|
|
59
59
|
if (this.dto) {
|
|
60
60
|
const app = ibiz.hub.getApp(this.entity.appId);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
|
|
62
|
+
if (uiDomain && uiDomain.state.rsInit !== true) {
|
|
63
|
+
await this.dto.calcRs(context);
|
|
64
|
+
uiDomain.calcParentRs();
|
|
65
|
+
uiDomain.state.rsInit = true;
|
|
66
|
+
}
|
|
67
|
+
// 设置之前,根据关系清理掉当前界面域下的数据缓存
|
|
68
|
+
app.deService.clearTempCacheByRs(
|
|
69
|
+
{
|
|
70
|
+
srfappid: app.appId,
|
|
71
|
+
srfsessionid: context.srfsessionid,
|
|
72
|
+
},
|
|
73
|
+
this.entity.id!,
|
|
74
|
+
);
|
|
66
75
|
const items = await this.dto.sets(context, [data]);
|
|
67
76
|
return items[0];
|
|
68
77
|
}
|
|
@@ -133,6 +133,7 @@ export class DynamicCodeListCache {
|
|
|
133
133
|
*/
|
|
134
134
|
protected convertData(data: IData): CodeListItem {
|
|
135
135
|
const result = {} as CodeListItem;
|
|
136
|
+
|
|
136
137
|
const {
|
|
137
138
|
valueAppDEFieldId,
|
|
138
139
|
textAppDEFieldId,
|
|
@@ -142,6 +143,8 @@ export class DynamicCodeListCache {
|
|
|
142
143
|
iconPathXAppDEFieldId,
|
|
143
144
|
disableAppDEFieldId,
|
|
144
145
|
dataAppDEFieldId,
|
|
146
|
+
clsAppDEFieldId,
|
|
147
|
+
colorAppDEFieldId,
|
|
145
148
|
} = this.codeList;
|
|
146
149
|
// 值属性
|
|
147
150
|
const value = valueAppDEFieldId ? data[valueAppDEFieldId] : data.srfkey;
|
|
@@ -177,6 +180,14 @@ export class DynamicCodeListCache {
|
|
|
177
180
|
if (disableAppDEFieldId) {
|
|
178
181
|
result.disableSelect = fieldValueToBoolean(data[disableAppDEFieldId]);
|
|
179
182
|
}
|
|
183
|
+
// 样式表属性
|
|
184
|
+
if (clsAppDEFieldId) {
|
|
185
|
+
result.textCls = data[clsAppDEFieldId];
|
|
186
|
+
}
|
|
187
|
+
// 颜色值属性
|
|
188
|
+
if (colorAppDEFieldId) {
|
|
189
|
+
result.color = data[colorAppDEFieldId];
|
|
190
|
+
}
|
|
180
191
|
// 数据属性
|
|
181
192
|
if (dataAppDEFieldId && data[dataAppDEFieldId]) {
|
|
182
193
|
try {
|
|
@@ -237,9 +248,14 @@ export class DynamicCodeListCache {
|
|
|
237
248
|
}
|
|
238
249
|
|
|
239
250
|
// *预定义加载
|
|
240
|
-
if (this.isPredefined) {
|
|
251
|
+
if (this.isPredefined && this.codeList.codeName) {
|
|
252
|
+
const index = this.codeList.codeName.indexOf('__');
|
|
253
|
+
const tag =
|
|
254
|
+
index !== -1
|
|
255
|
+
? this.codeList.codeName.substring(index + 2)
|
|
256
|
+
: this.codeList.codeName;
|
|
241
257
|
const res = await app.net.get(
|
|
242
|
-
`/dictionaries/codelist/${
|
|
258
|
+
`/dictionaries/codelist/${tag}`,
|
|
243
259
|
tempParams,
|
|
244
260
|
);
|
|
245
261
|
return Object.freeze(res.data.items);
|
|
@@ -86,6 +86,9 @@ export abstract class TreeNodeData implements ITreeNodeData {
|
|
|
86
86
|
if (sysImage.imagePath) {
|
|
87
87
|
icon.imagePath = sysImage.imagePath;
|
|
88
88
|
}
|
|
89
|
+
if (sysImage.rawContent) {
|
|
90
|
+
icon.htmlStr = sysImage.rawContent;
|
|
91
|
+
}
|
|
89
92
|
}
|
|
90
93
|
return Object.values(icon).length > 0 ? icon : undefined;
|
|
91
94
|
}
|
package/src/utils/index.ts
CHANGED
|
@@ -18,4 +18,5 @@ export { ThemeUtil } from './theme-util/theme-util';
|
|
|
18
18
|
export { UIDomain } from './ui-domain/ui-domain';
|
|
19
19
|
export { UIDomainManager } from './ui-domain-manager/ui-domain-manager';
|
|
20
20
|
export { RawValueUtil } from './raw-value-util/raw-value-util';
|
|
21
|
+
export { ViewStack } from './view-stack/view-stack';
|
|
21
22
|
export { handleAllSettled } from './promise/promise';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { IAppView } from '@ibiz/model-core';
|
|
2
|
+
import {
|
|
3
|
+
IViewController,
|
|
4
|
+
IViewEvent,
|
|
5
|
+
IViewStack,
|
|
6
|
+
IViewState,
|
|
7
|
+
} from '../../interface';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 视图堆栈
|
|
11
|
+
*
|
|
12
|
+
* @author chitanda
|
|
13
|
+
* @date 2024-01-18 10:01:47
|
|
14
|
+
* @export
|
|
15
|
+
* @class ViewStack
|
|
16
|
+
*/
|
|
17
|
+
export class ViewStack implements IViewStack {
|
|
18
|
+
private stackMap: Map<string, IViewController> = new Map();
|
|
19
|
+
|
|
20
|
+
private stack: IViewController[] = [];
|
|
21
|
+
|
|
22
|
+
private activeStack: IViewController[] = [];
|
|
23
|
+
|
|
24
|
+
add(
|
|
25
|
+
id: string,
|
|
26
|
+
view: IViewController<IAppView, IViewState, IViewEvent>,
|
|
27
|
+
): void {
|
|
28
|
+
this.stack.push(view);
|
|
29
|
+
this.stackMap.set(id, view);
|
|
30
|
+
this.recalculateActiveStack();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
remove(id: string): void {
|
|
34
|
+
const view = this.stackMap.get(id);
|
|
35
|
+
if (view) {
|
|
36
|
+
this.stack.splice(this.stack.indexOf(view), 1);
|
|
37
|
+
this.stackMap.delete(id);
|
|
38
|
+
this.recalculateActiveStack();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
getActives(): IViewController[] {
|
|
43
|
+
return this.activeStack;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
active(_id: string): void {
|
|
47
|
+
this.recalculateActiveStack();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
deactivate(_id: string): void {
|
|
51
|
+
this.recalculateActiveStack();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 重新计算激活视图堆栈
|
|
56
|
+
*
|
|
57
|
+
* @author chitanda
|
|
58
|
+
* @date 2024-01-18 14:01:23
|
|
59
|
+
* @protected
|
|
60
|
+
*/
|
|
61
|
+
protected recalculateActiveStack(): void {
|
|
62
|
+
this.activeStack = this.stack.filter(item => item.isActive === true);
|
|
63
|
+
}
|
|
64
|
+
}
|