@ibiz-template/runtime 0.1.19 → 0.1.21
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 +252 -31
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/constant/index.d.ts +1 -0
- package/out/constant/index.d.ts.map +1 -1
- package/out/constant/index.js +1 -0
- package/out/constant/view-call-tag.d.ts +14 -0
- package/out/constant/view-call-tag.d.ts.map +1 -0
- package/out/constant/view-call-tag.js +15 -0
- 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/engine/md-view.engine.js +2 -2
- package/out/global/global-util/global-util.d.ts +14 -0
- package/out/global/global-util/global-util.d.ts.map +1 -1
- package/out/global/global-util/global-util.js +26 -0
- 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/dto/method.dto.js +1 -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/constant/index.ts +1 -0
- package/src/constant/view-call-tag.ts +14 -0
- 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/engine/md-view.engine.ts +2 -2
- package/src/global/global-util/global-util.ts +28 -0
- 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/dto/method.dto.ts +1 -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
|
@@ -31,4 +31,30 @@ export class GlobalUtil {
|
|
|
31
31
|
*/
|
|
32
32
|
this.hbs = new HandlebarsUtil();
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* 显示应用级别的加载提示
|
|
36
|
+
*
|
|
37
|
+
* @author chitanda
|
|
38
|
+
* @date 2023-09-08 10:09:43
|
|
39
|
+
*/
|
|
40
|
+
showAppLoading() {
|
|
41
|
+
const el = document.getElementById('app-loading-x');
|
|
42
|
+
if (el) {
|
|
43
|
+
el.style.display = 'none';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 隐藏应用级别的加载提示
|
|
48
|
+
*
|
|
49
|
+
* @author chitanda
|
|
50
|
+
* @date 2023-09-08 10:09:15
|
|
51
|
+
*/
|
|
52
|
+
hiddenAppLoading() {
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
const el = document.getElementById('app-loading-x');
|
|
55
|
+
if (el) {
|
|
56
|
+
el.style.display = 'none';
|
|
57
|
+
}
|
|
58
|
+
}, 300);
|
|
59
|
+
}
|
|
34
60
|
}
|
|
@@ -50,5 +50,6 @@ export declare class AppUILogicExecutor extends LogicExecutor {
|
|
|
50
50
|
* @return {*} {(Promise<IAppUILogicRefViewBase | undefined>)}
|
|
51
51
|
*/
|
|
52
52
|
protected getWizardNewViewRef(appUILogic: IAppUINewDataLogic, parameters: IUILogicParams): Promise<IAppUILogicRefViewBase | undefined>;
|
|
53
|
+
protected calcOpenViewRef(appUILogic: IAppUIOpenDataLogic, parameters: IUILogicParams): Promise<IAppUILogicRefViewBase>;
|
|
53
54
|
}
|
|
54
55
|
//# sourceMappingURL=app-ui-logic-executor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-ui-logic-executor.d.ts","sourceRoot":"","sources":["../../../src/logic-scheduler/executor/app-ui-logic-executor.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,mBAAmB,EAEnB,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"app-ui-logic-executor.d.ts","sourceRoot":"","sources":["../../../src/logic-scheduler/executor/app-ui-logic-executor.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,mBAAmB,EAEnB,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG7D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;;;GAOG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;IAC3C,IAAI,EAAE,YAAY,CAAC;IAG3B,OAAO,CAAC,aAAa,EAAE,cAAc,GAAG,GAAG;IAiB3C;;;;;;;;;;;OAWG;IACG,yBAAyB,CAC7B,UAAU,EAAE,mBAAmB,EAC/B,UAAU,EAAE,cAAc,GACzB,OAAO,CAAC,UAAU,CAAC;IAqDtB;;;;;;;;;;;OAWG;IACG,wBAAwB,CAC5B,UAAU,EAAE,kBAAkB,EAC9B,UAAU,EAAE,cAAc,GACzB,OAAO,CAAC,UAAU,CAAC;IA8DtB;;;;;;;;;;OAUG;cACa,mBAAmB,CACjC,UAAU,EAAE,kBAAkB,EAC9B,UAAU,EAAE,cAAc,GACzB,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;cAmC9B,eAAe,CAC7B,UAAU,EAAE,mBAAmB,EAC/B,UAAU,EAAE,cAAc,GACzB,OAAO,CAAC,sBAAsB,CAAC;CA0BnC"}
|
|
@@ -12,6 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { ModelError, RuntimeError, RuntimeModelError, } from '@ibiz-template/core';
|
|
13
13
|
import { notNilEmpty } from 'qx-util';
|
|
14
14
|
import { OpenAppViewCommand } from '../../command';
|
|
15
|
+
import { getFormTypeFieldName } from '../../model';
|
|
15
16
|
import { convertNavData } from '../../utils';
|
|
16
17
|
import { LogicExecutor } from './logic-executor';
|
|
17
18
|
/**
|
|
@@ -52,10 +53,17 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
52
53
|
if (!(data === null || data === void 0 ? void 0 : data[0])) {
|
|
53
54
|
throw new RuntimeError('opendata没有可操作数据!');
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (
|
|
58
|
-
|
|
56
|
+
const openViewRefs = appUILogic.openDataAppViews;
|
|
57
|
+
let openViewRef;
|
|
58
|
+
if (openViewRefs) {
|
|
59
|
+
openViewRef = await this.calcOpenViewRef(appUILogic, parameters);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// 准备需要的模型
|
|
63
|
+
openViewRef = appUILogic.openDataAppView;
|
|
64
|
+
if (!openViewRef) {
|
|
65
|
+
throw new RuntimeModelError(appUILogic, 'opendata视图逻辑没有配置默认打开视图');
|
|
66
|
+
}
|
|
59
67
|
}
|
|
60
68
|
const openView = openViewRef.refAppViewId;
|
|
61
69
|
if (!openView) {
|
|
@@ -171,4 +179,25 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
171
179
|
}
|
|
172
180
|
return findView;
|
|
173
181
|
}
|
|
182
|
+
async calcOpenViewRef(appUILogic, parameters) {
|
|
183
|
+
const appDataEntityId = parameters.view.model.appDataEntityId;
|
|
184
|
+
// 表单类型属性
|
|
185
|
+
const formTypeName = await getFormTypeFieldName(appDataEntityId);
|
|
186
|
+
if (!formTypeName) {
|
|
187
|
+
throw new RuntimeModelError(appUILogic, `${appDataEntityId}实体缺少表单类型应用实体属性`);
|
|
188
|
+
}
|
|
189
|
+
const { data } = parameters;
|
|
190
|
+
// 表单类型值
|
|
191
|
+
const formTypeValue = data[0][formTypeName];
|
|
192
|
+
if (!formTypeValue) {
|
|
193
|
+
throw new RuntimeModelError(appUILogic, '数据源无表单类型应用实体属性值');
|
|
194
|
+
}
|
|
195
|
+
const openViewRefs = appUILogic.openDataAppViews;
|
|
196
|
+
// 根据表单类型值找到实际打开的视图
|
|
197
|
+
const findView = openViewRefs === null || openViewRefs === void 0 ? void 0 : openViewRefs.find(item => item.refMode === formTypeValue);
|
|
198
|
+
if (!findView) {
|
|
199
|
+
throw new RuntimeError(`没有找到与表单类型${formTypeValue}相关的实体的编辑视图`);
|
|
200
|
+
}
|
|
201
|
+
return findView;
|
|
202
|
+
}
|
|
174
203
|
}
|
|
@@ -21,7 +21,7 @@ export class ControlEventTrigger extends LogicTrigger {
|
|
|
21
21
|
* @type {string[]}
|
|
22
22
|
*/
|
|
23
23
|
this.listenEventNames = [];
|
|
24
|
-
const names = logic.eventNames.split('
|
|
24
|
+
const names = logic.eventNames.split(';');
|
|
25
25
|
this.listenEventNames = names.map(name => StudioControlEvents[name] || name);
|
|
26
26
|
}
|
|
27
27
|
match(matchParams) {
|
|
@@ -21,7 +21,7 @@ export class ViewEventTrigger extends LogicTrigger {
|
|
|
21
21
|
* @type {string[]}
|
|
22
22
|
*/
|
|
23
23
|
this.listenEventNames = [];
|
|
24
|
-
const names = logic.eventNames.split('
|
|
24
|
+
const names = logic.eventNames.split(';');
|
|
25
25
|
this.listenEventNames = names.map(name => StudioViewEvents[name] || name);
|
|
26
26
|
}
|
|
27
27
|
match(matchParams) {
|
|
@@ -26,6 +26,17 @@ export declare function hasDeCodeName(params: IParams, entityId: string): boolea
|
|
|
26
26
|
* @Date: 2023-05-31 10:26:24
|
|
27
27
|
*/
|
|
28
28
|
export declare function getDeACMode(appDEACModeId: string, entityId: string, srfappid?: string): Promise<IAppDEACMode | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* 从实体里找到表单类型应用实体属性
|
|
31
|
+
*
|
|
32
|
+
* @author zk
|
|
33
|
+
* @date 2023-09-07 05:09:41
|
|
34
|
+
* @export
|
|
35
|
+
* @param {string} entityId
|
|
36
|
+
* @param {string} [srfappid]
|
|
37
|
+
* @return {*} {(Promise<string | undefined>)}
|
|
38
|
+
*/
|
|
39
|
+
export declare function getFormTypeFieldName(entityId: string): Promise<string | undefined>;
|
|
29
40
|
/**
|
|
30
41
|
* 从实体里找到实体逻辑
|
|
31
42
|
* @author lxm
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-entity.d.ts","sourceRoot":"","sources":["../../../src/model/data-entity/data-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,WAAW,EACX,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAG1B;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAMnC;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,cAAc,GACrB,QAAQ,GAAG,SAAS,CAEtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GACrC,QAAQ,EAAE,CAYZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,MAAM,GACd,WAAW,GAAG,SAAS,CAEzB"}
|
|
1
|
+
{"version":3,"file":"data-entity.d.ts","sourceRoot":"","sources":["../../../src/model/data-entity/data-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,WAAW,EACX,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAG1B;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAMnC;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAG7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,cAAc,GACrB,QAAQ,GAAG,SAAS,CAEtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GACrC,QAAQ,EAAE,CAYZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,MAAM,GACd,WAAW,GAAG,SAAS,CAEzB"}
|
|
@@ -39,6 +39,20 @@ export async function getDeACMode(appDEACModeId, entityId, srfappid) {
|
|
|
39
39
|
});
|
|
40
40
|
return deACMode;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* 从实体里找到表单类型应用实体属性
|
|
44
|
+
*
|
|
45
|
+
* @author zk
|
|
46
|
+
* @date 2023-09-07 05:09:41
|
|
47
|
+
* @export
|
|
48
|
+
* @param {string} entityId
|
|
49
|
+
* @param {string} [srfappid]
|
|
50
|
+
* @return {*} {(Promise<string | undefined>)}
|
|
51
|
+
*/
|
|
52
|
+
export async function getFormTypeFieldName(entityId) {
|
|
53
|
+
const appDataEntity = await ibiz.hub.getAppDataEntity(entityId);
|
|
54
|
+
return appDataEntity.formTypeAppDEFieldId;
|
|
55
|
+
}
|
|
42
56
|
/**
|
|
43
57
|
* 从实体里找到实体逻辑
|
|
44
58
|
* @author lxm
|
package/out/model/index.d.ts
CHANGED
package/out/model/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
package/out/model/index.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IPanelItem } from '@ibiz/model-core';
|
|
2
|
+
/**
|
|
3
|
+
* 判断面板成员模型是否是数据容器
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2023-09-06 04:56:01
|
|
6
|
+
* @export
|
|
7
|
+
* @param {IPanelItem} panelItem
|
|
8
|
+
* @return {*} {boolean}
|
|
9
|
+
*/
|
|
10
|
+
export declare function isDataContainer(panelItem: IPanelItem): boolean;
|
|
11
|
+
//# sourceMappingURL=data-container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-container.d.ts","sourceRoot":"","sources":["../../../src/model/panel/data-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE/D;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAO9D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断面板成员模型是否是数据容器
|
|
3
|
+
* @author lxm
|
|
4
|
+
* @date 2023-09-06 04:56:01
|
|
5
|
+
* @export
|
|
6
|
+
* @param {IPanelItem} panelItem
|
|
7
|
+
* @return {*} {boolean}
|
|
8
|
+
*/
|
|
9
|
+
export function isDataContainer(panelItem) {
|
|
10
|
+
return (panelItem.itemType === 'CONTAINER' &&
|
|
11
|
+
['CONTAINER_MULTIDATA', 'CONTAINER_SINGLEDATA'].includes(panelItem.predefinedType));
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/model/panel/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './data-container';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-data-entity.d.ts","sourceRoot":"","sources":["../../../src/service/app-data-entity/app-data-entity.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;;;GAOG;AACH,qBAAa,aAAc,YAAW,WAAW;IAC/C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE5B,UAAkB,KAAK,EAAE,KAAK,CAAC;IAE/B,UAAkB,OAAO,EAAE,cAAc,CAAC;IAElC,OAAO,EAAE,MAAM,CAAC;IAEhB,aAAa,EAAE,MAAM,CAAC;IAEtB,UAAU,EAAE,MAAM,CAAC;IAEnB,YAAY,EAAE,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IAEf,YAAY,EAAE,MAAM,CAAC;IAErB,YAAY,EAAE,MAAM,CAAC;IAE7B,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED;;;;;;;OAOG;gBACS,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,GAAG,aAAa;IA6E/D;;;;;;OAMG;IACH,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAgClC;;;;;;OAMG;IACH,KAAK,IAAI,aAAa;
|
|
1
|
+
{"version":3,"file":"app-data-entity.d.ts","sourceRoot":"","sources":["../../../src/service/app-data-entity/app-data-entity.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;;;GAOG;AACH,qBAAa,aAAc,YAAW,WAAW;IAC/C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE5B,UAAkB,KAAK,EAAE,KAAK,CAAC;IAE/B,UAAkB,OAAO,EAAE,cAAc,CAAC;IAElC,OAAO,EAAE,MAAM,CAAC;IAEhB,aAAa,EAAE,MAAM,CAAC;IAEtB,UAAU,EAAE,MAAM,CAAC;IAEnB,YAAY,EAAE,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IAEf,YAAY,EAAE,MAAM,CAAC;IAErB,YAAY,EAAE,MAAM,CAAC;IAE7B,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED;;;;;;;OAOG;gBACS,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,GAAG,aAAa;IA6E/D;;;;;;OAMG;IACH,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAgClC;;;;;;OAMG;IACH,KAAK,IAAI,aAAa;IAMtB;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,aAAa,GAAG,aAAa;CAQnD"}
|
|
@@ -140,7 +140,9 @@ export class AppDataEntity {
|
|
|
140
140
|
* @return {*} {AppDataEntity}
|
|
141
141
|
*/
|
|
142
142
|
clone() {
|
|
143
|
-
|
|
143
|
+
const entity = new AppDataEntity(this._entity, this._data);
|
|
144
|
+
entity.srfkey = this.srfkey;
|
|
145
|
+
return entity;
|
|
144
146
|
}
|
|
145
147
|
/**
|
|
146
148
|
* 合并参数
|
|
@@ -126,7 +126,7 @@ export class MethodDto {
|
|
|
126
126
|
}
|
|
127
127
|
const entity = await ibiz.hub.getAppDataEntity(field.refAppDataEntityId, this.entity.appId);
|
|
128
128
|
const methodDto = findModelChild(entity.appDEMethodDTOs || [], field.refAppDEMethodDTOId);
|
|
129
|
-
const dto = new MethodDto(entity,
|
|
129
|
+
const dto = new MethodDto(entity, true, methodDto);
|
|
130
130
|
this.dtoMap.set(field.codeName, dto);
|
|
131
131
|
return dto;
|
|
132
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/method.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;;;;GAOG;AACH,8BAAsB,MAAM;IA2CxB,SAAS,CAAC,MAAM,EAAE,cAAc;IAChC,SAAS,CAAC,MAAM,EAAE,YAAY;IA3ChC,SAAS,CAAC,GAAG,EAAG,WAAW,CAAC;IAE5B;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAG,WAAW,CAAC;IAE9B;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAG,YAAY,CAAC;IAEhC;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IAElC;;;;;;;;OAQG;gBAES,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY;IAOhC;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,CACX,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,YAAY,CAAC;IAExB;;;;;;;;;;;OAWG;cACa,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,EACX,MAAM,EAAE,OAAO,GAEd,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAuC7B;;;;;;;;OAQG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAM5C;;;;;;;OAOG;cACa,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC;IAOpD;;;;;;;;OAQG;IACH,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,WAAW,GAAG,WAAW;
|
|
1
|
+
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/method.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;;;;GAOG;AACH,8BAAsB,MAAM;IA2CxB,SAAS,CAAC,MAAM,EAAE,cAAc;IAChC,SAAS,CAAC,MAAM,EAAE,YAAY;IA3ChC,SAAS,CAAC,GAAG,EAAG,WAAW,CAAC;IAE5B;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAG,WAAW,CAAC;IAE9B;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAG,YAAY,CAAC;IAEhC;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IAElC;;;;;;;;OAQG;gBAES,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY;IAOhC;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,CACX,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,YAAY,CAAC;IAExB;;;;;;;;;;;OAWG;cACa,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,EACX,MAAM,EAAE,OAAO,GAEd,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAuC7B;;;;;;;;OAQG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAM5C;;;;;;;OAOG;cACa,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC;IAOpD;;;;;;;;OAQG;IACH,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,WAAW,GAAG,WAAW;CAM/D"}
|
|
@@ -126,8 +126,8 @@ export class ControlVO {
|
|
|
126
126
|
* @returns {*}
|
|
127
127
|
*/
|
|
128
128
|
linkProperty(uiKey, dataKey, isOriginField = true) {
|
|
129
|
-
// srfuf不做处理
|
|
130
|
-
if (uiKey === 'srfuf') {
|
|
129
|
+
// srfuf和srfkey不做处理
|
|
130
|
+
if (uiKey === 'srfuf' || uiKey === 'srfkey') {
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
// 后台数据存在$origin里,其他存在ControlVo上
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"msg-box-node.d.ts","sourceRoot":"","sources":["../../../../src/ui-logic/ui-logic-node/msg-box-node/msg-box-node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;;;;GAQG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACjC,KAAK,EAAE,gBAAgB,CAAC;IAEhC,SAAS,CAAC,OAAO;;;;;MAKN;IAEL,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"msg-box-node.d.ts","sourceRoot":"","sources":["../../../../src/ui-logic/ui-logic-node/msg-box-node/msg-box-node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;;;;GAQG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACjC,KAAK,EAAE,gBAAgB,CAAC;IAEhC,SAAS,CAAC,OAAO;;;;;MAKN;IAEL,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA4D/C"}
|
|
@@ -72,7 +72,6 @@ export class MsgBoxNode extends UILogicNode {
|
|
|
72
72
|
default:
|
|
73
73
|
throw new ModelError(this.model, `${buttonsType}暂未支持`);
|
|
74
74
|
}
|
|
75
|
-
console.log(this.model, modalParams);
|
|
76
75
|
const result = await ibiz.modal.confirm(modalParams);
|
|
77
76
|
ctx.setLastReturn(resultTags[result ? 0 : 1]);
|
|
78
77
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
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.20",
|
|
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": "51da056249d0ed3e037db1e6d8a3b646e1ce06b6"
|
|
61
61
|
}
|
package/src/constant/index.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { IControl, IControlLogic, IViewLayoutPanel } from '@ibiz/model-core';
|
|
2
|
+
import { NoticeError } from '@ibiz-template/core';
|
|
3
|
+
import { isNil } from 'ramda';
|
|
2
4
|
import { BaseController } from '..';
|
|
3
5
|
import { CTX } from '../../ctx';
|
|
4
6
|
import {
|
|
@@ -17,6 +19,7 @@ import {
|
|
|
17
19
|
} from '../../../interface';
|
|
18
20
|
import { ControlLogicScheduler } from '../../../logic-scheduler';
|
|
19
21
|
import { getControlProvider } from '../../../register';
|
|
22
|
+
import { ScriptFactory } from '../../../utils';
|
|
20
23
|
|
|
21
24
|
/**
|
|
22
25
|
* 部件控制器
|
|
@@ -235,4 +238,68 @@ export class ControlController<
|
|
|
235
238
|
return this.getEventArgs();
|
|
236
239
|
};
|
|
237
240
|
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* 执行对应部件行为消息提示
|
|
244
|
+
* @author lxm
|
|
245
|
+
* @date 2023-09-07 04:51:21
|
|
246
|
+
* @param {string} tag
|
|
247
|
+
* @param {({ default?: string; data?: IData | IData[]; error?: Error })} [opts]
|
|
248
|
+
* @return {*} {void}
|
|
249
|
+
*/
|
|
250
|
+
actionNotification(
|
|
251
|
+
tag: string,
|
|
252
|
+
opts?: { default?: string; data?: IData | IData[]; error?: Error },
|
|
253
|
+
): void {
|
|
254
|
+
const { ctrlMsg } = this.model;
|
|
255
|
+
const msgItem = ctrlMsg?.ctrlMsgItems?.find(item => item.name === tag);
|
|
256
|
+
let message: string;
|
|
257
|
+
let duration: number | undefined;
|
|
258
|
+
if (msgItem && msgItem.content) {
|
|
259
|
+
// 自定义部件消息提示
|
|
260
|
+
duration = isNil(msgItem.timeout) ? undefined : msgItem.timeout / 1000; // 单位转换为秒
|
|
261
|
+
const scriptParams: IParams = { ...this.getEventArgs() };
|
|
262
|
+
if (opts?.data) {
|
|
263
|
+
scriptParams.data = opts.data;
|
|
264
|
+
}
|
|
265
|
+
message = ScriptFactory.execScriptFn(
|
|
266
|
+
scriptParams,
|
|
267
|
+
`\`${msgItem.content}\``,
|
|
268
|
+
{
|
|
269
|
+
isAsync: false,
|
|
270
|
+
singleRowReturn: true,
|
|
271
|
+
},
|
|
272
|
+
) as string;
|
|
273
|
+
} else {
|
|
274
|
+
// 全局多语言资源提示信息
|
|
275
|
+
const resTag = `CONTROL.${this.model.controlType}.${tag}`.toUpperCase();
|
|
276
|
+
message = ibiz.i18n.t(resTag, '');
|
|
277
|
+
// 多语言如果给出来是标识,说明没找到,消息改成空值
|
|
278
|
+
if (message === resTag) {
|
|
279
|
+
message = '';
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// 都没有的时候如果给了默认输出信息,弹出默认输出信息
|
|
284
|
+
if (!message && opts?.default) {
|
|
285
|
+
message = opts.default;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// 如果报错有Message的时候给报错的信息
|
|
289
|
+
if (!message && opts?.error) {
|
|
290
|
+
message = message || opts.error.message;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// 如果默认信息也没有就不弹出信息
|
|
294
|
+
if (!message) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
if (opts?.error) {
|
|
299
|
+
// 报错时抛错误
|
|
300
|
+
throw new NoticeError(message, duration);
|
|
301
|
+
} else {
|
|
302
|
+
ibiz.message.success(message, duration, duration === 0);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
238
305
|
}
|
|
@@ -60,8 +60,25 @@ export class MDControlController<
|
|
|
60
60
|
this.state.groups = [];
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* 实体属性映射,key是id,value是name
|
|
65
|
+
* @author lxm
|
|
66
|
+
* @date 2023-09-07 03:16:56
|
|
67
|
+
* @protected
|
|
68
|
+
*/
|
|
69
|
+
protected fieldIdNameMap = new Map<string, string>();
|
|
70
|
+
|
|
63
71
|
protected async onCreated(): Promise<void> {
|
|
64
72
|
await super.onCreated();
|
|
73
|
+
|
|
74
|
+
// 初始化实体属性id和name的映射
|
|
75
|
+
const dataEntity = await ibiz.hub.getAppDataEntity(
|
|
76
|
+
this.model.appDataEntityId!,
|
|
77
|
+
);
|
|
78
|
+
dataEntity.appDEFields?.forEach(field => {
|
|
79
|
+
this.fieldIdNameMap.set(field.id!, field.name!);
|
|
80
|
+
});
|
|
81
|
+
|
|
65
82
|
// 设置默认排序
|
|
66
83
|
this.setSort();
|
|
67
84
|
}
|
|
@@ -159,11 +176,15 @@ export class MDControlController<
|
|
|
159
176
|
});
|
|
160
177
|
} catch (error) {
|
|
161
178
|
await this._evt.emit('onLoadError', undefined);
|
|
179
|
+
this.actionNotification('FETCHERROR', {
|
|
180
|
+
error: error as Error,
|
|
181
|
+
});
|
|
162
182
|
throw error;
|
|
163
183
|
} finally {
|
|
164
184
|
await this.endLoading();
|
|
165
185
|
}
|
|
166
186
|
|
|
187
|
+
this.actionNotification('FETCHSUCCESS');
|
|
167
188
|
return this.state.items;
|
|
168
189
|
}
|
|
169
190
|
|
|
@@ -234,8 +255,9 @@ export class MDControlController<
|
|
|
234
255
|
);
|
|
235
256
|
|
|
236
257
|
if (args?.silent !== true) {
|
|
237
|
-
|
|
238
|
-
|
|
258
|
+
this.actionNotification('REMOVESUCCESS', {
|
|
259
|
+
data,
|
|
260
|
+
default: `数据[${data
|
|
239
261
|
.map(item => item.srfmajortext)
|
|
240
262
|
.join('、')}]删除成功!`,
|
|
241
263
|
});
|
|
@@ -247,6 +269,10 @@ export class MDControlController<
|
|
|
247
269
|
}
|
|
248
270
|
} catch (error) {
|
|
249
271
|
await this._evt.emit('onRemoveError', undefined);
|
|
272
|
+
this.actionNotification('REMOVEERROR', {
|
|
273
|
+
error: error as Error,
|
|
274
|
+
data,
|
|
275
|
+
});
|
|
250
276
|
throw error;
|
|
251
277
|
} finally {
|
|
252
278
|
await this.endLoading();
|
|
@@ -249,7 +249,8 @@ export class DataViewControlController
|
|
|
249
249
|
// 设置默认排序或者置空
|
|
250
250
|
const { minorSortAppDEFieldId, minorSortDir } = this.model;
|
|
251
251
|
if (minorSortAppDEFieldId && minorSortDir) {
|
|
252
|
-
|
|
252
|
+
const fieldName = this.fieldIdNameMap.get(minorSortAppDEFieldId)!;
|
|
253
|
+
this.state.sortQuery = `${fieldName.toLowerCase()},${minorSortDir.toLowerCase()}`;
|
|
253
254
|
} else {
|
|
254
255
|
this.state.sortQuery = '';
|
|
255
256
|
}
|
|
@@ -79,6 +79,9 @@ export class EditFormController
|
|
|
79
79
|
res = await this.service.getDraft(this.context, queryParams);
|
|
80
80
|
} catch (error) {
|
|
81
81
|
await this.evt.emit('onLoadDraftError', undefined);
|
|
82
|
+
this.actionNotification('GETDRAFTERROR', {
|
|
83
|
+
error: error as Error,
|
|
84
|
+
});
|
|
82
85
|
throw error;
|
|
83
86
|
} finally {
|
|
84
87
|
await this.endLoading();
|
|
@@ -91,6 +94,7 @@ export class EditFormController
|
|
|
91
94
|
this.formStateNotify(FormNotifyState.DRAFT);
|
|
92
95
|
|
|
93
96
|
await this.evt.emit('onLoadDraftSuccess', undefined);
|
|
97
|
+
this.actionNotification('GETDRAFTSUCCESS');
|
|
94
98
|
this.state.isLoaded = true;
|
|
95
99
|
return this.data;
|
|
96
100
|
}
|
|
@@ -120,6 +124,9 @@ export class EditFormController
|
|
|
120
124
|
res = await this.service.get(this.context, queryParams);
|
|
121
125
|
} catch (error) {
|
|
122
126
|
await this.evt.emit('onLoadError', undefined);
|
|
127
|
+
this.actionNotification('GETERROR', {
|
|
128
|
+
error: error as Error,
|
|
129
|
+
});
|
|
123
130
|
throw error;
|
|
124
131
|
} finally {
|
|
125
132
|
await this.endLoading();
|
|
@@ -130,6 +137,7 @@ export class EditFormController
|
|
|
130
137
|
this.formStateNotify(FormNotifyState.LOAD);
|
|
131
138
|
|
|
132
139
|
await this.evt.emit('onLoadSuccess', undefined);
|
|
140
|
+
this.actionNotification('GETSUCCESS');
|
|
133
141
|
this.state.isLoaded = true;
|
|
134
142
|
return this.data;
|
|
135
143
|
}
|
|
@@ -153,14 +161,17 @@ export class EditFormController
|
|
|
153
161
|
}
|
|
154
162
|
await this.startLoading();
|
|
155
163
|
await this.evt.emit('onBeforeSave', undefined);
|
|
164
|
+
const isCreate = this.data.srfuf === Srfuf.CREATE;
|
|
156
165
|
let res;
|
|
157
166
|
try {
|
|
158
|
-
res =
|
|
159
|
-
this.
|
|
160
|
-
|
|
161
|
-
: await this.service.update(this.context, this.data);
|
|
167
|
+
res = isCreate
|
|
168
|
+
? await this.service.create(this.context, this.data)
|
|
169
|
+
: await this.service.update(this.context, this.data);
|
|
162
170
|
} catch (error) {
|
|
163
171
|
await this.evt.emit('onSaveError', undefined);
|
|
172
|
+
this.actionNotification(`${isCreate ? 'CREATE' : 'UPDATE'}ERROR`, {
|
|
173
|
+
error: error as Error,
|
|
174
|
+
});
|
|
164
175
|
throw error;
|
|
165
176
|
} finally {
|
|
166
177
|
await this.endLoading();
|
|
@@ -172,7 +183,9 @@ export class EditFormController
|
|
|
172
183
|
this.state.modified = false;
|
|
173
184
|
await this.evt.emit('onSaveSuccess', undefined);
|
|
174
185
|
this.formStateNotify(FormNotifyState.SAVE);
|
|
175
|
-
|
|
186
|
+
this.actionNotification(`${isCreate ? 'CREATE' : 'UPDATE'}SUCCESS`, {
|
|
187
|
+
default: `${this.data.srfmajortext || ''}保存成功`,
|
|
188
|
+
});
|
|
176
189
|
return this.data;
|
|
177
190
|
}
|
|
178
191
|
|
|
@@ -203,6 +216,9 @@ export class EditFormController
|
|
|
203
216
|
res = await this.service.remove(this.context, this.params);
|
|
204
217
|
} catch (error) {
|
|
205
218
|
await this.evt.emit('onRemoveError', undefined);
|
|
219
|
+
this.actionNotification('REMOVEERROR', {
|
|
220
|
+
error: error as Error,
|
|
221
|
+
});
|
|
206
222
|
throw error;
|
|
207
223
|
} finally {
|
|
208
224
|
await this.endLoading();
|
|
@@ -214,6 +230,7 @@ export class EditFormController
|
|
|
214
230
|
this.state.data = new ControlVO();
|
|
215
231
|
this.state.modified = false;
|
|
216
232
|
await this.evt.emit('onRemoveSuccess', undefined);
|
|
233
|
+
this.actionNotification('REMOVESUCCESS');
|
|
217
234
|
|
|
218
235
|
return ok;
|
|
219
236
|
}
|
|
@@ -317,10 +334,15 @@ export class EditFormController
|
|
|
317
334
|
},
|
|
318
335
|
this.data,
|
|
319
336
|
);
|
|
337
|
+
} catch (error) {
|
|
338
|
+
this.actionNotification('WFSTARTERROR', {
|
|
339
|
+
error: error as Error,
|
|
340
|
+
});
|
|
341
|
+
throw error;
|
|
320
342
|
} finally {
|
|
321
343
|
await this.endLoading();
|
|
322
344
|
}
|
|
323
|
-
|
|
345
|
+
this.actionNotification('WFSTARTSUCCESS', { default: '流程启动成功' });
|
|
324
346
|
}
|
|
325
347
|
|
|
326
348
|
/**
|
|
@@ -346,10 +368,15 @@ export class EditFormController
|
|
|
346
368
|
},
|
|
347
369
|
this.data,
|
|
348
370
|
);
|
|
371
|
+
} catch (error) {
|
|
372
|
+
this.actionNotification('WFSUBMITERROR', {
|
|
373
|
+
error: error as Error,
|
|
374
|
+
});
|
|
375
|
+
throw error;
|
|
349
376
|
} finally {
|
|
350
377
|
await this.endLoading();
|
|
351
378
|
}
|
|
352
|
-
|
|
379
|
+
this.actionNotification('WFSUBMITSUCCESS', { default: '流程提交成功' });
|
|
353
380
|
}
|
|
354
381
|
|
|
355
382
|
async dataChangeNotify(names: string[]): Promise<void> {
|
|
@@ -269,4 +269,11 @@ export abstract class FormController<
|
|
|
269
269
|
// 找不到value为false即全部是true
|
|
270
270
|
return values.findIndex(value => !value) === -1;
|
|
271
271
|
}
|
|
272
|
+
|
|
273
|
+
actionNotification(
|
|
274
|
+
tag: string,
|
|
275
|
+
opts?: { default?: string; error?: Error },
|
|
276
|
+
): void {
|
|
277
|
+
super.actionNotification(tag, { data: this.data, ...(opts || {}) });
|
|
278
|
+
}
|
|
272
279
|
}
|