@ibiz-template/runtime 0.1.15 → 0.1.17
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 +357 -152
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/command/app/open-app-view/open-app-view.js +1 -1
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +5 -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 +2 -6
- package/out/controller/control/form/edit-form/edit-form.service.d.ts +8 -0
- package/out/controller/control/form/edit-form/edit-form.service.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.service.js +23 -21
- package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts +9 -0
- package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-item/form-item.controller.js +11 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-grid/form-mdctrl-repeater-grid.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-grid/form-mdctrl-repeater-grid.controller.js +2 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts +7 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +40 -8
- package/out/controller/control/grid/grid/grid.service.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.service.js +2 -1
- 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 +14 -9
- package/out/de-logic/de-logic-context.d.ts +21 -0
- package/out/de-logic/de-logic-context.d.ts.map +1 -1
- package/out/de-logic/de-logic-context.js +22 -0
- package/out/de-logic/de-logic-param/de-logic-param.d.ts.map +1 -1
- package/out/de-logic/de-logic-param/de-logic-param.js +2 -1
- package/out/engine/md-view.engine.d.ts +10 -1
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +12 -3
- package/out/interface/controller/controller/editor/i-editor-container.controller.d.ts +8 -0
- package/out/interface/controller/controller/editor/i-editor-container.controller.d.ts.map +1 -1
- package/out/interface/controller/event/view/i-form-pickup-data-view.event.d.ts +13 -0
- package/out/interface/controller/event/view/i-form-pickup-data-view.event.d.ts.map +1 -0
- package/out/interface/controller/event/view/i-form-pickup-data-view.event.js +1 -0
- package/out/interface/controller/event/view/index.d.ts +1 -0
- package/out/interface/controller/event/view/index.d.ts.map +1 -1
- package/out/interface/controller/event/view/index.js +1 -0
- package/out/interface/controller/state/control/i-grid.state.d.ts +14 -0
- package/out/interface/controller/state/control/i-grid.state.d.ts.map +1 -1
- package/out/interface/controller/state/view/i-form-pickup-data-view.state.d.ts +13 -0
- package/out/interface/controller/state/view/i-form-pickup-data-view.state.d.ts.map +1 -0
- package/out/interface/controller/state/view/i-form-pickup-data-view.state.js +1 -0
- package/out/interface/controller/state/view/i-view.state.d.ts +7 -0
- package/out/interface/controller/state/view/i-view.state.d.ts.map +1 -1
- package/out/interface/controller/state/view/index.d.ts +1 -0
- package/out/interface/controller/state/view/index.d.ts.map +1 -1
- package/out/interface/controller/state/view/index.js +1 -0
- package/out/interface/service/code-list-item/code-list-item.d.ts +5 -0
- package/out/interface/service/code-list-item/code-list-item.d.ts.map +1 -1
- package/out/interface/util/i-modal-util/i-modal-util.d.ts +35 -0
- package/out/interface/util/i-modal-util/i-modal-util.d.ts.map +1 -1
- package/out/model/layout/layout.d.ts +1 -1
- package/out/model/layout/layout.d.ts.map +1 -1
- package/out/model/layout/layout.js +2 -2
- package/out/service/dto/method.dto.d.ts +0 -1
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +1 -6
- 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 -0
- package/out/service/service/control/control.service.d.ts +0 -9
- package/out/service/service/control/control.service.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.d.ts +10 -0
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +12 -0
- package/out/service/service/entity/method/fetch.d.ts +1 -0
- package/out/service/service/entity/method/fetch.d.ts.map +1 -1
- package/out/service/service/entity/method/fetch.js +4 -0
- package/out/service/service/entity/method/method.d.ts +0 -10
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +0 -12
- package/out/ui-logic/ui-logic-context.d.ts +21 -0
- package/out/ui-logic/ui-logic-context.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-context.js +22 -0
- package/out/ui-logic/ui-logic-node/debug-param-node/debug-param-node.d.ts +17 -0
- package/out/ui-logic/ui-logic-node/debug-param-node/debug-param-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/debug-param-node/debug-param-node.js +21 -0
- package/out/ui-logic/ui-logic-node/index.d.ts +2 -0
- package/out/ui-logic/ui-logic-node/index.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/index.js +2 -0
- package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.d.ts +23 -0
- package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.js +79 -0
- package/out/ui-logic/ui-logic-param/ui-logic-param.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-param/ui-logic-param.js +2 -1
- package/out/ui-logic/ui-logic.d.ts.map +1 -1
- package/out/ui-logic/ui-logic.js +7 -3
- package/out/utils/text-util/text-util.d.ts +12 -3
- package/out/utils/text-util/text-util.d.ts.map +1 -1
- package/out/utils/text-util/text-util.js +23 -4
- package/package.json +2 -2
- package/src/command/app/open-app-view/open-app-view.ts +1 -1
- package/src/controller/common/view/view.controller.ts +5 -1
- package/src/controller/control/exp-bar/exp-bar.controller.ts +2 -6
- package/src/controller/control/form/edit-form/edit-form.service.ts +24 -22
- package/src/controller/control/form/form-detail/form-item/form-item.controller.ts +12 -0
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-grid/form-mdctrl-repeater-grid.controller.ts +2 -1
- package/src/controller/control/grid/grid/grid.controller.ts +46 -14
- package/src/controller/control/grid/grid/grid.service.ts +4 -1
- package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +16 -12
- package/src/de-logic/de-logic-context.ts +32 -0
- package/src/de-logic/de-logic-param/de-logic-param.ts +2 -1
- package/src/engine/md-view.engine.ts +14 -3
- package/src/interface/controller/controller/editor/i-editor-container.controller.ts +9 -0
- package/src/interface/controller/event/view/i-form-pickup-data-view.event.ts +12 -0
- package/src/interface/controller/event/view/index.ts +1 -0
- package/src/interface/controller/state/control/i-grid.state.ts +16 -0
- package/src/interface/controller/state/view/i-form-pickup-data-view.state.ts +12 -0
- package/src/interface/controller/state/view/i-view.state.ts +8 -0
- package/src/interface/controller/state/view/index.ts +1 -0
- package/src/interface/service/code-list-item/code-list-item.ts +6 -0
- package/src/interface/util/i-modal-util/i-modal-util.ts +41 -0
- package/src/model/layout/layout.ts +5 -3
- package/src/service/dto/method.dto.ts +1 -7
- package/src/service/service/code-list/code-list.service.ts +1 -0
- package/src/service/service/control/control.service.ts +0 -10
- package/src/service/service/entity/method/de-action.ts +13 -0
- package/src/service/service/entity/method/fetch.ts +5 -0
- package/src/service/service/entity/method/method.ts +0 -13
- package/src/ui-logic/ui-logic-context.ts +32 -0
- package/src/ui-logic/ui-logic-node/debug-param-node/debug-param-node.ts +26 -0
- package/src/ui-logic/ui-logic-node/index.ts +2 -0
- package/src/ui-logic/ui-logic-node/msg-box-node/msg-box-node.ts +87 -0
- package/src/ui-logic/ui-logic-param/ui-logic-param.ts +2 -1
- package/src/ui-logic/ui-logic.ts +8 -2
- package/src/utils/text-util/text-util.ts +22 -4
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ModelError, RuntimeModelError } from '@ibiz-template/core';
|
|
2
|
+
import { UILogicNode } from '../ui-logic-node';
|
|
3
|
+
/**
|
|
4
|
+
* 消息弹窗节点
|
|
5
|
+
*
|
|
6
|
+
* @author lxm
|
|
7
|
+
* @date 2023-02-09 21:02:20
|
|
8
|
+
* @export
|
|
9
|
+
* @class MsgBoxNode
|
|
10
|
+
* @extends {UILogicNode}
|
|
11
|
+
*/
|
|
12
|
+
export class MsgBoxNode extends UILogicNode {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.typeMap = {
|
|
16
|
+
INFO: 'info',
|
|
17
|
+
QUESTION: 'success',
|
|
18
|
+
WARNING: 'warning',
|
|
19
|
+
ERROR: 'error',
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
async exec(ctx) {
|
|
23
|
+
const { msgBoxType, buttonsType, msgBoxParamId } = this.model;
|
|
24
|
+
if (!msgBoxType) {
|
|
25
|
+
throw new RuntimeModelError(this.model, '缺少消息类型的配置');
|
|
26
|
+
}
|
|
27
|
+
if (!buttonsType) {
|
|
28
|
+
throw new RuntimeModelError(this.model, '缺少按钮类型的配置');
|
|
29
|
+
}
|
|
30
|
+
// 处理标题和内容
|
|
31
|
+
let { title } = this.model;
|
|
32
|
+
let { message } = this.model;
|
|
33
|
+
if (msgBoxParamId) {
|
|
34
|
+
const param = ctx.params[msgBoxParamId];
|
|
35
|
+
if (param.title) {
|
|
36
|
+
title = param.title;
|
|
37
|
+
}
|
|
38
|
+
if (param.message) {
|
|
39
|
+
message = param.message;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// 处理消息类型
|
|
43
|
+
const type = this.typeMap[msgBoxType];
|
|
44
|
+
const modalParams = {
|
|
45
|
+
type,
|
|
46
|
+
title: title || '消息',
|
|
47
|
+
desc: message,
|
|
48
|
+
};
|
|
49
|
+
let resultTags = [];
|
|
50
|
+
// 处理按钮类型
|
|
51
|
+
switch (buttonsType) {
|
|
52
|
+
case 'YESNO':
|
|
53
|
+
modalParams.confirmButtonText = '是';
|
|
54
|
+
modalParams.cancelButtonText = '否';
|
|
55
|
+
modalParams.showConfirmButton = true;
|
|
56
|
+
modalParams.showCancelButton = true;
|
|
57
|
+
resultTags = ['yes', 'no'];
|
|
58
|
+
break;
|
|
59
|
+
case 'OK':
|
|
60
|
+
modalParams.confirmButtonText = '确定';
|
|
61
|
+
modalParams.showConfirmButton = true;
|
|
62
|
+
modalParams.showCancelButton = false;
|
|
63
|
+
resultTags = ['ok'];
|
|
64
|
+
break;
|
|
65
|
+
case 'OKCANCEL':
|
|
66
|
+
modalParams.confirmButtonText = '确定';
|
|
67
|
+
modalParams.cancelButtonText = '取消';
|
|
68
|
+
modalParams.showConfirmButton = true;
|
|
69
|
+
modalParams.showCancelButton = true;
|
|
70
|
+
resultTags = ['ok', 'cancel'];
|
|
71
|
+
break;
|
|
72
|
+
default:
|
|
73
|
+
throw new ModelError(this.model, `${buttonsType}暂未支持`);
|
|
74
|
+
}
|
|
75
|
+
console.log(this.model, modalParams);
|
|
76
|
+
const result = await ibiz.modal.confirm(modalParams);
|
|
77
|
+
ctx.setLastReturn(resultTags[result ? 0 : 1]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-logic-param.d.ts","sourceRoot":"","sources":["../../../src/ui-logic/ui-logic-param/ui-logic-param.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;;GAOG;AACH,qBAAa,YAAY;IAQJ,KAAK,EAAE,eAAe;IAPzC;;;;;;OAMG;gBACgB,KAAK,EAAE,eAAe;IAEzC;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"ui-logic-param.d.ts","sourceRoot":"","sources":["../../../src/ui-logic/ui-logic-param/ui-logic-param.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;;GAOG;AACH,qBAAa,YAAY;IAQJ,KAAK,EAAE,eAAe;IAPzC;;;;;;OAMG;gBACgB,KAAK,EAAE,eAAe;IAEzC;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAiE/B;;;;;OAKG;IACH,KAAK,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;CAWjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-logic.d.ts","sourceRoot":"","sources":["../../src/ui-logic/ui-logic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"ui-logic.d.ts","sourceRoot":"","sources":["../../src/ui-logic/ui-logic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EASL,WAAW,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D;;;;;;;GAOG;AACH,qBAAa,OAAO;IA2BN,SAAS,CAAC,KAAK,EAAE,UAAU;IA1BvC;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAa;IAEtD;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IAExD;;;;;OAKG;gBACmB,KAAK,EAAE,UAAU;IAgEvC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IASpD;;;;;;;;;OASG;IACG,IAAI,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBxD;;;;;;;;;;;;;OAaG;cACa,QAAQ,CACtB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,IAAI,CAAC;CAiBjB"}
|
package/out/ui-logic/ui-logic.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-await-in-loop */
|
|
2
2
|
import { ModelError, RuntimeModelError } from '@ibiz-template/core';
|
|
3
3
|
import { UILogicContext } from './ui-logic-context';
|
|
4
|
-
import { BindParamNode, DEActionNode, DEUIActionNode, EndNode, PrepareJSParamNode, StartNode, ViewCtrlInvokeNode, } from './ui-logic-node';
|
|
4
|
+
import { BindParamNode, DEActionNode, DebugParamNode, DEUIActionNode, EndNode, MsgBoxNode, PrepareJSParamNode, StartNode, ViewCtrlInvokeNode, } from './ui-logic-node';
|
|
5
5
|
import { UILogicParam } from './ui-logic-param/ui-logic-param';
|
|
6
6
|
/**
|
|
7
7
|
* 界面逻辑
|
|
@@ -67,6 +67,12 @@ export class UILogic {
|
|
|
67
67
|
case 'VIEWCTRLINVOKE': // 视图部件调用
|
|
68
68
|
logicNode = new ViewCtrlInvokeNode(node);
|
|
69
69
|
break;
|
|
70
|
+
case 'MSGBOX': // 消息弹窗
|
|
71
|
+
logicNode = new MsgBoxNode(node);
|
|
72
|
+
break;
|
|
73
|
+
case 'DEBUGPARAM': // 调试逻辑参数
|
|
74
|
+
logicNode = new DebugParamNode(node);
|
|
75
|
+
break;
|
|
70
76
|
case 'RESETPARAM': // 重置参数
|
|
71
77
|
case 'COPYPARAM': // 拷贝参数
|
|
72
78
|
case 'VIEWCTRLFIREEVENT': // 视图部件事件触发
|
|
@@ -74,11 +80,9 @@ export class UILogic {
|
|
|
74
80
|
case 'SORTPARAM': // 排序数组参数
|
|
75
81
|
case 'RENEWPARAM': // 重新建立参数
|
|
76
82
|
case 'PFPLUGIN': // 前端插件调用
|
|
77
|
-
case 'MSGBOX': // 消息弹窗
|
|
78
83
|
case 'DEDATASET': // 实体数据集
|
|
79
84
|
case 'DELOGIC': // 实体逻辑
|
|
80
85
|
case 'THROWEXCEPTION': // 抛出异常
|
|
81
|
-
case 'DEBUGPARAM': // 调试逻辑参数
|
|
82
86
|
default:
|
|
83
87
|
throw new ModelError(node, `未支持的逻辑节点类型: ${logicNodeType}`);
|
|
84
88
|
}
|
|
@@ -7,6 +7,15 @@
|
|
|
7
7
|
* @class TextUtil
|
|
8
8
|
*/
|
|
9
9
|
export declare class TextUtil {
|
|
10
|
+
/**
|
|
11
|
+
* input元素,用于存储拷贝的文本
|
|
12
|
+
*
|
|
13
|
+
* @author zhanghengfeng
|
|
14
|
+
* @date 2023-08-31 20:08:06
|
|
15
|
+
* @private
|
|
16
|
+
* @type {(HTMLInputElement | null)}
|
|
17
|
+
*/
|
|
18
|
+
private inputElement;
|
|
10
19
|
/**
|
|
11
20
|
* 值格式化
|
|
12
21
|
*
|
|
@@ -21,10 +30,10 @@ export declare class TextUtil {
|
|
|
21
30
|
* 拷贝文本
|
|
22
31
|
*
|
|
23
32
|
* @author zhanghengfeng
|
|
24
|
-
* @date 2023-08-
|
|
33
|
+
* @date 2023-08-31 11:08:51
|
|
25
34
|
* @param {string} value
|
|
26
|
-
* @return {*} {
|
|
35
|
+
* @return {*} {boolean}
|
|
27
36
|
*/
|
|
28
|
-
copy(value: string):
|
|
37
|
+
copy(value: string): boolean;
|
|
29
38
|
}
|
|
30
39
|
//# sourceMappingURL=text-util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-util.d.ts","sourceRoot":"","sources":["../../../src/utils/text-util/text-util.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,QAAQ;IACnB;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAI5C;;;;;;;OAOG;
|
|
1
|
+
{"version":3,"file":"text-util.d.ts","sourceRoot":"","sources":["../../../src/utils/text-util/text-util.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,QAAQ;IACnB;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY,CAAiC;IAErD;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAI5C;;;;;;;OAOG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAW7B"}
|
|
@@ -7,6 +7,17 @@
|
|
|
7
7
|
* @class TextUtil
|
|
8
8
|
*/
|
|
9
9
|
export class TextUtil {
|
|
10
|
+
constructor() {
|
|
11
|
+
/**
|
|
12
|
+
* input元素,用于存储拷贝的文本
|
|
13
|
+
*
|
|
14
|
+
* @author zhanghengfeng
|
|
15
|
+
* @date 2023-08-31 20:08:06
|
|
16
|
+
* @private
|
|
17
|
+
* @type {(HTMLInputElement | null)}
|
|
18
|
+
*/
|
|
19
|
+
this.inputElement = null;
|
|
20
|
+
}
|
|
10
21
|
/**
|
|
11
22
|
* 值格式化
|
|
12
23
|
*
|
|
@@ -23,11 +34,19 @@ export class TextUtil {
|
|
|
23
34
|
* 拷贝文本
|
|
24
35
|
*
|
|
25
36
|
* @author zhanghengfeng
|
|
26
|
-
* @date 2023-08-
|
|
37
|
+
* @date 2023-08-31 11:08:51
|
|
27
38
|
* @param {string} value
|
|
28
|
-
* @return {*} {
|
|
39
|
+
* @return {*} {boolean}
|
|
29
40
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
41
|
+
copy(value) {
|
|
42
|
+
if (!this.inputElement) {
|
|
43
|
+
this.inputElement = document.createElement('input');
|
|
44
|
+
this.inputElement.style.position = 'absolute';
|
|
45
|
+
this.inputElement.style.left = '-9999px';
|
|
46
|
+
document.body.appendChild(this.inputElement);
|
|
47
|
+
}
|
|
48
|
+
this.inputElement.value = value;
|
|
49
|
+
this.inputElement.select();
|
|
50
|
+
return document.execCommand('copy');
|
|
32
51
|
}
|
|
33
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"qx-util": "^0.4.8",
|
|
58
58
|
"ramda": "^0.29.0"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "7f956bdd62e436209f34b16d69a78a73b35842ae"
|
|
61
61
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createUUID, notNilEmpty } from 'qx-util';
|
|
3
3
|
import { IBizContext, RuntimeError } from '@ibiz-template/core';
|
|
4
4
|
import { IAppView } from '@ibiz/model-core';
|
|
5
|
-
import { isEmpty, isNil } from 'ramda';
|
|
5
|
+
import { isEmpty, isNil, isNotNil } from 'ramda';
|
|
6
6
|
import { LoadingState } from '../../utils/loading/loading.state';
|
|
7
7
|
import {
|
|
8
8
|
IViewController,
|
|
@@ -217,6 +217,10 @@ export class ViewController<
|
|
|
217
217
|
|
|
218
218
|
// 给modal的关闭前回调注入视图关闭事件
|
|
219
219
|
this.modal.hooks.beforeDismiss.tapPromise(async modalData => {
|
|
220
|
+
// 如果视图设置了关闭状态,根据关闭状态返回
|
|
221
|
+
if (isNotNil(this.state.closeOK)) {
|
|
222
|
+
modalData.ok = this.state.closeOK;
|
|
223
|
+
}
|
|
220
224
|
await this._evt.emit('onCloseView', { ...modalData });
|
|
221
225
|
});
|
|
222
226
|
|
|
@@ -209,12 +209,8 @@ export class ExpBarControlController<
|
|
|
209
209
|
this.xDataController.evt.on('onLoadSuccess', event => {
|
|
210
210
|
this.xDataLoadSuccess(event);
|
|
211
211
|
});
|
|
212
|
-
this.xDataController.evt.on('
|
|
213
|
-
|
|
214
|
-
if (this.state.query) {
|
|
215
|
-
searchParams.query = this.state.query;
|
|
216
|
-
}
|
|
217
|
-
this.xDataController.state.searchParams = searchParams;
|
|
212
|
+
this.xDataController.evt.on('onRemoveSuccess', () => {
|
|
213
|
+
this.defaultNavByFirstItem();
|
|
218
214
|
});
|
|
219
215
|
}
|
|
220
216
|
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
IDEEditForm,
|
|
8
8
|
IDEEditFormItem,
|
|
9
9
|
IDEFormDetail,
|
|
10
|
-
IDEFormMDCtrl,
|
|
11
10
|
IDEWizardEditForm,
|
|
12
11
|
IWFEditForm,
|
|
13
12
|
} from '@ibiz/model-core';
|
|
@@ -94,10 +93,12 @@ export class EditFormService<
|
|
|
94
93
|
context: IParams,
|
|
95
94
|
data: IData,
|
|
96
95
|
): Promise<IHttpResponse<ControlVO>> {
|
|
96
|
+
const _data = data instanceof ControlVO ? data.getOrigin() : data;
|
|
97
|
+
const tempData = this.getFilteredData(_data);
|
|
97
98
|
let res = await this.exec(
|
|
98
99
|
this.model.createControlAction?.appDEMethodId || 'create',
|
|
99
100
|
context,
|
|
100
|
-
|
|
101
|
+
tempData,
|
|
101
102
|
);
|
|
102
103
|
res = this.handleResponse(res);
|
|
103
104
|
return res as IHttpResponse<ControlVO>;
|
|
@@ -116,10 +117,12 @@ export class EditFormService<
|
|
|
116
117
|
context: IParams,
|
|
117
118
|
data: IData,
|
|
118
119
|
): Promise<IHttpResponse<ControlVO>> {
|
|
120
|
+
const _data = data instanceof ControlVO ? data.getOrigin() : data;
|
|
121
|
+
const tempData = this.getFilteredData(_data);
|
|
119
122
|
let res = await this.exec(
|
|
120
123
|
this.model.updateControlAction?.appDEMethodId || 'update',
|
|
121
124
|
context,
|
|
122
|
-
|
|
125
|
+
tempData,
|
|
123
126
|
);
|
|
124
127
|
res = this.handleResponse(res);
|
|
125
128
|
return res as IHttpResponse<ControlVO>;
|
|
@@ -261,7 +264,7 @@ export class EditFormService<
|
|
|
261
264
|
recursiveIterate(
|
|
262
265
|
this.model,
|
|
263
266
|
(item: IDEFormDetail) => {
|
|
264
|
-
if (item.detailType === 'FORMITEM') {
|
|
267
|
+
if (item.detailType === 'FORMITEM' || item.detailType === 'MDCTRL') {
|
|
265
268
|
const formItem = item as IDEEditFormItem;
|
|
266
269
|
const uiKey = formItem.fieldName || formItem.id!.toLowerCase();
|
|
267
270
|
const deField =
|
|
@@ -279,24 +282,6 @@ export class EditFormService<
|
|
|
279
282
|
}
|
|
280
283
|
this.dataUIMap.set(uiKey, mapField);
|
|
281
284
|
}
|
|
282
|
-
if (item.detailType === 'MDCTRL') {
|
|
283
|
-
const formItem = item as IDEFormMDCtrl;
|
|
284
|
-
const uiKey = formItem.fieldName || formItem.id!.toLowerCase();
|
|
285
|
-
const deField =
|
|
286
|
-
formItem.fieldName || (item as IDEEditFormItem).appDEFieldId!;
|
|
287
|
-
let mapField: UIMapField;
|
|
288
|
-
if (deField) {
|
|
289
|
-
mapField = new UIMapField(uiKey, deField, {
|
|
290
|
-
isOriginField: true,
|
|
291
|
-
});
|
|
292
|
-
} else {
|
|
293
|
-
// 前台属性和没属性的表单项,或预置属性
|
|
294
|
-
mapField = new UIMapField(uiKey, uiKey, {
|
|
295
|
-
isOriginField: true,
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
this.dataUIMap.set(uiKey, mapField);
|
|
299
|
-
}
|
|
300
285
|
},
|
|
301
286
|
{
|
|
302
287
|
childrenFields: ['deformPages', 'deformDetails'],
|
|
@@ -319,4 +304,21 @@ export class EditFormService<
|
|
|
319
304
|
}
|
|
320
305
|
return res as IHttpResponse<ControlVO>;
|
|
321
306
|
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* 保存时根据表单项过滤出传给后台的数据
|
|
310
|
+
*
|
|
311
|
+
* @return {*}
|
|
312
|
+
* @author: zhujiamin
|
|
313
|
+
* @Date: 2023-09-01 10:04:25
|
|
314
|
+
*/
|
|
315
|
+
getFilteredData(data: IData): IData {
|
|
316
|
+
const tempData: IData = {};
|
|
317
|
+
this.dataUIMap.forEach(dataUI => {
|
|
318
|
+
if (data[dataUI.dataKey] !== undefined) {
|
|
319
|
+
tempData[dataUI.dataKey] = data[dataUI.dataKey];
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
return tempData;
|
|
323
|
+
}
|
|
322
324
|
}
|
|
@@ -162,6 +162,18 @@ export class FormItemController
|
|
|
162
162
|
return this.model.valueFormat;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
/**
|
|
166
|
+
* 数据类型
|
|
167
|
+
*
|
|
168
|
+
* @author zhanghengfeng
|
|
169
|
+
* @date 2023-09-01 11:09:00
|
|
170
|
+
* @readonly
|
|
171
|
+
* @type {(number | undefined)}
|
|
172
|
+
*/
|
|
173
|
+
get dataType(): number | undefined {
|
|
174
|
+
return this.model.dataType;
|
|
175
|
+
}
|
|
176
|
+
|
|
165
177
|
/**
|
|
166
178
|
* 初始化
|
|
167
179
|
*
|
|
@@ -67,7 +67,7 @@ export class FormMDCtrlRepeaterGridController extends FormMDCtrlContentTypeContr
|
|
|
67
67
|
public initColumns(details: IDEFormDetail[]): void {
|
|
68
68
|
details.forEach(async detail => {
|
|
69
69
|
if (detail.detailType === 'FORMITEM') {
|
|
70
|
-
const { editor } = detail as IDEFormItem;
|
|
70
|
+
const { editor, dataType } = detail as IDEFormItem;
|
|
71
71
|
const editorProvider = await getEditorProvider(editor!);
|
|
72
72
|
if (editorProvider) {
|
|
73
73
|
const c = await editorProvider.createController(editor!, {
|
|
@@ -75,6 +75,7 @@ export class FormMDCtrlRepeaterGridController extends FormMDCtrlContentTypeContr
|
|
|
75
75
|
valueFormat: (editor as IDEFormItem).valueFormat,
|
|
76
76
|
context: this.parent.form.context,
|
|
77
77
|
params: this.parent.form.params,
|
|
78
|
+
dataType,
|
|
78
79
|
});
|
|
79
80
|
this.editorMap[detail.codeName!] = {
|
|
80
81
|
provider: editorProvider,
|
|
@@ -31,6 +31,7 @@ import { ControlVO, Srfuf } from '../../../../service';
|
|
|
31
31
|
import { MDControlController } from '../../../common';
|
|
32
32
|
import { GridNotifyState } from '../../../constant';
|
|
33
33
|
import { isValueChange } from '../../../utils';
|
|
34
|
+
import { ScriptFactory } from '../../../../utils';
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
* 表格控制器
|
|
@@ -567,11 +568,36 @@ export class GridController
|
|
|
567
568
|
key: column.codeName!,
|
|
568
569
|
caption: column.caption!,
|
|
569
570
|
hidden: !!column.hideDefault,
|
|
571
|
+
uaColumn: column.columnType === 'UAGRIDCOLUMN',
|
|
570
572
|
});
|
|
571
573
|
}
|
|
572
574
|
},
|
|
573
575
|
{ childrenFields: ['degridColumns'] },
|
|
574
576
|
);
|
|
577
|
+
this.calcColumnFixed();
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* 计算列的固定状态
|
|
582
|
+
* @author lxm
|
|
583
|
+
* @date 2023-08-31 05:12:27
|
|
584
|
+
* @protected
|
|
585
|
+
*/
|
|
586
|
+
protected calcColumnFixed(): void {
|
|
587
|
+
const showColumns = this.state.columnStates.filter(
|
|
588
|
+
column => !column.hidden,
|
|
589
|
+
);
|
|
590
|
+
const allNum = showColumns.length;
|
|
591
|
+
const { frozenFirstColumn, frozenLastColumn } = this.model;
|
|
592
|
+
showColumns.forEach((column, index) => {
|
|
593
|
+
if (column.uaColumn) {
|
|
594
|
+
column.fixed = index + 1 <= Math.floor(allNum / 2) ? 'left' : 'right';
|
|
595
|
+
} else if (frozenFirstColumn && index < frozenFirstColumn) {
|
|
596
|
+
column.fixed = 'left';
|
|
597
|
+
} else if (frozenLastColumn && index >= allNum - frozenLastColumn) {
|
|
598
|
+
column.fixed = 'right';
|
|
599
|
+
}
|
|
600
|
+
});
|
|
575
601
|
}
|
|
576
602
|
|
|
577
603
|
/**
|
|
@@ -778,22 +804,28 @@ export class GridController
|
|
|
778
804
|
throw new RuntimeError(`没找到${updateId}编辑列更新`);
|
|
779
805
|
}
|
|
780
806
|
|
|
781
|
-
const { appDEMethodId, degeiupdateDetails } =
|
|
807
|
+
const { appDEMethodId, degeiupdateDetails, customCode, scriptCode } =
|
|
808
|
+
findUpdate;
|
|
782
809
|
const updateItems = degeiupdateDetails!.map(item => item.id!);
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
params,
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
updateItems.map(itemName => {
|
|
794
|
-
return this.setRowValue(row, itemName, result[itemName]);
|
|
795
|
-
}),
|
|
810
|
+
if (customCode && scriptCode) {
|
|
811
|
+
ScriptFactory.execScriptFn({ data: row.data }, scriptCode, {
|
|
812
|
+
isAsync: false,
|
|
813
|
+
});
|
|
814
|
+
} else {
|
|
815
|
+
const params = { ...this.params, ...row.data.getOrigin() };
|
|
816
|
+
const res = await this.service.updateGridEditItem(
|
|
817
|
+
appDEMethodId!,
|
|
818
|
+
this.context,
|
|
819
|
+
params,
|
|
796
820
|
);
|
|
821
|
+
const result = res.data;
|
|
822
|
+
if (result && updateItems?.length) {
|
|
823
|
+
await Promise.all(
|
|
824
|
+
updateItems.map(itemName => {
|
|
825
|
+
return this.setRowValue(row, itemName, result![itemName]);
|
|
826
|
+
}),
|
|
827
|
+
);
|
|
828
|
+
}
|
|
797
829
|
}
|
|
798
830
|
}
|
|
799
831
|
|
|
@@ -64,7 +64,10 @@ export class GridService extends MDControlService<IDEGrid> {
|
|
|
64
64
|
context: IParams,
|
|
65
65
|
params: IParams = {},
|
|
66
66
|
): Promise<IHttpResponse<ControlVO>> {
|
|
67
|
-
|
|
67
|
+
const entityService = await this.app.deService.getService(
|
|
68
|
+
this.model.appDataEntityId!,
|
|
69
|
+
);
|
|
70
|
+
let res = await entityService.exec(methodName, context, params);
|
|
68
71
|
res = this.handleResponse(res);
|
|
69
72
|
return res as IHttpResponse<ControlVO>;
|
|
70
73
|
}
|
package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
CHANGED
|
@@ -206,7 +206,7 @@ export class GridFieldColumnController extends GridColumnController<IDEGridField
|
|
|
206
206
|
* @return {*} {(string | undefined)}
|
|
207
207
|
*/
|
|
208
208
|
calcFieldAgg(items: IData[]): string | undefined {
|
|
209
|
-
const { aggField, aggMode, aggValueFormat } = this.model;
|
|
209
|
+
const { aggField, aggMode, aggValueFormat, unitName } = this.model;
|
|
210
210
|
// 无聚合配置的列,返回undefined
|
|
211
211
|
if (aggMode === 'NONE') {
|
|
212
212
|
return;
|
|
@@ -250,20 +250,24 @@ export class GridFieldColumnController extends GridColumnController<IDEGridField
|
|
|
250
250
|
`暂未支持聚合模式${this.grid.model.aggMode}`,
|
|
251
251
|
);
|
|
252
252
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
253
|
+
|
|
254
|
+
let value = `${aggValue}`;
|
|
256
255
|
|
|
257
256
|
// 聚合值格式化
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
);
|
|
257
|
+
if (aggValueFormat) {
|
|
258
|
+
try {
|
|
259
|
+
value = ibiz.util.text.format(`${aggValue}`, aggValueFormat);
|
|
260
|
+
} catch (error) {
|
|
261
|
+
ibiz.log.error(`${aggValue} 值格式化错误`);
|
|
262
|
+
}
|
|
265
263
|
}
|
|
266
|
-
|
|
264
|
+
|
|
265
|
+
// 添加单位
|
|
266
|
+
if (value && unitName) {
|
|
267
|
+
value += unitName;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return value;
|
|
267
271
|
}
|
|
268
272
|
|
|
269
273
|
/**
|
|
@@ -9,6 +9,14 @@ import { DELogicParam } from './de-logic-param/de-logic-param';
|
|
|
9
9
|
* @class DELogicContext
|
|
10
10
|
*/
|
|
11
11
|
export class DELogicContext {
|
|
12
|
+
/**
|
|
13
|
+
* 上一次返回值
|
|
14
|
+
* @author lxm
|
|
15
|
+
* @date 2023-09-04 09:22:52
|
|
16
|
+
* @type {unknown}
|
|
17
|
+
*/
|
|
18
|
+
lastReturn: unknown;
|
|
19
|
+
|
|
12
20
|
/**
|
|
13
21
|
* Creates an instance of DELogicContext.
|
|
14
22
|
* @author lxm
|
|
@@ -82,4 +90,28 @@ export class DELogicContext {
|
|
|
82
90
|
* @type {string}
|
|
83
91
|
*/
|
|
84
92
|
defaultParamName: string = 'Default';
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 设置上一次返回值
|
|
96
|
+
* @author lxm
|
|
97
|
+
* @date 2023-09-04 09:23:52
|
|
98
|
+
* @param {unknown} value
|
|
99
|
+
*/
|
|
100
|
+
setLastReturn(value: unknown): void {
|
|
101
|
+
this.lastReturn = value;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 初始化上一次返回参数类型的逻辑参数
|
|
106
|
+
* @author lxm
|
|
107
|
+
* @date 2023-09-04 09:52:00
|
|
108
|
+
* @param {string} tag
|
|
109
|
+
*/
|
|
110
|
+
initLastReturnParam(tag: string): void {
|
|
111
|
+
Object.defineProperty(this.params, tag, {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
configurable: true,
|
|
114
|
+
get: () => this.lastReturn,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
85
117
|
}
|
|
@@ -48,7 +48,8 @@ export class DELogicParam {
|
|
|
48
48
|
// 数据对象变量
|
|
49
49
|
ctx.params[tag] = {};
|
|
50
50
|
} else if (m.lastReturnParam) {
|
|
51
|
-
|
|
51
|
+
// 上一次调用返回
|
|
52
|
+
ctx.initLastReturnParam(tag);
|
|
52
53
|
} else if (m.appContextParam) {
|
|
53
54
|
// 应用上下文
|
|
54
55
|
ctx.params[tag] = ctx.context;
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
MDCtrlRemoveParams,
|
|
11
11
|
ISearchBarController,
|
|
12
12
|
MDCtrlLoadParams,
|
|
13
|
+
EventBase,
|
|
13
14
|
} from '../interface';
|
|
14
15
|
import { calcDeCodeNameById } from '../model';
|
|
15
16
|
import { ViewEngineBase } from './view-base.engine';
|
|
@@ -82,9 +83,7 @@ export class MDViewEngine extends ViewEngineBase {
|
|
|
82
83
|
async onMounted(): Promise<void> {
|
|
83
84
|
await super.onMounted();
|
|
84
85
|
const { model } = this.view;
|
|
85
|
-
this.xdataControl.evt.on('onActive',
|
|
86
|
-
await this.openData(event);
|
|
87
|
-
});
|
|
86
|
+
this.xdataControl.evt.on('onActive', this.onXDataActive.bind(this));
|
|
88
87
|
this.xdataControl.evt.on('onSelectionChange', async event => {
|
|
89
88
|
// 更新工具栏状态
|
|
90
89
|
this.toolbar?.calcButtonState(
|
|
@@ -135,6 +134,18 @@ export class MDViewEngine extends ViewEngineBase {
|
|
|
135
134
|
}
|
|
136
135
|
}
|
|
137
136
|
|
|
137
|
+
/**
|
|
138
|
+
* 多数据部件激活事件处理
|
|
139
|
+
* @author lxm
|
|
140
|
+
* @date 2023-08-31 02:53:37
|
|
141
|
+
* @protected
|
|
142
|
+
* @param {EventBase} event
|
|
143
|
+
* @return {*} {Promise<void>}
|
|
144
|
+
*/
|
|
145
|
+
protected async onXDataActive(event: EventBase): Promise<void> {
|
|
146
|
+
await this.openData(event);
|
|
147
|
+
}
|
|
148
|
+
|
|
138
149
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
139
150
|
async call(key: string, args: any): Promise<IData | null | undefined> {
|
|
140
151
|
if (key === SysUIActionTag.TOGGLE_FILTER) {
|
|
@@ -37,4 +37,13 @@ export interface IEditorContainerController {
|
|
|
37
37
|
* @type {IParams}
|
|
38
38
|
*/
|
|
39
39
|
params: IParams;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 数据类型
|
|
43
|
+
*
|
|
44
|
+
* @author zhanghengfeng
|
|
45
|
+
* @date 2023-09-01 11:09:38
|
|
46
|
+
* @type {(number | undefined)}
|
|
47
|
+
*/
|
|
48
|
+
dataType: number | undefined;
|
|
40
49
|
}
|