@ibiz-template/runtime 0.7.30 → 0.7.31-alpha.0
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 +403 -103
- package/dist/index.system.min.js +1 -1
- package/out/controller/control/chart/chart.controller.d.ts +1 -1
- package/out/controller/control/chart/chart.controller.d.ts.map +1 -1
- package/out/controller/control/chart/chart.controller.js +52 -22
- package/out/controller/control/chart/generator/base-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/base-series-generator.js +33 -2
- package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.d.ts +7 -0
- package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.js +17 -1
- package/out/controller/control/dashboard/portlet/report-portlet/report-portlet.controller.d.ts +10 -0
- package/out/controller/control/dashboard/portlet/report-portlet/report-portlet.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/report-portlet/report-portlet.controller.js +15 -0
- package/out/controller/control/dashboard/portlet/view-portlet/view-portlet.controller.d.ts +7 -0
- package/out/controller/control/dashboard/portlet/view-portlet/view-portlet.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/view-portlet/view-portlet.controller.js +17 -0
- package/out/controller/control/grid/grid/entity-schema.d.ts.map +1 -1
- package/out/controller/control/grid/grid/entity-schema.js +3 -0
- package/out/controller/control/search-bar/entity-schema.d.ts.map +1 -1
- package/out/controller/control/search-bar/entity-schema.js +3 -0
- package/out/controller/control/search-bar/search-bar.controller.d.ts +10 -1
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +60 -3
- package/out/controller/utils/code-list/code-list.d.ts +1 -1
- package/out/controller/utils/code-list/code-list.d.ts.map +1 -1
- package/out/interface/controller/state/control/search-bar/i-search-bar.state.d.ts +16 -0
- package/out/interface/controller/state/control/search-bar/i-search-bar.state.d.ts.map +1 -1
- package/out/service/de-service-util.d.ts +13 -0
- package/out/service/de-service-util.d.ts.map +1 -1
- package/out/service/de-service-util.js +59 -0
- package/out/service/service/code-list/code-list.service.d.ts +19 -0
- package/out/service/service/code-list/code-list.service.d.ts.map +1 -1
- package/out/service/service/code-list/code-list.service.js +49 -0
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +17 -0
- package/package.json +6 -5
|
@@ -100,5 +100,18 @@ export declare class DEServiceUtil {
|
|
|
100
100
|
* @return {*} {Promise<IHttpResponse<IData>>}
|
|
101
101
|
*/
|
|
102
102
|
exec(appDataEntityId: string, methodName: string, context: IContext, params?: IData | IData[] | undefined, params2?: IParams | undefined, header?: IData): Promise<IHttpResponse<IData>>;
|
|
103
|
+
/**
|
|
104
|
+
* 计算应用实体服务映射参数
|
|
105
|
+
* srfappdemapping:是否开启应用实体服务映射
|
|
106
|
+
* srfappmappingmap:应用映射表,与srfappdemapping搭配使用,原应用标识:目标应用标识,以冒号分割,多个应用以逗号隔开
|
|
107
|
+
* 如:logicdesign__logicdesign:ibizplm__plmweb
|
|
108
|
+
*
|
|
109
|
+
* @author tony001
|
|
110
|
+
* @date 2024-07-19 15:07:31
|
|
111
|
+
* @param {IContext} context
|
|
112
|
+
* @param {string} appDataEntityId
|
|
113
|
+
* @return {*} {Promise<IData>}
|
|
114
|
+
*/
|
|
115
|
+
computeAppDEMappingParam(context: IContext, appDataEntityId: string): Promise<IData>;
|
|
103
116
|
}
|
|
104
117
|
//# sourceMappingURL=de-service-util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"de-service-util.d.ts","sourceRoot":"","sources":["../../src/service/de-service-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAa,aAAa,EAAgB,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,aAAa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|
async getService(context, id) {
|
|
52
|
+
// 优先处理开启应用实体服务映射情况
|
|
53
|
+
const { targetApp, targetAppDataEntityId } = await this.computeAppDEMappingParam(context, id);
|
|
54
|
+
if (targetApp && targetAppDataEntityId) {
|
|
55
|
+
const targetService = await targetApp.deService.getService(context, targetAppDataEntityId);
|
|
56
|
+
return targetService;
|
|
57
|
+
}
|
|
58
|
+
// 标准逻辑
|
|
52
59
|
const sandboxId = context.srfsessionid || 'applocation';
|
|
53
60
|
if (!this.cache.has(sandboxId)) {
|
|
54
61
|
this.cache.set(sandboxId, new Map());
|
|
@@ -154,6 +161,13 @@ export class DEServiceUtil {
|
|
|
154
161
|
* @return {*} {Promise<IHttpResponse<IData>>}
|
|
155
162
|
*/
|
|
156
163
|
async exec(appDataEntityId, methodName, context, params, params2, header) {
|
|
164
|
+
// 优先处理开启应用实体服务映射情况
|
|
165
|
+
const { targetApp, targetAppDataEntityId } = await this.computeAppDEMappingParam(context, appDataEntityId);
|
|
166
|
+
if (targetApp && targetAppDataEntityId) {
|
|
167
|
+
const result = await targetApp.deService.exec(targetAppDataEntityId, methodName, context, params, params2, header);
|
|
168
|
+
return result;
|
|
169
|
+
}
|
|
170
|
+
// 标准逻辑
|
|
157
171
|
const service = await this.getService(context, appDataEntityId);
|
|
158
172
|
try {
|
|
159
173
|
const result = await service.exec(methodName, context, params, params2, header);
|
|
@@ -166,6 +180,51 @@ export class DEServiceUtil {
|
|
|
166
180
|
throw error;
|
|
167
181
|
}
|
|
168
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* 计算应用实体服务映射参数
|
|
185
|
+
* srfappdemapping:是否开启应用实体服务映射
|
|
186
|
+
* srfappmappingmap:应用映射表,与srfappdemapping搭配使用,原应用标识:目标应用标识,以冒号分割,多个应用以逗号隔开
|
|
187
|
+
* 如:logicdesign__logicdesign:ibizplm__plmweb
|
|
188
|
+
*
|
|
189
|
+
* @author tony001
|
|
190
|
+
* @date 2024-07-19 15:07:31
|
|
191
|
+
* @param {IContext} context
|
|
192
|
+
* @param {string} appDataEntityId
|
|
193
|
+
* @return {*} {Promise<IData>}
|
|
194
|
+
*/
|
|
195
|
+
async computeAppDEMappingParam(context, appDataEntityId) {
|
|
196
|
+
const result = {};
|
|
197
|
+
if (context.srfappdemapping &&
|
|
198
|
+
context.srfappdemapping === 'true' &&
|
|
199
|
+
context.srfappmappingmap) {
|
|
200
|
+
const { srfappmappingmap } = context;
|
|
201
|
+
const appMap = new Map();
|
|
202
|
+
const appMappings = (srfappmappingmap === null || srfappmappingmap === void 0 ? void 0 : srfappmappingmap.split(',')) || [];
|
|
203
|
+
for (const appMpping of appMappings) {
|
|
204
|
+
const [sourceAppId, targetAppId] = appMpping.split(':');
|
|
205
|
+
appMap.set(sourceAppId, targetAppId);
|
|
206
|
+
}
|
|
207
|
+
if (appMap.has(this.appModel.appId)) {
|
|
208
|
+
const targetApp = ibiz.hub.getApp(appMap.get(this.appModel.appId));
|
|
209
|
+
if (targetApp) {
|
|
210
|
+
// 合入目标应用
|
|
211
|
+
Object.assign(result, { targetApp });
|
|
212
|
+
// 合入目标应用实体
|
|
213
|
+
if (appDataEntityId.indexOf('.') !== -1) {
|
|
214
|
+
Object.assign(result, {
|
|
215
|
+
targetAppDataEntityId: `${targetApp.model.id}.${appDataEntityId.split('.').pop()}`,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
Object.assign(result, {
|
|
220
|
+
targetAppDataEntityId: appDataEntityId,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return result;
|
|
227
|
+
}
|
|
169
228
|
}
|
|
170
229
|
/**
|
|
171
230
|
* 实体服务构造方法缓存
|
|
@@ -89,6 +89,25 @@ export declare class CodeListService {
|
|
|
89
89
|
* @return {*} {Promise<CodeListItem[]>}
|
|
90
90
|
*/
|
|
91
91
|
get(tag: string, context: IContext, params?: IParams): Promise<readonly CodeListItem[]>;
|
|
92
|
+
/**
|
|
93
|
+
* 递归查找代码表项
|
|
94
|
+
*
|
|
95
|
+
* @param {IAppCodeList} codeList 代码表模型
|
|
96
|
+
* @param {readonly CodeListItem[] | undefined} dataItems 代码表数据
|
|
97
|
+
* @param {string | number} value 代码项值
|
|
98
|
+
* @returns 代码表项|CodeListItem | undefined
|
|
99
|
+
*/
|
|
100
|
+
findCodeListItem(codeList: IAppCodeList, dataItems: readonly CodeListItem[] | undefined, value: string | number): CodeListItem | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* 获取代码表项
|
|
103
|
+
*
|
|
104
|
+
* @param {string} tag 代码表标识
|
|
105
|
+
* @param {string | number} value 代码表值
|
|
106
|
+
* @param {IContext} context 上下文
|
|
107
|
+
* @param {IParams} params 视图参数
|
|
108
|
+
* @returns 代码表项|Promise<CodeListItem | undefined>
|
|
109
|
+
*/
|
|
110
|
+
getItem(tag: string, value: string | number, context: IContext, params?: IParams): Promise<CodeListItem | undefined>;
|
|
92
111
|
/**
|
|
93
112
|
* 获取代码表实例对象(动态代码表返回具体实例,静态代码表返回undefined)
|
|
94
113
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-list.service.d.ts","sourceRoot":"","sources":["../../../../src/service/service/code-list/code-list.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"code-list.service.d.ts","sourceRoot":"","sources":["../../../../src/service/service/code-list/code-list.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD;;;;;;;GAOG;AACH,qBAAa,eAAe;IAoBd,SAAS,CAAC,QAAQ,EAAE,YAAY;IAnB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AKG;IACG,mBAAmB,CACvB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC;IAqB5C;;;;;OAKG;IACH,OAAO,IAAI,IAAI;CAQhB"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { RuntimeError } from '@ibiz-template/core';
|
|
2
|
+
import { isNumber } from 'lodash-es';
|
|
2
3
|
import { ScriptFactory } from '../../../utils';
|
|
3
4
|
import { DynamicCodeListCache } from '../../utils';
|
|
5
|
+
import { calcThresholdRange } from '../../../controller/utils/code-list/code-list';
|
|
4
6
|
/**
|
|
5
7
|
* 全局代码表服务
|
|
6
8
|
*
|
|
@@ -169,6 +171,53 @@ export class CodeListService {
|
|
|
169
171
|
// todo 预定义代码表
|
|
170
172
|
return [];
|
|
171
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* 递归查找代码表项
|
|
176
|
+
*
|
|
177
|
+
* @param {IAppCodeList} codeList 代码表模型
|
|
178
|
+
* @param {readonly CodeListItem[] | undefined} dataItems 代码表数据
|
|
179
|
+
* @param {string | number} value 代码项值
|
|
180
|
+
* @returns 代码表项|CodeListItem | undefined
|
|
181
|
+
*/
|
|
182
|
+
findCodeListItem(codeList, dataItems, value) {
|
|
183
|
+
if (dataItems) {
|
|
184
|
+
const { thresholdGroup } = codeList;
|
|
185
|
+
// 阈值模式
|
|
186
|
+
if (thresholdGroup && isNumber(Number(value))) {
|
|
187
|
+
const findItem = calcThresholdRange(dataItems, Number(value));
|
|
188
|
+
if (findItem) {
|
|
189
|
+
return findItem;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const findItem = dataItems.find(item => item.value === value);
|
|
193
|
+
if (findItem) {
|
|
194
|
+
return findItem;
|
|
195
|
+
}
|
|
196
|
+
for (let i = 0; i < dataItems.length; i++) {
|
|
197
|
+
const childrenItem = this.findCodeListItem(codeList, dataItems[i].children, value);
|
|
198
|
+
if (childrenItem) {
|
|
199
|
+
return childrenItem;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* 获取代码表项
|
|
206
|
+
*
|
|
207
|
+
* @param {string} tag 代码表标识
|
|
208
|
+
* @param {string | number} value 代码表值
|
|
209
|
+
* @param {IContext} context 上下文
|
|
210
|
+
* @param {IParams} params 视图参数
|
|
211
|
+
* @returns 代码表项|Promise<CodeListItem | undefined>
|
|
212
|
+
*/
|
|
213
|
+
async getItem(tag, value, context, params) {
|
|
214
|
+
const codeList = this.allCodeLists.get(tag);
|
|
215
|
+
if (!codeList) {
|
|
216
|
+
throw new RuntimeError(ibiz.i18n.t('runtime.service.noFindCodeList', { tag }));
|
|
217
|
+
}
|
|
218
|
+
const dataItems = await this.get(tag, context, params);
|
|
219
|
+
return this.findCodeListItem(codeList, dataItems, value);
|
|
220
|
+
}
|
|
172
221
|
/**
|
|
173
222
|
* 获取代码表实例对象(动态代码表返回具体实例,静态代码表返回undefined)
|
|
174
223
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"de-action.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/de-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,aAAa,EAGd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"de-action.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/de-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,aAAa,EAGd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,E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CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;IAYxC;;;;;;;;;OASG;IACH,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,GAAG,WAAW;CAqBpE"}
|
|
@@ -5,6 +5,7 @@ import { clone } from 'ramda';
|
|
|
5
5
|
import { Method } from './method';
|
|
6
6
|
import { calcDeCodeNameById, findDELogic } from '../../../../model';
|
|
7
7
|
import { execDELogicAction, execFieldLogics } from '../../../../de-logic';
|
|
8
|
+
import { ScriptFactory } from '../../../../utils';
|
|
8
9
|
/**
|
|
9
10
|
* 实体行为方法
|
|
10
11
|
*
|
|
@@ -78,6 +79,14 @@ export class DEActionMethod extends Method {
|
|
|
78
79
|
const methodTag = this.method.actionTag
|
|
79
80
|
? this.method.actionTag.toUpperCase()
|
|
80
81
|
: this.method.codeName.toUpperCase();
|
|
82
|
+
if (this.method.beforeCode) {
|
|
83
|
+
await ScriptFactory.asyncExecScriptFn({
|
|
84
|
+
context,
|
|
85
|
+
data,
|
|
86
|
+
viewParam: params,
|
|
87
|
+
activeData: header,
|
|
88
|
+
}, this.method.beforeCode);
|
|
89
|
+
}
|
|
81
90
|
switch (methodTag) {
|
|
82
91
|
case 'CREATE':
|
|
83
92
|
result = await this.create(context, data, params || {}, header);
|
|
@@ -131,6 +140,14 @@ export class DEActionMethod extends Method {
|
|
|
131
140
|
}
|
|
132
141
|
}
|
|
133
142
|
}
|
|
143
|
+
if (this.method.afterCode) {
|
|
144
|
+
await ScriptFactory.asyncExecScriptFn({
|
|
145
|
+
context,
|
|
146
|
+
data: result.data,
|
|
147
|
+
viewParam: params,
|
|
148
|
+
activeData: header,
|
|
149
|
+
}, this.method.afterCode);
|
|
150
|
+
}
|
|
134
151
|
// 计算属性逻辑
|
|
135
152
|
if (result.data) {
|
|
136
153
|
await execFieldLogics(this.entity, 'compute', context, result.data, params);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.31-alpha.0",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"publish:dev": "npm run build && npm publish --access public --tag=dev --registry=https://registry.npmjs.org/",
|
|
28
28
|
"publish:alpha": "npm run build && npm publish --access public --tag=alpha --registry=https://registry.npmjs.org/",
|
|
29
29
|
"publish:beta": "npm run build && npm publish --access public --tag=beta --registry=https://registry.npmjs.org/",
|
|
30
|
-
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/
|
|
30
|
+
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
|
|
31
31
|
},
|
|
32
32
|
"author": "chitanda",
|
|
33
33
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@ibiz-template/core": "^0.7.30",
|
|
39
|
-
"@ibiz/model-core": "^0.1.
|
|
39
|
+
"@ibiz/model-core": "^0.1.46",
|
|
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.46",
|
|
58
58
|
"async-validator": "^4.2.5",
|
|
59
59
|
"dayjs": "^1.11.7",
|
|
60
60
|
"echarts": "^5.4.3",
|
|
@@ -65,5 +65,6 @@
|
|
|
65
65
|
"qs": "^6.11.0",
|
|
66
66
|
"qx-util": "^0.4.8",
|
|
67
67
|
"ramda": "^0.29.0"
|
|
68
|
-
}
|
|
68
|
+
},
|
|
69
|
+
"gitHead": "70b05a53d8dbcd4437657cf49b1209bd4d6b55ee"
|
|
69
70
|
}
|