@ibiz-template/runtime 0.4.17-dev.1 → 0.5.0-beta.1
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 +629 -816
- package/dist/index.system.min.js +2 -2
- package/out/controller/common/control/md-control.controller.d.ts +21 -1
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +38 -2
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.js +2 -6
- package/out/controller/control/gantt/gantt.controller.d.ts +6 -189
- package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.controller.js +6 -412
- package/out/controller/control/gantt/gantt.service.d.ts +2 -2
- package/out/controller/control/gantt/gantt.service.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.service.js +5 -5
- package/out/controller/control/kanban/kanban.controller.d.ts +2 -2
- package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
- package/out/controller/control/kanban/kanban.controller.js +1 -1
- package/out/controller/control/list/list.controller.d.ts +1 -30
- package/out/controller/control/list/list.controller.d.ts.map +1 -1
- package/out/controller/control/list/list.controller.js +0 -41
- package/out/controller/control/md-ctrl/md-ctrl.controller.js +1 -1
- package/out/controller/control/search-bar/index.d.ts +1 -0
- package/out/controller/control/search-bar/index.d.ts.map +1 -1
- package/out/controller/control/search-bar/index.js +1 -0
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +48 -4
- package/out/controller/control/search-bar/search-bar.service.d.ts +24 -0
- package/out/controller/control/search-bar/search-bar.service.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.service.js +62 -16
- package/out/interface/controller/event/control/i-gantt.event.d.ts +2 -44
- package/out/interface/controller/event/control/i-gantt.event.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-gantt.state.d.ts +2 -41
- package/out/interface/controller/state/control/i-gantt.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-search-bar.state.d.ts +8 -1
- package/out/interface/controller/state/control/i-search-bar.state.d.ts.map +1 -1
- package/out/interface/service/i-parent-config/i-parent-config.d.ts +67 -0
- package/out/interface/service/i-parent-config/i-parent-config.d.ts.map +1 -0
- package/out/interface/service/i-parent-config/i-parent-config.js +1 -0
- package/out/interface/service/index.d.ts +1 -0
- package/out/interface/service/index.d.ts.map +1 -1
- package/out/interface/service/service/i-app-de.service.d.ts +10 -0
- package/out/interface/service/service/i-app-de.service.d.ts.map +1 -1
- package/out/service/de-service-util.d.ts +3 -2
- package/out/service/de-service-util.d.ts.map +1 -1
- package/out/service/de-service-util.js +11 -10
- package/out/service/dto/method.dto.d.ts +22 -3
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +65 -4
- package/out/service/service/entity/de.service.d.ts +10 -0
- package/out/service/service/entity/de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.js +22 -1
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +1 -12
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts +0 -1
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.js +1 -2
- package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts +0 -7
- package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-node-data-util.js +0 -18
- package/out/ui-action/provider/ui-action-provider-base.d.ts +10 -0
- package/out/ui-action/provider/ui-action-provider-base.d.ts.map +1 -1
- package/out/ui-action/provider/ui-action-provider-base.js +20 -9
- package/out/utils/index.d.ts +1 -1
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +1 -1
- package/out/utils/open-redirect-view/open-redirect-view.d.ts +25 -1
- package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -1
- package/out/utils/open-redirect-view/open-redirect-view.js +72 -31
- package/out/utils/ui-domain/ui-domain.d.ts +28 -0
- package/out/utils/ui-domain/ui-domain.d.ts.map +1 -1
- package/out/utils/ui-domain/ui-domain.js +40 -0
- package/package.json +6 -6
- package/src/controller/common/control/md-control.controller.ts +50 -2
- package/src/controller/control/form/form-detail/form-detail/form-detail.controller.ts +2 -6
- package/src/controller/control/gantt/gantt.controller.ts +7 -492
- package/src/controller/control/gantt/gantt.service.ts +5 -5
- package/src/controller/control/kanban/kanban.controller.ts +2 -2
- package/src/controller/control/list/list.controller.ts +0 -54
- package/src/controller/control/md-ctrl/md-ctrl.controller.ts +1 -1
- package/src/controller/control/search-bar/index.ts +1 -0
- package/src/controller/control/search-bar/search-bar.controller.ts +63 -10
- package/src/controller/control/search-bar/search-bar.service.ts +70 -16
- package/src/interface/controller/event/control/i-gantt.event.ts +2 -38
- package/src/interface/controller/state/control/i-gantt.state.ts +2 -47
- package/src/interface/controller/state/control/i-search-bar.state.ts +9 -1
- package/src/interface/service/i-parent-config/i-parent-config.ts +66 -0
- package/src/interface/service/index.ts +1 -0
- package/src/interface/service/service/i-app-de.service.ts +13 -0
- package/src/service/de-service-util.ts +6 -4
- package/src/service/dto/method.dto.ts +77 -5
- package/src/service/service/entity/de.service.ts +26 -1
- package/src/service/service/entity/method/method.ts +1 -13
- package/src/service/vo/gantt-node-data/gantt-data-set-node-data.ts +1 -4
- package/src/service/vo/gantt-node-data/gantt-node-data-util.ts +0 -21
- package/src/ui-action/provider/ui-action-provider-base.ts +34 -15
- package/src/utils/index.ts +1 -0
- package/src/utils/open-redirect-view/open-redirect-view.ts +93 -38
- package/src/utils/ui-domain/ui-domain.ts +44 -0
|
@@ -65,21 +65,25 @@ export async function toLocalOpenWFRedirectView(context, linkUrl, opts = {}) {
|
|
|
65
65
|
context.srfprocessinstanceid = params.srfprocessinstanceid;
|
|
66
66
|
delete params.srfprocessinstanceid;
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
return {
|
|
69
|
+
context,
|
|
70
|
+
params,
|
|
71
|
+
opts,
|
|
72
|
+
viewId: deRdView.id,
|
|
73
|
+
};
|
|
69
74
|
}
|
|
70
75
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* @
|
|
74
|
-
* @date 2022-09-28 16:09:15
|
|
76
|
+
* 获取处理后的重定向视图最终要跳转视图的相关信息
|
|
77
|
+
* @author lxm
|
|
78
|
+
* @date 2023-12-26 11:16:02
|
|
75
79
|
* @export
|
|
76
80
|
* @param {IAppDERedirectView} appView
|
|
77
|
-
* @param {IContext}
|
|
81
|
+
* @param {IContext} context
|
|
78
82
|
* @param {IParams} [params={}]
|
|
79
|
-
* @param {
|
|
80
|
-
* @return {*} {Promise<
|
|
83
|
+
* @param {IOpenViewOptions} [opts={}]
|
|
84
|
+
* @return {*} {(Promise<({ type: 'view' } & ToViewParams) | { type: 'url'; url: string }>)}
|
|
81
85
|
*/
|
|
82
|
-
export async function
|
|
86
|
+
export async function getDERedirectToView(appView, context, params = {}, opts = {}) {
|
|
83
87
|
var _a;
|
|
84
88
|
// 计算重定向视图上下文参数转换
|
|
85
89
|
const navContext = appView.appViewNavContexts || [];
|
|
@@ -116,20 +120,13 @@ export async function openDERedirectView(appView, context, params = {}, opts = {
|
|
|
116
120
|
linkUrl = linkUrl.slice(linkUrl.indexOf('appredirectview?'));
|
|
117
121
|
}
|
|
118
122
|
if (linkUrl.startsWith('http://') || linkUrl.startsWith('https://')) {
|
|
119
|
-
return
|
|
120
|
-
const newWindow = window.open(linkUrl, '_blank');
|
|
121
|
-
if (newWindow) {
|
|
122
|
-
newWindow.callback = () => {
|
|
123
|
-
resolve({ ok: true, data: [] });
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
});
|
|
123
|
+
return { type: 'url', url: linkUrl };
|
|
127
124
|
}
|
|
128
125
|
if (linkUrl.startsWith('appredirectview?')) {
|
|
129
|
-
await toLocalOpenWFRedirectView(context, linkUrl, opts);
|
|
130
|
-
return {
|
|
126
|
+
const toView = await toLocalOpenWFRedirectView(context, linkUrl, opts);
|
|
127
|
+
return Object.assign({ type: 'view' }, toView);
|
|
131
128
|
}
|
|
132
|
-
|
|
129
|
+
throw new RuntimeError(`未支持的linkUrl格式:${linkUrl}`);
|
|
133
130
|
}
|
|
134
131
|
}
|
|
135
132
|
}
|
|
@@ -144,8 +141,14 @@ export async function openDERedirectView(appView, context, params = {}, opts = {
|
|
|
144
141
|
// 拼接当前重定向视图所在应用实体名称为前缀
|
|
145
142
|
const deRdTag = `${entity.name.toUpperCase()}:${rdTag}`;
|
|
146
143
|
// 所有重定向引用视图
|
|
147
|
-
const allRefViews =
|
|
148
|
-
|
|
144
|
+
const allRefViews = [];
|
|
145
|
+
if (appView.redirectAppViewRefs) {
|
|
146
|
+
allRefViews.push(...appView.redirectAppViewRefs);
|
|
147
|
+
}
|
|
148
|
+
if (appView.appViewRefs) {
|
|
149
|
+
allRefViews.push(...appView.appViewRefs);
|
|
150
|
+
}
|
|
151
|
+
const refView = allRefViews.find(view => {
|
|
149
152
|
const matchKey = view.name || view.id;
|
|
150
153
|
// 特殊补充 wfRdTag 匹配,子流程应用特殊模式
|
|
151
154
|
return matchKey === deRdTag || matchKey === rdTag || matchKey === wfRdTag;
|
|
@@ -153,14 +156,15 @@ export async function openDERedirectView(appView, context, params = {}, opts = {
|
|
|
153
156
|
if (refView) {
|
|
154
157
|
const viewId = refView.refAppViewId;
|
|
155
158
|
if (viewId) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
return {
|
|
160
|
+
type: 'view',
|
|
161
|
+
viewId,
|
|
162
|
+
context,
|
|
163
|
+
params,
|
|
164
|
+
opts: Object.assign(Object.assign({}, opts), { data: [curData] }),
|
|
165
|
+
};
|
|
163
166
|
}
|
|
167
|
+
throw new RuntimeModelError(refView, `未配置实际引用视图`);
|
|
164
168
|
}
|
|
165
169
|
else {
|
|
166
170
|
ibiz.log.error('重定向视图引用有:', allRefViews === null || allRefViews === void 0 ? void 0 : allRefViews.map(({ refAppViewId, name, realTitle }) => ({
|
|
@@ -170,7 +174,43 @@ export async function openDERedirectView(appView, context, params = {}, opts = {
|
|
|
170
174
|
})));
|
|
171
175
|
throw new RuntimeModelError(appView, `未找到重定向标识[${rdTag}]或[${deRdTag}]或工作流[${wfRdTag}]对应视图`);
|
|
172
176
|
}
|
|
173
|
-
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* 打开实体重定向视图
|
|
180
|
+
*
|
|
181
|
+
* @author chitanda
|
|
182
|
+
* @date 2022-09-28 16:09:15
|
|
183
|
+
* @export
|
|
184
|
+
* @param {IAppDERedirectView} appView
|
|
185
|
+
* @param {IContext}
|
|
186
|
+
* @param {IParams} [params={}]
|
|
187
|
+
* @param {IData[]} [data=[]]
|
|
188
|
+
* @return {*} {Promise<IModalData>}
|
|
189
|
+
*/
|
|
190
|
+
export async function openDERedirectView(appView, context, params = {}, opts = {}) {
|
|
191
|
+
let toView;
|
|
192
|
+
try {
|
|
193
|
+
toView = await getDERedirectToView(appView, context, params, opts);
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
ibiz.log.error(error);
|
|
197
|
+
return { ok: false, data: [] };
|
|
198
|
+
}
|
|
199
|
+
// 返回路径,则用window打开
|
|
200
|
+
if (toView.type === 'url') {
|
|
201
|
+
const openUrl = toView.url;
|
|
202
|
+
return new Promise(resolve => {
|
|
203
|
+
const newWindow = window.open(openUrl, '_blank');
|
|
204
|
+
if (newWindow) {
|
|
205
|
+
newWindow.callback = () => {
|
|
206
|
+
resolve({ ok: true, data: [] });
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
// 返回视图相关信息,则打开视图
|
|
212
|
+
const result = await ibiz.commands.execute(OpenAppViewCommand.TAG, toView.viewId, toView.context, toView.params, toView.opts);
|
|
213
|
+
return result || { ok: true, data: [] };
|
|
174
214
|
}
|
|
175
215
|
/**
|
|
176
216
|
* 计算重定向标识
|
|
@@ -193,7 +233,8 @@ export async function calcDERdTag(entity, rdView, params, data) {
|
|
|
193
233
|
const { codeName } = findFieldById(entity, typeFieldId);
|
|
194
234
|
const value = data[codeName.toLowerCase()];
|
|
195
235
|
if (notNilEmpty(value)) {
|
|
196
|
-
|
|
236
|
+
// 因为平台发布出来的标识全都是大写,所以这里也全部转大写
|
|
237
|
+
return `${value.toUpperCase()}`;
|
|
197
238
|
}
|
|
198
239
|
ibiz.log.warn(`重定向视图[${rdView.name}]自定义类别属性[${typeFieldId}]值为空`, data);
|
|
199
240
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IParentConfig } from '../../interface';
|
|
1
2
|
/**
|
|
2
3
|
* 界面域
|
|
3
4
|
*
|
|
@@ -15,6 +16,15 @@ export declare class UIDomain {
|
|
|
15
16
|
* @type {string}
|
|
16
17
|
*/
|
|
17
18
|
readonly id: string;
|
|
19
|
+
/**
|
|
20
|
+
* DTO 父子关系映射
|
|
21
|
+
*
|
|
22
|
+
* @author chitanda
|
|
23
|
+
* @date 2023-12-26 15:12:13
|
|
24
|
+
* @protected
|
|
25
|
+
* @type {Map<string, IParentConfig[]>}
|
|
26
|
+
*/
|
|
27
|
+
protected rsMap: Map<string, IParentConfig[]>;
|
|
18
28
|
/**
|
|
19
29
|
* Creates an instance of UIDomain.
|
|
20
30
|
*
|
|
@@ -24,6 +34,24 @@ export declare class UIDomain {
|
|
|
24
34
|
* @param {string} [id]
|
|
25
35
|
*/
|
|
26
36
|
constructor(id?: string);
|
|
37
|
+
/**
|
|
38
|
+
* 设置当前界面域下,指定实体的相关父关系以及属性。在 DTO 包解析时设置此参数,销毁时清空
|
|
39
|
+
*
|
|
40
|
+
* @author chitanda
|
|
41
|
+
* @date 2023-12-26 15:12:31
|
|
42
|
+
* @param {string} entity
|
|
43
|
+
* @param {IParentConfig} config
|
|
44
|
+
*/
|
|
45
|
+
setDERConfig(deCodeName: string, config: IParentConfig): void;
|
|
46
|
+
/**
|
|
47
|
+
* 获取当前界面域下,具体实体的关系(在数据加载完成之后才有值)
|
|
48
|
+
*
|
|
49
|
+
* @author chitanda
|
|
50
|
+
* @date 2023-12-26 16:12:07
|
|
51
|
+
* @param {string} deCodeName
|
|
52
|
+
* @return {*} {IParentConfig[]}
|
|
53
|
+
*/
|
|
54
|
+
getDERConfig(deCodeName: string): IParentConfig[];
|
|
27
55
|
/**
|
|
28
56
|
* 界面域销毁
|
|
29
57
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-domain.d.ts","sourceRoot":"","sources":["../../../src/utils/ui-domain/ui-domain.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ui-domain.d.ts","sourceRoot":"","sources":["../../../src/utils/ui-domain/ui-domain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;GAOG;AACH,qBAAa,QAAQ;IACnB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAAa;IAE1D;;;;;;;OAOG;gBACS,EAAE,CAAC,EAAE,MAAM;IAQvB;;;;;;;OAOG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI;IAQ7D;;;;;;;OAOG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,EAAE;IAOjD;;;;;OAKG;IACH,OAAO,IAAI,IAAI;CAWhB"}
|
|
@@ -17,6 +17,15 @@ export class UIDomain {
|
|
|
17
17
|
* @param {string} [id]
|
|
18
18
|
*/
|
|
19
19
|
constructor(id) {
|
|
20
|
+
/**
|
|
21
|
+
* DTO 父子关系映射
|
|
22
|
+
*
|
|
23
|
+
* @author chitanda
|
|
24
|
+
* @date 2023-12-26 15:12:13
|
|
25
|
+
* @protected
|
|
26
|
+
* @type {Map<string, IParentConfig[]>}
|
|
27
|
+
*/
|
|
28
|
+
this.rsMap = new Map();
|
|
20
29
|
if (id) {
|
|
21
30
|
this.id = id;
|
|
22
31
|
}
|
|
@@ -24,6 +33,35 @@ export class UIDomain {
|
|
|
24
33
|
this.id = createUUID();
|
|
25
34
|
}
|
|
26
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* 设置当前界面域下,指定实体的相关父关系以及属性。在 DTO 包解析时设置此参数,销毁时清空
|
|
38
|
+
*
|
|
39
|
+
* @author chitanda
|
|
40
|
+
* @date 2023-12-26 15:12:31
|
|
41
|
+
* @param {string} entity
|
|
42
|
+
* @param {IParentConfig} config
|
|
43
|
+
*/
|
|
44
|
+
setDERConfig(deCodeName, config) {
|
|
45
|
+
if (!this.rsMap.has(deCodeName)) {
|
|
46
|
+
this.rsMap.set(deCodeName, []);
|
|
47
|
+
}
|
|
48
|
+
const arr = this.rsMap.get(deCodeName);
|
|
49
|
+
arr.push(config);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 获取当前界面域下,具体实体的关系(在数据加载完成之后才有值)
|
|
53
|
+
*
|
|
54
|
+
* @author chitanda
|
|
55
|
+
* @date 2023-12-26 16:12:07
|
|
56
|
+
* @param {string} deCodeName
|
|
57
|
+
* @return {*} {IParentConfig[]}
|
|
58
|
+
*/
|
|
59
|
+
getDERConfig(deCodeName) {
|
|
60
|
+
if (this.rsMap.has(deCodeName)) {
|
|
61
|
+
return this.rsMap.get(deCodeName);
|
|
62
|
+
}
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
27
65
|
/**
|
|
28
66
|
* 界面域销毁
|
|
29
67
|
*
|
|
@@ -31,6 +69,8 @@ export class UIDomain {
|
|
|
31
69
|
* @date 2023-12-22 15:12:49
|
|
32
70
|
*/
|
|
33
71
|
destroy() {
|
|
72
|
+
// 清空当前域下的父子关系映射
|
|
73
|
+
this.rsMap.clear();
|
|
34
74
|
const apps = ibiz.hub.getAllApps();
|
|
35
75
|
apps.forEach(app => {
|
|
36
76
|
app.deService.reset({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-beta.1",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"author": "chitanda",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@ibiz-template/core": "^0.
|
|
33
|
-
"@ibiz/model-core": "^0.0.
|
|
32
|
+
"@ibiz-template/core": "^0.5.0-beta.0",
|
|
33
|
+
"@ibiz/model-core": "^0.0.29",
|
|
34
34
|
"@types/path-browserify": "^1.0.2",
|
|
35
35
|
"@types/qs": "^6.9.10",
|
|
36
36
|
"@types/systemjs": "^6.13.5",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"ramda": "^0.29.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@ibiz-template/core": "^0.
|
|
50
|
-
"@ibiz/model-core": "^0.0.
|
|
49
|
+
"@ibiz-template/core": "^0.5.0-beta.0",
|
|
50
|
+
"@ibiz/model-core": "^0.0.29",
|
|
51
51
|
"async-validator": "^4.2.5",
|
|
52
52
|
"dayjs": "^1.11.7",
|
|
53
53
|
"echarts": "^5.4.3",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"qx-util": "^0.4.8",
|
|
60
60
|
"ramda": "^0.29.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "30a5699d02d89a2755a595888a5f94c384f3b5fb"
|
|
63
63
|
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
IMDControlController,
|
|
7
7
|
IMDControlEvent,
|
|
8
8
|
IMDControlState,
|
|
9
|
+
IToolbarController,
|
|
9
10
|
MDCtrlLoadParams,
|
|
10
11
|
MDCtrlRemoveParams,
|
|
11
12
|
} from '../../../interface';
|
|
@@ -89,6 +90,38 @@ export class MDControlController<
|
|
|
89
90
|
*/
|
|
90
91
|
protected dataEntity!: IAppDataEntity;
|
|
91
92
|
|
|
93
|
+
/**
|
|
94
|
+
* 批操作工具栏
|
|
95
|
+
*
|
|
96
|
+
* @author zk
|
|
97
|
+
* @date 2023-08-02 06:08:34
|
|
98
|
+
* @readonly
|
|
99
|
+
* @type {(IToolbarController | undefined)}
|
|
100
|
+
* @memberof ListController
|
|
101
|
+
*/
|
|
102
|
+
protected get batchToolbarController(): IToolbarController | undefined {
|
|
103
|
+
const controller = this.view.getController(
|
|
104
|
+
`${this.model.name!}_batchtoolbar`,
|
|
105
|
+
);
|
|
106
|
+
return controller as IToolbarController;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 快速工具栏
|
|
111
|
+
*
|
|
112
|
+
* @author zk
|
|
113
|
+
* @date 2023-08-02 06:08:34
|
|
114
|
+
* @readonly
|
|
115
|
+
* @type {(IToolbarController | undefined)}
|
|
116
|
+
* @memberof ListController
|
|
117
|
+
*/
|
|
118
|
+
protected get quickToolbarController(): IToolbarController | undefined {
|
|
119
|
+
const controller = this.view.getController(
|
|
120
|
+
`${this.model.name!}_quicktoolbar`,
|
|
121
|
+
);
|
|
122
|
+
return controller as IToolbarController;
|
|
123
|
+
}
|
|
124
|
+
|
|
92
125
|
protected async onCreated(): Promise<void> {
|
|
93
126
|
await super.onCreated();
|
|
94
127
|
|
|
@@ -213,7 +246,10 @@ export class MDControlController<
|
|
|
213
246
|
if (this.state.isSimple) {
|
|
214
247
|
return [];
|
|
215
248
|
}
|
|
216
|
-
|
|
249
|
+
const silent = args.silent === true;
|
|
250
|
+
if (!silent) {
|
|
251
|
+
await this.startLoading();
|
|
252
|
+
}
|
|
217
253
|
try {
|
|
218
254
|
// *初始加载需要重置分页
|
|
219
255
|
const isInitialLoad = args.isInitialLoad === true;
|
|
@@ -253,7 +289,9 @@ export class MDControlController<
|
|
|
253
289
|
});
|
|
254
290
|
throw error;
|
|
255
291
|
} finally {
|
|
256
|
-
|
|
292
|
+
if (!silent) {
|
|
293
|
+
await this.endLoading();
|
|
294
|
+
}
|
|
257
295
|
}
|
|
258
296
|
|
|
259
297
|
this.state.items.forEach((item, index) => {
|
|
@@ -401,6 +439,16 @@ export class MDControlController<
|
|
|
401
439
|
data: selection,
|
|
402
440
|
});
|
|
403
441
|
}
|
|
442
|
+
// 根据数据计算工具栏权限和状态
|
|
443
|
+
const data = selection?.[0];
|
|
444
|
+
this.batchToolbarController?.calcButtonState(
|
|
445
|
+
data,
|
|
446
|
+
this.model.appDataEntityId,
|
|
447
|
+
);
|
|
448
|
+
this.quickToolbarController?.calcButtonState(
|
|
449
|
+
data,
|
|
450
|
+
this.model.appDataEntityId,
|
|
451
|
+
);
|
|
404
452
|
}
|
|
405
453
|
|
|
406
454
|
/**
|
|
@@ -297,15 +297,11 @@ export class FormDetailController<T extends IDEFormDetail = IDEFormDetail>
|
|
|
297
297
|
protected calcDynaClass(data: IData): void {
|
|
298
298
|
if (this.model.dynaClass) {
|
|
299
299
|
const dynaClass = calcDynaClass(this.model.dynaClass, data);
|
|
300
|
-
|
|
301
|
-
this.state.class.containerDyna = dynaClass;
|
|
302
|
-
}
|
|
300
|
+
this.state.class.containerDyna = dynaClass;
|
|
303
301
|
}
|
|
304
302
|
if (this.model.labelDynaClass) {
|
|
305
303
|
const dynaClass = calcDynaClass(this.model.labelDynaClass, data);
|
|
306
|
-
|
|
307
|
-
this.state.class.labelDyna = dynaClass;
|
|
308
|
-
}
|
|
304
|
+
this.state.class.labelDyna = dynaClass;
|
|
309
305
|
}
|
|
310
306
|
}
|
|
311
307
|
|