@ibiz-template/runtime 0.2.11 → 0.2.13
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 +223 -72
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +6 -0
- package/out/controller/control/calendar/calendar.controller.js +5 -5
- package/out/controller/control/chart/generator/base-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/base-series-generator.js +2 -2
- package/out/controller/control/exp-bar/calendar-exp-bar.controller.d.ts +1 -1
- package/out/controller/control/exp-bar/calendar-exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/calendar-exp-bar.controller.js +2 -2
- package/out/controller/control/exp-bar/exp-bar.controller.d.ts +3 -3
- package/out/controller/control/exp-bar/exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/exp-bar.controller.js +23 -10
- package/out/controller/control/exp-bar/tree-exp-bar.controller.d.ts +13 -1
- package/out/controller/control/exp-bar/tree-exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/tree-exp-bar.controller.js +29 -12
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-data-view/form-mdctrl-data-view.controller.d.ts +3 -3
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-data-view/form-mdctrl-data-view.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-data-view/form-mdctrl-data-view.controller.js +7 -3
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.controller.d.ts +2 -2
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.controller.js +2 -2
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-grid/form-mdctrl-grid.controller.d.ts +3 -3
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-grid/form-mdctrl-grid.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-grid/form-mdctrl-grid.controller.js +13 -3
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-list/form-mdctrl-list.controller.d.ts +2 -2
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-list/form-mdctrl-list.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-list/form-mdctrl-list.controller.js +6 -2
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.js +4 -3
- package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.js +3 -3
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts +11 -1
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts.map +1 -1
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.js +27 -14
- package/out/controller/control/tree/tree.controller.d.ts +1 -0
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +25 -0
- package/out/controller/utils/index.d.ts +1 -0
- package/out/controller/utils/index.d.ts.map +1 -1
- package/out/controller/utils/index.js +1 -0
- package/out/controller/utils/route/route.d.ts +10 -0
- package/out/controller/utils/route/route.d.ts.map +1 -0
- package/out/controller/utils/route/route.js +11 -0
- package/out/controller/utils/view-msg/view-msg-controller.d.ts.map +1 -1
- package/out/controller/utils/view-msg/view-msg-controller.js +10 -1
- package/out/interface/controller/common/i-nav-view-msg/i-nav-view-msg.d.ts +18 -0
- package/out/interface/controller/common/i-nav-view-msg/i-nav-view-msg.d.ts.map +1 -1
- package/out/interface/controller/common/view-message/i-view-message.d.ts +9 -0
- package/out/interface/controller/common/view-message/i-view-message.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-exp-bar-control.controller.d.ts +1 -1
- package/out/interface/controller/controller/control/i-exp-bar-control.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-tree.controller.d.ts +8 -0
- package/out/interface/controller/controller/control/i-tree.controller.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-tree.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-tree.state.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-action-executor.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-action-executor.js +4 -0
- package/out/service/service/entity/util/util.d.ts +1 -0
- package/out/service/service/entity/util/util.d.ts.map +1 -1
- package/out/service/service/entity/util/util.js +1 -0
- package/out/service/service/work-flow/work-flow.service.d.ts +11 -0
- package/out/service/service/work-flow/work-flow.service.d.ts.map +1 -1
- package/out/service/service/work-flow/work-flow.service.js +15 -2
- package/out/service/vo/control.vo.d.ts.map +1 -1
- package/out/service/vo/control.vo.js +11 -0
- package/out/service/vo/tree-node-data/tree-code-list-node-data.d.ts +0 -1
- package/out/service/vo/tree-node-data/tree-code-list-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-code-list-node-data.js +0 -1
- package/out/ui-action/provider/backend-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/backend-ui-action-provider.js +3 -1
- package/package.json +3 -4
- package/src/controller/common/view/view.controller.ts +6 -0
- package/src/controller/control/calendar/calendar.controller.ts +5 -5
- package/src/controller/control/chart/generator/base-series-generator.ts +5 -2
- package/src/controller/control/exp-bar/calendar-exp-bar.controller.ts +2 -2
- package/src/controller/control/exp-bar/exp-bar.controller.ts +24 -13
- package/src/controller/control/exp-bar/tree-exp-bar.controller.ts +30 -11
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-data-view/form-mdctrl-data-view.controller.ts +7 -4
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.controller.ts +2 -2
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-grid/form-mdctrl-grid.controller.ts +14 -5
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-list/form-mdctrl-list.controller.ts +6 -3
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.ts +4 -3
- package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +3 -3
- package/src/controller/control/tab-exp-panel/tab-exp-panel.controller.ts +31 -11
- package/src/controller/control/tree/tree.controller.ts +36 -0
- package/src/controller/utils/index.ts +1 -0
- package/src/controller/utils/route/route.ts +11 -0
- package/src/controller/utils/view-msg/view-msg-controller.ts +11 -1
- package/src/interface/controller/common/i-nav-view-msg/i-nav-view-msg.ts +20 -0
- package/src/interface/controller/common/view-message/i-view-message.ts +10 -0
- package/src/interface/controller/controller/control/i-exp-bar-control.controller.ts +1 -1
- package/src/interface/controller/controller/control/i-tree.controller.ts +9 -0
- package/src/interface/controller/state/control/i-tree.state.ts +8 -0
- package/src/logic-scheduler/executor/app-ui-action-executor.ts +8 -1
- package/src/service/service/entity/util/util.ts +1 -0
- package/src/service/service/work-flow/work-flow.service.ts +20 -2
- package/src/service/vo/control.vo.ts +12 -0
- package/src/service/vo/tree-node-data/tree-code-list-node-data.ts +0 -3
- package/src/ui-action/provider/backend-ui-action-provider.ts +5 -1
|
@@ -464,6 +464,12 @@ export class ViewController<
|
|
|
464
464
|
title: message.title!,
|
|
465
465
|
desc: message.message,
|
|
466
466
|
};
|
|
467
|
+
// userTag为确认按钮文本
|
|
468
|
+
if (message.extraParams.userTag) {
|
|
469
|
+
Object.assign(modalParams, {
|
|
470
|
+
confirmButtonText: message.extraParams.userTag,
|
|
471
|
+
});
|
|
472
|
+
}
|
|
467
473
|
if (message.messageType === 'WARN') {
|
|
468
474
|
await ibiz.modal.warning(modalParams);
|
|
469
475
|
} else if (message.messageType === 'ERROR') {
|
|
@@ -106,8 +106,8 @@ export class CalendarController
|
|
|
106
106
|
*/
|
|
107
107
|
protected getCurSelectDate(param: IParams): IData {
|
|
108
108
|
const { selectedDate } = this.state;
|
|
109
|
-
const {
|
|
110
|
-
if (!
|
|
109
|
+
const { srfstartdate, srfenddate } = param;
|
|
110
|
+
if (!srfstartdate || !srfenddate) {
|
|
111
111
|
// 获取当前月份的第一天
|
|
112
112
|
const firstDayOfMonth = new Date(
|
|
113
113
|
selectedDate.getFullYear(),
|
|
@@ -121,11 +121,11 @@ export class CalendarController
|
|
|
121
121
|
1,
|
|
122
122
|
);
|
|
123
123
|
return {
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
srfstartdate: dayjs(firstDayOfMonth).format('YYYY-MM-DD HH:mm:ss'),
|
|
125
|
+
srfenddate: dayjs(lastDayOfMonth).format('YYYY-MM-DD HH:mm:ss'),
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
return {
|
|
128
|
+
return { srfstartdate, srfenddate };
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RuntimeModelError, toNumberOrNil } from '@ibiz-template/core';
|
|
1
|
+
import { plus, RuntimeModelError, toNumberOrNil } from '@ibiz-template/core';
|
|
2
2
|
import {
|
|
3
3
|
IChartSeriesCSCartesian2DEncode,
|
|
4
4
|
IDEChartSeries,
|
|
@@ -282,7 +282,10 @@ export class BaseSeriesGenerator<T extends IDEChartSeries = IDEChartSeries> {
|
|
|
282
282
|
groupData[group].set(catalog, { value: 0 });
|
|
283
283
|
}
|
|
284
284
|
// 相同分类属性的值属性数据累加
|
|
285
|
-
groupData[group].get(catalog)!.value
|
|
285
|
+
groupData[group].get(catalog)!.value = plus(
|
|
286
|
+
groupData[group].get(catalog)!.value,
|
|
287
|
+
item[this.valueField],
|
|
288
|
+
);
|
|
286
289
|
groupData[group].get(catalog)!.deData = item;
|
|
287
290
|
});
|
|
288
291
|
|
|
@@ -60,12 +60,12 @@ export class CalendarExpBarController
|
|
|
60
60
|
return controller as ICalendarController;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
public
|
|
63
|
+
public navBySrfnav(): void {
|
|
64
64
|
const selectItem: ICalendarItemData | undefined =
|
|
65
65
|
this.xDataController?.state.items.find(
|
|
66
66
|
item => item.navId === this.state.srfnav,
|
|
67
67
|
);
|
|
68
|
-
super.
|
|
68
|
+
super.navBySrfnav();
|
|
69
69
|
if (!selectItem) {
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
import { calcDeCodeNameById } from '../../../model';
|
|
23
23
|
import { calcNavParams } from '../../../utils';
|
|
24
24
|
import { ControlController } from '../../common';
|
|
25
|
-
import { ControllerEvent } from '../../utils';
|
|
25
|
+
import { ControllerEvent, hasSubRoute } from '../../utils';
|
|
26
26
|
|
|
27
27
|
type XDataControlModel = IDEGrid | IDEList | IDEDataView;
|
|
28
28
|
|
|
@@ -229,7 +229,7 @@ export class ExpBarControlController<
|
|
|
229
229
|
this.xDataLoadSuccess(event);
|
|
230
230
|
});
|
|
231
231
|
this.xDataController.evt.on('onRemoveSuccess', () => {
|
|
232
|
-
this.
|
|
232
|
+
this.navByFirstItem();
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
235
|
|
|
@@ -261,10 +261,10 @@ export class ExpBarControlController<
|
|
|
261
261
|
// 只处理默认第一次加载
|
|
262
262
|
if (this.state.srfnav && this.routeDepth) {
|
|
263
263
|
// 路由srfnav回显
|
|
264
|
-
this.
|
|
264
|
+
this.navBySrfnav();
|
|
265
265
|
} else {
|
|
266
266
|
// 默认选中第一条并导航
|
|
267
|
-
this.
|
|
267
|
+
this.navByFirstItem();
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
}
|
|
@@ -275,17 +275,14 @@ export class ExpBarControlController<
|
|
|
275
275
|
* @date 2023-08-10 04:04:08
|
|
276
276
|
* @protected
|
|
277
277
|
*/
|
|
278
|
-
protected
|
|
278
|
+
protected navBySrfnav(): void {
|
|
279
279
|
// 找到选中项,如果没有就模拟选中数据
|
|
280
280
|
const selectItem = this.xDataController?.state.items.find(
|
|
281
281
|
item => item[this.navKeyName] === this.state.srfnav,
|
|
282
282
|
);
|
|
283
283
|
|
|
284
284
|
// 是否是路由模式且有子路由
|
|
285
|
-
const routeAndHasSub =
|
|
286
|
-
this.routeDepth &&
|
|
287
|
-
window.location.hash.split('/').length > this.routeDepth * 2 + 2;
|
|
288
|
-
|
|
285
|
+
const routeAndHasSub = this.routeDepth && hasSubRoute(this.routeDepth);
|
|
289
286
|
if (routeAndHasSub) {
|
|
290
287
|
if (selectItem) {
|
|
291
288
|
// 在多数据部件里面选项设置回显。
|
|
@@ -295,14 +292,28 @@ export class ExpBarControlController<
|
|
|
295
292
|
this._evt.emit('onNavViewChange', {
|
|
296
293
|
navViewMsg: {
|
|
297
294
|
key: this.state.srfnav,
|
|
295
|
+
isRoutePushed: true,
|
|
298
296
|
isCache: this.isCache,
|
|
299
297
|
},
|
|
300
298
|
context: this.context,
|
|
301
299
|
});
|
|
302
|
-
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (selectItem) {
|
|
303
304
|
// 非路由模式,或者有路由模式下有srfnav没有子路由时,需要在多数据部件里面选项设置回显。
|
|
304
305
|
this.xDataController.setActive(selectItem);
|
|
305
306
|
this.xDataController.setSelection([selectItem]);
|
|
307
|
+
} else {
|
|
308
|
+
// 找不到匹配的选中项的情况,告诉导航占位显示404
|
|
309
|
+
this._evt.emit('onNavViewChange', {
|
|
310
|
+
navViewMsg: {
|
|
311
|
+
key: this.state.srfnav,
|
|
312
|
+
is404: true,
|
|
313
|
+
isCache: this.isCache,
|
|
314
|
+
},
|
|
315
|
+
context: this.context,
|
|
316
|
+
});
|
|
306
317
|
}
|
|
307
318
|
}
|
|
308
319
|
|
|
@@ -314,7 +325,7 @@ export class ExpBarControlController<
|
|
|
314
325
|
* @date 2023-08-10 03:58:15
|
|
315
326
|
* @protected
|
|
316
327
|
*/
|
|
317
|
-
protected
|
|
328
|
+
protected navByFirstItem(): void {
|
|
318
329
|
const data = this.xDataController.state.items[0];
|
|
319
330
|
if (!data) {
|
|
320
331
|
// 导航视图传空让他导航占位绘制空界面
|
|
@@ -474,10 +485,10 @@ export class ExpBarControlController<
|
|
|
474
485
|
* @date 2023-09-14 07:03:39
|
|
475
486
|
* @param {{ srfnav?: string; path: string }} info 当前系统的路由的从一级到最后一级的所有路径。
|
|
476
487
|
*/
|
|
477
|
-
onRouterChange(info: { srfnav: string; path: string }): void {
|
|
488
|
+
async onRouterChange(info: { srfnav: string; path: string }): Promise<void> {
|
|
478
489
|
if (this.state.srfnav !== info.srfnav) {
|
|
479
490
|
this.state.srfnav = info.srfnav;
|
|
480
|
-
this.
|
|
491
|
+
this.navBySrfnav();
|
|
481
492
|
}
|
|
482
493
|
}
|
|
483
494
|
}
|
|
@@ -128,7 +128,7 @@ export class TreeExpBarController
|
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
protected
|
|
131
|
+
protected navByFirstItem(): void {
|
|
132
132
|
const data = this.xDataController.state.items.find(node => {
|
|
133
133
|
// 根节点不显示的时候排除根节点
|
|
134
134
|
if (
|
|
@@ -165,16 +165,35 @@ export class TreeExpBarController
|
|
|
165
165
|
|
|
166
166
|
// 计算树的默认展开集合
|
|
167
167
|
if (this.state.srfnav) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
168
|
+
this.defaultExpandedKeys = this.calcExpandKeys(this.state.srfnav);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 根据srfnav计算需要展开的节点标识
|
|
174
|
+
* @author lxm
|
|
175
|
+
* @date 2023-11-07 02:42:45
|
|
176
|
+
* @param {string} srfnav
|
|
177
|
+
* @return {*} {string[]}
|
|
178
|
+
*/
|
|
179
|
+
calcExpandKeys(srfnav: string): string[] {
|
|
180
|
+
const expandedKeys: string[] = [];
|
|
181
|
+
srfnav.split(':').forEach((item, index) => {
|
|
182
|
+
if (index === 0) {
|
|
183
|
+
expandedKeys.push(item);
|
|
184
|
+
} else {
|
|
185
|
+
expandedKeys.push(`${expandedKeys[index - 1]}:${item}`);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
expandedKeys.pop(); // 删除最后一个
|
|
189
|
+
return expandedKeys;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
async onRouterChange(info: { srfnav: string; path: string }): Promise<void> {
|
|
193
|
+
if (this.state.srfnav !== info.srfnav) {
|
|
194
|
+
const expandKeys = this.calcExpandKeys(info.srfnav);
|
|
195
|
+
await this.xDataController.expandNodeByKey(expandKeys);
|
|
178
196
|
}
|
|
197
|
+
await super.onRouterChange(info);
|
|
179
198
|
}
|
|
180
199
|
}
|
|
@@ -20,7 +20,7 @@ export class FormMDCtrlDataViewController extends FormMDCtrlControlController {
|
|
|
20
20
|
* @type {IListController}
|
|
21
21
|
* @memberof FormMDCtrlDataViewController
|
|
22
22
|
*/
|
|
23
|
-
dataViewController
|
|
23
|
+
dataViewController?: IListController;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* 表格选中数据
|
|
@@ -43,14 +43,14 @@ export class FormMDCtrlDataViewController extends FormMDCtrlControlController {
|
|
|
43
43
|
state: { isSelect: boolean } = { isSelect: false };
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* 卡片挂载后把控制器抛出来
|
|
47
47
|
*
|
|
48
48
|
* @author zk
|
|
49
49
|
* @date 2023-07-30 07:07:25
|
|
50
50
|
* @param {EventBase} event
|
|
51
51
|
* @memberof FormMDCtrlDataViewController
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
onDataViewCreated(event: EventBase): void {
|
|
54
54
|
this.dataViewController = event.ctrl as IListController;
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -75,6 +75,9 @@ export class FormMDCtrlDataViewController extends FormMDCtrlControlController {
|
|
|
75
75
|
* @memberof FormMDCtrlController
|
|
76
76
|
*/
|
|
77
77
|
onDataRemove(): void {
|
|
78
|
+
if (!this.dataViewController) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
78
81
|
this.dataViewController.remove();
|
|
79
82
|
this.parent.state.contentCtrlData = this.dataViewController.state.items;
|
|
80
83
|
this.parent.setFormDataValue();
|
|
@@ -101,7 +104,7 @@ export class FormMDCtrlDataViewController extends FormMDCtrlControlController {
|
|
|
101
104
|
* @memberof FormMDCtrlContentTypeController
|
|
102
105
|
*/
|
|
103
106
|
async initData(): Promise<void> {
|
|
104
|
-
this.dataViewController
|
|
107
|
+
this.dataViewController?.load();
|
|
105
108
|
}
|
|
106
109
|
|
|
107
110
|
/**
|
|
@@ -45,14 +45,14 @@ export class FormMDCtrlFormController extends FormMDCtrlControlController {
|
|
|
45
45
|
service!: EditFormService;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* 表单初始化后把控制器抛出来
|
|
49
49
|
*
|
|
50
50
|
* @author zk
|
|
51
51
|
* @date 2023-07-30 07:07:25
|
|
52
52
|
* @param {EventBase} event
|
|
53
53
|
* @memberof FormMDCtrlGridController
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
onControlCreated(event: EventBase, index: number): void {
|
|
56
56
|
const formController = event.ctrl as IEditFormController;
|
|
57
57
|
this.controlControllerArray[index] = formController;
|
|
58
58
|
formController.load();
|
|
@@ -22,7 +22,7 @@ export class FormMDCtrlGridController extends FormMDCtrlControlController {
|
|
|
22
22
|
* @type {IGridController}
|
|
23
23
|
* @memberof FormMDCtrlGridController
|
|
24
24
|
*/
|
|
25
|
-
gridController
|
|
25
|
+
gridController?: IGridController;
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* 表格选中数据
|
|
@@ -45,14 +45,14 @@ export class FormMDCtrlGridController extends FormMDCtrlControlController {
|
|
|
45
45
|
state: { isSelect: boolean } = { isSelect: false };
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* 表格初始化后把控制器抛出来
|
|
49
49
|
*
|
|
50
50
|
* @author zk
|
|
51
51
|
* @date 2023-07-30 07:07:25
|
|
52
52
|
* @param {EventBase} event
|
|
53
53
|
* @memberof FormMDCtrlGridController
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
onGridCreated(event: EventBase): void {
|
|
56
56
|
this.gridController = event.ctrl as IGridController;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -77,6 +77,9 @@ export class FormMDCtrlGridController extends FormMDCtrlControlController {
|
|
|
77
77
|
* @memberof FormMDCtrlController
|
|
78
78
|
*/
|
|
79
79
|
onDataRemove(): void {
|
|
80
|
+
if (!this.gridController) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
80
83
|
this.gridController.remove();
|
|
81
84
|
this.parent.state.contentCtrlData = this.gridController.state.items;
|
|
82
85
|
this.parent.setFormDataValue();
|
|
@@ -103,7 +106,7 @@ export class FormMDCtrlGridController extends FormMDCtrlControlController {
|
|
|
103
106
|
* @memberof FormMDCtrlContentTypeController
|
|
104
107
|
*/
|
|
105
108
|
async initData(): Promise<void> {
|
|
106
|
-
this.gridController
|
|
109
|
+
this.gridController?.load();
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
/**
|
|
@@ -115,6 +118,9 @@ export class FormMDCtrlGridController extends FormMDCtrlControlController {
|
|
|
115
118
|
* @memberof FormMDCtrlContentTypeController
|
|
116
119
|
*/
|
|
117
120
|
async onDataInsert(): Promise<void> {
|
|
121
|
+
if (!this.gridController) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
118
124
|
await this.gridController.newRow();
|
|
119
125
|
this.parent.state.contentCtrlData = this.gridController.state.items;
|
|
120
126
|
this.parent.setFormDataValue();
|
|
@@ -150,9 +156,12 @@ export class FormMDCtrlGridController extends FormMDCtrlControlController {
|
|
|
150
156
|
* @memberof FormMDCtrlFormController
|
|
151
157
|
*/
|
|
152
158
|
async validate(): Promise<boolean> {
|
|
159
|
+
if (!this.gridController) {
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
153
162
|
const { rows } = this.gridController.state;
|
|
154
163
|
const values = await Promise.all(
|
|
155
|
-
rows.map(row => this.gridController
|
|
164
|
+
rows.map(row => this.gridController!.validate(row)),
|
|
156
165
|
);
|
|
157
166
|
|
|
158
167
|
// 找不到value为false即全部是true
|
|
@@ -20,7 +20,7 @@ export class FormMDCtrlListController extends FormMDCtrlControlController {
|
|
|
20
20
|
* @type {IListController}
|
|
21
21
|
* @memberof FormMDCtrlListController
|
|
22
22
|
*/
|
|
23
|
-
listController
|
|
23
|
+
listController?: IListController;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* 表格选中数据
|
|
@@ -50,7 +50,7 @@ export class FormMDCtrlListController extends FormMDCtrlControlController {
|
|
|
50
50
|
* @param {EventBase} event
|
|
51
51
|
* @memberof FormMDCtrlListController
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
onListCreated(event: EventBase): void {
|
|
54
54
|
this.listController = event.ctrl as IListController;
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -75,6 +75,9 @@ export class FormMDCtrlListController extends FormMDCtrlControlController {
|
|
|
75
75
|
* @memberof FormMDCtrlController
|
|
76
76
|
*/
|
|
77
77
|
onDataRemove(): void {
|
|
78
|
+
if (!this.listController) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
78
81
|
this.listController.remove();
|
|
79
82
|
this.parent.state.contentCtrlData = this.listController.state.items;
|
|
80
83
|
this.parent.setFormDataValue();
|
|
@@ -101,7 +104,7 @@ export class FormMDCtrlListController extends FormMDCtrlControlController {
|
|
|
101
104
|
* @memberof FormMDCtrlContentTypeController
|
|
102
105
|
*/
|
|
103
106
|
async initData(): Promise<void> {
|
|
104
|
-
this.listController
|
|
107
|
+
this.listController?.load();
|
|
105
108
|
}
|
|
106
109
|
|
|
107
110
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IControl, IDEFormDetail, IDEFormMDCtrl } from '@ibiz/model-core';
|
|
2
|
+
import { clone } from 'ramda';
|
|
2
3
|
import { IFormController } from '../../../../../../../interface';
|
|
3
4
|
import { findChildFormDetails } from '../../../../../../../model';
|
|
4
5
|
import { getFormDetailProvider } from '../../../../../../../register';
|
|
@@ -29,10 +30,10 @@ export class FormMDCtrlItemController
|
|
|
29
30
|
data: IData,
|
|
30
31
|
form: FormController,
|
|
31
32
|
) {
|
|
32
|
-
const
|
|
33
|
+
const tempModel = clone(form.model);
|
|
33
34
|
// 合并父级表单模型 兼容值规则 和 父表单模型
|
|
34
|
-
Object.assign(
|
|
35
|
-
super(
|
|
35
|
+
Object.assign(tempModel, model, { name: undefined });
|
|
36
|
+
super(tempModel, context, params, ctx);
|
|
36
37
|
this.state.data = data;
|
|
37
38
|
this.state.isSimple = true;
|
|
38
39
|
}
|
package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
import { DataTypes, ModelError } from '@ibiz-template/core';
|
|
2
|
+
import { DataTypes, ModelError, plus } from '@ibiz-template/core';
|
|
3
3
|
import { IAppCodeList, IDEGridFieldColumn } from '@ibiz/model-core';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import { debounce } from 'lodash-es';
|
|
@@ -236,13 +236,13 @@ export class GridFieldColumnController extends GridColumnController<IDEGridField
|
|
|
236
236
|
case 'SUM':
|
|
237
237
|
aggValue = items
|
|
238
238
|
.map(item => item[fieldName] as number)
|
|
239
|
-
.reduce((a, b) => a
|
|
239
|
+
.reduce((a, b) => plus(a, b), 0);
|
|
240
240
|
break;
|
|
241
241
|
case 'AVG':
|
|
242
242
|
aggValue =
|
|
243
243
|
items
|
|
244
244
|
.map(item => item[fieldName] as number)
|
|
245
|
-
.reduce((a, b) => a
|
|
245
|
+
.reduce((a, b) => plus(a, b), 0) / items.length;
|
|
246
246
|
break;
|
|
247
247
|
case 'MAX':
|
|
248
248
|
aggValue = Math.max(...items.map(item => item[fieldName] as number));
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import { calcDeCodeNameById } from '../../../model';
|
|
10
10
|
import { calcNavParams } from '../../../utils';
|
|
11
11
|
import { ControlController } from '../../common';
|
|
12
|
+
import { hasSubRoute } from '../../utils';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* 分页导航面板
|
|
@@ -57,6 +58,19 @@ export class TabExpPanelController
|
|
|
57
58
|
return ibiz.config.view.expCacheMode.includes(this.model.controlType!);
|
|
58
59
|
}
|
|
59
60
|
|
|
61
|
+
/**
|
|
62
|
+
* 当前路由视图的层级
|
|
63
|
+
*
|
|
64
|
+
* @author zk
|
|
65
|
+
* @date 2023-07-11 10:07:20
|
|
66
|
+
* @readonly
|
|
67
|
+
* @type {(number | undefined)}
|
|
68
|
+
* @memberof ExpBarControlController
|
|
69
|
+
*/
|
|
70
|
+
get routeDepth(): number | undefined {
|
|
71
|
+
return this.view.modal.routeDepth;
|
|
72
|
+
}
|
|
73
|
+
|
|
60
74
|
/**
|
|
61
75
|
* 初始化state的属性
|
|
62
76
|
*
|
|
@@ -141,23 +155,25 @@ export class TabExpPanelController
|
|
|
141
155
|
* @memberof TabExpPanelController
|
|
142
156
|
*/
|
|
143
157
|
initDefaultPage(): void {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
this.handleTabChange();
|
|
147
|
-
};
|
|
148
|
-
if (!this.state.defaultTabName) {
|
|
149
|
-
initFirstPage();
|
|
150
|
-
} else {
|
|
158
|
+
// 跳转指定的默认分页
|
|
159
|
+
if (this.state.defaultTabName) {
|
|
151
160
|
const activeTab = this.state.tabPages.find(
|
|
152
161
|
item => item.tabTag === this.state.defaultTabName,
|
|
153
162
|
);
|
|
154
|
-
if (
|
|
155
|
-
initFirstPage();
|
|
156
|
-
} else {
|
|
163
|
+
if (activeTab) {
|
|
157
164
|
this.state.activeName = activeTab.tabTag;
|
|
158
|
-
this.changeToTab(
|
|
165
|
+
this.changeToTab(
|
|
166
|
+
this.activeTabViewPanelModel,
|
|
167
|
+
// 路由模式下并且有子路由
|
|
168
|
+
this.routeDepth !== undefined && hasSubRoute(this.routeDepth),
|
|
169
|
+
);
|
|
170
|
+
return;
|
|
159
171
|
}
|
|
160
172
|
}
|
|
173
|
+
|
|
174
|
+
// 没有默认分页或者匹配不到时,跳转第一个分页
|
|
175
|
+
this.state.activeName = this.state.tabPages[0].tabTag;
|
|
176
|
+
this.handleTabChange();
|
|
161
177
|
}
|
|
162
178
|
|
|
163
179
|
/**
|
|
@@ -169,8 +185,12 @@ export class TabExpPanelController
|
|
|
169
185
|
*/
|
|
170
186
|
protected changeToTab(
|
|
171
187
|
tab: IDETabViewPanel = this.activeTabViewPanelModel!,
|
|
188
|
+
isRoutePushed = false,
|
|
172
189
|
): void {
|
|
173
190
|
const navViewMsg = this.getNavViewMsg(tab);
|
|
191
|
+
if (isRoutePushed === true) {
|
|
192
|
+
navViewMsg.isRoutePushed = true;
|
|
193
|
+
}
|
|
174
194
|
this.evt.emit('onNavViewChange', { navViewMsg });
|
|
175
195
|
}
|
|
176
196
|
|
|
@@ -41,6 +41,7 @@ export class TreeController
|
|
|
41
41
|
// 根节点初始化
|
|
42
42
|
this.state.defaultExpandedKeys = [];
|
|
43
43
|
this.state.expandedKeys = [];
|
|
44
|
+
this.state.navigational = false;
|
|
44
45
|
this.state.size = 0;
|
|
45
46
|
}
|
|
46
47
|
|
|
@@ -154,6 +155,14 @@ export class TreeController
|
|
|
154
155
|
* @memberof TreeController
|
|
155
156
|
*/
|
|
156
157
|
async onTreeNodeClick(nodeData: ITreeNodeData): Promise<void> {
|
|
158
|
+
// 导航的时候,没有导航视图的时候,节点后续点击逻辑都不走,也不选中
|
|
159
|
+
if (this.state.navigational) {
|
|
160
|
+
const nodeModel = this.getNodeModel(nodeData.nodeId);
|
|
161
|
+
if (!nodeModel?.navAppViewId) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
157
166
|
// 单选时,单击才会触发选中逻辑
|
|
158
167
|
if (this.state.singleSelect) {
|
|
159
168
|
// 选中相关处理
|
|
@@ -363,4 +372,31 @@ export class TreeController
|
|
|
363
372
|
children: nodes,
|
|
364
373
|
});
|
|
365
374
|
}
|
|
375
|
+
|
|
376
|
+
async expandNodeByKey(expandKeys: string[]): Promise<void> {
|
|
377
|
+
const noExpandKeys = expandKeys.filter(
|
|
378
|
+
key => !this.state.expandedKeys.includes(key),
|
|
379
|
+
);
|
|
380
|
+
if (noExpandKeys.length === 0) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// 找到已存在的要展开的节点
|
|
385
|
+
const existNodes = this.state.items.filter(item =>
|
|
386
|
+
noExpandKeys.includes(item.id),
|
|
387
|
+
);
|
|
388
|
+
|
|
389
|
+
// 补充所有未展开的节点标识,查询过程中会自动加载后续展开
|
|
390
|
+
this.state.expandedKeys.push(...noExpandKeys);
|
|
391
|
+
|
|
392
|
+
if (existNodes.length === 0) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
// 展开加载节点
|
|
396
|
+
await Promise.all(
|
|
397
|
+
existNodes.map(node => {
|
|
398
|
+
return this.loadNodes(node);
|
|
399
|
+
}),
|
|
400
|
+
);
|
|
401
|
+
}
|
|
366
402
|
}
|
|
@@ -2,6 +2,7 @@ export * from './counter';
|
|
|
2
2
|
export * from './loading/loading.state';
|
|
3
3
|
export * from './button-state';
|
|
4
4
|
export * from './event';
|
|
5
|
+
export * from './route/route';
|
|
5
6
|
export * from './util/util';
|
|
6
7
|
export * from './value-rule/value-rule';
|
|
7
8
|
export * from './value-ex/value-ex';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 是否有子路由路径
|
|
3
|
+
* @author lxm
|
|
4
|
+
* @date 2023-11-08 10:12:54
|
|
5
|
+
* @export
|
|
6
|
+
* @param {number} routeDepth
|
|
7
|
+
* @return {*} {boolean}
|
|
8
|
+
*/
|
|
9
|
+
export function hasSubRoute(routeDepth: number): boolean {
|
|
10
|
+
return window.location.hash.split('/').length > routeDepth * 2 + 2;
|
|
11
|
+
}
|
|
@@ -146,13 +146,16 @@ export class ViewMsgController {
|
|
|
146
146
|
*/
|
|
147
147
|
protected calcStaticMsg(detail: IAppViewMsgGroupDetail): IViewMessage {
|
|
148
148
|
const { position: position1 } = detail;
|
|
149
|
+
const viewMsg = this.viewMsgMap.get(detail.appViewMsgId!)!;
|
|
149
150
|
const {
|
|
150
151
|
title,
|
|
151
152
|
message,
|
|
152
153
|
removeMode,
|
|
153
154
|
position: position2,
|
|
154
155
|
messageType,
|
|
155
|
-
} =
|
|
156
|
+
} = viewMsg;
|
|
157
|
+
const { userTag, userTag2, userTag3, userTag4 } = viewMsg as IData;
|
|
158
|
+
|
|
156
159
|
// detail里的位置优先
|
|
157
160
|
const position = position1 || position2;
|
|
158
161
|
return {
|
|
@@ -161,6 +164,13 @@ export class ViewMsgController {
|
|
|
161
164
|
position,
|
|
162
165
|
messageType,
|
|
163
166
|
removeMode,
|
|
167
|
+
// 额外参数
|
|
168
|
+
extraParams: {
|
|
169
|
+
userTag,
|
|
170
|
+
userTag2,
|
|
171
|
+
userTag3,
|
|
172
|
+
userTag4,
|
|
173
|
+
},
|
|
164
174
|
};
|
|
165
175
|
}
|
|
166
176
|
|
|
@@ -46,6 +46,16 @@ export interface INavViewMsg {
|
|
|
46
46
|
*/
|
|
47
47
|
viewId?: string;
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* 是否路由已经跳转
|
|
51
|
+
*
|
|
52
|
+
* @author zk
|
|
53
|
+
* @date 2023-09-26 06:09:17
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof INavViewMsg
|
|
56
|
+
*/
|
|
57
|
+
isRoutePushed?: boolean;
|
|
58
|
+
|
|
49
59
|
/**
|
|
50
60
|
* 是否缓存
|
|
51
61
|
*
|
|
@@ -55,4 +65,14 @@ export interface INavViewMsg {
|
|
|
55
65
|
* @memberof INavViewMsg
|
|
56
66
|
*/
|
|
57
67
|
isCache?: boolean;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 是否404
|
|
71
|
+
*
|
|
72
|
+
* @author zk
|
|
73
|
+
* @date 2023-09-26 06:09:17
|
|
74
|
+
* @type {string}
|
|
75
|
+
* @memberof INavViewMsg
|
|
76
|
+
*/
|
|
77
|
+
is404?: boolean;
|
|
58
78
|
}
|