@ibiz-template/runtime 0.1.19 → 0.1.20
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 +217 -29
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/controller/common/control/control.controller.d.ts +13 -0
- package/out/controller/common/control/control.controller.d.ts.map +1 -1
- package/out/controller/common/control/control.controller.js +58 -0
- package/out/controller/common/control/md-control.controller.d.ts +7 -0
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +27 -2
- package/out/controller/control/data-view/data-view.controller.d.ts.map +1 -1
- package/out/controller/control/data-view/data-view.controller.js +2 -1
- 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 +36 -7
- package/out/controller/control/form/form/form.controller.d.ts +4 -0
- package/out/controller/control/form/form/form.controller.d.ts.map +1 -1
- package/out/controller/control/form/form/form.controller.js +3 -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 +11 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts +1 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +29 -5
- package/out/controller/control/list/list.controller.d.ts.map +1 -1
- package/out/controller/control/list/list.controller.js +2 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts +1 -0
- package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.js +33 -4
- package/out/logic-scheduler/trigger/control-event-trigger.js +1 -1
- package/out/logic-scheduler/trigger/view-event-trigger.js +1 -1
- package/out/model/data-entity/data-entity.d.ts +11 -0
- package/out/model/data-entity/data-entity.d.ts.map +1 -1
- package/out/model/data-entity/data-entity.js +14 -0
- package/out/model/index.d.ts +1 -0
- package/out/model/index.d.ts.map +1 -1
- package/out/model/index.js +1 -0
- package/out/model/panel/data-container.d.ts +11 -0
- package/out/model/panel/data-container.d.ts.map +1 -0
- package/out/model/panel/data-container.js +12 -0
- package/out/model/panel/index.d.ts +2 -0
- package/out/model/panel/index.d.ts.map +1 -0
- package/out/model/panel/index.js +1 -0
- package/out/service/app-data-entity/app-data-entity.d.ts.map +1 -1
- package/out/service/app-data-entity/app-data-entity.js +3 -1
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +3 -0
- package/out/service/vo/control.vo.js +2 -2
- package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.js +0 -1
- package/package.json +3 -3
- package/src/controller/common/control/control.controller.ts +67 -0
- package/src/controller/common/control/md-control.controller.ts +28 -2
- package/src/controller/control/data-view/data-view.controller.ts +2 -1
- package/src/controller/control/form/edit-form/edit-form.controller.ts +34 -7
- package/src/controller/control/form/form/form.controller.ts +7 -0
- package/src/controller/control/form/search-form/search-form.controller.ts +10 -1
- package/src/controller/control/grid/grid/grid.controller.ts +28 -5
- package/src/controller/control/list/list.controller.ts +2 -1
- package/src/logic-scheduler/executor/app-ui-logic-executor.ts +44 -7
- package/src/logic-scheduler/trigger/control-event-trigger.ts +1 -1
- package/src/logic-scheduler/trigger/view-event-trigger.ts +1 -1
- package/src/model/data-entity/data-entity.ts +17 -0
- package/src/model/index.ts +1 -0
- package/src/model/panel/data-container.ts +18 -0
- package/src/model/panel/index.ts +1 -0
- package/src/service/app-data-entity/app-data-entity.ts +3 -1
- package/src/service/service/entity/method/method.ts +3 -0
- package/src/service/vo/control.vo.ts +2 -2
- package/src/ui-logic/ui-logic-node/msg-box-node/msg-box-node.ts +0 -1
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import { notNilEmpty } from 'qx-util';
|
|
13
13
|
import { OpenAppViewCommand } from '../../command';
|
|
14
14
|
import { IModalData, IUILogicParams } from '../../interface';
|
|
15
|
+
import { getFormTypeFieldName } from '../../model';
|
|
15
16
|
import { convertNavData } from '../../utils';
|
|
16
17
|
import { LogicExecutor } from './logic-executor';
|
|
17
18
|
|
|
@@ -65,13 +66,19 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
65
66
|
if (!data?.[0]) {
|
|
66
67
|
throw new RuntimeError('opendata没有可操作数据!');
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
const openViewRefs = appUILogic.openDataAppViews;
|
|
70
|
+
let openViewRef: IAppUILogicRefViewBase | undefined;
|
|
71
|
+
if (openViewRefs) {
|
|
72
|
+
openViewRef = await this.calcOpenViewRef(appUILogic, parameters);
|
|
73
|
+
} else {
|
|
74
|
+
// 准备需要的模型
|
|
75
|
+
openViewRef = appUILogic.openDataAppView;
|
|
76
|
+
if (!openViewRef) {
|
|
77
|
+
throw new RuntimeModelError(
|
|
78
|
+
appUILogic,
|
|
79
|
+
'opendata视图逻辑没有配置默认打开视图',
|
|
80
|
+
);
|
|
81
|
+
}
|
|
75
82
|
}
|
|
76
83
|
const openView = openViewRef.refAppViewId;
|
|
77
84
|
if (!openView) {
|
|
@@ -231,4 +238,34 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
231
238
|
}
|
|
232
239
|
return findView;
|
|
233
240
|
}
|
|
241
|
+
|
|
242
|
+
protected async calcOpenViewRef(
|
|
243
|
+
appUILogic: IAppUIOpenDataLogic,
|
|
244
|
+
parameters: IUILogicParams,
|
|
245
|
+
): Promise<IAppUILogicRefViewBase> {
|
|
246
|
+
const appDataEntityId = parameters.view.model.appDataEntityId!;
|
|
247
|
+
// 表单类型属性
|
|
248
|
+
const formTypeName = await getFormTypeFieldName(appDataEntityId);
|
|
249
|
+
if (!formTypeName) {
|
|
250
|
+
throw new RuntimeModelError(
|
|
251
|
+
appUILogic,
|
|
252
|
+
`${appDataEntityId}实体缺少表单类型应用实体属性`,
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
const { data } = parameters;
|
|
256
|
+
// 表单类型值
|
|
257
|
+
const formTypeValue = data[0][formTypeName];
|
|
258
|
+
if (!formTypeValue) {
|
|
259
|
+
throw new RuntimeModelError(appUILogic, '数据源无表单类型应用实体属性值');
|
|
260
|
+
}
|
|
261
|
+
const openViewRefs = appUILogic.openDataAppViews;
|
|
262
|
+
// 根据表单类型值找到实际打开的视图
|
|
263
|
+
const findView = openViewRefs?.find(item => item.refMode === formTypeValue);
|
|
264
|
+
if (!findView) {
|
|
265
|
+
throw new RuntimeError(
|
|
266
|
+
`没有找到与表单类型${formTypeValue}相关的实体的编辑视图`,
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
return findView;
|
|
270
|
+
}
|
|
234
271
|
}
|
|
@@ -28,7 +28,7 @@ export class ControlEventTrigger extends LogicTrigger {
|
|
|
28
28
|
protected scheduler: LogicScheduler,
|
|
29
29
|
) {
|
|
30
30
|
super(logic, scheduler);
|
|
31
|
-
const names = logic.eventNames!.split('
|
|
31
|
+
const names = logic.eventNames!.split(';');
|
|
32
32
|
this.listenEventNames = names.map(
|
|
33
33
|
name => StudioControlEvents[name as keyof StudioControlEvents] || name,
|
|
34
34
|
);
|
|
@@ -28,7 +28,7 @@ export class ViewEventTrigger extends LogicTrigger {
|
|
|
28
28
|
protected scheduler: LogicScheduler,
|
|
29
29
|
) {
|
|
30
30
|
super(logic, scheduler);
|
|
31
|
-
const names = logic.eventNames!.split('
|
|
31
|
+
const names = logic.eventNames!.split(';');
|
|
32
32
|
this.listenEventNames = names.map(
|
|
33
33
|
name => StudioViewEvents[name as keyof StudioViewEvents] || name,
|
|
34
34
|
);
|
|
@@ -52,6 +52,23 @@ export async function getDeACMode(
|
|
|
52
52
|
return deACMode;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* 从实体里找到表单类型应用实体属性
|
|
57
|
+
*
|
|
58
|
+
* @author zk
|
|
59
|
+
* @date 2023-09-07 05:09:41
|
|
60
|
+
* @export
|
|
61
|
+
* @param {string} entityId
|
|
62
|
+
* @param {string} [srfappid]
|
|
63
|
+
* @return {*} {(Promise<string | undefined>)}
|
|
64
|
+
*/
|
|
65
|
+
export async function getFormTypeFieldName(
|
|
66
|
+
entityId: string,
|
|
67
|
+
): Promise<string | undefined> {
|
|
68
|
+
const appDataEntity = await ibiz.hub.getAppDataEntity(entityId)!;
|
|
69
|
+
return appDataEntity.formTypeAppDEFieldId;
|
|
70
|
+
}
|
|
71
|
+
|
|
55
72
|
/**
|
|
56
73
|
* 从实体里找到实体逻辑
|
|
57
74
|
* @author lxm
|
package/src/model/index.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IPanelContainer, IPanelItem } from '@ibiz/model-core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 判断面板成员模型是否是数据容器
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2023-09-06 04:56:01
|
|
7
|
+
* @export
|
|
8
|
+
* @param {IPanelItem} panelItem
|
|
9
|
+
* @return {*} {boolean}
|
|
10
|
+
*/
|
|
11
|
+
export function isDataContainer(panelItem: IPanelItem): boolean {
|
|
12
|
+
return (
|
|
13
|
+
panelItem.itemType === 'CONTAINER' &&
|
|
14
|
+
['CONTAINER_MULTIDATA', 'CONTAINER_SINGLEDATA'].includes(
|
|
15
|
+
(panelItem as IPanelContainer).predefinedType!,
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './data-container';
|
|
@@ -172,7 +172,9 @@ export class AppDataEntity implements IDataEntity {
|
|
|
172
172
|
* @return {*} {AppDataEntity}
|
|
173
173
|
*/
|
|
174
174
|
clone(): AppDataEntity {
|
|
175
|
-
|
|
175
|
+
const entity = new AppDataEntity(this._entity, this._data);
|
|
176
|
+
entity.srfkey = this.srfkey;
|
|
177
|
+
return entity;
|
|
176
178
|
}
|
|
177
179
|
|
|
178
180
|
/**
|
|
@@ -181,6 +181,9 @@ export abstract class Method {
|
|
|
181
181
|
* @return {*} {IDataEntity}
|
|
182
182
|
*/
|
|
183
183
|
protected createEntity(data: IData | IDataEntity): IDataEntity {
|
|
184
|
+
if (data instanceof AppDataEntity) {
|
|
185
|
+
return data.clone();
|
|
186
|
+
}
|
|
184
187
|
return new AppDataEntity(this.entity, data);
|
|
185
188
|
}
|
|
186
189
|
}
|
|
@@ -80,7 +80,6 @@ export class MsgBoxNode extends UILogicNode {
|
|
|
80
80
|
default:
|
|
81
81
|
throw new ModelError(this.model, `${buttonsType}暂未支持`);
|
|
82
82
|
}
|
|
83
|
-
console.log(this.model, modalParams);
|
|
84
83
|
const result = await ibiz.modal.confirm(modalParams);
|
|
85
84
|
ctx.setLastReturn(resultTags[result ? 0 : 1]);
|
|
86
85
|
}
|