@ibiz-template/runtime 0.1.12-dev.0 → 0.1.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 +6294 -371
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +9 -0
- package/out/controller/common/editor/editor.controller.d.ts +1 -1
- package/out/controller/common/editor/editor.controller.d.ts.map +1 -1
- package/out/controller/common/editor/editor.controller.js +2 -4
- package/out/controller/control/app-menu/app-menu.controller.d.ts +1 -1
- package/out/controller/control/app-menu/app-menu.controller.d.ts.map +1 -1
- package/out/controller/control/app-menu/app-menu.controller.js +2 -2
- package/out/controller/control/caption-bar/caption-bar.controller.d.ts.map +1 -1
- package/out/controller/control/caption-bar/caption-bar.controller.js +1 -2
- package/out/controller/control/chart/chart.controller.js +1 -1
- package/out/controller/control/chart/generator/base-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/base-series-generator.js +5 -4
- package/out/controller/control/chart/generator/chart-options-generator.d.ts +25 -1
- package/out/controller/control/chart/generator/chart-options-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/chart-options-generator.js +29 -1
- package/out/controller/control/exp-bar/exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/exp-bar.controller.js +19 -0
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts +7 -0
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.js +54 -19
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.d.ts +4 -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 +22 -2
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.controller.d.ts +3 -62
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.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.controller.js +7 -97
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.d.ts +2 -48
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.js +2 -94
- package/out/controller/control/form/search-form/search-form.controller.js +1 -0
- package/out/controller/control/form/search-form/search-form.service.d.ts +1 -1
- package/out/controller/control/form/search-form/search-form.service.d.ts.map +1 -1
- package/out/controller/control/form/search-form/search-form.service.js +2 -3
- package/out/controller/control/grid/grid/grid-column.controller.d.ts +16 -0
- package/out/controller/control/grid/grid/grid-column.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid-column.controller.js +22 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts +8 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +20 -8
- package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts +8 -0
- package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.js +20 -1
- package/out/controller/control/index.d.ts +1 -0
- package/out/controller/control/index.d.ts.map +1 -1
- package/out/controller/control/index.js +1 -0
- package/out/controller/control/md-ctrl/index.d.ts +4 -0
- package/out/controller/control/md-ctrl/index.d.ts.map +1 -0
- package/out/controller/control/md-ctrl/index.js +3 -0
- package/out/controller/control/md-ctrl/md-ctrl-row.state.d.ts +34 -0
- package/out/controller/control/md-ctrl/md-ctrl-row.state.d.ts.map +1 -0
- package/out/controller/control/md-ctrl/md-ctrl-row.state.js +31 -0
- package/out/controller/control/md-ctrl/md-ctrl.controller.d.ts +77 -0
- package/out/controller/control/md-ctrl/md-ctrl.controller.d.ts.map +1 -0
- package/out/controller/control/md-ctrl/md-ctrl.controller.js +160 -0
- package/out/controller/control/md-ctrl/md-ctrl.service.d.ts +21 -0
- package/out/controller/control/md-ctrl/md-ctrl.service.d.ts.map +1 -0
- package/out/controller/control/md-ctrl/md-ctrl.service.js +40 -0
- package/out/controller/control/panel/panel/panel-item.controller.js +1 -1
- package/out/controller/control/panel/panel/panel.controller.d.ts.map +1 -1
- package/out/controller/control/panel/panel/panel.controller.js +4 -2
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +15 -6
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +9 -3
- 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/hub/config/app-view-config-service.d.ts.map +1 -1
- package/out/hub/config/app-view-config-service.js +1 -0
- package/out/interface/common/i-app-view-config-service/i-app-view-config-service.d.ts +4 -0
- package/out/interface/common/i-app-view-config-service/i-app-view-config-service.d.ts.map +1 -1
- package/out/interface/controller/event/control/i-edit-form.event.d.ts +48 -3
- package/out/interface/controller/event/control/i-edit-form.event.d.ts.map +1 -1
- package/out/interface/controller/event/control/i-form.event.d.ts +27 -0
- package/out/interface/controller/event/control/i-form.event.d.ts.map +1 -1
- package/out/interface/controller/event/control/i-md-control.event.d.ts +57 -14
- package/out/interface/controller/event/control/i-md-control.event.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-exp-bar-control.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-exp-bar-control.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-search-bar.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-search-bar.state.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts +3 -3
- package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.js +3 -3
- package/out/service/service/code-list/code-list.service.d.ts.map +1 -1
- package/out/service/service/code-list/code-list.service.js +1 -1
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +4 -4
- package/out/service/utils/dynamic-code-list/dynamic-code-list.js +1 -1
- package/out/service/utils/index.d.ts +0 -1
- package/out/service/utils/index.d.ts.map +1 -1
- package/out/service/utils/index.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 +2 -3
- package/out/ui-action/uiaction-util.js +1 -1
- package/out/utils/handlebars/handlebars.d.ts +50 -0
- package/out/utils/handlebars/handlebars.d.ts.map +1 -0
- package/out/utils/handlebars/handlebars.js +64 -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/script/script-function.d.ts.map +1 -1
- package/out/utils/script/script-function.js +3 -0
- package/out/utils/text-util/text-util.d.ts +9 -0
- package/out/utils/text-util/text-util.d.ts.map +1 -1
- package/out/utils/text-util/text-util.js +11 -0
- package/package.json +5 -3
- package/src/controller/common/control/md-control.controller.ts +7 -0
- package/src/controller/common/editor/editor.controller.ts +3 -6
- package/src/controller/control/app-menu/app-menu.controller.ts +6 -3
- package/src/controller/control/caption-bar/caption-bar.controller.ts +1 -2
- package/src/controller/control/chart/chart.controller.ts +1 -1
- package/src/controller/control/chart/generator/base-series-generator.ts +5 -3
- package/src/controller/control/chart/generator/chart-options-generator.ts +39 -1
- package/src/controller/control/exp-bar/exp-bar.controller.ts +25 -0
- package/src/controller/control/form/edit-form/edit-form.controller.ts +55 -24
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.ts +41 -4
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.controller.ts +11 -159
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.ts +2 -140
- package/src/controller/control/form/search-form/search-form.controller.ts +1 -1
- package/src/controller/control/form/search-form/search-form.service.ts +2 -3
- package/src/controller/control/grid/grid/grid-column.controller.ts +22 -0
- package/src/controller/control/grid/grid/grid.controller.ts +25 -7
- package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +21 -1
- package/src/controller/control/index.ts +1 -0
- package/src/controller/control/md-ctrl/index.ts +3 -0
- package/src/controller/control/md-ctrl/md-ctrl-row.state.ts +40 -0
- package/src/controller/control/md-ctrl/md-ctrl.controller.ts +199 -0
- package/src/controller/control/md-ctrl/md-ctrl.service.ts +40 -0
- package/src/controller/control/panel/panel/panel-item.controller.ts +1 -1
- package/src/controller/control/panel/panel/panel.controller.ts +6 -2
- package/src/controller/control/search-bar/search-bar.controller.ts +21 -8
- package/src/engine/md-view.engine.ts +7 -3
- package/src/global/global-util/global-util.ts +9 -1
- package/src/hub/config/app-view-config-service.ts +1 -0
- package/src/interface/common/i-app-view-config-service/i-app-view-config-service.ts +4 -0
- package/src/interface/controller/event/control/i-edit-form.event.ts +53 -3
- package/src/interface/controller/event/control/i-form.event.ts +30 -0
- package/src/interface/controller/event/control/i-md-control.event.ts +63 -15
- package/src/interface/controller/state/control/i-exp-bar-control.state.ts +8 -0
- package/src/interface/controller/state/control/i-search-bar.state.ts +8 -0
- package/src/logic-scheduler/executor/app-ui-logic-executor.ts +5 -5
- package/src/service/service/code-list/code-list.service.ts +1 -4
- package/src/service/service/entity/method/method.ts +4 -8
- package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +1 -1
- package/src/service/utils/index.ts +0 -1
- package/src/ui-action/provider/backend-ui-action-provider.ts +2 -3
- package/src/ui-action/uiaction-util.ts +1 -1
- package/src/utils/handlebars/handlebars.ts +70 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/script/script-function.ts +3 -0
- package/src/utils/text-util/text-util.ts +12 -0
- package/out/service/utils/route-context/route-context.d.ts +0 -20
- package/out/service/utils/route-context/route-context.d.ts.map +0 -1
- package/out/service/utils/route-context/route-context.js +0 -71
- package/src/service/utils/route-context/route-context.ts +0 -75
|
@@ -213,7 +213,9 @@ export class MDViewEngine extends ViewEngineBase {
|
|
|
213
213
|
view: this.view,
|
|
214
214
|
});
|
|
215
215
|
|
|
216
|
-
if (result
|
|
216
|
+
if (result instanceof Object && result.ok) {
|
|
217
|
+
this.refresh();
|
|
218
|
+
} else if (result === -1) {
|
|
217
219
|
ibiz.log.warn(`视图[${this.view.model.codeName}],未配置编辑打开视图`);
|
|
218
220
|
}
|
|
219
221
|
}
|
|
@@ -253,7 +255,9 @@ export class MDViewEngine extends ViewEngineBase {
|
|
|
253
255
|
view: this.view,
|
|
254
256
|
});
|
|
255
257
|
|
|
256
|
-
if (result
|
|
258
|
+
if (result instanceof Object && result.ok) {
|
|
259
|
+
this.refresh();
|
|
260
|
+
} else if (result === -1) {
|
|
257
261
|
throw new RuntimeModelError(this.view.model, `缺少newdata的视图逻辑`);
|
|
258
262
|
}
|
|
259
263
|
}
|
|
@@ -356,7 +360,7 @@ export class MDViewEngine extends ViewEngineBase {
|
|
|
356
360
|
protected calcViewHeaderVisible(): boolean {
|
|
357
361
|
let showHeader = super.calcViewHeaderVisible();
|
|
358
362
|
// 搜索栏
|
|
359
|
-
if (!this.searchBar) {
|
|
363
|
+
if (!this.searchBar || !this.searchBar.state.visible) {
|
|
360
364
|
const controller = this.viewLayoutPanel!.panelItems.view_searchbar;
|
|
361
365
|
if (controller) {
|
|
362
366
|
controller.state.visible = false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IExportExcelUtil } from '../../interface';
|
|
2
|
-
import { TextUtil, LayoutPanelUtil } from '../../utils';
|
|
2
|
+
import { TextUtil, LayoutPanelUtil, HandlebarsUtil } from '../../utils';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 全局工具方法或对象
|
|
@@ -26,6 +26,14 @@ export class GlobalUtil {
|
|
|
26
26
|
*/
|
|
27
27
|
readonly text = new TextUtil();
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* handlebars 工具
|
|
31
|
+
*
|
|
32
|
+
* @author chitanda
|
|
33
|
+
* @date 2023-08-28 23:08:59
|
|
34
|
+
*/
|
|
35
|
+
readonly hbs = new HandlebarsUtil();
|
|
36
|
+
|
|
29
37
|
/**
|
|
30
38
|
* 获取导出Excel工具类对象
|
|
31
39
|
* @author lxm
|
|
@@ -24,6 +24,7 @@ export class AppViewConfigService implements IAppViewConfigService {
|
|
|
24
24
|
id: model.id!,
|
|
25
25
|
codeName: model.codeName!,
|
|
26
26
|
openMode: model.openMode!,
|
|
27
|
+
viewType: model.viewType!,
|
|
27
28
|
width: model.width,
|
|
28
29
|
height: model.height,
|
|
29
30
|
appDataEntityId: model.appDataEntityId,
|
|
@@ -11,11 +11,11 @@ import { IFormEvent } from './i-form.event';
|
|
|
11
11
|
*/
|
|
12
12
|
export interface IEditFormEvent extends IFormEvent {
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* 加载之前
|
|
15
15
|
*
|
|
16
16
|
* @author lxm
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
onBeforeLoad: {
|
|
19
19
|
event: EventBase;
|
|
20
20
|
emitArgs: undefined;
|
|
21
21
|
};
|
|
@@ -30,6 +30,26 @@ export interface IEditFormEvent extends IFormEvent {
|
|
|
30
30
|
emitArgs: undefined;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* 加载失败
|
|
35
|
+
*
|
|
36
|
+
* @author lxm
|
|
37
|
+
*/
|
|
38
|
+
onLoadError: {
|
|
39
|
+
event: EventBase;
|
|
40
|
+
emitArgs: undefined;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 保存之前
|
|
45
|
+
*
|
|
46
|
+
* @author lxm
|
|
47
|
+
*/
|
|
48
|
+
onBeforeSave: {
|
|
49
|
+
event: EventBase;
|
|
50
|
+
emitArgs: undefined;
|
|
51
|
+
};
|
|
52
|
+
|
|
33
53
|
/**
|
|
34
54
|
* 保存成功后
|
|
35
55
|
*
|
|
@@ -41,7 +61,27 @@ export interface IEditFormEvent extends IFormEvent {
|
|
|
41
61
|
};
|
|
42
62
|
|
|
43
63
|
/**
|
|
44
|
-
*
|
|
64
|
+
* 保存失败
|
|
65
|
+
*
|
|
66
|
+
* @author lxm
|
|
67
|
+
*/
|
|
68
|
+
onSaveError: {
|
|
69
|
+
event: EventBase;
|
|
70
|
+
emitArgs: undefined;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 删除之前
|
|
75
|
+
*
|
|
76
|
+
* @author lxm
|
|
77
|
+
*/
|
|
78
|
+
onBeforeRemove: {
|
|
79
|
+
event: EventBase;
|
|
80
|
+
emitArgs: undefined;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 删除成功之后
|
|
45
85
|
*
|
|
46
86
|
* @author lxm
|
|
47
87
|
*/
|
|
@@ -49,4 +89,14 @@ export interface IEditFormEvent extends IFormEvent {
|
|
|
49
89
|
event: EventBase;
|
|
50
90
|
emitArgs: undefined;
|
|
51
91
|
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 删除失败
|
|
95
|
+
*
|
|
96
|
+
* @author lxm
|
|
97
|
+
*/
|
|
98
|
+
onRemoveError: {
|
|
99
|
+
event: EventBase;
|
|
100
|
+
emitArgs: undefined;
|
|
101
|
+
};
|
|
52
102
|
}
|
|
@@ -21,4 +21,34 @@ export interface IFormEvent extends IControlEvent {
|
|
|
21
21
|
event: EventBase;
|
|
22
22
|
emitArgs: undefined;
|
|
23
23
|
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 加载草稿之前
|
|
27
|
+
*
|
|
28
|
+
* @author lxm
|
|
29
|
+
*/
|
|
30
|
+
onBeforeLoadDraft: {
|
|
31
|
+
event: EventBase;
|
|
32
|
+
emitArgs: Partial<EventBase>;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 加载草稿成功后
|
|
37
|
+
*
|
|
38
|
+
* @author lxm
|
|
39
|
+
*/
|
|
40
|
+
onLoadDraftSuccess: {
|
|
41
|
+
event: EventBase;
|
|
42
|
+
emitArgs: undefined;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 加载草稿失败
|
|
47
|
+
*
|
|
48
|
+
* @author lxm
|
|
49
|
+
*/
|
|
50
|
+
onLoadDraftError: {
|
|
51
|
+
event: EventBase;
|
|
52
|
+
emitArgs: undefined;
|
|
53
|
+
};
|
|
24
54
|
}
|
|
@@ -11,17 +11,6 @@ import { IControlEvent } from './i-control.event';
|
|
|
11
11
|
* @interface IMDControlEvent
|
|
12
12
|
*/
|
|
13
13
|
export interface IMDControlEvent extends IControlEvent {
|
|
14
|
-
/**
|
|
15
|
-
* 加载前事件,返回值是视图参数
|
|
16
|
-
*
|
|
17
|
-
* @author lxm
|
|
18
|
-
* @date 2022-08-30 16:08:18
|
|
19
|
-
*/
|
|
20
|
-
onBeforeLoad: {
|
|
21
|
-
event: EventBase;
|
|
22
|
-
emitArgs: undefined;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
14
|
/**
|
|
26
15
|
* 数据激活事件
|
|
27
16
|
*
|
|
@@ -45,10 +34,19 @@ export interface IMDControlEvent extends IControlEvent {
|
|
|
45
34
|
};
|
|
46
35
|
|
|
47
36
|
/**
|
|
48
|
-
*
|
|
37
|
+
* 保存之前
|
|
38
|
+
*
|
|
39
|
+
* @author lxm
|
|
40
|
+
*/
|
|
41
|
+
onBeforeSave: {
|
|
42
|
+
event: EventBase;
|
|
43
|
+
emitArgs: undefined;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 保存成功后
|
|
49
48
|
*
|
|
50
49
|
* @author lxm
|
|
51
|
-
* @date 2022-11-15 16:11:22
|
|
52
50
|
*/
|
|
53
51
|
onSaveSuccess: {
|
|
54
52
|
event: EventBase;
|
|
@@ -56,16 +54,56 @@ export interface IMDControlEvent extends IControlEvent {
|
|
|
56
54
|
};
|
|
57
55
|
|
|
58
56
|
/**
|
|
59
|
-
*
|
|
57
|
+
* 保存失败
|
|
58
|
+
*
|
|
59
|
+
* @author lxm
|
|
60
|
+
*/
|
|
61
|
+
onSaveError: {
|
|
62
|
+
event: EventBase;
|
|
63
|
+
emitArgs: undefined;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 删除之前
|
|
68
|
+
*
|
|
69
|
+
* @author lxm
|
|
70
|
+
*/
|
|
71
|
+
onBeforeRemove: {
|
|
72
|
+
event: EventBase;
|
|
73
|
+
emitArgs: undefined;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 删除成功之后
|
|
60
78
|
*
|
|
61
79
|
* @author lxm
|
|
62
|
-
* @date 2022-11-15 18:11:14
|
|
63
80
|
*/
|
|
64
81
|
onRemoveSuccess: {
|
|
65
82
|
event: EventBase;
|
|
66
83
|
emitArgs: undefined;
|
|
67
84
|
};
|
|
68
85
|
|
|
86
|
+
/**
|
|
87
|
+
* 删除失败
|
|
88
|
+
*
|
|
89
|
+
* @author lxm
|
|
90
|
+
*/
|
|
91
|
+
onRemoveError: {
|
|
92
|
+
event: EventBase;
|
|
93
|
+
emitArgs: undefined;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* 加载前事件
|
|
98
|
+
*
|
|
99
|
+
* @author lxm
|
|
100
|
+
* @date 2022-08-30 16:08:18
|
|
101
|
+
*/
|
|
102
|
+
onBeforeLoad: {
|
|
103
|
+
event: EventBase;
|
|
104
|
+
emitArgs: undefined;
|
|
105
|
+
};
|
|
106
|
+
|
|
69
107
|
/**
|
|
70
108
|
* 加载后处理事件
|
|
71
109
|
*
|
|
@@ -76,4 +114,14 @@ export interface IMDControlEvent extends IControlEvent {
|
|
|
76
114
|
event: LoadEvent;
|
|
77
115
|
emitArgs: PartialWithObject<LoadEvent, EventBase>;
|
|
78
116
|
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* 加载失败
|
|
120
|
+
*
|
|
121
|
+
* @author lxm
|
|
122
|
+
*/
|
|
123
|
+
onLoadError: {
|
|
124
|
+
event: EventBase;
|
|
125
|
+
emitArgs: undefined;
|
|
126
|
+
};
|
|
79
127
|
}
|
|
@@ -59,7 +59,7 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
59
59
|
async executeOpenDataAppUILogic(
|
|
60
60
|
appUILogic: IAppUIOpenDataLogic,
|
|
61
61
|
parameters: IUILogicParams,
|
|
62
|
-
): Promise<
|
|
62
|
+
): Promise<IModalData> {
|
|
63
63
|
const { context, params, ...rest } = parameters;
|
|
64
64
|
const { data } = parameters;
|
|
65
65
|
if (!data?.[0]) {
|
|
@@ -97,7 +97,7 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
// 打开视图
|
|
100
|
-
|
|
100
|
+
return ibiz.commands.execute(
|
|
101
101
|
OpenAppViewCommand.TAG,
|
|
102
102
|
openView,
|
|
103
103
|
tempContext,
|
|
@@ -121,7 +121,7 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
121
121
|
async executeNewDataAppUILogic(
|
|
122
122
|
appUILogic: IAppUINewDataLogic,
|
|
123
123
|
parameters: IUILogicParams,
|
|
124
|
-
): Promise<
|
|
124
|
+
): Promise<IModalData> {
|
|
125
125
|
const { context, params, ...rest } = parameters;
|
|
126
126
|
const { data } = parameters;
|
|
127
127
|
const { enableWizardAdd, enableBatchAdd, batchAddOnly, newDataAppView } =
|
|
@@ -132,7 +132,7 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
132
132
|
newViewRef = await this.getWizardNewViewRef(appUILogic, parameters);
|
|
133
133
|
if (!newViewRef) {
|
|
134
134
|
// 选择视图取消操作直接返回
|
|
135
|
-
return;
|
|
135
|
+
return { ok: false };
|
|
136
136
|
}
|
|
137
137
|
} else if (enableBatchAdd) {
|
|
138
138
|
// todo 批添加
|
|
@@ -174,7 +174,7 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
// 打开视图
|
|
177
|
-
|
|
177
|
+
return ibiz.commands.execute(
|
|
178
178
|
OpenAppViewCommand.TAG,
|
|
179
179
|
newViewRef.refAppViewId,
|
|
180
180
|
tempContext,
|
|
@@ -101,10 +101,7 @@ export class CodeListService {
|
|
|
101
101
|
// todo代码项其他属性,表单数据
|
|
102
102
|
let text = codeItem.text!;
|
|
103
103
|
if (codeItem.textLanguageRes) {
|
|
104
|
-
text = ibiz.i18n.t(
|
|
105
|
-
codeItem.textLanguageRes.lanResTag!,
|
|
106
|
-
codeItem.textLanguageRes.defaultContent,
|
|
107
|
-
);
|
|
104
|
+
text = ibiz.i18n.t(codeItem.textLanguageRes.lanResTag!, codeItem.text);
|
|
108
105
|
}
|
|
109
106
|
const _codeItem: CodeListItem = {
|
|
110
107
|
text,
|
|
@@ -121,20 +121,16 @@ export abstract class Method {
|
|
|
121
121
|
let res: HttpResponse | null = null;
|
|
122
122
|
switch (requestMethod) {
|
|
123
123
|
case 'POST':
|
|
124
|
-
res = await this.app.net.post(`${path}/${methodName}`, data
|
|
124
|
+
res = await this.app.net.post(`${path}/${methodName}`, data);
|
|
125
125
|
break;
|
|
126
126
|
case 'GET':
|
|
127
|
-
res = await this.app.net.get(`${path}/${methodName}`,
|
|
127
|
+
res = await this.app.net.get(`${path}/${methodName}`, params);
|
|
128
128
|
break;
|
|
129
129
|
case 'PUT':
|
|
130
|
-
res = await this.app.net.put(`${path}/${methodName}`, data
|
|
130
|
+
res = await this.app.net.put(`${path}/${methodName}`, data);
|
|
131
131
|
break;
|
|
132
132
|
case 'DELETE':
|
|
133
|
-
res = await this.app.net.delete(
|
|
134
|
-
`${path}/${methodName}`,
|
|
135
|
-
data,
|
|
136
|
-
params,
|
|
137
|
-
);
|
|
133
|
+
res = await this.app.net.delete(`${path}/${methodName}`, params);
|
|
138
134
|
break;
|
|
139
135
|
default:
|
|
140
136
|
if (requestMethod) {
|
|
@@ -161,7 +161,7 @@ export class DynamicCodeListCache {
|
|
|
161
161
|
if (this.isPredefined) {
|
|
162
162
|
// 特殊处理,避免预置代码表加载不全
|
|
163
163
|
if (!params.size) {
|
|
164
|
-
params
|
|
164
|
+
params = { ...params, size: 10000 };
|
|
165
165
|
}
|
|
166
166
|
const res = await app.net.get(
|
|
167
167
|
`/dictionaries/codelist/${this.codeList.codeName}`,
|
|
@@ -4,5 +4,4 @@ export { DEDQCondUtil } from './de-dq-cond-util/de-dq-cond-util';
|
|
|
4
4
|
export { DynamicCodeListCache } from './dynamic-code-list/dynamic-code-list';
|
|
5
5
|
export { DECache } from './de-cache/de-cache';
|
|
6
6
|
export { getMatchResPath, calcResPath } from './res-path/res-path';
|
|
7
|
-
export { calcRouteContext } from './route-context/route-context';
|
|
8
7
|
export { SearchFilter } from './search-filter/search-filter';
|
|
@@ -33,7 +33,6 @@ export class BackendUIActionProvider extends UIActionProviderBase {
|
|
|
33
33
|
data,
|
|
34
34
|
params,
|
|
35
35
|
);
|
|
36
|
-
const tempParams = { ...params, ...resultParams };
|
|
37
36
|
|
|
38
37
|
// 如果有打开视图,打开视图,并把返回的数据作为子实体数据
|
|
39
38
|
const frontPSAppView = action.frontAppViewId;
|
|
@@ -71,7 +70,7 @@ export class BackendUIActionProvider extends UIActionProviderBase {
|
|
|
71
70
|
methodName,
|
|
72
71
|
resultContext,
|
|
73
72
|
isMultiData ? _data : _data[0],
|
|
74
|
-
|
|
73
|
+
resultParams,
|
|
75
74
|
);
|
|
76
75
|
|
|
77
76
|
// 适配界面行为成功提示信息
|
|
@@ -81,7 +80,7 @@ export class BackendUIActionProvider extends UIActionProviderBase {
|
|
|
81
80
|
Object.assign(actionResult, {
|
|
82
81
|
data: isArray(res.data) ? res.data : [res.data],
|
|
83
82
|
nextContext: resultContext,
|
|
84
|
-
nextParams:
|
|
83
|
+
nextParams: resultParams,
|
|
85
84
|
});
|
|
86
85
|
|
|
87
86
|
return actionResult;
|
|
@@ -49,7 +49,7 @@ export class UIActionUtil {
|
|
|
49
49
|
): Promise<void> {
|
|
50
50
|
const result = await this.exec(actionId, params);
|
|
51
51
|
if (result.closeView) {
|
|
52
|
-
params.view.closeView();
|
|
52
|
+
params.view.closeView({ ok: true });
|
|
53
53
|
} else if (result.refresh) {
|
|
54
54
|
switch (result.refreshMode) {
|
|
55
55
|
case 1:
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* handlebars 渲染工具类
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2023-08-28 17:08:13
|
|
6
|
+
* @export
|
|
7
|
+
* @class HandlebarsUtil
|
|
8
|
+
*/
|
|
9
|
+
export class HandlebarsUtil {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
protected hsb: any;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* handlebars 是否已经初始化
|
|
15
|
+
*
|
|
16
|
+
* @author chitanda
|
|
17
|
+
* @date 2023-08-28 18:08:01
|
|
18
|
+
* @readonly
|
|
19
|
+
* @type {boolean}
|
|
20
|
+
*/
|
|
21
|
+
get isInit(): boolean {
|
|
22
|
+
return !!this.hsb;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 异步加载,初始化 handlebars
|
|
27
|
+
*
|
|
28
|
+
* @author chitanda
|
|
29
|
+
* @date 2023-08-28 17:08:24
|
|
30
|
+
* @return {*} {Promise<void>}
|
|
31
|
+
*/
|
|
32
|
+
async init(): Promise<void> {
|
|
33
|
+
this.hsb = await import('handlebars');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 异步绘制模板,返回渲染后的字符串
|
|
38
|
+
*
|
|
39
|
+
* @author chitanda
|
|
40
|
+
* @date 2023-08-28 18:08:10
|
|
41
|
+
* @param {string} template
|
|
42
|
+
* @param {IData} data
|
|
43
|
+
* @return {*} {Promise<string>}
|
|
44
|
+
*/
|
|
45
|
+
async render(template: string, data: IData): Promise<string> {
|
|
46
|
+
if (!this.hsb) {
|
|
47
|
+
await this.init();
|
|
48
|
+
}
|
|
49
|
+
const tmp = this.hsb.compile(template);
|
|
50
|
+
return tmp(data);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 同步绘制模板,返回渲染后的字符串
|
|
55
|
+
*
|
|
56
|
+
* @description 需要自己保证 handlebars 已经加载
|
|
57
|
+
* @author chitanda
|
|
58
|
+
* @date 2023-08-28 18:08:14
|
|
59
|
+
* @param {string} template
|
|
60
|
+
* @param {IData} data
|
|
61
|
+
* @return {*} {string}
|
|
62
|
+
*/
|
|
63
|
+
syncRender(template: string, data: IData): string {
|
|
64
|
+
if (!this.hsb) {
|
|
65
|
+
throw new Error('handlebars not init');
|
|
66
|
+
}
|
|
67
|
+
const tmp = this.hsb.compile(template);
|
|
68
|
+
return tmp(data);
|
|
69
|
+
}
|
|
70
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -19,4 +19,16 @@ export class TextUtil {
|
|
|
19
19
|
format(value: string, _code: string): string {
|
|
20
20
|
return value;
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 拷贝文本
|
|
25
|
+
*
|
|
26
|
+
* @author zhanghengfeng
|
|
27
|
+
* @date 2023-08-28 14:08:57
|
|
28
|
+
* @param {string} value
|
|
29
|
+
* @return {*} {Promise<void>}
|
|
30
|
+
*/
|
|
31
|
+
async copy(value: string): Promise<void> {
|
|
32
|
+
return navigator.clipboard.writeText(value);
|
|
33
|
+
}
|
|
22
34
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IAppView } from '@ibiz/model-core';
|
|
2
|
-
/**
|
|
3
|
-
* 计算资源上下文时,需要排除自身实体codeName的视图(导航类视图和多数据视图)
|
|
4
|
-
* @return {*}
|
|
5
|
-
* @author: zhujiamin
|
|
6
|
-
* @Date: 2023-02-20 15:45:46
|
|
7
|
-
*/
|
|
8
|
-
export declare const excludeViewTypes: string[];
|
|
9
|
-
/**
|
|
10
|
-
* 计算放置到路径中的资源上下文参数
|
|
11
|
-
*
|
|
12
|
-
* @author chitanda
|
|
13
|
-
* @date 2023-01-10 14:01:51
|
|
14
|
-
* @export
|
|
15
|
-
* @param {IParams} context
|
|
16
|
-
* @param {ServicePathItem[][]} pathItems
|
|
17
|
-
* @return {*} {Record<string, unknown>}
|
|
18
|
-
*/
|
|
19
|
-
export declare function calcRouteContext(_appView?: IAppView): Record<string, unknown>;
|
|
20
|
-
//# sourceMappingURL=route-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-context.d.ts","sourceRoot":"","sources":["../../../../src/service/utils/route-context/route-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAYpC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAG9B,QAAQ,CAAC,EAAE,QAAQ,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqCzB"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { ViewType } from '../../../constant';
|
|
2
|
-
/**
|
|
3
|
-
* 计算资源上下文时,需要排除自身实体codeName的视图(导航类视图和多数据视图)
|
|
4
|
-
* @return {*}
|
|
5
|
-
* @author: zhujiamin
|
|
6
|
-
* @Date: 2023-02-20 15:45:46
|
|
7
|
-
*/
|
|
8
|
-
export const excludeViewTypes = [
|
|
9
|
-
ViewType.DE_GRID_VIEW,
|
|
10
|
-
ViewType.DE_GRID_EXP_VIEW,
|
|
11
|
-
ViewType.DE_LIST_VIEW,
|
|
12
|
-
ViewType.DE_LIST_EXP_VIEW,
|
|
13
|
-
ViewType.DE_DATA_VIEW,
|
|
14
|
-
ViewType.DE_DATAVIEW_EXP_VIEW,
|
|
15
|
-
ViewType.DE_CALENDAR_VIEW,
|
|
16
|
-
ViewType.DE_CALENDAR_EXP_VIEW,
|
|
17
|
-
ViewType.DE_CHART_VIEW,
|
|
18
|
-
ViewType.DE_CHART_EXP_VIEW,
|
|
19
|
-
ViewType.DE_KANBAN_VIEW,
|
|
20
|
-
];
|
|
21
|
-
/**
|
|
22
|
-
* 计算放置到路径中的资源上下文参数
|
|
23
|
-
*
|
|
24
|
-
* @author chitanda
|
|
25
|
-
* @date 2023-01-10 14:01:51
|
|
26
|
-
* @export
|
|
27
|
-
* @param {IParams} context
|
|
28
|
-
* @param {ServicePathItem[][]} pathItems
|
|
29
|
-
* @return {*} {Record<string, unknown>}
|
|
30
|
-
*/
|
|
31
|
-
export function calcRouteContext(
|
|
32
|
-
// context: IParams,
|
|
33
|
-
// pathItems: ServicePathItem[][],
|
|
34
|
-
_appView) {
|
|
35
|
-
let paths = [];
|
|
36
|
-
// pathItems.forEach(items => {
|
|
37
|
-
// const values: string[][] = [];
|
|
38
|
-
// for (let i = 0; i < items.length; i++) {
|
|
39
|
-
// const arr: string[] = [];
|
|
40
|
-
// const item = items[i];
|
|
41
|
-
// if (
|
|
42
|
-
// appView &&
|
|
43
|
-
// appView.viewType &&
|
|
44
|
-
// excludeViewTypes.includes(appView.viewType)
|
|
45
|
-
// ) {
|
|
46
|
-
// // 排除导航类视图和多数据视图自身
|
|
47
|
-
// const deName = appView.getPSAppDataEntity()?.codeName.toLowerCase();
|
|
48
|
-
// if (deName === item.name) {
|
|
49
|
-
// return;
|
|
50
|
-
// }
|
|
51
|
-
// }
|
|
52
|
-
// const val = context[item.lower];
|
|
53
|
-
// if (val) {
|
|
54
|
-
// arr.push(item.lower);
|
|
55
|
-
// arr.push(val);
|
|
56
|
-
// values.push(arr);
|
|
57
|
-
// }
|
|
58
|
-
// }
|
|
59
|
-
// paths.push(values);
|
|
60
|
-
// });
|
|
61
|
-
paths = paths.sort((a, b) => b.length - a.length);
|
|
62
|
-
const [pathArr] = paths;
|
|
63
|
-
if (pathArr) {
|
|
64
|
-
const obj = {};
|
|
65
|
-
pathArr.forEach(([key, val]) => {
|
|
66
|
-
obj[key] = val;
|
|
67
|
-
});
|
|
68
|
-
return obj;
|
|
69
|
-
}
|
|
70
|
-
return {};
|
|
71
|
-
}
|