@ibiz-template/runtime 0.0.3-beta.3 → 0.0.3-beta.4
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/system/index.system.js +1 -1
- package/out/config/global-config.d.ts +3 -0
- package/out/config/global-config.d.ts.map +1 -1
- package/out/config/global-config.js +3 -0
- package/out/controller/control/form/edit-form.d.ts.map +1 -1
- package/out/controller/control/form/edit-form.js +6 -1
- package/out/controller/control/form/form-button.d.ts.map +1 -1
- package/out/controller/control/form/form-button.js +1 -1
- package/out/controller/control/form/form-detail.d.ts +2 -2
- package/out/controller/control/form/form-detail.d.ts.map +1 -1
- package/out/controller/control/form/form-detail.js +2 -2
- package/out/controller/control/form/form-druipart.d.ts +2 -2
- package/out/controller/control/form/form-druipart.d.ts.map +1 -1
- package/out/controller/control/form/form-druipart.js +4 -4
- package/out/controller/control/form/form-item.d.ts +2 -2
- package/out/controller/control/form/form-item.d.ts.map +1 -1
- package/out/controller/control/form/form-item.js +4 -4
- package/out/controller/control/form/form.d.ts +1 -1
- package/out/controller/control/form/form.d.ts.map +1 -1
- package/out/controller/control/form/form.js +19 -7
- package/out/controller/control/form/search-form.d.ts +1 -1
- package/out/controller/control/form/search-form.d.ts.map +1 -1
- package/out/controller/control/form/search-form.js +2 -2
- package/out/controller/control/grid/grid-field-column.d.ts +1 -1
- package/out/controller/control/grid/grid-field-column.d.ts.map +1 -1
- package/out/controller/control/grid/grid-field-column.js +8 -2
- package/out/controller/control/grid/grid-row.d.ts +8 -0
- package/out/controller/control/grid/grid-row.d.ts.map +1 -1
- package/out/controller/control/grid/grid-row.js +8 -0
- package/out/controller/control/grid/grid.d.ts +1 -1
- package/out/controller/control/grid/grid.d.ts.map +1 -1
- package/out/controller/control/grid/grid.js +27 -8
- package/out/controller/control/portlet/portlet-part.js +3 -4
- package/out/controller/editor/autocomplete.d.ts +73 -0
- package/out/controller/editor/autocomplete.d.ts.map +1 -0
- package/out/controller/editor/autocomplete.js +117 -0
- package/out/controller/editor/check-box.d.ts +12 -0
- package/out/controller/editor/check-box.d.ts.map +1 -0
- package/out/controller/editor/check-box.js +10 -0
- package/out/controller/editor/code-list-editor.d.ts.map +1 -1
- package/out/controller/editor/code-list-editor.js +1 -1
- package/out/controller/editor/editor.d.ts +1 -1
- package/out/controller/editor/editor.d.ts.map +1 -1
- package/out/controller/editor/editor.js +6 -6
- package/out/controller/editor/index.d.ts +4 -0
- package/out/controller/editor/index.d.ts.map +1 -1
- package/out/controller/editor/index.js +4 -0
- package/out/controller/editor/list-box-picker.d.ts +42 -0
- package/out/controller/editor/list-box-picker.d.ts.map +1 -0
- package/out/controller/editor/list-box-picker.js +67 -0
- package/out/controller/editor/list-box.d.ts +11 -0
- package/out/controller/editor/list-box.d.ts.map +1 -0
- package/out/controller/editor/list-box.js +9 -0
- package/out/controller/editor/picker.d.ts +6 -2
- package/out/controller/editor/picker.d.ts.map +1 -1
- package/out/controller/editor/picker.js +20 -10
- package/out/controller/interface/register/i-view-register.d.ts +2 -2
- package/out/controller/interface/register/i-view-register.d.ts.map +1 -1
- package/out/controller/neuron/nerve/view/grid-exp-view-nerve.d.ts.map +1 -1
- package/out/controller/neuron/nerve/view/grid-exp-view-nerve.js +1 -0
- package/out/controller/neuron/nerve/view/kanban-view-nerve.d.ts.map +1 -1
- package/out/controller/neuron/nerve/view/kanban-view-nerve.js +1 -0
- package/out/controller/neuron/nerve/view/list-exp-view-nerve.d.ts.map +1 -1
- package/out/controller/neuron/nerve/view/list-exp-view-nerve.js +1 -0
- package/out/controller/register/control-register.d.ts.map +1 -1
- package/out/controller/register/control-register.js +1 -0
- package/out/controller/register/editor-register.d.ts.map +1 -1
- package/out/controller/register/editor-register.js +2 -0
- package/out/controller/register/view-register.d.ts +2 -2
- package/out/controller/register/view-register.d.ts.map +1 -1
- package/out/controller/register/view-register.js +10 -12
- package/out/controller/state/control/form/form-state.d.ts +8 -0
- package/out/controller/state/control/form/form-state.d.ts.map +1 -1
- package/out/controller/state/control/form/form-state.js +8 -0
- package/out/controller/view/md-view.d.ts +0 -27
- package/out/controller/view/md-view.d.ts.map +1 -1
- package/out/controller/view/md-view.js +1 -28
- package/out/controller/view/pickup-grid-view.js +1 -1
- package/out/de-logic/de-logic-context.d.ts +28 -0
- package/out/de-logic/de-logic-context.d.ts.map +1 -0
- package/out/de-logic/de-logic-context.js +29 -0
- package/out/de-logic/de-logic-link/de-logic-link-cond/de-logic-link-cond.d.ts +11 -0
- package/out/de-logic/de-logic-link/de-logic-link-cond/de-logic-link-cond.d.ts.map +1 -0
- package/out/de-logic/de-logic-link/de-logic-link-cond/de-logic-link-cond.js +10 -0
- package/out/de-logic/de-logic-link/de-logic-link-group-cond/de-logic-link-group-cond.d.ts +58 -0
- package/out/de-logic/de-logic-link/de-logic-link-group-cond/de-logic-link-group-cond.d.ts.map +1 -0
- package/out/de-logic/de-logic-link/de-logic-link-group-cond/de-logic-link-group-cond.js +79 -0
- package/out/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.d.ts +48 -0
- package/out/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.d.ts.map +1 -0
- package/out/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.js +65 -0
- package/out/de-logic/de-logic-link/de-logic-link.d.ts +59 -0
- package/out/de-logic/de-logic-link/de-logic-link.d.ts.map +1 -0
- package/out/de-logic/de-logic-link/de-logic-link.js +67 -0
- package/out/de-logic/de-logic-node/bind-param-node/bind-param-node.d.ts +15 -0
- package/out/de-logic/de-logic-node/bind-param-node/bind-param-node.d.ts.map +1 -0
- package/out/de-logic/de-logic-node/bind-param-node/bind-param-node.js +25 -0
- package/out/de-logic/de-logic-node/data-set-node/data-set-node.d.ts +15 -0
- package/out/de-logic/de-logic-node/data-set-node/data-set-node.d.ts.map +1 -0
- package/out/de-logic/de-logic-node/data-set-node/data-set-node.js +29 -0
- package/out/de-logic/de-logic-node/de-action-node/de-action-node.d.ts +15 -0
- package/out/de-logic/de-logic-node/de-action-node/de-action-node.d.ts.map +1 -0
- package/out/de-logic/de-logic-node/de-action-node/de-action-node.js +36 -0
- package/out/de-logic/de-logic-node/de-logic-node.d.ts +43 -0
- package/out/de-logic/de-logic-node/de-logic-node.d.ts.map +1 -0
- package/out/de-logic/de-logic-node/de-logic-node.js +22 -0
- package/out/de-logic/de-logic-node/end-node/end-node.d.ts +15 -0
- package/out/de-logic/de-logic-node/end-node/end-node.d.ts.map +1 -0
- package/out/de-logic/de-logic-node/end-node/end-node.js +37 -0
- package/out/de-logic/de-logic-node/index.d.ts +8 -0
- package/out/de-logic/de-logic-node/index.d.ts.map +1 -0
- package/out/de-logic/de-logic-node/index.js +7 -0
- package/out/de-logic/de-logic-node/prepare-param-node/prepare-param-node.d.ts +15 -0
- package/out/de-logic/de-logic-node/prepare-param-node/prepare-param-node.d.ts.map +1 -0
- package/out/de-logic/de-logic-node/prepare-param-node/prepare-param-node.js +15 -0
- package/out/de-logic/de-logic-node/start-node/start-node.d.ts +15 -0
- package/out/de-logic/de-logic-node/start-node/start-node.d.ts.map +1 -0
- package/out/de-logic/de-logic-node/start-node/start-node.js +15 -0
- package/out/de-logic/de-logic-node/throw-exception-node/throw-exception-node.d.ts +15 -0
- package/out/de-logic/de-logic-node/throw-exception-node/throw-exception-node.d.ts.map +1 -0
- package/out/de-logic/de-logic-node/throw-exception-node/throw-exception-node.js +23 -0
- package/out/de-logic/de-logic-param/de-logic-param.d.ts +33 -0
- package/out/de-logic/de-logic-param/de-logic-param.d.ts.map +1 -0
- package/out/de-logic/de-logic-param/de-logic-param.js +93 -0
- package/out/de-logic/de-logic.d.ts +79 -0
- package/out/de-logic/de-logic.d.ts.map +1 -0
- package/out/de-logic/de-logic.js +157 -0
- package/out/de-logic/index.d.ts +17 -0
- package/out/de-logic/index.d.ts.map +1 -0
- package/out/de-logic/index.js +38 -0
- package/out/interface/i-global-config/i-global-config.d.ts +31 -0
- package/out/interface/i-global-config/i-global-config.d.ts.map +1 -1
- package/out/interface/i-plugin-factory/i-plugin-factory.d.ts +8 -23
- package/out/interface/i-plugin-factory/i-plugin-factory.d.ts.map +1 -1
- package/out/interface/i-plugin-item/i-plugin-item.d.ts +1 -8
- package/out/interface/i-plugin-item/i-plugin-item.d.ts.map +1 -1
- package/out/service/dto/method.dto.d.ts +3 -3
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +22 -22
- package/out/service/entity/entity.d.ts +9 -0
- package/out/service/entity/entity.d.ts.map +1 -1
- package/out/service/entity/entity.js +11 -2
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +12 -4
- package/out/service/service/entity/method/method-renturn.js +2 -2
- package/out/service/service/entity/method/method.d.ts +1 -1
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +28 -25
- package/out/service/service/widget/control-service.d.ts +1 -1
- package/out/service/service/widget/control-service.d.ts.map +1 -1
- package/out/service/service/widget/control-service.js +2 -2
- package/out/service/service/widget/edit-form-service.d.ts.map +1 -1
- package/out/service/service/widget/edit-form-service.js +3 -3
- package/out/service/service/widget/md-control-service.d.ts.map +1 -1
- package/out/service/service/widget/md-control-service.js +3 -3
- package/out/service/service/widget/wizard-panel-service.d.ts +2 -2
- package/out/service/service/widget/wizard-panel-service.d.ts.map +1 -1
- package/out/service/service/widget/wizard-panel-service.js +4 -4
- package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
- package/out/service/utils/dynamic-code-list/dynamic-code-list.js +5 -2
- package/out/service/vo/tree-node-data/tree-data-set-node-data.js +2 -2
- package/out/ui-logic/ui-logic.d.ts +1 -1
- package/out/ui-logic/ui-logic.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.js +4 -0
- package/package.json +6 -6
- package/src/config/global-config.ts +6 -0
- package/src/controller/control/form/edit-form.ts +7 -1
- package/src/controller/control/form/form-button.ts +4 -1
- package/src/controller/control/form/form-detail.ts +2 -2
- package/src/controller/control/form/form-druipart.ts +4 -4
- package/src/controller/control/form/form-item.ts +7 -4
- package/src/controller/control/form/form.ts +21 -7
- package/src/controller/control/form/search-form.ts +2 -2
- package/src/controller/control/grid/grid-field-column.ts +8 -2
- package/src/controller/control/grid/grid-row.ts +9 -0
- package/src/controller/control/grid/grid.ts +32 -9
- package/src/controller/control/portlet/portlet-part.ts +3 -3
- package/src/controller/editor/autocomplete.ts +138 -0
- package/src/controller/editor/check-box.ts +11 -0
- package/src/controller/editor/code-list-editor.ts +5 -1
- package/src/controller/editor/editor.ts +10 -16
- package/src/controller/editor/index.ts +4 -0
- package/src/controller/editor/list-box-picker.ts +78 -0
- package/src/controller/editor/list-box.ts +10 -0
- package/src/controller/editor/picker.ts +33 -10
- package/src/controller/interface/register/i-view-register.ts +2 -2
- package/src/controller/neuron/nerve/view/grid-exp-view-nerve.ts +4 -0
- package/src/controller/neuron/nerve/view/kanban-view-nerve.ts +4 -0
- package/src/controller/neuron/nerve/view/list-exp-view-nerve.ts +4 -0
- package/src/controller/register/control-register.ts +5 -0
- package/src/controller/register/editor-register.ts +6 -0
- package/src/controller/register/view-register.ts +14 -14
- package/src/controller/state/control/form/form-state.ts +9 -0
- package/src/controller/view/md-view.ts +1 -31
- package/src/controller/view/pickup-grid-view.ts +1 -1
- package/src/de-logic/de-logic-context.ts +28 -0
- package/src/de-logic/de-logic-link/de-logic-link-cond/de-logic-link-cond.ts +9 -0
- package/src/de-logic/de-logic-link/de-logic-link-group-cond/de-logic-link-group-cond.ts +97 -0
- package/src/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.ts +96 -0
- package/src/de-logic/de-logic-link/de-logic-link.ts +80 -0
- package/src/de-logic/de-logic-node/bind-param-node/bind-param-node.ts +33 -0
- package/src/de-logic/de-logic-node/data-set-node/data-set-node.ts +42 -0
- package/src/de-logic/de-logic-node/de-action-node/de-action-node.ts +49 -0
- package/src/de-logic/de-logic-node/de-logic-node.ts +52 -0
- package/src/de-logic/de-logic-node/end-node/end-node.ts +49 -0
- package/src/de-logic/de-logic-node/index.ts +7 -0
- package/src/de-logic/de-logic-node/prepare-param-node/prepare-param-node.ts +23 -0
- package/src/de-logic/de-logic-node/start-node/start-node.ts +23 -0
- package/src/de-logic/de-logic-node/throw-exception-node/throw-exception-node.ts +32 -0
- package/src/de-logic/de-logic-param/de-logic-param.ts +90 -0
- package/src/de-logic/de-logic.ts +190 -0
- package/src/de-logic/index.ts +45 -0
- package/src/interface/i-global-config/i-global-config.ts +34 -0
- package/src/interface/i-plugin-factory/i-plugin-factory.ts +8 -23
- package/src/interface/i-plugin-item/i-plugin-item.ts +1 -8
- package/src/service/dto/method.dto.ts +25 -23
- package/src/service/entity/entity.ts +12 -2
- package/src/service/service/entity/method/de-action.ts +13 -4
- package/src/service/service/entity/method/method-renturn.ts +2 -2
- package/src/service/service/entity/method/method.ts +33 -26
- package/src/service/service/widget/control-service.ts +7 -1
- package/src/service/service/widget/edit-form-service.ts +13 -3
- package/src/service/service/widget/md-control-service.ts +13 -3
- package/src/service/service/widget/wizard-panel-service.ts +4 -2
- package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +6 -2
- package/src/service/vo/tree-node-data/tree-data-set-node-data.ts +2 -2
- package/src/ui-logic/ui-logic.ts +1 -1
- package/src/utils/app-de-ui-action-util/handler/backend-ui-action-handler.ts +6 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { IHttpResponse } from '@ibiz-template/core';
|
|
2
|
+
import {
|
|
3
|
+
AutoCompleteEditorModel,
|
|
4
|
+
DefectModelError,
|
|
5
|
+
} from '@ibiz-template/model';
|
|
6
|
+
import { EditorController } from '.';
|
|
7
|
+
import { DEACModeUtil } from '../utils';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 自动完成编辑器控制器
|
|
11
|
+
* @return {*}
|
|
12
|
+
* @author: zhujiamin
|
|
13
|
+
* @Date: 2022-08-25 10:57:58
|
|
14
|
+
*/
|
|
15
|
+
export class AutoCompleteEditorController extends EditorController<AutoCompleteEditorModel> {
|
|
16
|
+
/**
|
|
17
|
+
* 占位
|
|
18
|
+
* @return {*}
|
|
19
|
+
* @author: zhujiamin
|
|
20
|
+
* @Date: 2022-08-25 14:33:14
|
|
21
|
+
*/
|
|
22
|
+
public placeHolder = '请选择数据';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*值项
|
|
26
|
+
*/
|
|
27
|
+
public valueItem = '';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 主键属性名称
|
|
31
|
+
*/
|
|
32
|
+
public keyName: string = '';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 主文本属性名称
|
|
36
|
+
*/
|
|
37
|
+
public textName: string = '';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 实体codeName
|
|
41
|
+
*/
|
|
42
|
+
public serviceName: string = '';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 数据集codeName
|
|
46
|
+
*/
|
|
47
|
+
public interfaceName: string = '';
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 自填模式sort排序
|
|
51
|
+
*/
|
|
52
|
+
public sort: string | undefined = '';
|
|
53
|
+
|
|
54
|
+
protected async onInit(): Promise<void> {
|
|
55
|
+
super.onInit();
|
|
56
|
+
this.valueItem = this.model.valueItemName?.toLowerCase() || '';
|
|
57
|
+
this.keyName = this.model.appDataEntity?.keyName || '';
|
|
58
|
+
this.textName = this.model.appDataEntity?.textName || '';
|
|
59
|
+
this.getAcParams();
|
|
60
|
+
this.sort = this.getAcSort();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 获取Ac参数
|
|
65
|
+
*/
|
|
66
|
+
public getAcParams() {
|
|
67
|
+
const appDe = this.model.source.getPSAppDataEntity?.();
|
|
68
|
+
const dataSet = this.model.source.getPSAppDEDataSet?.();
|
|
69
|
+
if (appDe && dataSet) {
|
|
70
|
+
this.serviceName = appDe.codeName;
|
|
71
|
+
this.interfaceName = dataSet.codeName;
|
|
72
|
+
}
|
|
73
|
+
if (this.model.deACMode) {
|
|
74
|
+
this.textName = this.model.deACMode.textFieldName || this.textName;
|
|
75
|
+
this.keyName = this.model.deACMode.valueFieldName || this.keyName;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 获取自填模式sort排序
|
|
81
|
+
*/
|
|
82
|
+
public getAcSort() {
|
|
83
|
+
if (this.model.deACMode) {
|
|
84
|
+
const { sortField, sortDir } = this.model.deACMode;
|
|
85
|
+
if (sortField && sortDir) {
|
|
86
|
+
return `${sortField},${sortDir}`;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* 加载实体数据集数据
|
|
94
|
+
*
|
|
95
|
+
* @param {string} query 模糊匹配字符串
|
|
96
|
+
* @param {IData} data 表单数据
|
|
97
|
+
* @returns {*} {Promise<IHttpResponse<IData[]>>}
|
|
98
|
+
* @memberof PickerEditorController
|
|
99
|
+
*/
|
|
100
|
+
public async getServiceData(
|
|
101
|
+
query: string,
|
|
102
|
+
data: IData,
|
|
103
|
+
): Promise<IHttpResponse<IData[]>> {
|
|
104
|
+
const { context, params } = this.handlePublicParams(
|
|
105
|
+
data,
|
|
106
|
+
this.context,
|
|
107
|
+
this.params,
|
|
108
|
+
);
|
|
109
|
+
if (this.sort && !Object.is(this.sort, '')) {
|
|
110
|
+
Object.assign(params, { sort: this.sort });
|
|
111
|
+
}
|
|
112
|
+
Object.assign(params, { query, size: 1000 });
|
|
113
|
+
if (this.serviceName && this.interfaceName) {
|
|
114
|
+
const deService = await this.app.es.getService(this.serviceName);
|
|
115
|
+
const res = await deService.exec(this.interfaceName, context, params);
|
|
116
|
+
return res as IHttpResponse<IData[]>;
|
|
117
|
+
}
|
|
118
|
+
throw new DefectModelError(this.model.source, '请配置实体和实体数据集');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* 计算回填数据
|
|
123
|
+
*
|
|
124
|
+
* @author lxm
|
|
125
|
+
* @date 2022-10-24 16:10:24
|
|
126
|
+
* @param {IData} data 选中数据
|
|
127
|
+
* @returns {*} {Promise<Array<{ name: string; value: any }>>}
|
|
128
|
+
*/
|
|
129
|
+
async calcFillDataItems(
|
|
130
|
+
data: IData,
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
132
|
+
): Promise<Array<{ name: string; value: any }>> {
|
|
133
|
+
if (this.model.deACMode) {
|
|
134
|
+
return DEACModeUtil.calcFillDataItems(data, this.model.deACMode);
|
|
135
|
+
}
|
|
136
|
+
return [];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CheckBoxModel } from '@ibiz-template/model';
|
|
2
|
+
import { EditorController } from '.';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 选项框编辑器控制器
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @class CheckBoxEditorController
|
|
9
|
+
* @extends {EditorController}
|
|
10
|
+
*/
|
|
11
|
+
export class CheckBoxEditorController extends EditorController<CheckBoxModel> {}
|
|
@@ -21,7 +21,11 @@ export class CodeListEditorController<
|
|
|
21
21
|
* @Date: 2022-08-25 15:46:27
|
|
22
22
|
*/
|
|
23
23
|
public async loadCodeList(data: IData): Promise<readonly CodeListItem[]> {
|
|
24
|
-
const { context, params } = this.handlePublicParams(
|
|
24
|
+
const { context, params } = this.handlePublicParams(
|
|
25
|
+
data,
|
|
26
|
+
this.context,
|
|
27
|
+
this.params,
|
|
28
|
+
);
|
|
25
29
|
if (this.model.codeList) {
|
|
26
30
|
let dataItems: readonly CodeListItem[] = [];
|
|
27
31
|
const { codeName } = this.model.codeList;
|
|
@@ -126,30 +126,24 @@ export class EditorController<T extends EditorModel = EditorModel> {
|
|
|
126
126
|
* @author: zhujiamin
|
|
127
127
|
* @Date: 2022-08-25 15:44:14
|
|
128
128
|
*/
|
|
129
|
-
public handlePublicParams(
|
|
129
|
+
public handlePublicParams(
|
|
130
|
+
data: IData,
|
|
131
|
+
context: IBizContext,
|
|
132
|
+
params: IParams,
|
|
133
|
+
) {
|
|
130
134
|
const { navigateContexts, navigateParams } = this.model;
|
|
131
135
|
let selfContext = {};
|
|
132
136
|
if (navigateContexts && data) {
|
|
133
|
-
selfContext = convertNavData(
|
|
134
|
-
navigateContexts!,
|
|
135
|
-
this.context,
|
|
136
|
-
this.params,
|
|
137
|
-
data,
|
|
138
|
-
);
|
|
137
|
+
selfContext = convertNavData(navigateContexts!, context, params, data);
|
|
139
138
|
}
|
|
140
|
-
const
|
|
139
|
+
const _context = new IBizContext(selfContext, context);
|
|
141
140
|
|
|
142
141
|
let selfParams = {};
|
|
143
142
|
if (navigateParams && data) {
|
|
144
|
-
selfParams = convertNavData(
|
|
145
|
-
navigateParams!,
|
|
146
|
-
this.context,
|
|
147
|
-
this.params,
|
|
148
|
-
data,
|
|
149
|
-
);
|
|
143
|
+
selfParams = convertNavData(navigateParams!, context, params, data);
|
|
150
144
|
}
|
|
151
|
-
const
|
|
152
|
-
return { context, params };
|
|
145
|
+
const _params: IParams = { ...params, ...selfParams };
|
|
146
|
+
return { context: _context, params: _params };
|
|
153
147
|
}
|
|
154
148
|
|
|
155
149
|
// 字符串转number
|
|
@@ -13,3 +13,7 @@ export { StepperEditorController } from './stepper';
|
|
|
13
13
|
export { RateEditorController } from './rate';
|
|
14
14
|
export { SliderEditorController } from './slider';
|
|
15
15
|
export { SwitchEditorController } from './switch';
|
|
16
|
+
export { ListBoxEditorController } from './list-box';
|
|
17
|
+
export { ListBoxPickerEditorController } from './list-box-picker';
|
|
18
|
+
export { AutoCompleteEditorController } from './autocomplete';
|
|
19
|
+
export { CheckBoxEditorController } from './check-box';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { IHttpResponse } from '@ibiz-template/core';
|
|
2
|
+
import {
|
|
3
|
+
DefectModelError,
|
|
4
|
+
ListBoxPickerEditorModel,
|
|
5
|
+
} from '@ibiz-template/model';
|
|
6
|
+
import { EditorController } from './editor';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 列表框picker编辑器控制器
|
|
10
|
+
* @return {*}
|
|
11
|
+
* @author: zhujiamin
|
|
12
|
+
* @Date: 2022-08-25 10:57:58
|
|
13
|
+
*/
|
|
14
|
+
export class ListBoxPickerEditorController extends EditorController<ListBoxPickerEditorModel> {
|
|
15
|
+
/**
|
|
16
|
+
* 主键属性名称
|
|
17
|
+
*/
|
|
18
|
+
public keyName: string = '';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 主文本属性名称
|
|
22
|
+
*/
|
|
23
|
+
public textName: string = '';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 实体codeName
|
|
27
|
+
*/
|
|
28
|
+
public serviceName: string = '';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 数据集codeName
|
|
32
|
+
*/
|
|
33
|
+
public interfaceName: string = '';
|
|
34
|
+
|
|
35
|
+
protected async onInit(): Promise<void> {
|
|
36
|
+
super.onInit();
|
|
37
|
+
if (this.model.source.editorType === 'LISTBOXPICKUP') {
|
|
38
|
+
this.keyName = this.model.appDataEntity?.keyName || '';
|
|
39
|
+
this.textName = this.model.appDataEntity?.textName || '';
|
|
40
|
+
this.getAcParams();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 获取Ac参数
|
|
46
|
+
*/
|
|
47
|
+
public getAcParams() {
|
|
48
|
+
const appDe = this.model.source.getPSAppDataEntity();
|
|
49
|
+
const dataSet = this.model.source.getPSAppDEDataSet();
|
|
50
|
+
if (appDe && dataSet) {
|
|
51
|
+
this.serviceName = appDe.codeName;
|
|
52
|
+
this.interfaceName = dataSet.codeName;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 加载实体数据集数据
|
|
58
|
+
*
|
|
59
|
+
* @param {string} query 模糊匹配字符串
|
|
60
|
+
* @param {IData} data 表单数据
|
|
61
|
+
* @returns {*} {Promise<IHttpResponse<IData[]>>}
|
|
62
|
+
* @memberof PickerEditorController
|
|
63
|
+
*/
|
|
64
|
+
public async getServiceData(data: IData): Promise<IHttpResponse<IData[]>> {
|
|
65
|
+
const { context, params } = this.handlePublicParams(
|
|
66
|
+
data,
|
|
67
|
+
this.context,
|
|
68
|
+
this.params,
|
|
69
|
+
);
|
|
70
|
+
Object.assign(params, { size: 1000 });
|
|
71
|
+
if (this.serviceName && this.interfaceName) {
|
|
72
|
+
const deService = await this.app.es.getService(this.serviceName);
|
|
73
|
+
const res = await deService.exec(this.interfaceName, context, params);
|
|
74
|
+
return res as IHttpResponse<IData[]>;
|
|
75
|
+
}
|
|
76
|
+
throw new DefectModelError(this.model.source, '请配置实体和实体数据集');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ListBoxEditorModel } from '@ibiz-template/model';
|
|
2
|
+
import { CodeListEditorController } from './code-list-editor';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 列表框编辑器控制器
|
|
6
|
+
* @return {*}
|
|
7
|
+
* @author: zhujiamin
|
|
8
|
+
* @Date: 2022-08-25 10:57:58
|
|
9
|
+
*/
|
|
10
|
+
export class ListBoxEditorController extends CodeListEditorController<ListBoxEditorModel> {}
|
|
@@ -70,9 +70,14 @@ export class PickerEditorController extends EditorController<PickerEditorModel>
|
|
|
70
70
|
*/
|
|
71
71
|
public noAC: boolean = false;
|
|
72
72
|
|
|
73
|
+
/**
|
|
74
|
+
* 不支持按钮(根据编辑器类型得)
|
|
75
|
+
*/
|
|
76
|
+
public noButton: boolean = false;
|
|
77
|
+
|
|
73
78
|
protected async onInit(): Promise<void> {
|
|
74
79
|
super.onInit();
|
|
75
|
-
this.
|
|
80
|
+
this.initParams();
|
|
76
81
|
this.valueItem = this.model.valueItemName?.toLowerCase() || '';
|
|
77
82
|
this.keyName = this.model.appDataEntity?.keyName || '';
|
|
78
83
|
this.textName = this.model.appDataEntity?.textName || '';
|
|
@@ -83,14 +88,18 @@ export class PickerEditorController extends EditorController<PickerEditorModel>
|
|
|
83
88
|
}
|
|
84
89
|
|
|
85
90
|
/**
|
|
86
|
-
* 初始化noAc
|
|
91
|
+
* 初始化noAc和noButton
|
|
87
92
|
*/
|
|
88
|
-
public
|
|
93
|
+
public initParams() {
|
|
89
94
|
switch (this.model.editorType) {
|
|
90
95
|
case 'PICKEREX_NOAC':
|
|
91
96
|
this.noAC = true;
|
|
92
97
|
break;
|
|
98
|
+
case 'PICKEREX_NOBUTTON':
|
|
99
|
+
this.noButton = true;
|
|
100
|
+
break;
|
|
93
101
|
default:
|
|
102
|
+
this.noButton = false;
|
|
94
103
|
this.noAC = false;
|
|
95
104
|
}
|
|
96
105
|
}
|
|
@@ -117,8 +126,8 @@ export class PickerEditorController extends EditorController<PickerEditorModel>
|
|
|
117
126
|
* 获取Ac参数
|
|
118
127
|
*/
|
|
119
128
|
public getAcParams() {
|
|
120
|
-
const appDe = this.model.source.getPSAppDataEntity();
|
|
121
|
-
const dataSet = this.model.source.getPSAppDEDataSet();
|
|
129
|
+
const appDe = this.model.source.getPSAppDataEntity?.();
|
|
130
|
+
const dataSet = this.model.source.getPSAppDEDataSet?.();
|
|
122
131
|
if (appDe && dataSet) {
|
|
123
132
|
this.serviceName = appDe.codeName;
|
|
124
133
|
this.interfaceName = dataSet.codeName;
|
|
@@ -154,11 +163,17 @@ export class PickerEditorController extends EditorController<PickerEditorModel>
|
|
|
154
163
|
query: string,
|
|
155
164
|
data: IData,
|
|
156
165
|
): Promise<IHttpResponse<IData[]>> {
|
|
157
|
-
|
|
166
|
+
// 附加编辑器视图参数
|
|
167
|
+
const tempParams = { ...this.params, query, size: 1000 };
|
|
158
168
|
if (this.sort && !Object.is(this.sort, '')) {
|
|
159
|
-
Object.assign(
|
|
169
|
+
Object.assign(tempParams, { sort: this.sort });
|
|
160
170
|
}
|
|
161
|
-
|
|
171
|
+
|
|
172
|
+
const { context, params } = this.handlePublicParams(
|
|
173
|
+
data,
|
|
174
|
+
this.context,
|
|
175
|
+
tempParams,
|
|
176
|
+
);
|
|
162
177
|
if (this.serviceName && this.interfaceName) {
|
|
163
178
|
const deService = await this.app.es.getService(this.serviceName);
|
|
164
179
|
const res = await deService.exec(this.interfaceName, context, params);
|
|
@@ -179,7 +194,11 @@ export class PickerEditorController extends EditorController<PickerEditorModel>
|
|
|
179
194
|
data: IData,
|
|
180
195
|
selectedData?: string,
|
|
181
196
|
): Promise<IData[] | undefined> {
|
|
182
|
-
const { context, params } = this.handlePublicParams(
|
|
197
|
+
const { context, params } = this.handlePublicParams(
|
|
198
|
+
data,
|
|
199
|
+
this.context,
|
|
200
|
+
this.params,
|
|
201
|
+
);
|
|
183
202
|
if (selectedData) {
|
|
184
203
|
params.selectedData = selectedData;
|
|
185
204
|
}
|
|
@@ -197,7 +216,11 @@ export class PickerEditorController extends EditorController<PickerEditorModel>
|
|
|
197
216
|
* 打开数据链接视图
|
|
198
217
|
*/
|
|
199
218
|
public async openLinkView(data: IData): Promise<IData[] | undefined> {
|
|
200
|
-
const { context, params } = this.handlePublicParams(
|
|
219
|
+
const { context, params } = this.handlePublicParams(
|
|
220
|
+
data,
|
|
221
|
+
this.context,
|
|
222
|
+
this.params,
|
|
223
|
+
);
|
|
201
224
|
context.srfkey = data[this.valueItem];
|
|
202
225
|
if (!this.linkView) {
|
|
203
226
|
throw new DefectModelError(this.model.source, '请配置数据链接视图');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ViewModel } from '@ibiz-template/model';
|
|
2
2
|
import { IRegister } from '../../../interface';
|
|
3
3
|
import { IViewProvider } from '../provider';
|
|
4
4
|
|
|
@@ -20,5 +20,5 @@ export interface IViewRegister extends IRegister<IViewProvider> {
|
|
|
20
20
|
* @param {ControlModel} model 部件模型
|
|
21
21
|
* @returns {*} {(IViewProvider)}
|
|
22
22
|
*/
|
|
23
|
-
get(model:
|
|
23
|
+
get(model: ViewModel): Promise<IViewProvider>;
|
|
24
24
|
}
|
|
@@ -59,6 +59,10 @@ export class GridExpViewNerve extends MDViewNerve<
|
|
|
59
59
|
this.grid.evt.on('destroyed', () => {
|
|
60
60
|
this.grid = undefined as never;
|
|
61
61
|
});
|
|
62
|
+
this.grid.evt.on(
|
|
63
|
+
'beforeLoad',
|
|
64
|
+
this.controller.onBeforeLoad.bind(this.controller),
|
|
65
|
+
);
|
|
62
66
|
this.grid.evt.on(
|
|
63
67
|
'dataActive',
|
|
64
68
|
this.controller.onDataActive.bind(this.controller),
|
|
@@ -46,6 +46,10 @@ export class KanbanViewNerve<
|
|
|
46
46
|
'beforeLoad',
|
|
47
47
|
this.controller.onBeforeLoad.bind(this.controller),
|
|
48
48
|
);
|
|
49
|
+
this.kanban.evt.on(
|
|
50
|
+
'beforeLoad',
|
|
51
|
+
this.controller.onBeforeLoad.bind(this.controller),
|
|
52
|
+
);
|
|
49
53
|
this.kanban.evt.on(
|
|
50
54
|
'dataActive',
|
|
51
55
|
this.controller.onDataActive.bind(this.controller),
|
|
@@ -58,6 +58,10 @@ export class ListExpViewNerve extends MDViewNerve<
|
|
|
58
58
|
this.list.evt.on('destroyed', () => {
|
|
59
59
|
this.list = undefined as never;
|
|
60
60
|
});
|
|
61
|
+
this.list.evt.on(
|
|
62
|
+
'beforeLoad',
|
|
63
|
+
this.controller.onBeforeLoad.bind(this.controller),
|
|
64
|
+
);
|
|
61
65
|
this.list.evt.on(
|
|
62
66
|
'dataActive',
|
|
63
67
|
this.controller.onDataActive.bind(this.controller),
|
|
@@ -18,6 +18,11 @@ export class ControlRegister
|
|
|
18
18
|
implements IControlRegister
|
|
19
19
|
{
|
|
20
20
|
async get(model: ControlModel): Promise<IControlProvider> {
|
|
21
|
+
await ibiz.plugin.loadPredefinedPlugin(
|
|
22
|
+
`CONTROL_${model.source.controlType}_${
|
|
23
|
+
model.source.controlStyle || 'DEFAULT'
|
|
24
|
+
}`,
|
|
25
|
+
);
|
|
21
26
|
// 先找插件标识和类型
|
|
22
27
|
if (model.source.getPSSysPFPlugin()) {
|
|
23
28
|
await ibiz.plugin.loadPlugin(model.source.getPSSysPFPlugin()!);
|
|
@@ -18,6 +18,12 @@ export class EditorRegister
|
|
|
18
18
|
implements IEditorRegister
|
|
19
19
|
{
|
|
20
20
|
async get(model: EditorModel): Promise<IEditorProvider> {
|
|
21
|
+
// 加载预置的编辑器插件
|
|
22
|
+
await ibiz.plugin.loadPredefinedPlugin(
|
|
23
|
+
`EDITOR_${model.source.editorType}_${
|
|
24
|
+
model.source.editorStyle || 'DEFAULT'
|
|
25
|
+
}`,
|
|
26
|
+
);
|
|
21
27
|
// 先找插件标识和类型
|
|
22
28
|
if (model.source.getPSSysPFPlugin()) {
|
|
23
29
|
await ibiz.plugin.loadPlugin(model.source.getPSSysPFPlugin()!);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UnsupportedModelError, ViewModel } from '@ibiz-template/model';
|
|
2
2
|
import { RegisterBase } from '../../register';
|
|
3
3
|
import { IViewRegister, IViewProvider } from '../interface';
|
|
4
4
|
|
|
@@ -16,23 +16,23 @@ export class ViewRegister
|
|
|
16
16
|
extends RegisterBase<IViewProvider>
|
|
17
17
|
implements IViewRegister
|
|
18
18
|
{
|
|
19
|
-
async get(model:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
19
|
+
async get(model: ViewModel): Promise<IViewProvider> {
|
|
20
|
+
await ibiz.plugin.loadPredefinedPlugin(
|
|
21
|
+
`VIEW_${model.source.viewType}_${model.source.viewStyle || 'DEFAULT'}`,
|
|
22
|
+
);
|
|
24
23
|
// 先找插件标识和类型
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const { source } = model;
|
|
25
|
+
if (source.getPSSysPFPlugin()) {
|
|
26
|
+
await ibiz.plugin.loadPlugin(source.getPSSysPFPlugin()!);
|
|
27
|
+
const { pluginType, pluginCode } = source.getPSSysPFPlugin()!;
|
|
28
28
|
const key = `${pluginType}_${pluginCode}`;
|
|
29
29
|
if (this.providers.has(key)) {
|
|
30
30
|
return this.providers.get(key)!;
|
|
31
31
|
}
|
|
32
|
-
ibiz.log.error(`找不到插件标识[${key}]对应的适配器`,
|
|
32
|
+
ibiz.log.error(`找不到插件标识[${key}]对应的适配器`, source);
|
|
33
33
|
}
|
|
34
34
|
// 再找视图类型和视图样式
|
|
35
|
-
const { viewType, viewStyle } =
|
|
35
|
+
const { viewType, viewStyle } = source;
|
|
36
36
|
if (viewStyle && viewStyle !== 'DEFAULT') {
|
|
37
37
|
const key = `${viewType}_${viewStyle}`;
|
|
38
38
|
if (this.providers.has(key)) {
|
|
@@ -40,14 +40,14 @@ export class ViewRegister
|
|
|
40
40
|
}
|
|
41
41
|
ibiz.log.error(
|
|
42
42
|
`找不到视图类型:[${viewType}]的视图样式:[${viewStyle}]对应的适配器`,
|
|
43
|
-
|
|
43
|
+
source,
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
// 最后找视图类型
|
|
47
47
|
if (this.providers.has(viewType)) {
|
|
48
48
|
return this.providers.get(viewType)!;
|
|
49
49
|
}
|
|
50
|
-
ibiz.log.error(`找不到视图类型[${viewType}]对应的适配器`,
|
|
51
|
-
throw new UnsupportedModelError(
|
|
50
|
+
ibiz.log.error(`找不到视图类型[${viewType}]对应的适配器`, source);
|
|
51
|
+
throw new UnsupportedModelError(source, `暂未实现`);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -28,4 +28,13 @@ export class FormState extends ControlState {
|
|
|
28
28
|
* @type {ControlVO}
|
|
29
29
|
*/
|
|
30
30
|
data: ControlVO = new ControlVO();
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 是否正在处理中(动态控制,值规则,表单项更新等逻辑中)
|
|
34
|
+
* @author lxm
|
|
35
|
+
* @date 2023-03-06 09:07:20
|
|
36
|
+
* @type {boolean}
|
|
37
|
+
* @memberof FormController
|
|
38
|
+
*/
|
|
39
|
+
processing: boolean = false;
|
|
31
40
|
}
|
|
@@ -18,36 +18,6 @@ export class MDViewController<
|
|
|
18
18
|
> extends ViewController<T> {
|
|
19
19
|
state = new MDViewState();
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
* 是否显示搜索表单
|
|
23
|
-
*
|
|
24
|
-
* @deprecated
|
|
25
|
-
* @author lxm
|
|
26
|
-
* @date 2022-08-28 20:08:10
|
|
27
|
-
* @type {boolean}
|
|
28
|
-
*/
|
|
29
|
-
showSearchForm: boolean = false;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* 快速搜索字符串
|
|
33
|
-
*
|
|
34
|
-
* @deprecated
|
|
35
|
-
* @author lxm
|
|
36
|
-
* @date 2022-08-31 11:08:45
|
|
37
|
-
* @type {string}
|
|
38
|
-
*/
|
|
39
|
-
query: string = '';
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* 选中的数据
|
|
43
|
-
*
|
|
44
|
-
* @deprecated
|
|
45
|
-
* @author lxm
|
|
46
|
-
* @date 2022-08-28 18:08:34
|
|
47
|
-
* @type {IData[]}
|
|
48
|
-
*/
|
|
49
|
-
selectedData: IData[] = [];
|
|
50
|
-
|
|
51
21
|
declare nerve: MDViewNerve;
|
|
52
22
|
|
|
53
23
|
protected createNerve(): MDViewNerve {
|
|
@@ -206,7 +176,7 @@ export class MDViewController<
|
|
|
206
176
|
* @returns {*} {IParams}
|
|
207
177
|
*/
|
|
208
178
|
onBeforeLoad(): IParams {
|
|
209
|
-
const params: IParams = { query: this.state.query };
|
|
179
|
+
const params: IParams = { query: this.state.query.trim() };
|
|
210
180
|
// 有搜索表单的整合相关参数
|
|
211
181
|
if (this.nerve.searchForm) {
|
|
212
182
|
const addParams = this.nerve.searchForm.call.getParams();
|
|
@@ -26,7 +26,7 @@ export class PickupGridViewController extends GridViewController {
|
|
|
26
26
|
*/
|
|
27
27
|
onSelectionChange(data: IData[]) {
|
|
28
28
|
super.onSelectionChange(data);
|
|
29
|
-
this.nerve.self.evt.asyncEmit('selectionChange', this.selectedData);
|
|
29
|
+
this.nerve.self.evt.asyncEmit('selectionChange', this.state.selectedData);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/**
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 实体逻辑执行上下文
|
|
3
|
+
*
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2023-03-09 07:38:38
|
|
6
|
+
* @export
|
|
7
|
+
* @class DELogicContext
|
|
8
|
+
*/
|
|
9
|
+
export class DELogicContext {
|
|
10
|
+
/**
|
|
11
|
+
* 实体逻辑参数
|
|
12
|
+
*
|
|
13
|
+
* @description 实体逻辑参数初始化时设置
|
|
14
|
+
* @author lxm
|
|
15
|
+
* @date 2023-02-08 17:02:38
|
|
16
|
+
* @type {Record<string, IData>}
|
|
17
|
+
*/
|
|
18
|
+
params: Record<string, IData> = {};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* UI逻辑执行返回值
|
|
22
|
+
*
|
|
23
|
+
* @author lxm
|
|
24
|
+
* @date 2023-02-09 21:02:40
|
|
25
|
+
* @type {unknown}
|
|
26
|
+
*/
|
|
27
|
+
result: unknown = null;
|
|
28
|
+
}
|