@ibiz-template/runtime 0.1.18 → 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 +407 -147
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/app-hub.d.ts +9 -0
- package/out/app-hub.d.ts.map +1 -1
- package/out/app-hub.js +14 -0
- package/out/application.d.ts.map +1 -1
- package/out/application.js +5 -12
- 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/dashboard/dashboard.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/dashboard.controller.js +3 -3
- 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 +54 -13
- 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 +7 -3
- 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 +43 -14
- package/out/controller/control/list/list.controller.d.ts.map +1 -1
- package/out/controller/control/list/list.controller.js +2 -1
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +4 -1
- package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts +9 -0
- package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts.map +1 -1
- package/out/interface/provider/model-loader.provider.d.ts +9 -0
- package/out/interface/provider/model-loader.provider.d.ts.map +1 -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 +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 +11 -1
- package/out/service/dto/method.dto.d.ts +2 -1
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +9 -4
- package/out/service/service/authority/authority.service.js +1 -1
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +2 -1
- package/out/service/service/entity/method/fetch.d.ts.map +1 -1
- package/out/service/service/entity/method/fetch.js +2 -1
- package/out/service/service/entity/method/method-input.d.ts +6 -6
- package/out/service/service/entity/method/method-input.d.ts.map +1 -1
- package/out/service/service/entity/method/method-input.js +10 -6
- package/out/service/service/entity/method/method-renturn.d.ts +6 -5
- package/out/service/service/entity/method/method-renturn.d.ts.map +1 -1
- package/out/service/service/entity/method/method-renturn.js +10 -5
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +5 -2
- package/out/service/service/entity/util/util.d.ts +12 -0
- package/out/service/service/entity/util/util.d.ts.map +1 -0
- package/out/service/service/entity/util/util.js +13 -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/out/utils/handlebars/helpers/index.d.ts.map +1 -1
- package/out/utils/handlebars/helpers/index.js +4 -2
- package/out/utils/handlebars/helpers/json/json-parse.d.ts +16 -0
- package/out/utils/handlebars/helpers/json/json-parse.d.ts.map +1 -0
- package/out/utils/handlebars/helpers/json/json-parse.js +19 -0
- package/out/utils/handlebars/helpers/json/{json.d.ts → json-stringify.d.ts} +3 -3
- package/out/utils/handlebars/helpers/json/json-stringify.d.ts.map +1 -0
- package/out/utils/handlebars/helpers/json/{json.js → json-stringify.js} +2 -2
- package/package.json +3 -3
- package/src/app-hub.ts +15 -0
- package/src/application.ts +8 -17
- 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/dashboard/dashboard.controller.ts +3 -3
- package/src/controller/control/data-view/data-view.controller.ts +2 -1
- package/src/controller/control/form/edit-form/edit-form.controller.ts +64 -17
- package/src/controller/control/form/form/form.controller.ts +11 -3
- package/src/controller/control/form/search-form/search-form.controller.ts +10 -1
- package/src/controller/control/grid/grid/grid.controller.ts +54 -18
- package/src/controller/control/list/list.controller.ts +2 -1
- package/src/controller/control/tree/tree.controller.ts +7 -1
- package/src/interface/common/i-app-hub-service/i-app-hub-service.ts +10 -0
- package/src/interface/provider/model-loader.provider.ts +10 -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 +13 -1
- package/src/service/dto/method.dto.ts +8 -3
- package/src/service/service/authority/authority.service.ts +1 -1
- package/src/service/service/entity/method/de-action.ts +2 -1
- package/src/service/service/entity/method/fetch.ts +2 -1
- package/src/service/service/entity/method/method-input.ts +11 -6
- package/src/service/service/entity/method/method-renturn.ts +11 -5
- package/src/service/service/entity/method/method.ts +5 -2
- package/src/service/service/entity/util/util.ts +17 -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
- package/src/utils/handlebars/helpers/index.ts +4 -2
- package/src/utils/handlebars/helpers/json/json-parse.ts +21 -0
- package/src/utils/handlebars/helpers/json/{json.ts → json-stringify.ts} +2 -2
- package/out/utils/handlebars/helpers/json/json.d.ts.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MethodDto } from '../../../dto/method.dto';
|
|
2
2
|
import { findModelChild } from '../../../../model';
|
|
3
|
+
import { isLocalMode } from '../util/util';
|
|
3
4
|
/**
|
|
4
5
|
* 应用实体方法输入转换
|
|
5
6
|
*
|
|
@@ -9,21 +10,24 @@ import { findModelChild } from '../../../../model';
|
|
|
9
10
|
* @class MethodInput
|
|
10
11
|
*/
|
|
11
12
|
export class MethodInput {
|
|
13
|
+
get isLocalMode() {
|
|
14
|
+
return isLocalMode(this.method);
|
|
15
|
+
}
|
|
12
16
|
/**
|
|
13
17
|
* Creates an instance of MethodInput.
|
|
14
|
-
*
|
|
15
18
|
* @author chitanda
|
|
16
|
-
* @date
|
|
19
|
+
* @date 2023-09-06 16:09:26
|
|
17
20
|
* @param {IAppDataEntity} entity
|
|
18
|
-
* @param {
|
|
21
|
+
* @param {IAppDEMethod} method
|
|
19
22
|
*/
|
|
20
|
-
constructor(entity,
|
|
23
|
+
constructor(entity, method) {
|
|
21
24
|
this.entity = entity;
|
|
22
|
-
this.
|
|
25
|
+
this.method = method;
|
|
26
|
+
const input = method.appDEMethodInput;
|
|
23
27
|
if (input) {
|
|
24
28
|
const methodDto = findModelChild(entity.appDEMethodDTOs || [], input.appDEMethodDTOId);
|
|
25
29
|
if (methodDto) {
|
|
26
|
-
this.dto = new MethodDto(entity, methodDto);
|
|
30
|
+
this.dto = new MethodDto(entity, this.isLocalMode, methodDto);
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAppDataEntity,
|
|
1
|
+
import { IAppDataEntity, IAppDEMethod } from '@ibiz/model-core';
|
|
2
2
|
import { MethodDto } from '../../../dto/method.dto';
|
|
3
3
|
import { IDataEntity } from '../../../../interface';
|
|
4
4
|
/**
|
|
@@ -11,17 +11,18 @@ import { IDataEntity } from '../../../../interface';
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class MethodReturn {
|
|
13
13
|
protected entity: IAppDataEntity;
|
|
14
|
-
protected
|
|
14
|
+
protected method: IAppDEMethod;
|
|
15
15
|
protected dto?: MethodDto;
|
|
16
|
+
protected get isLocalMode(): boolean;
|
|
16
17
|
/**
|
|
17
18
|
* Creates an instance of MethodReturn.
|
|
18
|
-
*
|
|
19
19
|
* @author chitanda
|
|
20
|
-
* @date
|
|
20
|
+
* @date 2023-09-06 16:09:45
|
|
21
21
|
* @param {IAppDataEntity} entity
|
|
22
|
+
* @param {IAppDEMethod} method
|
|
22
23
|
* @param {IAppDEMethodReturn} [output]
|
|
23
24
|
*/
|
|
24
|
-
constructor(entity: IAppDataEntity,
|
|
25
|
+
constructor(entity: IAppDataEntity, method: IAppDEMethod);
|
|
25
26
|
/**
|
|
26
27
|
* 处理请求返回参数
|
|
27
28
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method-renturn.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/method-renturn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"method-renturn.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/method-renturn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD;;;;;;;GAOG;AACH,qBAAa,YAAY;IAgBrB,SAAS,CAAC,MAAM,EAAE,cAAc;IAChC,SAAS,CAAC,MAAM,EAAE,YAAY;IAhBhC,SAAS,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;IAE1B,SAAS,KAAK,WAAW,IAAI,OAAO,CAEnC;IAED;;;;;;;OAOG;gBAES,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY;IAchC;;;;;;;;OAQG;IACG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC;CAOlE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MethodDto } from '../../../dto/method.dto';
|
|
2
2
|
import { AppDataEntity } from '../../../app-data-entity/app-data-entity';
|
|
3
3
|
import { findModelChild } from '../../../../model';
|
|
4
|
+
import { isLocalMode } from '../util/util';
|
|
4
5
|
/**
|
|
5
6
|
* 应用实体方法输出转换
|
|
6
7
|
*
|
|
@@ -10,21 +11,25 @@ import { findModelChild } from '../../../../model';
|
|
|
10
11
|
* @class MethodReturn
|
|
11
12
|
*/
|
|
12
13
|
export class MethodReturn {
|
|
14
|
+
get isLocalMode() {
|
|
15
|
+
return isLocalMode(this.method);
|
|
16
|
+
}
|
|
13
17
|
/**
|
|
14
18
|
* Creates an instance of MethodReturn.
|
|
15
|
-
*
|
|
16
19
|
* @author chitanda
|
|
17
|
-
* @date
|
|
20
|
+
* @date 2023-09-06 16:09:45
|
|
18
21
|
* @param {IAppDataEntity} entity
|
|
22
|
+
* @param {IAppDEMethod} method
|
|
19
23
|
* @param {IAppDEMethodReturn} [output]
|
|
20
24
|
*/
|
|
21
|
-
constructor(entity,
|
|
25
|
+
constructor(entity, method) {
|
|
22
26
|
this.entity = entity;
|
|
23
|
-
this.
|
|
27
|
+
this.method = method;
|
|
28
|
+
const output = method.appDEMethodReturn;
|
|
24
29
|
if (output) {
|
|
25
30
|
const methodDto = findModelChild(entity.appDEMethodDTOs || [], output.appDEMethodDTOId);
|
|
26
31
|
if (methodDto) {
|
|
27
|
-
this.dto = new MethodDto(entity, methodDto);
|
|
32
|
+
this.dto = new MethodDto(entity, this.isLocalMode, methodDto);
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
}
|
|
@@ -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"}
|
|
@@ -27,8 +27,8 @@ export class Method {
|
|
|
27
27
|
this.entity = entity;
|
|
28
28
|
this.method = method;
|
|
29
29
|
this.app = ibiz.hub.getApp(entity.appId);
|
|
30
|
-
this.input = new MethodInput(entity, method
|
|
31
|
-
this.result = new MethodReturn(entity, method
|
|
30
|
+
this.input = new MethodInput(entity, method);
|
|
31
|
+
this.result = new MethodReturn(entity, method);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* 发送请求
|
|
@@ -110,6 +110,9 @@ export class Method {
|
|
|
110
110
|
* @return {*} {IDataEntity}
|
|
111
111
|
*/
|
|
112
112
|
createEntity(data) {
|
|
113
|
+
if (data instanceof AppDataEntity) {
|
|
114
|
+
return data.clone();
|
|
115
|
+
}
|
|
113
116
|
return new AppDataEntity(this.entity, data);
|
|
114
117
|
}
|
|
115
118
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IAppDEMethod } from '@ibiz/model-core';
|
|
2
|
+
/**
|
|
3
|
+
* 是否为本地模式
|
|
4
|
+
*
|
|
5
|
+
* @author chitanda
|
|
6
|
+
* @date 2023-09-06 16:09:06
|
|
7
|
+
* @export
|
|
8
|
+
* @param {IAppDEMethod} method
|
|
9
|
+
* @return {*} {boolean}
|
|
10
|
+
*/
|
|
11
|
+
export declare function isLocalMode(method: IAppDEMethod): boolean;
|
|
12
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/util/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE7E;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAKzD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 是否为本地模式
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2023-09-06 16:09:06
|
|
6
|
+
* @export
|
|
7
|
+
* @param {IAppDEMethod} method
|
|
8
|
+
* @return {*} {boolean}
|
|
9
|
+
*/
|
|
10
|
+
export function isLocalMode(method) {
|
|
11
|
+
return (method.actionType === 'BUILTIN' ||
|
|
12
|
+
method.dataSetType === 'DATAQUERY');
|
|
13
|
+
}
|
|
@@ -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
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/handlebars/helpers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/handlebars/helpers/index.ts"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAoB/C"}
|
|
@@ -5,7 +5,8 @@ import { HelperEq } from './eq/eq';
|
|
|
5
5
|
import { HelperGt } from './gt/gt';
|
|
6
6
|
import { HelperGte } from './gte/gte';
|
|
7
7
|
import { HelperEqPropertyValue } from './eq-property-value/eq-property-value';
|
|
8
|
-
import {
|
|
8
|
+
import { HelperJsonParse } from './json/json-parse';
|
|
9
|
+
import { HelperJsonStringify } from './json/json-stringify';
|
|
9
10
|
import { HelperLowerCase } from './lower-case/lower-case';
|
|
10
11
|
import { HelperLt } from './lt/lt';
|
|
11
12
|
import { HelperLte } from './lte/lte';
|
|
@@ -30,7 +31,8 @@ export function installHelpers(hsb) {
|
|
|
30
31
|
new HelperEq(hsb);
|
|
31
32
|
new HelperGt(hsb);
|
|
32
33
|
new HelperGte(hsb);
|
|
33
|
-
new
|
|
34
|
+
new HelperJsonParse(hsb);
|
|
35
|
+
new HelperJsonStringify(hsb);
|
|
34
36
|
new HelperLowerCase(hsb);
|
|
35
37
|
new HelperLt(hsb);
|
|
36
38
|
new HelperLte(hsb);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HelperBase } from '../helper-base';
|
|
2
|
+
/**
|
|
3
|
+
* json字符创 转 对象
|
|
4
|
+
*
|
|
5
|
+
* @description 用法 {{json xxx 2}},支持第二个参数传递格式化。效果: 将 json 对象转为 json 字符串
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2021-12-24 15:12:59
|
|
8
|
+
* @export
|
|
9
|
+
* @class HelperJson
|
|
10
|
+
* @extends {HelperBase}
|
|
11
|
+
*/
|
|
12
|
+
export declare class HelperJsonParse extends HelperBase {
|
|
13
|
+
constructor(hbs: IData);
|
|
14
|
+
onExecute(obj: string): string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=json-parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-parse.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/json/json-parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;GASG;AACH,qBAAa,eAAgB,SAAQ,UAAU;gBACjC,GAAG,EAAE,KAAK;IAItB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAG/B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HelperBase } from '../helper-base';
|
|
2
|
+
/**
|
|
3
|
+
* json字符创 转 对象
|
|
4
|
+
*
|
|
5
|
+
* @description 用法 {{json xxx 2}},支持第二个参数传递格式化。效果: 将 json 对象转为 json 字符串
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2021-12-24 15:12:59
|
|
8
|
+
* @export
|
|
9
|
+
* @class HelperJson
|
|
10
|
+
* @extends {HelperBase}
|
|
11
|
+
*/
|
|
12
|
+
export class HelperJsonParse extends HelperBase {
|
|
13
|
+
constructor(hbs) {
|
|
14
|
+
super(hbs, 'jsonParse');
|
|
15
|
+
}
|
|
16
|
+
onExecute(obj) {
|
|
17
|
+
return JSON.parse(obj);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -6,11 +6,11 @@ import { HelperBase } from '../helper-base';
|
|
|
6
6
|
* @author chitanda
|
|
7
7
|
* @date 2021-12-24 15:12:59
|
|
8
8
|
* @export
|
|
9
|
-
* @class
|
|
9
|
+
* @class HelperJsonStringify
|
|
10
10
|
* @extends {HelperBase}
|
|
11
11
|
*/
|
|
12
|
-
export declare class
|
|
12
|
+
export declare class HelperJsonStringify extends HelperBase {
|
|
13
13
|
constructor(hbs: IData);
|
|
14
14
|
onExecute(obj: Record<string, unknown> | unknown[], space: number): string;
|
|
15
15
|
}
|
|
16
|
-
//# sourceMappingURL=json.d.ts.map
|
|
16
|
+
//# sourceMappingURL=json-stringify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-stringify.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/json/json-stringify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;GASG;AACH,qBAAa,mBAAoB,SAAQ,UAAU;gBACrC,GAAG,EAAE,KAAK;IAItB,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;CAO3E"}
|
|
@@ -6,10 +6,10 @@ import { HelperBase } from '../helper-base';
|
|
|
6
6
|
* @author chitanda
|
|
7
7
|
* @date 2021-12-24 15:12:59
|
|
8
8
|
* @export
|
|
9
|
-
* @class
|
|
9
|
+
* @class HelperJsonStringify
|
|
10
10
|
* @extends {HelperBase}
|
|
11
11
|
*/
|
|
12
|
-
export class
|
|
12
|
+
export class HelperJsonStringify extends HelperBase {
|
|
13
13
|
constructor(hbs) {
|
|
14
14
|
super(hbs, 'jsonStringify');
|
|
15
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
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": "bd9c4f935e57362567b12c7b4b91a64f4c099616"
|
|
61
61
|
}
|
package/src/app-hub.ts
CHANGED
|
@@ -204,6 +204,21 @@ export class AppHub implements IAppHubService {
|
|
|
204
204
|
return this.view2appMap.has(id);
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
/**
|
|
208
|
+
* 获取应用样式
|
|
209
|
+
*
|
|
210
|
+
* @author chitanda
|
|
211
|
+
* @date 2023-09-06 10:09:22
|
|
212
|
+
* @param {string} appId
|
|
213
|
+
* @return {*} {(Promise<string | null>)}
|
|
214
|
+
*/
|
|
215
|
+
async getAppStyle(appId: string): Promise<string | null> {
|
|
216
|
+
if (this.modelLoaderProvider) {
|
|
217
|
+
return this.modelLoaderProvider.getAppStyle(appId);
|
|
218
|
+
}
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
|
|
207
222
|
/**
|
|
208
223
|
* 根据视图代码名称查找视图
|
|
209
224
|
*
|
package/src/application.ts
CHANGED
|
@@ -112,23 +112,14 @@ export class Application implements IAppService {
|
|
|
112
112
|
* @return {*} {Promise<void>}
|
|
113
113
|
*/
|
|
114
114
|
protected async loadAppModelStyle(): Promise<void> {
|
|
115
|
-
await this.
|
|
116
|
-
|
|
117
|
-
.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
dom.innerHTML = res.data as unknown as string;
|
|
125
|
-
document.head.appendChild(dom);
|
|
126
|
-
})
|
|
127
|
-
.catch(err => {
|
|
128
|
-
ibiz.log.error(
|
|
129
|
-
`应用[${this.appId}]模型全局样式加载失败:${err.message}`,
|
|
130
|
-
);
|
|
131
|
-
});
|
|
115
|
+
const style = await ibiz.hub.getAppStyle(this.appId);
|
|
116
|
+
if (style) {
|
|
117
|
+
const dom = document.createElement('style');
|
|
118
|
+
dom.setAttribute('type', 'text/css');
|
|
119
|
+
dom.id = this.appId;
|
|
120
|
+
dom.innerHTML = style;
|
|
121
|
+
document.head.appendChild(dom);
|
|
122
|
+
}
|
|
132
123
|
}
|
|
133
124
|
|
|
134
125
|
/**
|
|
@@ -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();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RuntimeError } from '@ibiz-template/core';
|
|
2
1
|
import {
|
|
3
2
|
IDashboard,
|
|
4
3
|
IDBContainerPortletPart,
|
|
@@ -119,9 +118,10 @@ export class DashboardController
|
|
|
119
118
|
return portlet.dataChangeNotify(data);
|
|
120
119
|
}),
|
|
121
120
|
);
|
|
122
|
-
|
|
121
|
+
const rejectedValue = values.find(item => item.status === 'rejected');
|
|
122
|
+
if (rejectedValue) {
|
|
123
123
|
ibiz.log.error('dataChangeNotify报错', values);
|
|
124
|
-
throw
|
|
124
|
+
throw (rejectedValue as PromiseRejectedResult).reason;
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
}
|
|
@@ -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
|
}
|