@ibiz-template/runtime 0.1.18 → 0.1.19
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 +190 -118
- 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/control/dashboard/dashboard.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/dashboard.controller.js +3 -3
- 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 +18 -6
- package/out/controller/control/form/form/form.controller.d.ts.map +1 -1
- package/out/controller/control/form/form/form.controller.js +4 -3
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +14 -9
- 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/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 +8 -0
- 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.js +2 -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/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 +2 -2
- package/src/app-hub.ts +15 -0
- package/src/application.ts +8 -17
- package/src/controller/control/dashboard/dashboard.controller.ts +3 -3
- package/src/controller/control/form/edit-form/edit-form.controller.ts +30 -10
- package/src/controller/control/form/form/form.controller.ts +4 -3
- package/src/controller/control/grid/grid/grid.controller.ts +26 -13
- 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/service/app-data-entity/app-data-entity.ts +10 -0
- 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 +2 -2
- package/src/service/service/entity/util/util.ts +17 -0
- 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,8 +1,9 @@
|
|
|
1
|
-
import { IAppDataEntity,
|
|
1
|
+
import { IAppDataEntity, IAppDEMethod } from '@ibiz/model-core';
|
|
2
2
|
import { MethodDto } from '../../../dto/method.dto';
|
|
3
3
|
import { AppDataEntity } from '../../../app-data-entity/app-data-entity';
|
|
4
4
|
import { findModelChild } from '../../../../model';
|
|
5
5
|
import { IDataEntity } from '../../../../interface';
|
|
6
|
+
import { isLocalMode } from '../util/util';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* 应用实体方法输出转换
|
|
@@ -15,25 +16,30 @@ import { IDataEntity } from '../../../../interface';
|
|
|
15
16
|
export class MethodReturn {
|
|
16
17
|
protected dto?: MethodDto;
|
|
17
18
|
|
|
19
|
+
protected get isLocalMode(): boolean {
|
|
20
|
+
return isLocalMode(this.method);
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
/**
|
|
19
24
|
* Creates an instance of MethodReturn.
|
|
20
|
-
*
|
|
21
25
|
* @author chitanda
|
|
22
|
-
* @date
|
|
26
|
+
* @date 2023-09-06 16:09:45
|
|
23
27
|
* @param {IAppDataEntity} entity
|
|
28
|
+
* @param {IAppDEMethod} method
|
|
24
29
|
* @param {IAppDEMethodReturn} [output]
|
|
25
30
|
*/
|
|
26
31
|
constructor(
|
|
27
32
|
protected entity: IAppDataEntity,
|
|
28
|
-
protected
|
|
33
|
+
protected method: IAppDEMethod,
|
|
29
34
|
) {
|
|
35
|
+
const output = method.appDEMethodReturn;
|
|
30
36
|
if (output) {
|
|
31
37
|
const methodDto = findModelChild(
|
|
32
38
|
entity.appDEMethodDTOs || [],
|
|
33
39
|
output.appDEMethodDTOId!,
|
|
34
40
|
);
|
|
35
41
|
if (methodDto) {
|
|
36
|
-
this.dto = new MethodDto(entity, methodDto);
|
|
42
|
+
this.dto = new MethodDto(entity, this.isLocalMode, methodDto);
|
|
37
43
|
}
|
|
38
44
|
}
|
|
39
45
|
}
|
|
@@ -64,8 +64,8 @@ export abstract class Method {
|
|
|
64
64
|
protected method: IAppDEMethod,
|
|
65
65
|
) {
|
|
66
66
|
this.app = ibiz.hub.getApp(entity.appId);
|
|
67
|
-
this.input = new MethodInput(entity, method
|
|
68
|
-
this.result = new MethodReturn(entity, method
|
|
67
|
+
this.input = new MethodInput(entity, method);
|
|
68
|
+
this.result = new MethodReturn(entity, method);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IAppDEAction, IAppDEDataSet, IAppDEMethod } from '@ibiz/model-core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 是否为本地模式
|
|
5
|
+
*
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2023-09-06 16:09:06
|
|
8
|
+
* @export
|
|
9
|
+
* @param {IAppDEMethod} method
|
|
10
|
+
* @return {*} {boolean}
|
|
11
|
+
*/
|
|
12
|
+
export function isLocalMode(method: IAppDEMethod): boolean {
|
|
13
|
+
return (
|
|
14
|
+
(method as IAppDEAction).actionType === 'BUILTIN' ||
|
|
15
|
+
(method as IAppDEDataSet).dataSetType === 'DATAQUERY'
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -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';
|
|
@@ -31,7 +32,8 @@ export function installHelpers(hsb: IData): void {
|
|
|
31
32
|
new HelperEq(hsb);
|
|
32
33
|
new HelperGt(hsb);
|
|
33
34
|
new HelperGte(hsb);
|
|
34
|
-
new
|
|
35
|
+
new HelperJsonParse(hsb);
|
|
36
|
+
new HelperJsonStringify(hsb);
|
|
35
37
|
new HelperLowerCase(hsb);
|
|
36
38
|
new HelperLt(hsb);
|
|
37
39
|
new HelperLte(hsb);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HelperBase } from '../helper-base';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* json字符创 转 对象
|
|
5
|
+
*
|
|
6
|
+
* @description 用法 {{json xxx 2}},支持第二个参数传递格式化。效果: 将 json 对象转为 json 字符串
|
|
7
|
+
* @author chitanda
|
|
8
|
+
* @date 2021-12-24 15:12:59
|
|
9
|
+
* @export
|
|
10
|
+
* @class HelperJson
|
|
11
|
+
* @extends {HelperBase}
|
|
12
|
+
*/
|
|
13
|
+
export class HelperJsonParse extends HelperBase {
|
|
14
|
+
constructor(hbs: IData) {
|
|
15
|
+
super(hbs, 'jsonParse');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
onExecute(obj: string): string {
|
|
19
|
+
return JSON.parse(obj);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -7,10 +7,10 @@ import { HelperBase } from '../helper-base';
|
|
|
7
7
|
* @author chitanda
|
|
8
8
|
* @date 2021-12-24 15:12:59
|
|
9
9
|
* @export
|
|
10
|
-
* @class
|
|
10
|
+
* @class HelperJsonStringify
|
|
11
11
|
* @extends {HelperBase}
|
|
12
12
|
*/
|
|
13
|
-
export class
|
|
13
|
+
export class HelperJsonStringify extends HelperBase {
|
|
14
14
|
constructor(hbs: IData) {
|
|
15
15
|
super(hbs, 'jsonStringify');
|
|
16
16
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/json/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;GASG;AACH,qBAAa,UAAW,SAAQ,UAAU;gBAC5B,GAAG,EAAE,KAAK;IAItB,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;CAO3E"}
|