@ibiz-template/runtime 0.1.26 → 0.1.28
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 +654 -355
- 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 +1 -0
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +7 -0
- package/out/controller/control/data-view/data-view.controller.d.ts +42 -1
- package/out/controller/control/data-view/data-view.controller.d.ts.map +1 -1
- package/out/controller/control/data-view/data-view.controller.js +131 -4
- package/out/controller/control/exp-bar/exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/exp-bar.controller.js +4 -1
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts +1 -0
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.js +7 -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 +10 -68
- package/out/controller/control/form/search-form/search-form.controller.d.ts +1 -0
- package/out/controller/control/form/search-form/search-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/search-form/search-form.controller.js +7 -0
- package/out/controller/control/grid/grid/grid-row.state.d.ts +1 -0
- package/out/controller/control/grid/grid/grid-row.state.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts +10 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +61 -17
- package/out/controller/control/kanban/kanban.controller.d.ts +1 -34
- package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
- package/out/controller/control/kanban/kanban.controller.js +0 -83
- package/out/controller/control/panel/panel/panel-item.controller.d.ts +34 -2
- package/out/controller/control/panel/panel/panel-item.controller.d.ts.map +1 -1
- package/out/controller/control/panel/panel/panel-item.controller.js +84 -5
- package/out/controller/control/panel/panel/panel.controller.d.ts +2 -1
- package/out/controller/control/panel/panel/panel.controller.d.ts.map +1 -1
- package/out/controller/control/panel/panel/panel.controller.js +11 -1
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts +20 -0
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts.map +1 -1
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.js +45 -0
- package/out/controller/control/toolbar/toolbar.controllerr.d.ts.map +1 -1
- package/out/controller/control/toolbar/toolbar.controllerr.js +33 -21
- package/out/controller/utils/index.d.ts +1 -0
- package/out/controller/utils/index.d.ts.map +1 -1
- package/out/controller/utils/index.js +1 -0
- package/out/controller/utils/value-default/value-default.d.ts +37 -0
- package/out/controller/utils/value-default/value-default.d.ts.map +1 -0
- package/out/controller/utils/value-default/value-default.js +65 -0
- package/out/de-logic/de-logic-node/end-node/end-node.d.ts.map +1 -1
- package/out/de-logic/de-logic-node/end-node/end-node.js +4 -0
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +7 -0
- package/out/interface/controller/controller/control/panel-item/i-panel-item.controller.d.ts +2 -2
- package/out/interface/controller/controller/control/panel-item/i-panel-item.controller.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-control.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-control.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-data-view-control.state.d.ts +8 -0
- package/out/interface/controller/state/control/i-data-view-control.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-grid.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-grid.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-kanban.state.d.ts +0 -8
- package/out/interface/controller/state/control/i-kanban.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-md-control.state.d.ts +14 -0
- package/out/interface/controller/state/control/i-md-control.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-tab-exp-panel.state.d.ts +8 -0
- package/out/interface/controller/state/control/i-tab-exp-panel.state.d.ts.map +1 -1
- package/out/logic-scheduler/trigger/item-dyna-logic-trigger.d.ts.map +1 -1
- package/out/logic-scheduler/trigger/item-dyna-logic-trigger.js +4 -1
- package/out/model/layout/layout.d.ts.map +1 -1
- package/out/model/layout/layout.js +17 -1
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +2 -2
- package/out/service/utils/dynamic-code-list/dynamic-code-list.js +4 -4
- package/out/ui-logic/ui-logic-node/end-node/end-node.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/end-node/end-node.js +4 -0
- package/out/utils/wf-helper/wf-helper.js +2 -2
- package/package.json +5 -5
- package/src/controller/common/control/md-control.controller.ts +9 -0
- package/src/controller/control/data-view/data-view.controller.ts +152 -4
- package/src/controller/control/exp-bar/exp-bar.controller.ts +5 -1
- package/src/controller/control/form/edit-form/edit-form.controller.ts +9 -0
- package/src/controller/control/form/form-detail/form-item/form-item.controller.ts +13 -67
- package/src/controller/control/form/search-form/search-form.controller.ts +9 -0
- package/src/controller/control/grid/grid/grid-row.state.ts +2 -0
- package/src/controller/control/grid/grid/grid.controller.ts +69 -18
- package/src/controller/control/kanban/kanban.controller.ts +1 -98
- package/src/controller/control/panel/panel/panel-item.controller.ts +105 -5
- package/src/controller/control/panel/panel/panel.controller.ts +17 -1
- package/src/controller/control/tab-exp-panel/tab-exp-panel.controller.ts +45 -0
- package/src/controller/control/toolbar/toolbar.controllerr.ts +40 -24
- package/src/controller/utils/index.ts +1 -0
- package/src/controller/utils/value-default/value-default.ts +110 -0
- package/src/de-logic/de-logic-node/end-node/end-node.ts +6 -0
- package/src/engine/md-view.engine.ts +8 -0
- package/src/interface/controller/controller/control/panel-item/i-panel-item.controller.ts +2 -2
- package/src/interface/controller/state/control/i-control.state.ts +8 -0
- package/src/interface/controller/state/control/i-data-view-control.state.ts +10 -1
- package/src/interface/controller/state/control/i-grid.state.ts +8 -0
- package/src/interface/controller/state/control/i-kanban.state.ts +0 -9
- package/src/interface/controller/state/control/i-md-control.state.ts +16 -0
- package/src/interface/controller/state/control/i-tab-exp-panel.state.ts +9 -0
- package/src/logic-scheduler/trigger/item-dyna-logic-trigger.ts +5 -1
- package/src/model/layout/layout.ts +16 -2
- package/src/service/service/entity/method/method.ts +5 -2
- package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +4 -4
- package/src/ui-logic/ui-logic-node/end-node/end-node.ts +6 -0
- package/src/utils/wf-helper/wf-helper.ts +2 -2
|
@@ -133,10 +133,15 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
133
133
|
* @date 2022-09-20 18:09:56
|
|
134
134
|
* @param {string[]} names
|
|
135
135
|
*/
|
|
136
|
-
dataChangeNotify(names: string[]): void {
|
|
136
|
+
async dataChangeNotify(names: string[]): Promise<void> {
|
|
137
137
|
// 计算动态控制逻辑
|
|
138
138
|
this.calcDynamicLogic(names);
|
|
139
139
|
|
|
140
|
+
// 计算显示,禁用,必填状态
|
|
141
|
+
this.calcItemDisabled(this.data);
|
|
142
|
+
this.calcItemVisible(this.data);
|
|
143
|
+
this.calcItemRequired(this.data);
|
|
144
|
+
|
|
140
145
|
// 计算动态样式表
|
|
141
146
|
this.calcDynaClass(this.data);
|
|
142
147
|
}
|
|
@@ -147,14 +152,109 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
147
152
|
* @author lxm
|
|
148
153
|
* @date 2022-09-20 18:09:07
|
|
149
154
|
*/
|
|
150
|
-
panelStateNotify(_state: PanelNotifyState): void {
|
|
155
|
+
async panelStateNotify(_state: PanelNotifyState): Promise<void> {
|
|
151
156
|
// 计算动态控制逻辑
|
|
152
157
|
this.calcDynamicLogic([], true);
|
|
153
158
|
|
|
159
|
+
// 计算显示,禁用,必填状态
|
|
160
|
+
this.calcItemDisabled(this.data);
|
|
161
|
+
this.calcItemVisible(this.data);
|
|
162
|
+
this.calcItemRequired(this.data);
|
|
163
|
+
|
|
154
164
|
// 计算动态样式表
|
|
155
165
|
this.calcDynaClass(this.data);
|
|
156
166
|
}
|
|
157
167
|
|
|
168
|
+
/**
|
|
169
|
+
* 计算项的禁用状态
|
|
170
|
+
* @author lxm
|
|
171
|
+
* @date 2023-06-26 06:19:00
|
|
172
|
+
* @param {IData} data
|
|
173
|
+
*/
|
|
174
|
+
calcItemDisabled(data: IData): void {
|
|
175
|
+
let enable = !this.dynaLogicResult.disabled;
|
|
176
|
+
|
|
177
|
+
// 上层计算为启用时计算预定义项启用逻辑
|
|
178
|
+
if (enable && this.panel.scheduler) {
|
|
179
|
+
const itemEnable = this.panel.scheduler.triggerItemEnable(
|
|
180
|
+
this.model.id!,
|
|
181
|
+
{
|
|
182
|
+
data: [data],
|
|
183
|
+
},
|
|
184
|
+
);
|
|
185
|
+
if (itemEnable !== undefined) {
|
|
186
|
+
enable = itemEnable;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// 修改state
|
|
191
|
+
this.state.disabled = !enable;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* 计算项的显示状态
|
|
196
|
+
* @author lxm
|
|
197
|
+
* @date 2023-06-26 06:19:00
|
|
198
|
+
* @param {IData} data
|
|
199
|
+
*/
|
|
200
|
+
calcItemVisible(data: IData): void {
|
|
201
|
+
let { visible } = this.dynaLogicResult;
|
|
202
|
+
|
|
203
|
+
// 上层计算为显示时计算预定义项显示逻辑
|
|
204
|
+
if (visible && this.panel.scheduler) {
|
|
205
|
+
const itemVIsible = this.panel.scheduler.triggerItemVisible(
|
|
206
|
+
this.model.id!,
|
|
207
|
+
{
|
|
208
|
+
data: [data],
|
|
209
|
+
},
|
|
210
|
+
);
|
|
211
|
+
if (itemVIsible !== undefined) {
|
|
212
|
+
visible = itemVIsible;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// 修改state
|
|
217
|
+
this.state.visible = visible;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* 计算项的必填状态
|
|
222
|
+
* @author lxm
|
|
223
|
+
* @date 2023-06-26 06:19:00
|
|
224
|
+
* @param {IData} data
|
|
225
|
+
*/
|
|
226
|
+
calcItemRequired(data: IData): void {
|
|
227
|
+
let allowEmpty = !this.dynaLogicResult.required;
|
|
228
|
+
|
|
229
|
+
// 上层计算为启用时计算预定义项启用逻辑
|
|
230
|
+
if (allowEmpty && this.panel.scheduler) {
|
|
231
|
+
const itemAllowEmpty = this.panel.scheduler.triggerItemBlank(
|
|
232
|
+
this.model.id!,
|
|
233
|
+
{
|
|
234
|
+
data: [data],
|
|
235
|
+
},
|
|
236
|
+
);
|
|
237
|
+
if (itemAllowEmpty !== undefined) {
|
|
238
|
+
allowEmpty = itemAllowEmpty;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// 修改state
|
|
243
|
+
this.state.required = !allowEmpty;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* 动态逻辑结果
|
|
248
|
+
* @author lxm
|
|
249
|
+
* @date 2023-09-21 03:36:37
|
|
250
|
+
* @protected
|
|
251
|
+
*/
|
|
252
|
+
protected dynaLogicResult = {
|
|
253
|
+
visible: true,
|
|
254
|
+
disabled: false,
|
|
255
|
+
required: false,
|
|
256
|
+
};
|
|
257
|
+
|
|
158
258
|
/**
|
|
159
259
|
* 计算动态逻辑
|
|
160
260
|
*
|
|
@@ -182,15 +282,15 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
182
282
|
switch (logic.logicCat) {
|
|
183
283
|
// 动态空输入,不满足则必填
|
|
184
284
|
case 'ITEMBLANK':
|
|
185
|
-
this.
|
|
285
|
+
this.dynaLogicResult.required = !ok;
|
|
186
286
|
break;
|
|
187
287
|
// 动态启用,满足则启用
|
|
188
288
|
case 'ITEMENABLE':
|
|
189
|
-
this.
|
|
289
|
+
this.dynaLogicResult.disabled = !ok;
|
|
190
290
|
break;
|
|
191
291
|
// 动态显示,满足则显示
|
|
192
292
|
case 'PANELVISIBLE':
|
|
193
|
-
this.
|
|
293
|
+
this.dynaLogicResult.visible = ok;
|
|
194
294
|
break;
|
|
195
295
|
default:
|
|
196
296
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */
|
|
2
|
-
import { RuntimeError } from '@ibiz-template/core';
|
|
2
|
+
import { recursiveIterate, RuntimeError } from '@ibiz-template/core';
|
|
3
3
|
import {
|
|
4
|
+
IControlLogic,
|
|
4
5
|
IPanel,
|
|
5
6
|
IPanelContainer,
|
|
6
7
|
IPanelItem,
|
|
@@ -268,4 +269,19 @@ export class PanelController<
|
|
|
268
269
|
this.state.data[name] = value;
|
|
269
270
|
this.dataChangeNotify([name]);
|
|
270
271
|
}
|
|
272
|
+
|
|
273
|
+
protected initControlScheduler(logics: IControlLogic[] = []): void {
|
|
274
|
+
const actualLogics = [...logics];
|
|
275
|
+
// 遍历所有的项,如果有逻辑的话加入
|
|
276
|
+
recursiveIterate(
|
|
277
|
+
this.model,
|
|
278
|
+
(item: IPanelItem) => {
|
|
279
|
+
if (item.controlLogics) {
|
|
280
|
+
actualLogics.push(...item.controlLogics);
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
{ childrenFields: ['rootPanelItems', 'panelItems', 'panelTabPages'] },
|
|
284
|
+
);
|
|
285
|
+
super.initControlScheduler(actualLogics);
|
|
286
|
+
}
|
|
271
287
|
}
|
|
@@ -22,6 +22,22 @@ export class TabExpPanelController
|
|
|
22
22
|
extends ControlController<ITabExpPanel, ITabExpPanelState, ITabExpPanelEvent>
|
|
23
23
|
implements ITabExpPanelController
|
|
24
24
|
{
|
|
25
|
+
/**
|
|
26
|
+
* 是否显示文本
|
|
27
|
+
* @return {*}
|
|
28
|
+
* @author: zhujiamin
|
|
29
|
+
* @Date: 2023-09-20 10:36:35
|
|
30
|
+
*/
|
|
31
|
+
isShowCaption = true;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 是否显示图标
|
|
35
|
+
* @return {*}
|
|
36
|
+
* @author: zhujiamin
|
|
37
|
+
* @Date: 2023-09-20 10:36:46
|
|
38
|
+
*/
|
|
39
|
+
isShowIcon = false;
|
|
40
|
+
|
|
25
41
|
/**
|
|
26
42
|
* 初始化state的属性
|
|
27
43
|
*
|
|
@@ -46,6 +62,7 @@ export class TabExpPanelController
|
|
|
46
62
|
this.layoutPanel = this.view.layoutPanel!;
|
|
47
63
|
|
|
48
64
|
this.initTabPages();
|
|
65
|
+
this.initIconCaption();
|
|
49
66
|
}
|
|
50
67
|
|
|
51
68
|
/**
|
|
@@ -61,6 +78,7 @@ export class TabExpPanelController
|
|
|
61
78
|
caption: panel.caption!,
|
|
62
79
|
tabTag: panel.id!,
|
|
63
80
|
class: panel.sysCss ? [panel.sysCss.cssName!] : [],
|
|
81
|
+
sysImage: panel.sysImage,
|
|
64
82
|
});
|
|
65
83
|
});
|
|
66
84
|
this.state.tabPages = tabPages;
|
|
@@ -69,6 +87,33 @@ export class TabExpPanelController
|
|
|
69
87
|
}
|
|
70
88
|
}
|
|
71
89
|
|
|
90
|
+
/**
|
|
91
|
+
* 初始化图标和文本显示
|
|
92
|
+
*
|
|
93
|
+
* @memberof TabExpPanelController
|
|
94
|
+
*/
|
|
95
|
+
initIconCaption(): void {
|
|
96
|
+
// 临时处理,视图参数那边配置showMode决定显示
|
|
97
|
+
if (this.params.showmode) {
|
|
98
|
+
switch (this.params.showmode) {
|
|
99
|
+
case 'ICONANDSHORTWORD':
|
|
100
|
+
this.isShowIcon = true;
|
|
101
|
+
this.isShowCaption = true;
|
|
102
|
+
break;
|
|
103
|
+
case 'ICON':
|
|
104
|
+
this.isShowIcon = true;
|
|
105
|
+
this.isShowCaption = false;
|
|
106
|
+
break;
|
|
107
|
+
case 'SHORTWORD':
|
|
108
|
+
this.isShowIcon = false;
|
|
109
|
+
this.isShowCaption = true;
|
|
110
|
+
break;
|
|
111
|
+
default:
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
72
117
|
/**
|
|
73
118
|
* 初始化默认分页
|
|
74
119
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { recursiveIterate } from '@ibiz-template/core';
|
|
1
|
+
import { recursiveIterate, RuntimeError } from '@ibiz-template/core';
|
|
2
2
|
import {
|
|
3
3
|
IDEToolbar,
|
|
4
4
|
IDEToolbarItem,
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
IExtraButton,
|
|
14
14
|
IButtonState,
|
|
15
15
|
} from '../../../interface';
|
|
16
|
+
import { getUIActionById } from '../../../model';
|
|
16
17
|
import { ControlVO } from '../../../service';
|
|
17
18
|
import { UIActionUtil } from '../../../ui-action';
|
|
18
19
|
import { ControlController } from '../../common';
|
|
@@ -69,15 +70,35 @@ export class ToolbarController<
|
|
|
69
70
|
// 执行界面行为
|
|
70
71
|
if (item.itemType === 'DEUIACTION') {
|
|
71
72
|
const actionId = (item as IDETBUIActionItem).uiactionId;
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
const uiAction = await getUIActionById(actionId!);
|
|
74
|
+
if (!uiAction) {
|
|
75
|
+
throw new RuntimeError(`没有找到界面行为模型${actionId}`);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// 是否过程中启用loading
|
|
79
|
+
const enableLoading =
|
|
80
|
+
['SYS', 'BACKEND', 'WFBACKEND'].includes(uiAction.uiactionMode!) &&
|
|
81
|
+
uiAction.showBusyIndicator !== false;
|
|
82
|
+
|
|
83
|
+
if (enableLoading) {
|
|
84
|
+
this.state.buttonsState.setLoading(item.id!);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
try {
|
|
88
|
+
const res = await this.ctx.view.call(ViewCallTag.GET_DATA);
|
|
89
|
+
const data = res || [];
|
|
90
|
+
const args = this.getEventArgs();
|
|
91
|
+
args.params = Object.assign(param, args.params);
|
|
92
|
+
await UIActionUtil.execAndResolved(actionId!, {
|
|
93
|
+
...args,
|
|
94
|
+
data,
|
|
95
|
+
event,
|
|
96
|
+
});
|
|
97
|
+
} finally {
|
|
98
|
+
if (enableLoading) {
|
|
99
|
+
this.state.buttonsState.setLoading('');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
81
102
|
}
|
|
82
103
|
}
|
|
83
104
|
|
|
@@ -122,21 +143,16 @@ export class ToolbarController<
|
|
|
122
143
|
event: MouseEvent,
|
|
123
144
|
params?: IData,
|
|
124
145
|
): Promise<void> {
|
|
125
|
-
this.state.buttonsState.setLoading(item.id!);
|
|
126
146
|
const isExtra = (item as IExtraButton).buttonType === 'extra';
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
await this.doUIAction(item, event, params);
|
|
137
|
-
}
|
|
138
|
-
} finally {
|
|
139
|
-
this.state.buttonsState.setLoading('');
|
|
147
|
+
await this._evt.emit('onClick', {
|
|
148
|
+
event,
|
|
149
|
+
eventArg: item.id!,
|
|
150
|
+
buttonType: isExtra ? 'extra' : 'deuiaction',
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// 工具栏才走界面行为
|
|
154
|
+
if (!isExtra) {
|
|
155
|
+
await this.doUIAction(item, event, params);
|
|
140
156
|
}
|
|
141
157
|
}
|
|
142
158
|
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { RuntimeError, ModelError } from '@ibiz-template/core';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import { createUUID } from 'qx-util';
|
|
4
|
+
import { isNil, isNotNil } from 'ramda';
|
|
5
|
+
|
|
6
|
+
export type DefaultValueOrigins = {
|
|
7
|
+
data: IData;
|
|
8
|
+
context: IParams;
|
|
9
|
+
params: IParams;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type DefaultValueOpts = {
|
|
13
|
+
/**
|
|
14
|
+
* 属性名称
|
|
15
|
+
* @author lxm
|
|
16
|
+
* @date 2023-09-18 03:47:18
|
|
17
|
+
* @type {string}
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* 默认值类型
|
|
22
|
+
* @author lxm
|
|
23
|
+
* @date 2023-09-18 03:47:24
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
valueType?: string;
|
|
27
|
+
/**
|
|
28
|
+
* 默认值
|
|
29
|
+
* @author lxm
|
|
30
|
+
* @date 2023-09-18 03:47:31
|
|
31
|
+
* @type {string}
|
|
32
|
+
*/
|
|
33
|
+
defaultValue?: string;
|
|
34
|
+
/**
|
|
35
|
+
* 值格式化
|
|
36
|
+
* @author lxm
|
|
37
|
+
* @date 2023-09-18 03:47:36
|
|
38
|
+
* @type {string}
|
|
39
|
+
*/
|
|
40
|
+
valueFormat?: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export function getDefaultValue(
|
|
44
|
+
opts: DefaultValueOpts,
|
|
45
|
+
origins: DefaultValueOrigins,
|
|
46
|
+
): unknown {
|
|
47
|
+
const { name, valueType, defaultValue, valueFormat } = opts;
|
|
48
|
+
const { data, context, params } = origins;
|
|
49
|
+
|
|
50
|
+
// 没有配置默认值,不处理返回undefined
|
|
51
|
+
if (isNil(valueType) && isNil(defaultValue)) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 类型为置空的时候
|
|
56
|
+
if (valueType === 'RESET') {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const value = data[name];
|
|
61
|
+
// 除置空之外的默认值类型,有值的时候不处理返回undefined
|
|
62
|
+
if (isNotNil(value)) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 没有配类型,配了默认值的直接赋值默认值
|
|
67
|
+
if (!valueType && defaultValue) {
|
|
68
|
+
return defaultValue;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
switch (valueType) {
|
|
72
|
+
// 当前应用数据,优先取视图参数,视图参数没有取上下文
|
|
73
|
+
case 'APPDATA':
|
|
74
|
+
if (Object.prototype.hasOwnProperty.call(params, defaultValue!)) {
|
|
75
|
+
return params[defaultValue!];
|
|
76
|
+
}
|
|
77
|
+
if (Object.prototype.hasOwnProperty.call(context, defaultValue!)) {
|
|
78
|
+
return context[defaultValue!];
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
// 当前操作用户(名称)
|
|
82
|
+
case 'OPERATORNAME':
|
|
83
|
+
return context.srfusername;
|
|
84
|
+
// 当前操作用户(编号)
|
|
85
|
+
case 'OPERATOR':
|
|
86
|
+
return context.srfuserid;
|
|
87
|
+
// 当前时间
|
|
88
|
+
case 'CURTIME':
|
|
89
|
+
return dayjs().format(valueFormat);
|
|
90
|
+
// 数据对象属性
|
|
91
|
+
case 'PARAM':
|
|
92
|
+
return data[defaultValue!];
|
|
93
|
+
case 'SESSION': // 用户全局对象
|
|
94
|
+
case 'APPLICATION': // 系统全局对象
|
|
95
|
+
// 取appData里的上下文
|
|
96
|
+
if (!ibiz.appData?.context) {
|
|
97
|
+
throw new RuntimeError('appdata.context不存在');
|
|
98
|
+
}
|
|
99
|
+
return ibiz.appData.context[defaultValue!];
|
|
100
|
+
// 网页请求用视图参数
|
|
101
|
+
case 'CONTEXT':
|
|
102
|
+
return params[defaultValue!];
|
|
103
|
+
// 唯一编码
|
|
104
|
+
case 'UNIQUEID':
|
|
105
|
+
return createUUID();
|
|
106
|
+
default:
|
|
107
|
+
// 未支持类型
|
|
108
|
+
throw new ModelError({}, `默认值类型[${valueType}]未支持`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -18,6 +18,12 @@ export class EndNode extends DELogicNode {
|
|
|
18
18
|
async exec(ctx: DELogicContext): Promise<void> {
|
|
19
19
|
ctx.isEndNode = true;
|
|
20
20
|
const { returnParamId, returnType, rawValue } = this.model;
|
|
21
|
+
|
|
22
|
+
// 没配置不做处理
|
|
23
|
+
if (!returnType) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
21
27
|
switch (returnType) {
|
|
22
28
|
case 'NONEVALUE': // 无值(NONE)
|
|
23
29
|
ctx.result = undefined;
|
|
@@ -78,6 +78,14 @@ export class MDViewEngine extends ViewEngineBase {
|
|
|
78
78
|
await super.onCreated();
|
|
79
79
|
const { childNames } = this.view;
|
|
80
80
|
childNames.push(this.xdataControlName!, 'searchform', 'searchbar');
|
|
81
|
+
|
|
82
|
+
// 存在xdataControlName名称时就是普通多数据视图,给对应的多数据部件传递noLoadDefault
|
|
83
|
+
if (this.xdataControlName) {
|
|
84
|
+
if (!this.view.slotProps[this.xdataControlName]) {
|
|
85
|
+
this.view.slotProps[this.xdataControlName] = {};
|
|
86
|
+
}
|
|
87
|
+
this.view.slotProps[this.xdataControlName].loadDefault = false;
|
|
88
|
+
}
|
|
81
89
|
}
|
|
82
90
|
|
|
83
91
|
async onMounted(): Promise<void> {
|
|
@@ -43,7 +43,7 @@ export interface IPanelItemController {
|
|
|
43
43
|
* @date 2022-09-20 18:09:56
|
|
44
44
|
* @param {string[]} names
|
|
45
45
|
*/
|
|
46
|
-
dataChangeNotify(names: string[]): void
|
|
46
|
+
dataChangeNotify(names: string[]): Promise<void>;
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* 面板状态变更通知
|
|
@@ -51,5 +51,5 @@ export interface IPanelItemController {
|
|
|
51
51
|
* @author lxm
|
|
52
52
|
* @date 2022-09-20 18:09:07
|
|
53
53
|
*/
|
|
54
|
-
panelStateNotify(
|
|
54
|
+
panelStateNotify(state: PanelNotifyState): Promise<void>;
|
|
55
55
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IButtonContainerState } from '../../common';
|
|
1
2
|
import { IMDControlState } from './i-md-control.state';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -7,4 +8,12 @@ import { IMDControlState } from './i-md-control.state';
|
|
|
7
8
|
* @interface IDataViewControlState
|
|
8
9
|
* @extends {IMDControlState}
|
|
9
10
|
*/
|
|
10
|
-
export interface IDataViewControlState extends IMDControlState {
|
|
11
|
+
export interface IDataViewControlState extends IMDControlState {
|
|
12
|
+
/**
|
|
13
|
+
* 分组界面行为组状态
|
|
14
|
+
*
|
|
15
|
+
* @type {(IButtonContainerState)}
|
|
16
|
+
* @memberof PortletPartState
|
|
17
|
+
*/
|
|
18
|
+
groupActionGroupState?: IButtonContainerState;
|
|
19
|
+
}
|
|
@@ -115,6 +115,14 @@ export interface IGridRowState {
|
|
|
115
115
|
* @memberof GridRowState
|
|
116
116
|
*/
|
|
117
117
|
processing: boolean;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 缓存的数据对象
|
|
121
|
+
* @author lxm
|
|
122
|
+
* @date 2023-09-18 05:11:32
|
|
123
|
+
* @type {IData}
|
|
124
|
+
*/
|
|
125
|
+
cacheData?: ControlVO;
|
|
118
126
|
}
|
|
119
127
|
|
|
120
128
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IButtonContainerState } from '../../common';
|
|
2
1
|
import { IDataViewControlState } from './i-data-view-control.state';
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -24,12 +23,4 @@ export interface IKanbanState extends IDataViewControlState {
|
|
|
24
23
|
* @type {boolean}
|
|
25
24
|
*/
|
|
26
25
|
updating: boolean;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* 分组界面行为组状态
|
|
30
|
-
*
|
|
31
|
-
* @type {(IButtonContainerState)}
|
|
32
|
-
* @memberof PortletPartState
|
|
33
|
-
*/
|
|
34
|
-
groupActionGroupState?: IButtonContainerState;
|
|
35
26
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IButtonContainerState } from '../../common';
|
|
1
2
|
import { IControlState } from './i-control.state';
|
|
2
3
|
|
|
3
4
|
export interface IMDControlState extends IControlState {
|
|
@@ -114,4 +115,19 @@ export interface IMDControlGroupState {
|
|
|
114
115
|
* @type {string}
|
|
115
116
|
*/
|
|
116
117
|
key: string | number;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 分组界面行为组状态
|
|
121
|
+
*
|
|
122
|
+
* @type {(IButtonContainerState)}
|
|
123
|
+
* @memberof IMDControlGroupState
|
|
124
|
+
*/
|
|
125
|
+
groupActionGroupState?: IButtonContainerState;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* 当前分组已选中的数据集合
|
|
129
|
+
*
|
|
130
|
+
* @type {IData[]}
|
|
131
|
+
*/
|
|
132
|
+
selectedData?: IData[];
|
|
117
133
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ISysImage } from '@ibiz/model-core';
|
|
1
2
|
import { IControlState } from './i-control.state';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -72,4 +73,12 @@ export interface ITabExpPanelPagesState {
|
|
|
72
73
|
* @type {string[]}
|
|
73
74
|
*/
|
|
74
75
|
class: string[];
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 标题图标
|
|
79
|
+
* @author lxm
|
|
80
|
+
* @date 2023-07-25 02:51:28
|
|
81
|
+
* @type {string[]}
|
|
82
|
+
*/
|
|
83
|
+
sysImage?: ISysImage;
|
|
75
84
|
}
|
|
@@ -39,7 +39,11 @@ export class ItemDynaLogicTrigger extends LogicTrigger {
|
|
|
39
39
|
|
|
40
40
|
match(matchParams: ITriggerMatchParams): boolean {
|
|
41
41
|
const superResult = super.match(matchParams);
|
|
42
|
-
return
|
|
42
|
+
return (
|
|
43
|
+
superResult &&
|
|
44
|
+
// 忽略大小写匹配
|
|
45
|
+
matchParams.itemName?.toLowerCase() === this.logic.itemName?.toLowerCase()
|
|
46
|
+
);
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
execute(executeParams: IUILogicParams): boolean {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IGridLayoutPos, ILayoutPos } from '@ibiz/model-core';
|
|
2
|
+
import { isArray, isObject, isString } from 'lodash-es';
|
|
2
3
|
import type { GridLayoutAttrs, ScreenSize } from '../../interface';
|
|
3
4
|
import { ScriptFactory } from '../../utils';
|
|
4
5
|
|
|
@@ -145,8 +146,21 @@ export function calcGridLayoutPos(
|
|
|
145
146
|
* @return {*} {string[]}
|
|
146
147
|
*/
|
|
147
148
|
export function calcDynaClass(expression: string, data: IData): string[] {
|
|
148
|
-
|
|
149
|
+
const classArr: string[] = [];
|
|
150
|
+
const result = ScriptFactory.execScriptFn({ data }, expression, {
|
|
149
151
|
singleRowReturn: true,
|
|
150
152
|
isAsync: false,
|
|
151
|
-
})
|
|
153
|
+
});
|
|
154
|
+
if (isString(result)) {
|
|
155
|
+
classArr.push(result);
|
|
156
|
+
} else if (isArray(result)) {
|
|
157
|
+
classArr.push(...result);
|
|
158
|
+
} else if (isObject(result)) {
|
|
159
|
+
Object.keys(result).forEach(key => {
|
|
160
|
+
if ((result as IData)[key]) {
|
|
161
|
+
classArr.push(key);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return classArr;
|
|
152
166
|
}
|
|
@@ -115,7 +115,7 @@ export abstract class Method {
|
|
|
115
115
|
);
|
|
116
116
|
break;
|
|
117
117
|
case 'GET':
|
|
118
|
-
res = await this.app.net.get(`${path}/${methodName}`, data);
|
|
118
|
+
res = await this.app.net.get(`${path}/${methodName}`, data || params);
|
|
119
119
|
break;
|
|
120
120
|
case 'PUT': {
|
|
121
121
|
res = await this.app.net.put(
|
|
@@ -125,7 +125,10 @@ export abstract class Method {
|
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
127
|
case 'DELETE':
|
|
128
|
-
res = await this.app.net.delete(
|
|
128
|
+
res = await this.app.net.delete(
|
|
129
|
+
`${path}/${methodName}`,
|
|
130
|
+
data || params,
|
|
131
|
+
);
|
|
129
132
|
break;
|
|
130
133
|
default:
|
|
131
134
|
if (requestMethod) {
|
|
@@ -158,11 +158,11 @@ export class DynamicCodeListCache {
|
|
|
158
158
|
): Promise<CodeListItem[]> {
|
|
159
159
|
const app = ibiz.hub.getApp(context.srfappid);
|
|
160
160
|
// *预定义加载
|
|
161
|
+
// 特殊处理,避免预置代码表加载不全
|
|
162
|
+
if (!params.size) {
|
|
163
|
+
params = { ...params, size: 10000 };
|
|
164
|
+
}
|
|
161
165
|
if (this.isPredefined) {
|
|
162
|
-
// 特殊处理,避免预置代码表加载不全
|
|
163
|
-
if (!params.size) {
|
|
164
|
-
params = { ...params, size: 10000 };
|
|
165
|
-
}
|
|
166
166
|
const res = await app.net.get(
|
|
167
167
|
`/dictionaries/codelist/${this.codeList.codeName}`,
|
|
168
168
|
params,
|