@ibiz-template/runtime 0.7.3 → 0.7.5
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 +228 -32
- package/dist/index.system.min.js +1 -1
- package/out/application.d.ts +19 -2
- package/out/application.d.ts.map +1 -1
- package/out/application.js +15 -1
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +11 -7
- package/out/controller/control/grid/grid/grid.controller.d.ts +29 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +101 -1
- package/out/controller/utils/view-msg/view-msg-controller.d.ts +10 -1
- package/out/controller/utils/view-msg/view-msg-controller.d.ts.map +1 -1
- package/out/controller/utils/view-msg/view-msg-controller.js +17 -3
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +1 -4
- package/out/interface/common/i-app-service/i-app-service.d.ts +19 -2
- package/out/interface/common/i-app-service/i-app-service.d.ts.map +1 -1
- package/out/interface/controller/common/view-message/i-view-message.d.ts +8 -0
- package/out/interface/controller/common/view-message/i-view-message.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-drtab.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-drtab.state.d.ts.map +1 -1
- package/out/service/service/control/control.service.js +1 -1
- package/out/service/service/index.d.ts +1 -0
- package/out/service/service/index.d.ts.map +1 -1
- package/out/service/service/index.js +1 -0
- package/out/service/service/util/util.service.d.ts +43 -0
- package/out/service/service/util/util.service.d.ts.map +1 -0
- package/out/service/service/util/util.service.js +46 -0
- package/out/ui-logic/ui-logic-param/ui-logic-param.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-param/ui-logic-param.js +21 -9
- package/out/utils/nav-params/nav-params.d.ts +2 -0
- package/out/utils/nav-params/nav-params.d.ts.map +1 -1
- package/out/utils/nav-params/nav-params.js +25 -1
- package/package.json +3 -3
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 应用功能组件服务
|
|
3
|
+
*
|
|
4
|
+
* @author tony001
|
|
5
|
+
* @date 2024-04-23 11:04:58
|
|
6
|
+
* @export
|
|
7
|
+
* @class UtilService
|
|
8
|
+
*/
|
|
9
|
+
export class UtilService {
|
|
10
|
+
/**
|
|
11
|
+
* Creates an instance of UtilService.
|
|
12
|
+
* @author tony001
|
|
13
|
+
* @date 2024-04-23 11:04:49
|
|
14
|
+
* @param {IApplication} appModel
|
|
15
|
+
*/
|
|
16
|
+
constructor(appModel) {
|
|
17
|
+
this.appModel = appModel;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 加载指定数据
|
|
21
|
+
*
|
|
22
|
+
* @author tony001
|
|
23
|
+
* @date 2024-04-23 11:04:22
|
|
24
|
+
* @param {string} tag
|
|
25
|
+
* @param {IContext} context
|
|
26
|
+
* @param {IParams} params
|
|
27
|
+
* @return {*} {Promise<IData>}
|
|
28
|
+
*/
|
|
29
|
+
async load(tag, context, params) {
|
|
30
|
+
throw new Error('暂未实现');
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 保存指定数据
|
|
34
|
+
*
|
|
35
|
+
* @author tony001
|
|
36
|
+
* @date 2024-04-23 12:04:36
|
|
37
|
+
* @param {string} tag
|
|
38
|
+
* @param {IContext} context
|
|
39
|
+
* @param {IParams} params
|
|
40
|
+
* @param {IData} data
|
|
41
|
+
* @return {*} {Promise<IData>}
|
|
42
|
+
*/
|
|
43
|
+
async save(tag, context, params, data) {
|
|
44
|
+
throw new Error('暂未实现');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-logic-param.d.ts","sourceRoot":"","sources":["../../../src/ui-logic/ui-logic-param/ui-logic-param.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ui-logic-param.d.ts","sourceRoot":"","sources":["../../../src/ui-logic/ui-logic-param/ui-logic-param.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;;GAOG;AACH,qBAAa,YAAY;IAQJ,KAAK,EAAE,eAAe;IAPzC;;;;;;OAMG;gBACgB,KAAK,EAAE,eAAe;IAEzC;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAgH/B;;;;;OAKG;IACH,KAAK,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;CAiBjC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-prototype-builtins */
|
|
1
2
|
import { ModelError } from '@ibiz-template/core';
|
|
2
3
|
/**
|
|
3
4
|
* 界面逻辑参数
|
|
@@ -46,14 +47,15 @@ export class UILogicParam {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
else if (m.activeContainerParam) {
|
|
50
|
+
// 当前容器对象
|
|
49
51
|
ctx.params[tag] = parameters.ctrl || parameters.view;
|
|
50
52
|
}
|
|
51
53
|
else if (m.activeCtrlParam) {
|
|
52
|
-
//
|
|
54
|
+
// 当前部件对象
|
|
53
55
|
ctx.params[tag] = parameters.ctrl;
|
|
54
56
|
}
|
|
55
57
|
else if (m.ctrlParam) {
|
|
56
|
-
//
|
|
58
|
+
// 指定部件对象
|
|
57
59
|
// 部件模型名称会被小写
|
|
58
60
|
const control = parameters.view.getController(m.codeName.toLowerCase());
|
|
59
61
|
if (control) {
|
|
@@ -64,13 +66,16 @@ export class UILogicParam {
|
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
else if (m.activeViewParam) {
|
|
67
|
-
//
|
|
69
|
+
// 当前视图对象
|
|
68
70
|
ctx.params[tag] = parameters.view;
|
|
69
71
|
}
|
|
70
72
|
else if (m.appGlobalParam) {
|
|
71
73
|
// 应用全局变量
|
|
72
74
|
let value = ibiz.util.getGlobalParam();
|
|
73
75
|
if (m.paramFieldName) {
|
|
76
|
+
if (!value.hasOwnProperty(m.paramFieldName)) {
|
|
77
|
+
value[m.paramFieldName] = {};
|
|
78
|
+
}
|
|
74
79
|
value = value[m.paramFieldName];
|
|
75
80
|
}
|
|
76
81
|
ctx.params[tag] = value;
|
|
@@ -80,10 +85,11 @@ export class UILogicParam {
|
|
|
80
85
|
ctx.params[tag] = app;
|
|
81
86
|
}
|
|
82
87
|
else if (m.entityListParam) {
|
|
83
|
-
//
|
|
88
|
+
// 数据对象列表变量
|
|
84
89
|
ctx.params[tag] = [];
|
|
85
90
|
}
|
|
86
91
|
else if (m.entityPageParam) {
|
|
92
|
+
// 分页查询结果变量
|
|
87
93
|
ctx.params[tag] = [];
|
|
88
94
|
}
|
|
89
95
|
else if (m.entityParam) {
|
|
@@ -95,37 +101,43 @@ export class UILogicParam {
|
|
|
95
101
|
ctx.initLastReturnParam(tag);
|
|
96
102
|
}
|
|
97
103
|
else if (m.navContextParam) {
|
|
98
|
-
//
|
|
104
|
+
// 应用上下文变量
|
|
99
105
|
ctx.params[tag] = context;
|
|
100
106
|
}
|
|
101
107
|
else if (m.navViewParamParam) {
|
|
102
|
-
//
|
|
108
|
+
// 视图路由参数变量
|
|
103
109
|
ctx.params[tag] = ibiz.util.getRouterParams();
|
|
104
110
|
}
|
|
105
111
|
else if (m.routeViewSessionParam) {
|
|
106
112
|
// 路由视图会话
|
|
107
113
|
let value = parameters.view.getTopView().state;
|
|
108
114
|
if (m.paramFieldName) {
|
|
115
|
+
if (!value.hasOwnProperty(m.paramFieldName)) {
|
|
116
|
+
value[m.paramFieldName] = {};
|
|
117
|
+
}
|
|
109
118
|
value = value[m.paramFieldName];
|
|
110
119
|
}
|
|
111
120
|
ctx.params[tag] = value;
|
|
112
121
|
}
|
|
113
122
|
else if (m.simpleListParam) {
|
|
114
|
-
//
|
|
123
|
+
// 简单数据列表变量
|
|
115
124
|
ctx.params[tag] = [];
|
|
116
125
|
}
|
|
117
126
|
else if (m.simpleParam) {
|
|
118
|
-
//
|
|
127
|
+
// 简单数据变量
|
|
119
128
|
ctx.params[tag] = {};
|
|
120
129
|
}
|
|
121
130
|
else if (m.viewNavDataParam) {
|
|
122
|
-
//
|
|
131
|
+
// 视图导航数据变量
|
|
123
132
|
ctx.params[tag] = params;
|
|
124
133
|
}
|
|
125
134
|
else if (m.viewSessionParam) {
|
|
126
135
|
// 当前视图会话
|
|
127
136
|
let value = parameters.view.state;
|
|
128
137
|
if (m.paramFieldName) {
|
|
138
|
+
if (!value.hasOwnProperty(m.paramFieldName)) {
|
|
139
|
+
value[m.paramFieldName] = {};
|
|
140
|
+
}
|
|
129
141
|
value = value[m.paramFieldName];
|
|
130
142
|
}
|
|
131
143
|
ctx.params[tag] = value;
|
|
@@ -13,6 +13,7 @@ export declare function convertObjectToNavParams(navParams: IData): INavigatePar
|
|
|
13
13
|
* - 把%xxx%,转换成origins元素里对应叫xxx的值
|
|
14
14
|
* - 按顺序查找origins的元素,且只要有xxx的属性就算找到,不管值是否为空。
|
|
15
15
|
* - naviData里{a:%xxx%},origins里找不到xxx则返回值里不存在a属性
|
|
16
|
+
* - naviData里%a.b.c%,origins里找到origins.a.b.c,没找到则不做处理
|
|
16
17
|
* - naviData里非%xxx%形式的,都当成直接值原样返回,包括空值。
|
|
17
18
|
*
|
|
18
19
|
* @author lxm
|
|
@@ -27,6 +28,7 @@ export declare function convertNavData(navParams: INavigateParam[] | IData | und
|
|
|
27
28
|
* - 把%xxx%,转换成origins元素里对应叫xxx的值
|
|
28
29
|
* - 按顺序查找origins的元素,且只要有xxx的属性就算找到,不管值是否为空。
|
|
29
30
|
* - naviData里{a:%xxx%},origins里找不到xxx则返回值里不存在a属性
|
|
31
|
+
* - naviData里%a.b.c%,origins里找到origins.a.b.c,没找到则不做处理
|
|
30
32
|
* - naviData里非%xxx%形式的,都当成直接值原样返回,包括空值。
|
|
31
33
|
*
|
|
32
34
|
* @author lxm
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-params.d.ts","sourceRoot":"","sources":["../../../src/utils/nav-params/nav-params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,KAAK,GAAG,cAAc,EAAE,CAmB3E;AAED
|
|
1
|
+
{"version":3,"file":"nav-params.d.ts","sourceRoot":"","sources":["../../../src/utils/nav-params/nav-params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,KAAK,GAAG,cAAc,EAAE,CAmB3E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,cAAc,EAAE,GAAG,KAAK,GAAG,SAAS,GAAG,IAAI,EACtD,GAAG,OAAO,EAAE,KAAK,EAAE,GAClB,KAAK,CAYP;AAqDD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,cAAc,EAAE,EAC3B,GAAG,OAAO,EAAE,KAAK,EAAE,GAClB,KAAK,CAkCP;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,cAAc,EAAE,GAAG,KAAK,GAAG,SAAS,GAAG,IAAI,EACtD,OAAO,EAAE,KAAK,EAAE,GACf,KAAK,CAsBP"}
|
|
@@ -32,6 +32,7 @@ export function convertObjectToNavParams(navParams) {
|
|
|
32
32
|
* - 把%xxx%,转换成origins元素里对应叫xxx的值
|
|
33
33
|
* - 按顺序查找origins的元素,且只要有xxx的属性就算找到,不管值是否为空。
|
|
34
34
|
* - naviData里{a:%xxx%},origins里找不到xxx则返回值里不存在a属性
|
|
35
|
+
* - naviData里%a.b.c%,origins里找到origins.a.b.c,没找到则不做处理
|
|
35
36
|
* - naviData里非%xxx%形式的,都当成直接值原样返回,包括空值。
|
|
36
37
|
*
|
|
37
38
|
* @author lxm
|
|
@@ -61,24 +62,47 @@ export function convertNavData(navParams, ...origins) {
|
|
|
61
62
|
* @return {*} {{ find: boolean; value: unknown }} 返回find是否找到值,value为找到的值,可以是空值
|
|
62
63
|
*/
|
|
63
64
|
function getVal(origins, key) {
|
|
65
|
+
const keys = key.split('.');
|
|
66
|
+
let currentVal;
|
|
64
67
|
// 找到origins里第一个有该属性的的项
|
|
65
68
|
const findOrigin = origins.find(item => {
|
|
66
69
|
if (isNilOrEmpty(item)) {
|
|
67
70
|
return false;
|
|
68
71
|
}
|
|
72
|
+
// 处理%a.b.c%的情况
|
|
73
|
+
if (keys.length > 1) {
|
|
74
|
+
currentVal = item;
|
|
75
|
+
for (let i = 0; i < keys.length; i++) {
|
|
76
|
+
const k = keys[i];
|
|
77
|
+
if (currentVal &&
|
|
78
|
+
(currentVal[k] ||
|
|
79
|
+
Object.prototype.hasOwnProperty.call(currentVal, k))) {
|
|
80
|
+
currentVal = currentVal[k];
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
currentVal = undefined;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return currentVal !== undefined;
|
|
88
|
+
}
|
|
69
89
|
return (
|
|
70
90
|
// proxy数据判断是否能拿到值
|
|
71
91
|
item[key] ||
|
|
72
92
|
// 上下文等判断是否有这个属性,如果有且值为空,则赋该空值
|
|
73
93
|
Object.prototype.hasOwnProperty.call(item, key));
|
|
74
94
|
});
|
|
75
|
-
return {
|
|
95
|
+
return {
|
|
96
|
+
find: !!findOrigin,
|
|
97
|
+
value: keys.length > 1 ? currentVal : findOrigin === null || findOrigin === void 0 ? void 0 : findOrigin[key],
|
|
98
|
+
};
|
|
76
99
|
}
|
|
77
100
|
/**
|
|
78
101
|
* 通过模型中的导航数组 转换导航数据(如导航上下文,导航视图参数)
|
|
79
102
|
* - 把%xxx%,转换成origins元素里对应叫xxx的值
|
|
80
103
|
* - 按顺序查找origins的元素,且只要有xxx的属性就算找到,不管值是否为空。
|
|
81
104
|
* - naviData里{a:%xxx%},origins里找不到xxx则返回值里不存在a属性
|
|
105
|
+
* - naviData里%a.b.c%,origins里找到origins.a.b.c,没找到则不做处理
|
|
82
106
|
* - naviData里非%xxx%形式的,都当成直接值原样返回,包括空值。
|
|
83
107
|
*
|
|
84
108
|
* @author lxm
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@ibiz-template/core": "^0.7.3",
|
|
39
|
-
"@ibiz/model-core": "^0.1.
|
|
39
|
+
"@ibiz/model-core": "^0.1.21",
|
|
40
40
|
"@types/animejs": "^3.1.12",
|
|
41
41
|
"@types/path-browserify": "^1.0.2",
|
|
42
42
|
"@types/qs": "^6.9.11",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@ibiz-template/core": "^0.6.0",
|
|
57
|
-
"@ibiz/model-core": "^0.1.
|
|
57
|
+
"@ibiz/model-core": "^0.1.21",
|
|
58
58
|
"async-validator": "^4.2.5",
|
|
59
59
|
"dayjs": "^1.11.7",
|
|
60
60
|
"echarts": "^5.4.3",
|