@ibiz-template/runtime 0.1.16 → 0.1.18
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 +339 -142
- 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 +4 -2
- package/out/controller/common/index.d.ts +1 -0
- package/out/controller/common/index.d.ts.map +1 -1
- package/out/controller/common/index.js +1 -0
- 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/common/view/wf-step-trace-view.controller.d.ts +8 -0
- package/out/controller/common/view/wf-step-trace-view.controller.d.ts.map +1 -0
- package/out/controller/common/view/wf-step-trace-view.controller.js +20 -0
- 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 -0
- 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.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +16 -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.js +1 -1
- package/out/controller/control/list/list.controller.d.ts.map +1 -1
- package/out/controller/control/list/list.controller.js +1 -0
- 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 +7 -0
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +11 -2
- 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/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/i-wf-step-trace-view.state.d.ts +6 -0
- package/out/interface/controller/state/view/i-wf-step-trace-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/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 +5 -6
- 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/package.json +3 -3
- package/src/controller/common/control/md-control.controller.ts +4 -2
- package/src/controller/common/index.ts +1 -0
- package/src/controller/common/view/view.controller.ts +5 -1
- package/src/controller/common/view/wf-step-trace-view.controller.ts +36 -0
- package/src/controller/control/exp-bar/exp-bar.controller.ts +2 -0
- 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 +21 -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 +1 -1
- package/src/controller/control/list/list.controller.ts +1 -0
- 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 +12 -2
- 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/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/i-wf-step-trace-view.state.ts +8 -1
- package/src/interface/controller/state/view/index.ts +1 -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 +5 -7
- 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
|
@@ -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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"author": "chitanda",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@ibiz-template/core": "^0.1.
|
|
32
|
+
"@ibiz-template/core": "^0.1.18",
|
|
33
33
|
"@ibiz/model-core": "^0.0.15",
|
|
34
34
|
"@types/path-browserify": "^1.0.0",
|
|
35
35
|
"@types/qs": "^6.9.7",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"qx-util": "^0.4.8",
|
|
58
58
|
"ramda": "^0.29.0"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "d363fb94c05e098f5a6c928533788e7cba99f833"
|
|
61
61
|
}
|
|
@@ -229,7 +229,7 @@ export class MDControlController<
|
|
|
229
229
|
needRefresh = true;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
this.afterRemove(
|
|
232
|
+
this.afterRemove(item);
|
|
233
233
|
}),
|
|
234
234
|
);
|
|
235
235
|
|
|
@@ -268,7 +268,9 @@ export class MDControlController<
|
|
|
268
268
|
const index = this.state.items.findIndex(
|
|
269
269
|
item => item.srfkey === data.srfkey,
|
|
270
270
|
);
|
|
271
|
-
|
|
271
|
+
if (index !== -1) {
|
|
272
|
+
this.state.items.splice(index, 1);
|
|
273
|
+
}
|
|
272
274
|
}
|
|
273
275
|
|
|
274
276
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { MobViewController } from './view/mob-view.controller';
|
|
2
2
|
export { ViewController } from './view/view.controller';
|
|
3
|
+
export { WFStepTraceViewController } from './view/wf-step-trace-view.controller';
|
|
3
4
|
export { BaseController } from './base.controller';
|
|
4
5
|
export { EditorController } from './editor/editor.controller';
|
|
5
6
|
export { CodeListEditorController } from './editor/code-list-editor.controller';
|
|
@@ -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
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IAppView } from '@ibiz/model-core';
|
|
2
|
+
import {
|
|
3
|
+
IViewController,
|
|
4
|
+
IViewEvent,
|
|
5
|
+
IWFStepTraceViewState,
|
|
6
|
+
} from '../../../interface';
|
|
7
|
+
import { ViewController } from './view.controller';
|
|
8
|
+
|
|
9
|
+
export class WFStepTraceViewController<
|
|
10
|
+
T extends IAppView = IAppView,
|
|
11
|
+
S extends IWFStepTraceViewState = IWFStepTraceViewState,
|
|
12
|
+
E extends IViewEvent = IViewEvent,
|
|
13
|
+
>
|
|
14
|
+
extends ViewController<T, S, E>
|
|
15
|
+
implements IViewController<T, S, E>
|
|
16
|
+
{
|
|
17
|
+
protected initState(): void {
|
|
18
|
+
super.initState();
|
|
19
|
+
this.state.historyData = null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
protected async onCreated(): Promise<void> {
|
|
23
|
+
await super.onCreated();
|
|
24
|
+
const app = ibiz.hub.getApp(this.context.srfappid);
|
|
25
|
+
if (this.ctx.parent?.view.model.appDataEntityId) {
|
|
26
|
+
const entityService = await app.deService.getService(
|
|
27
|
+
this.ctx.parent.view.model.appDataEntityId,
|
|
28
|
+
);
|
|
29
|
+
const params = Object.assign(this.context.clone(), this.params);
|
|
30
|
+
const res = await entityService.wf.getWFHistory(params);
|
|
31
|
+
if (res.data) {
|
|
32
|
+
this.state.historyData = res.data;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -278,6 +278,8 @@ export class ExpBarControlController<
|
|
|
278
278
|
protected defaultNavByFirstItem(): void {
|
|
279
279
|
const data = this.xDataController.state.items[0];
|
|
280
280
|
if (!data) {
|
|
281
|
+
// 导航视图传空让他导航占位绘制空界面
|
|
282
|
+
this._evt.emit('onNavViewChange', { navViewMsg: { key: '' } });
|
|
281
283
|
return;
|
|
282
284
|
}
|
|
283
285
|
// 默认选中并激活第一项
|
|
@@ -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
|
* 表格控制器
|
|
@@ -803,22 +804,28 @@ export class GridController
|
|
|
803
804
|
throw new RuntimeError(`没找到${updateId}编辑列更新`);
|
|
804
805
|
}
|
|
805
806
|
|
|
806
|
-
const { appDEMethodId, degeiupdateDetails } =
|
|
807
|
+
const { appDEMethodId, degeiupdateDetails, customCode, scriptCode } =
|
|
808
|
+
findUpdate;
|
|
807
809
|
const updateItems = degeiupdateDetails!.map(item => item.id!);
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
params,
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
updateItems.map(itemName => {
|
|
819
|
-
return this.setRowValue(row, itemName, result[itemName]);
|
|
820
|
-
}),
|
|
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,
|
|
821
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
|
+
}
|
|
822
829
|
}
|
|
823
830
|
}
|
|
824
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
|
@@ -279,7 +279,7 @@ export class GridFieldColumnController extends GridColumnController<IDEGridField
|
|
|
279
279
|
*/
|
|
280
280
|
formatValue(value: unknown = ''): string {
|
|
281
281
|
// 根据数据类型增强转换显示文本
|
|
282
|
-
if (this.model.valueType) {
|
|
282
|
+
if (this.model.valueType !== 'SIMPLE') {
|
|
283
283
|
return ValueExUtil.toText(this.model, value);
|
|
284
284
|
}
|
|
285
285
|
|
|
@@ -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;
|
|
@@ -117,14 +117,14 @@ export class MDViewEngine extends ViewEngineBase {
|
|
|
117
117
|
// 搜索表单搜索触发加载
|
|
118
118
|
if (this.searchForm) {
|
|
119
119
|
this.searchForm.evt.on('onSearch', () => {
|
|
120
|
-
this.
|
|
120
|
+
this.reLoad();
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
// 搜索栏搜索触发加载
|
|
125
125
|
if (this.searchBar) {
|
|
126
126
|
this.searchBar.evt.on('onSearch', () => {
|
|
127
|
-
this.
|
|
127
|
+
this.reLoad();
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -304,6 +304,16 @@ export class MDViewEngine extends ViewEngineBase {
|
|
|
304
304
|
await this.xdataControl.refresh();
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
+
/**
|
|
308
|
+
* 视图重新加载
|
|
309
|
+
* @author lxm
|
|
310
|
+
* @date 2023-05-22 03:17:33
|
|
311
|
+
* @return {*} {Promise<void>}
|
|
312
|
+
*/
|
|
313
|
+
protected async reLoad(): Promise<void> {
|
|
314
|
+
await this.xdataControl.load({ isInitialLoad: true });
|
|
315
|
+
}
|
|
316
|
+
|
|
307
317
|
/**
|
|
308
318
|
* 获取搜索相关的查询参数
|
|
309
319
|
* @author lxm
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IPickupDataViewEvent } from './i-pickup-data-view.event';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 表单选择数据视图事件
|
|
5
|
+
*
|
|
6
|
+
* @author zk
|
|
7
|
+
* @date 2023-09-01 02:09:26
|
|
8
|
+
* @export
|
|
9
|
+
* @interface IFormPickupDataViewEvent
|
|
10
|
+
* @extends {IMDViewEvent}
|
|
11
|
+
*/
|
|
12
|
+
export interface IFormPickupDataViewEvent extends IPickupDataViewEvent {}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IPickupDataViewState } from './i-pickup-data-view.state';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 表单选择数据视图UI状态
|
|
5
|
+
*
|
|
6
|
+
* @author zk
|
|
7
|
+
* @date 2023-09-01 02:09:26
|
|
8
|
+
* @export
|
|
9
|
+
* @interface IFormPickupDataViewState
|
|
10
|
+
* @extends {IMDViewState}
|
|
11
|
+
*/
|
|
12
|
+
export interface IFormPickupDataViewState extends IPickupDataViewState {}
|
|
@@ -32,4 +32,12 @@ export interface IViewState extends IControllerState, IViewSession {
|
|
|
32
32
|
* @type {boolean}
|
|
33
33
|
*/
|
|
34
34
|
noLoadDefault: boolean;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 设置关闭视图时返回给外面的状态
|
|
38
|
+
* @author lxm
|
|
39
|
+
* @date 2023-09-01 10:37:46
|
|
40
|
+
* @type {boolean}
|
|
41
|
+
*/
|
|
42
|
+
closeOK?: boolean;
|
|
35
43
|
}
|
|
@@ -7,4 +7,11 @@ import { IViewState } from './i-view.state';
|
|
|
7
7
|
* @class IWFDynaActionViewState
|
|
8
8
|
* @extends {IViewState}
|
|
9
9
|
*/
|
|
10
|
-
export interface IWFStepTraceViewState extends IViewState {
|
|
10
|
+
export interface IWFStepTraceViewState extends IViewState {
|
|
11
|
+
/**
|
|
12
|
+
* 工作流历史数据
|
|
13
|
+
* @return {*}
|
|
14
|
+
* @author: zhujiamin
|
|
15
|
+
*/
|
|
16
|
+
historyData: IData | null;
|
|
17
|
+
}
|