@ibiz-template/runtime 0.5.3-beta.7 → 0.5.3-beta.9
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 +654 -314
- package/dist/index.system.min.js +1 -1
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.js +4 -0
- package/out/controller/control/form/form-detail/form-tab-page/form-tab-page.controller.d.ts +8 -0
- package/out/controller/control/form/form-detail/form-tab-page/form-tab-page.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-tab-page/form-tab-page.controller.js +10 -0
- package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.controller.d.ts +8 -0
- package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.controller.js +14 -0
- package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.state.d.ts +7 -0
- package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.state.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.state.js +10 -0
- package/out/controller/control/grid/grid/grid.service.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.service.js +1 -10
- package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts +7 -0
- package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.js +11 -2
- package/out/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.d.ts +0 -7
- package/out/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.js +0 -9
- package/out/interface/service/i-transaction/i-transaction.d.ts +83 -0
- package/out/interface/service/i-transaction/i-transaction.d.ts.map +1 -0
- package/out/interface/service/i-transaction/i-transaction.js +1 -0
- package/out/interface/service/index.d.ts +1 -0
- package/out/interface/service/index.d.ts.map +1 -1
- package/out/interface/service/service/i-app-de.service.d.ts +9 -3
- package/out/interface/service/service/i-app-de.service.d.ts.map +1 -1
- package/out/service/dto/method.dto.d.ts +1 -3
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +1 -8
- package/out/service/service/entity/de.service.d.ts +1 -2
- package/out/service/service/entity/de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.js +5 -2
- package/out/service/service/entity/method/de-action.d.ts +13 -1
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +163 -56
- 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-renturn.d.ts.map +1 -1
- package/out/service/service/entity/method/method-renturn.js +6 -0
- package/out/service/utils/de-cache/de-cache.d.ts +11 -1
- package/out/service/utils/de-cache/de-cache.d.ts.map +1 -1
- package/out/service/utils/de-cache/de-cache.js +122 -18
- package/out/service/utils/de-dq-cond/ps-model-cond-engine-base.d.ts.map +1 -1
- package/out/service/utils/de-dq-cond/ps-model-cond-engine-base.js +4 -0
- package/out/ui-action/provider/front-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.js +2 -1
- package/out/utils/ui-domain/transaction.d.ts +66 -0
- package/out/utils/ui-domain/transaction.d.ts.map +1 -0
- package/out/utils/ui-domain/transaction.js +94 -0
- package/out/utils/ui-domain/ui-domain.d.ts +18 -0
- package/out/utils/ui-domain/ui-domain.d.ts.map +1 -1
- package/out/utils/ui-domain/ui-domain.js +23 -0
- package/package.json +2 -2
- package/src/controller/control/form/form-detail/form-detail/form-detail.controller.ts +4 -0
- package/src/controller/control/form/form-detail/form-tab-page/form-tab-page.controller.ts +14 -0
- package/src/controller/control/form/form-detail/form-tab-panel/form-tab-panel.controller.ts +16 -0
- package/src/controller/control/form/form-detail/form-tab-panel/form-tab-panel.state.ts +9 -1
- package/src/controller/control/grid/grid/grid.service.ts +1 -11
- package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +12 -2
- package/src/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.ts +0 -10
- package/src/interface/service/i-transaction/i-transaction.ts +88 -0
- package/src/interface/service/index.ts +4 -0
- package/src/interface/service/service/i-app-de.service.ts +10 -3
- package/src/service/dto/method.dto.ts +0 -7
- package/src/service/service/entity/de.service.ts +7 -9
- package/src/service/service/entity/method/de-action.ts +182 -61
- package/src/service/service/entity/method/fetch.ts +2 -4
- package/src/service/service/entity/method/method-renturn.ts +6 -0
- package/src/service/utils/de-cache/de-cache.ts +128 -19
- package/src/service/utils/de-dq-cond/ps-model-cond-engine-base.ts +4 -0
- package/src/ui-action/provider/front-ui-action-provider.ts +2 -1
- package/src/utils/ui-domain/transaction.ts +100 -0
- package/src/utils/ui-domain/ui-domain.ts +25 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { HttpError, HttpResponse, RuntimeError, RuntimeModelError, } from '@ibiz-template/core';
|
|
2
2
|
import { isArray, isNil } from 'lodash-es';
|
|
3
|
+
import { ascSort } from 'qx-util';
|
|
4
|
+
import { clone } from 'ramda';
|
|
3
5
|
import { Method } from './method';
|
|
4
6
|
import { calcDeCodeNameById, findDELogic } from '../../../../model';
|
|
5
7
|
import { execDELogicAction, execFieldLogics } from '../../../../de-logic';
|
|
@@ -29,7 +31,9 @@ export class DEActionMethod extends Method {
|
|
|
29
31
|
return this.input.handle(context, data);
|
|
30
32
|
}
|
|
31
33
|
async exec(context, data, params) {
|
|
32
|
-
|
|
34
|
+
let result;
|
|
35
|
+
// 执行变更属性逻辑
|
|
36
|
+
if (data && !['READ', 'GETDRAFT'].includes(this.method.actionMode)) {
|
|
33
37
|
await execFieldLogics(this.entity, 'change', context, data, params);
|
|
34
38
|
}
|
|
35
39
|
// 实体逻辑处理
|
|
@@ -38,61 +42,58 @@ export class DEActionMethod extends Method {
|
|
|
38
42
|
if (!deLogic) {
|
|
39
43
|
throw new RuntimeModelError(this.method, '缺少实体处理逻辑');
|
|
40
44
|
}
|
|
41
|
-
|
|
45
|
+
result = await execDELogicAction(deLogic, context, data, params);
|
|
42
46
|
}
|
|
43
|
-
|
|
44
|
-
data
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
? null
|
|
89
|
-
: data === null || data === void 0 ? void 0 : data[this.entity.keyAppDEFieldId];
|
|
47
|
+
else {
|
|
48
|
+
if (data && !this.isLocalMode) {
|
|
49
|
+
data = await this.inputHandle(context, data);
|
|
50
|
+
}
|
|
51
|
+
switch (this.method.codeName) {
|
|
52
|
+
case 'Create':
|
|
53
|
+
result = await this.create(context, data, params || {});
|
|
54
|
+
break;
|
|
55
|
+
case 'Get':
|
|
56
|
+
result = await this.get(context, params);
|
|
57
|
+
break;
|
|
58
|
+
case 'GetDraft':
|
|
59
|
+
result = await this.getDraft(context, params);
|
|
60
|
+
break;
|
|
61
|
+
case 'Remove':
|
|
62
|
+
result = await this.remove(context, params);
|
|
63
|
+
break;
|
|
64
|
+
case 'Update':
|
|
65
|
+
result = await this.update(context, data, params);
|
|
66
|
+
break;
|
|
67
|
+
case 'CreateTemp':
|
|
68
|
+
result = await this.createTemp(context, data);
|
|
69
|
+
break;
|
|
70
|
+
case 'GetTemp':
|
|
71
|
+
result = await this.getTemp(context, data);
|
|
72
|
+
break;
|
|
73
|
+
case 'GetDraftTemp':
|
|
74
|
+
result = await this.getDraftTemp(context, params);
|
|
75
|
+
break;
|
|
76
|
+
case 'RemoveTemp':
|
|
77
|
+
result = await this.removeTemp(context, data);
|
|
78
|
+
break;
|
|
79
|
+
case 'UpdateTemp':
|
|
80
|
+
result = await this.updateTemp(context, data);
|
|
81
|
+
break;
|
|
82
|
+
default: {
|
|
83
|
+
let path = this.calcPath(context);
|
|
84
|
+
if (this.method.needResourceKey) {
|
|
85
|
+
let srfkey = context[this.entity.codeName.toLowerCase()];
|
|
86
|
+
if (isNil(srfkey)) {
|
|
87
|
+
srfkey = isArray(data)
|
|
88
|
+
? null
|
|
89
|
+
: data === null || data === void 0 ? void 0 : data[this.entity.keyAppDEFieldId];
|
|
90
|
+
}
|
|
91
|
+
path = `${path}/${srfkey}`;
|
|
90
92
|
}
|
|
91
|
-
|
|
93
|
+
const res = await this.request(path, context, data, params);
|
|
94
|
+
res.data = await this.result.handle(context, res.data);
|
|
95
|
+
result = res;
|
|
92
96
|
}
|
|
93
|
-
const res = await this.request(path, context, data, params);
|
|
94
|
-
res.data = await this.result.handle(context, res.data);
|
|
95
|
-
result = res;
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
// 计算属性逻辑
|
|
@@ -262,6 +263,14 @@ export class DEActionMethod extends Method {
|
|
|
262
263
|
if (!key && context) {
|
|
263
264
|
key = context[this.entity.codeName.toLowerCase()];
|
|
264
265
|
}
|
|
266
|
+
try {
|
|
267
|
+
await this.associationDeletion(key, context, params);
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
throw new HttpError({
|
|
271
|
+
response: new HttpResponse(null, 500, error.message),
|
|
272
|
+
});
|
|
273
|
+
}
|
|
265
274
|
const data = this.service.local.delete(context, key);
|
|
266
275
|
if (data) {
|
|
267
276
|
return new HttpResponse(data);
|
|
@@ -272,6 +281,106 @@ export class DEActionMethod extends Method {
|
|
|
272
281
|
throw new HttpError(err);
|
|
273
282
|
}
|
|
274
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* 关联删除
|
|
286
|
+
*
|
|
287
|
+
* @author chitanda
|
|
288
|
+
* @date 2024-01-17 16:01:47
|
|
289
|
+
* @protected
|
|
290
|
+
* @param {string} key
|
|
291
|
+
* @param {IContext} context
|
|
292
|
+
* @param {IParams} [params]
|
|
293
|
+
* @return {*} {Promise<void>}
|
|
294
|
+
*/
|
|
295
|
+
async associationDeletion(key, context, _params) {
|
|
296
|
+
// 当前执行界面域
|
|
297
|
+
const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
|
|
298
|
+
// 当前事务
|
|
299
|
+
const t = uiDomain.transaction;
|
|
300
|
+
let selfOpenTransaction = false;
|
|
301
|
+
// 由第一层触发关联删除的位置来打开事务,后续子的关联删除不需要再次打开事务
|
|
302
|
+
if (t.state.isOpen === false) {
|
|
303
|
+
t.open();
|
|
304
|
+
selfOpenTransaction = true;
|
|
305
|
+
}
|
|
306
|
+
try {
|
|
307
|
+
let configs = uiDomain.getDERConfigByMajor(this.entity.id);
|
|
308
|
+
if (configs.length > 0) {
|
|
309
|
+
// 当前主数据
|
|
310
|
+
const data = this.service.local.get(context, key);
|
|
311
|
+
// 根据删除顺序排序
|
|
312
|
+
configs = ascSort(configs, 'removeOrder');
|
|
313
|
+
// 根据关系进行关联删除
|
|
314
|
+
for (const config of configs) {
|
|
315
|
+
if (config.rstype !== 'DER1N') {
|
|
316
|
+
throw new RuntimeModelError(config, '目前只支持[DER1N]关系类型关联删除删除');
|
|
317
|
+
}
|
|
318
|
+
const { removeActionType, removeRejectMsg, minorAppDataEntityId, nestedAppDEDataSetId = 'FetchDefault', } = config;
|
|
319
|
+
// 获取当前应用域下的子实体服务
|
|
320
|
+
const app = ibiz.hub.getApp(this.entity.appId);
|
|
321
|
+
const minorService = await app.deService.getService(context, minorAppDataEntityId);
|
|
322
|
+
// 克隆上下文,防止污染。并设置当前实体的主键上下文
|
|
323
|
+
const _context = clone(context);
|
|
324
|
+
_context[this.entity.codeName.toLowerCase()] = key;
|
|
325
|
+
// 查询出关联的子实体数据
|
|
326
|
+
const res = await minorService.exec(nestedAppDEDataSetId, _context);
|
|
327
|
+
const items = (res.data || []);
|
|
328
|
+
switch (removeActionType) {
|
|
329
|
+
// 同时删除
|
|
330
|
+
case 1: {
|
|
331
|
+
for (let i = 0; i < items.length; i++) {
|
|
332
|
+
const item = items[i];
|
|
333
|
+
_context[minorService.model.codeName.toLowerCase()] =
|
|
334
|
+
item.srfkey;
|
|
335
|
+
const res2 = await minorService.remove(_context, item);
|
|
336
|
+
if (res2.ok === false) {
|
|
337
|
+
throw new Error(res2.statusText);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
// 置空
|
|
343
|
+
case 2:
|
|
344
|
+
for (let i = 0; i < items.length; i++) {
|
|
345
|
+
const item = items[i];
|
|
346
|
+
_context[minorService.model.codeName.toLowerCase()] =
|
|
347
|
+
item.srfkey;
|
|
348
|
+
item[config.parentAppDEFieldId.toLowerCase()] = undefined;
|
|
349
|
+
const res2 = await minorService.updateTemp(_context, item);
|
|
350
|
+
if (res2.ok === false) {
|
|
351
|
+
throw new Error(res2.statusText);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
break;
|
|
355
|
+
// 限制删除
|
|
356
|
+
case 3:
|
|
357
|
+
if (items.length > 0) {
|
|
358
|
+
const msg = items.map(item => item.srfmajortext).join('、');
|
|
359
|
+
const message = `无法删除[${this.entity.logicName}-${data.srfmajortext}], 数据被[${minorService.model.logicName}-${msg}]引用`;
|
|
360
|
+
throw new Error(removeRejectMsg || message);
|
|
361
|
+
}
|
|
362
|
+
break;
|
|
363
|
+
default:
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
// 谁打开的事务,由谁来提交和关闭
|
|
368
|
+
if (selfOpenTransaction && t.state.isOpen) {
|
|
369
|
+
t.commit();
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
catch (error) {
|
|
373
|
+
if (selfOpenTransaction && t.state.isOpen) {
|
|
374
|
+
t.rollback();
|
|
375
|
+
}
|
|
376
|
+
throw error;
|
|
377
|
+
}
|
|
378
|
+
finally {
|
|
379
|
+
if (selfOpenTransaction && t.state.isOpen) {
|
|
380
|
+
t.close();
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
275
384
|
/**
|
|
276
385
|
* 更新临时数据
|
|
277
386
|
*
|
|
@@ -319,7 +428,6 @@ export class DEActionMethod extends Method {
|
|
|
319
428
|
key = context[this.entity.codeName.toLowerCase()];
|
|
320
429
|
}
|
|
321
430
|
const data = this.service.local.get(context, key);
|
|
322
|
-
// await this.executeDEFelidLogic(context, data);
|
|
323
431
|
if (data) {
|
|
324
432
|
return new HttpResponse(data);
|
|
325
433
|
}
|
|
@@ -341,8 +449,7 @@ export class DEActionMethod extends Method {
|
|
|
341
449
|
// const keys: string[] = params[this.entity.keyName];
|
|
342
450
|
// if (keys) {
|
|
343
451
|
// try {
|
|
344
|
-
//
|
|
345
|
-
// await s.local.deleteBatch(context, keys);
|
|
452
|
+
// await this.service.local.deleteBatch(context, keys);
|
|
346
453
|
// } catch (err) {
|
|
347
454
|
// return new HttpResponse(err, 500);
|
|
348
455
|
// }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,OAAO,EAAgB,gBAAgB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD;;;;;;;;GAQG;AACH,qBAAa,WAAY,SAAQ,MAAM;IAC7B,MAAM,EAAE,aAAa,CAAC;IAExB,IAAI,CACR,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,EACxB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,OAAO,EAAgB,gBAAgB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD;;;;;;;;GAQG;AACH,qBAAa,WAAY,SAAQ,MAAM;IAC7B,MAAM,EAAE,aAAa,CAAC;IAExB,IAAI,CACR,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,EACxB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC;IAmDvC;;;;;;;;;OASG;IACG,WAAW,CACf,IAAI,EAAE,gBAAgB,GAAG,IAAI,EAC7B,MAAM,EAAE,YAAY,EACpB,cAAc,GAAE,MAAM,EAA0C,GAC/D,OAAO,CAAC,WAAW,EAAE,CAAC;IAwCzB;;;;;;;OAOG;cACa,gBAAgB,CAC9B,OAAO,EAAE,QAAQ,EACjB,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC;CAkBlC"}
|
|
@@ -22,7 +22,8 @@ export class FetchMethod extends Method {
|
|
|
22
22
|
let res;
|
|
23
23
|
if (this.isLocalMode) {
|
|
24
24
|
const cond = DEDQCondUtil.getCond(this.method);
|
|
25
|
-
const
|
|
25
|
+
const filter = new SearchFilter(context, searchParams);
|
|
26
|
+
const items = await this.searchLocal(cond, filter);
|
|
26
27
|
res = new HttpResponse(items, 200);
|
|
27
28
|
}
|
|
28
29
|
else {
|
|
@@ -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,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;;;;GAOG;AACH,qBAAa,YAAY;IAcrB,SAAS,CAAC,OAAO,EAAE,aAAa;IAChC,SAAS,CAAC,MAAM,EAAE,cAAc;IAChC,SAAS,CAAC,MAAM,EAAE,YAAY;IAC9B,SAAS,CAAC,WAAW,EAAE,OAAO;IAhBhC,SAAS,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;IAE1B;;;;;;;;;OASG;gBAES,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY,EACpB,WAAW,GAAE,OAAe;IAgBxC;;;;;;;;OAQG;IACG,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC;
|
|
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;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;;;;GAOG;AACH,qBAAa,YAAY;IAcrB,SAAS,CAAC,OAAO,EAAE,aAAa;IAChC,SAAS,CAAC,MAAM,EAAE,cAAc;IAChC,SAAS,CAAC,MAAM,EAAE,YAAY;IAC9B,SAAS,CAAC,WAAW,EAAE,OAAO;IAhBhC,SAAS,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;IAE1B;;;;;;;;;OASG;gBAES,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY,EACpB,WAAW,GAAE,OAAe;IAgBxC;;;;;;;;OAQG;IACG,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC;CAgBnE"}
|
|
@@ -46,6 +46,12 @@ export class MethodReturn {
|
|
|
46
46
|
*/
|
|
47
47
|
async handle(context, data) {
|
|
48
48
|
if (this.dto) {
|
|
49
|
+
const app = ibiz.hub.getApp(this.entity.appId);
|
|
50
|
+
// 设置之前清理掉当前界面域下的数据缓存
|
|
51
|
+
app.deService.clearTempCache({
|
|
52
|
+
srfappid: app.appId,
|
|
53
|
+
srfsessionid: context.srfsessionid,
|
|
54
|
+
});
|
|
49
55
|
const items = await this.dto.sets(context, [data]);
|
|
50
56
|
return items[0];
|
|
51
57
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAppDataEntity } from '@ibiz/model-core';
|
|
2
|
-
import { IDataEntity } from '../../../interface';
|
|
2
|
+
import { IDataEntity, ITransaction } from '../../../interface';
|
|
3
3
|
/**
|
|
4
4
|
* 实体缓存工具类
|
|
5
5
|
*
|
|
@@ -169,5 +169,15 @@ export declare class DECache {
|
|
|
169
169
|
* @param {(IDataEntity | IDataEntity[])} data 需要计算的数据或数据集合
|
|
170
170
|
*/
|
|
171
171
|
protected calcUnionKey(data: IDataEntity): void;
|
|
172
|
+
/**
|
|
173
|
+
* 根据上下文,获取已经开启的事务
|
|
174
|
+
*
|
|
175
|
+
* @author chitanda
|
|
176
|
+
* @date 2024-01-17 15:01:28
|
|
177
|
+
* @protected
|
|
178
|
+
* @param {IContext} context
|
|
179
|
+
* @return {*} {(ITransaction | null)}
|
|
180
|
+
*/
|
|
181
|
+
protected getTransaction(context: IContext): ITransaction | null;
|
|
172
182
|
}
|
|
173
183
|
//# sourceMappingURL=de-cache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"de-cache.d.ts","sourceRoot":"","sources":["../../../../src/service/utils/de-cache/de-cache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"de-cache.d.ts","sourceRoot":"","sources":["../../../../src/service/utils/de-cache/de-cache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG/D;;;;;;;GAOG;AACH,qBAAa,OAAO;IAoBN,SAAS,CAAC,MAAM,EAAE,cAAc;IAnB5C;;;;;;;OAOG;IACH,SAAS,KAAK,UAAU,IAAI,OAAO,CAElC;IAED;;;;;;OAMG;gBACmB,MAAM,EAAE,cAAc;IAE5C;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAa;IAExD;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;IAQvD;;;;;;;OAOG;IACH,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;IAK1D;;;;;;;OAOG;IACH,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAKrD;;;;;;;OAOG;IACH,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI;IAoC/D;;;;;;;OAOG;IACH,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAY1D;;;;;;;OAOG;IACH,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI;IA+ClE;;;;;;;OAOG;IACH,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IA2B7D;;;;;;;;OAQG;IACH,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE;IA8BtE;;;;;;;;OAQG;IACH,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE;IA4DtE;;;;;;;;OAQG;IACH,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAwC3D;;;;;;;;OAQG;IACH,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAItD;;;;;;OAMG;IACH,OAAO,IAAI,WAAW,EAAE;IAKxB;;;;;;;OAOG;IACH,YAAY,CAAC,MAAM,GAAE,OAAY,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,OAAO;IAgB9D;;;;;OAKG;IACH,KAAK,IAAI,IAAI;IAOb;;;;;OAKG;IACH,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAgB/C;;;;;;;;OAQG;IACH,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,YAAY,GAAG,IAAI;CAOjE"}
|
|
@@ -103,8 +103,20 @@ export class DECache {
|
|
|
103
103
|
entity.srfkey = createUUID();
|
|
104
104
|
}
|
|
105
105
|
entity.srftempdate = new Date().getTime();
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
// 提交回调
|
|
107
|
+
const commit = () => {
|
|
108
|
+
this.cacheMap.set(entity.srfkey, clone(entity));
|
|
109
|
+
ibiz.log.warn('add', entity.srfkey, entity);
|
|
110
|
+
};
|
|
111
|
+
const t = this.getTransaction(context);
|
|
112
|
+
if (t) {
|
|
113
|
+
t.change(entity.srfkey, () => {
|
|
114
|
+
commit();
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
commit();
|
|
119
|
+
}
|
|
108
120
|
return entity;
|
|
109
121
|
}
|
|
110
122
|
catch (err) {
|
|
@@ -156,10 +168,27 @@ export class DECache {
|
|
|
156
168
|
entity.srftempdate = new Date().getTime();
|
|
157
169
|
const data = this.cacheMap.get(oldKey);
|
|
158
170
|
if (data) {
|
|
159
|
-
data
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
171
|
+
const _data = clone(data);
|
|
172
|
+
_data.assign(entity);
|
|
173
|
+
// 提交回调
|
|
174
|
+
const commit = () => {
|
|
175
|
+
data.assign(entity);
|
|
176
|
+
if (oldKey !== entity.srfkey) {
|
|
177
|
+
this.cacheMap.delete(oldKey);
|
|
178
|
+
}
|
|
179
|
+
this.cacheMap.set(entity.srfkey, data);
|
|
180
|
+
ibiz.log.warn('update', entity.srfkey, entity);
|
|
181
|
+
};
|
|
182
|
+
const t = this.getTransaction(context);
|
|
183
|
+
if (t) {
|
|
184
|
+
t.change(entity.srfkey, () => {
|
|
185
|
+
commit();
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
commit();
|
|
190
|
+
}
|
|
191
|
+
return _data;
|
|
163
192
|
}
|
|
164
193
|
throw new Error('数据不存在,无法更新!');
|
|
165
194
|
}
|
|
@@ -182,9 +211,19 @@ export class DECache {
|
|
|
182
211
|
const key = srfKey;
|
|
183
212
|
if (this.cacheMap.has(key)) {
|
|
184
213
|
const data = this.cacheMap.get(key);
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
214
|
+
const commit = () => {
|
|
215
|
+
this.cacheMap.delete(key);
|
|
216
|
+
ibiz.log.warn('delete', key);
|
|
217
|
+
};
|
|
218
|
+
const t = this.getTransaction(context);
|
|
219
|
+
if (t) {
|
|
220
|
+
t.change(key, () => {
|
|
221
|
+
commit();
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
commit();
|
|
226
|
+
}
|
|
188
227
|
return data;
|
|
189
228
|
}
|
|
190
229
|
return null;
|
|
@@ -206,6 +245,11 @@ export class DECache {
|
|
|
206
245
|
createBatch(context, entities) {
|
|
207
246
|
try {
|
|
208
247
|
isExistSessionId('add', context);
|
|
248
|
+
const commit = (entity) => {
|
|
249
|
+
this.cacheMap.set(entity.srfkey, entity);
|
|
250
|
+
ibiz.log.warn('add', entity.srfkey, entity);
|
|
251
|
+
};
|
|
252
|
+
const t = this.getTransaction(context);
|
|
209
253
|
for (let i = 0; i < entities.length; i++) {
|
|
210
254
|
const entity = entities[i];
|
|
211
255
|
if (isNil(entity.srfkey) || isEmpty(entity.srfkey)) {
|
|
@@ -213,9 +257,14 @@ export class DECache {
|
|
|
213
257
|
}
|
|
214
258
|
entity.srftempdate = new Date().getTime();
|
|
215
259
|
const data = clone(entity);
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
260
|
+
if (t) {
|
|
261
|
+
t.change(data.srfkey, () => {
|
|
262
|
+
commit(data);
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
commit(data);
|
|
267
|
+
}
|
|
219
268
|
}
|
|
220
269
|
return entities;
|
|
221
270
|
}
|
|
@@ -236,16 +285,44 @@ export class DECache {
|
|
|
236
285
|
updateBatch(context, entities) {
|
|
237
286
|
try {
|
|
238
287
|
isExistSessionId('update', context);
|
|
288
|
+
const commit = (entity, oldKey) => {
|
|
289
|
+
// 如果主键改变,删除旧的数据再设置新数据
|
|
290
|
+
if (oldKey !== entity.srfkey) {
|
|
291
|
+
this.cacheMap.delete(oldKey);
|
|
292
|
+
}
|
|
293
|
+
this.cacheMap.set(entity.srfkey, entity);
|
|
294
|
+
ibiz.log.warn('update', entity.srfkey, entity);
|
|
295
|
+
};
|
|
296
|
+
const t = this.getTransaction(context);
|
|
239
297
|
for (let i = 0; i < entities.length; i++) {
|
|
240
298
|
const entity = entities[i];
|
|
241
299
|
isExistSrfKey('update', entity);
|
|
300
|
+
const oldKey = entity.srfkey;
|
|
301
|
+
// 联合主键相关数据处理
|
|
302
|
+
if (this.isUnionKey) {
|
|
303
|
+
this.calcUnionKey(entity);
|
|
304
|
+
// 主键改变的时候,检测变更之后的主键是否已经存在
|
|
305
|
+
if (oldKey !== entity.srfkey &&
|
|
306
|
+
this.checkData(context, entity.srfkey)) {
|
|
307
|
+
throw new RuntimeError(`更新联合主键数据失败,已有主键为${entity.srfkey}的数据`);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
242
310
|
entity.srftempdate = new Date().getTime();
|
|
243
311
|
const data = this.cacheMap.get(entity.srfkey);
|
|
244
312
|
if (data) {
|
|
245
|
-
data
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
313
|
+
const _data = clone(data);
|
|
314
|
+
_data.assign(entity);
|
|
315
|
+
entities[i] = _data;
|
|
316
|
+
if (t) {
|
|
317
|
+
t.change(entity.srfkey, () => {
|
|
318
|
+
data.assign(entity);
|
|
319
|
+
commit(data, oldKey);
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
data.assign(entity);
|
|
324
|
+
commit(data, oldKey);
|
|
325
|
+
}
|
|
249
326
|
}
|
|
250
327
|
else {
|
|
251
328
|
throw new Error(`数据[${entity.srfdename}-${entity.srfmajortext}(${entity.srfkey})]不存在,无法更新!`);
|
|
@@ -285,10 +362,21 @@ export class DECache {
|
|
|
285
362
|
if (notRemoveKeys.length > 0) {
|
|
286
363
|
throw new Error(`未找到以下数据「${notRemoveKeys.join('、')}」,无法删除!`);
|
|
287
364
|
}
|
|
288
|
-
|
|
289
|
-
const key = srfKeys[i];
|
|
365
|
+
const commit = (key) => {
|
|
290
366
|
this.cacheMap.delete(key);
|
|
291
367
|
ibiz.log.warn('delete', key);
|
|
368
|
+
};
|
|
369
|
+
const t = this.getTransaction(context);
|
|
370
|
+
for (let i = 0; i < srfKeys.length; i++) {
|
|
371
|
+
const key = srfKeys[i];
|
|
372
|
+
if (t) {
|
|
373
|
+
t.change(key, () => {
|
|
374
|
+
commit(key);
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
commit(key);
|
|
379
|
+
}
|
|
292
380
|
}
|
|
293
381
|
return [];
|
|
294
382
|
}
|
|
@@ -369,4 +457,20 @@ export class DECache {
|
|
|
369
457
|
});
|
|
370
458
|
data.srfkey = unionValues.join('||');
|
|
371
459
|
}
|
|
460
|
+
/**
|
|
461
|
+
* 根据上下文,获取已经开启的事务
|
|
462
|
+
*
|
|
463
|
+
* @author chitanda
|
|
464
|
+
* @date 2024-01-17 15:01:28
|
|
465
|
+
* @protected
|
|
466
|
+
* @param {IContext} context
|
|
467
|
+
* @return {*} {(ITransaction | null)}
|
|
468
|
+
*/
|
|
469
|
+
getTransaction(context) {
|
|
470
|
+
const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
|
|
471
|
+
if (uiDomain && uiDomain.transaction.state.isOpen === true) {
|
|
472
|
+
return uiDomain.transaction;
|
|
473
|
+
}
|
|
474
|
+
return null;
|
|
475
|
+
}
|
|
372
476
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ps-model-cond-engine-base.d.ts","sourceRoot":"","sources":["../../../../src/service/utils/de-dq-cond/ps-model-cond-engine-base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE;;;;;;GAMG;AACH,8BAAsB,qBAAqB;IACzC;;;;;;OAMG;IACH,OAAO,CAAC,oBAAoB,CAAqC;IAEjE;;;;;OAKG;IACH,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI;IAS3B;;;;;;;;;OASG;IACH,SAAS,CAAC,cAAc,CACtB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,YAAY,EAAE,MAAM,GAAG,MAAM,GAC5B,OAAO;
|
|
1
|
+
{"version":3,"file":"ps-model-cond-engine-base.d.ts","sourceRoot":"","sources":["../../../../src/service/utils/de-dq-cond/ps-model-cond-engine-base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE;;;;;;GAMG;AACH,8BAAsB,qBAAqB;IACzC;;;;;;OAMG;IACH,OAAO,CAAC,oBAAoB,CAAqC;IAEjE;;;;;OAKG;IACH,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI;IAS3B;;;;;;;;;OASG;IACH,SAAS,CAAC,cAAc,CACtB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,YAAY,EAAE,MAAM,GAAG,MAAM,GAC5B,OAAO;IAmFV;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,CAAC,sBAAsB,IAAI,oBAAoB;IAEjE;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,CAAC,uBAAuB,IAAI,qBAAqB;IAEnE;;;;;OAKG;IACH,uBAAuB,IAAI,oBAAoB;CAGhD"}
|
|
@@ -54,6 +54,10 @@ export class PSModelCondEngineBase {
|
|
|
54
54
|
"LT" /* CondType.CONDOP_LT */ === strCondOp ||
|
|
55
55
|
"LTANDEQ" /* CondType.CONDOP_LTANDEQ */ === strCondOp ||
|
|
56
56
|
"NOTEQ" /* CondType.CONDOP_NOTEQ */ === strCondOp) {
|
|
57
|
+
// 特殊处理,如果值为空,直接返回false
|
|
58
|
+
if (objValue == null || objCondValue == null) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
57
61
|
// 大小比较
|
|
58
62
|
let nRet = -1;
|
|
59
63
|
// eslint-disable-next-line eqeqeq
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"front-ui-action-provider.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/front-ui-action-provider.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAa,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAc,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,SAAQ,oBAAoB;IACvD,UAAU,CACd,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IA+D3B;;;;;;;;OAQG;IAEH,SAAS,CAAC,OAAO,CACf,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,eAAe;IAalB;;;;;;OAMG;cACa,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC;IAiEhB;;;;;;OAMG;cACa,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"front-ui-action-provider.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/front-ui-action-provider.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAa,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAc,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,SAAQ,oBAAoB;IACvD,UAAU,CACd,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IA+D3B;;;;;;;;OAQG;IAEH,SAAS,CAAC,OAAO,CACf,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,eAAe;IAalB;;;;;;OAMG;cACa,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC;IAiEhB;;;;;;OAMG;cACa,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IA4C3B;;;;;;OAMG;cACa,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC;CAqDjB"}
|
|
@@ -147,7 +147,7 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
147
147
|
async executeDataImport(action, args) {
|
|
148
148
|
var _a;
|
|
149
149
|
// 处理参数
|
|
150
|
-
const { resultParams } = await this.handleParams(action, args.context, args.data, args.params);
|
|
150
|
+
const { resultContext, resultParams } = await this.handleParams(action, args.context, args.data, args.params);
|
|
151
151
|
const appDataEntity = await ibiz.hub.getAppDataEntity(action.appDataEntityId, action.appId);
|
|
152
152
|
const appDEDataImport = (_a = appDataEntity.appDEDataImports) === null || _a === void 0 ? void 0 : _a.find(dataImport => dataImport.id === action.appDEDataImportId);
|
|
153
153
|
let importName = 'DataImport';
|
|
@@ -159,6 +159,7 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
159
159
|
dismiss: () => modal.dismiss(),
|
|
160
160
|
appDataEntity,
|
|
161
161
|
dataImport: appDEDataImport,
|
|
162
|
+
context: resultContext,
|
|
162
163
|
params: resultParams,
|
|
163
164
|
}, {
|
|
164
165
|
width: 'auto',
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ITransaction, ITransactionState } from '../../interface';
|
|
2
|
+
/**
|
|
3
|
+
* 界面域下简单数据事务
|
|
4
|
+
*
|
|
5
|
+
* @author chitanda
|
|
6
|
+
* @date 2024-01-17 15:01:39
|
|
7
|
+
* @export
|
|
8
|
+
* @class Transaction
|
|
9
|
+
*/
|
|
10
|
+
export declare class Transaction implements ITransaction {
|
|
11
|
+
/**
|
|
12
|
+
* 待提交队列
|
|
13
|
+
*
|
|
14
|
+
* @author chitanda
|
|
15
|
+
* @date 2024-01-17 15:01:38
|
|
16
|
+
* @protected
|
|
17
|
+
*/
|
|
18
|
+
protected commitQueue: Map<string, () => void>;
|
|
19
|
+
/**
|
|
20
|
+
* 事务状态
|
|
21
|
+
*
|
|
22
|
+
* @author chitanda
|
|
23
|
+
* @date 2024-01-17 15:01:45
|
|
24
|
+
* @type {ITransactionState}
|
|
25
|
+
*/
|
|
26
|
+
readonly state: ITransactionState;
|
|
27
|
+
/**
|
|
28
|
+
* 开启事务
|
|
29
|
+
*
|
|
30
|
+
* @description 事务开启后,所有的数据操作都会被缓存,直到事务提交或者回滚
|
|
31
|
+
* @author chitanda
|
|
32
|
+
* @date 2024-01-17 15:01:46
|
|
33
|
+
*/
|
|
34
|
+
open(): void;
|
|
35
|
+
/**
|
|
36
|
+
* 新增变更事务回调,事务提交时会按照添加顺序倒序执行
|
|
37
|
+
*
|
|
38
|
+
* @author chitanda
|
|
39
|
+
* @date 2024-01-17 16:01:50
|
|
40
|
+
* @param {string} id 回调标识,用于去重。一个数据只能有一个回调
|
|
41
|
+
* @param {() => void} commit
|
|
42
|
+
*/
|
|
43
|
+
change(id: string, commit: () => void): void;
|
|
44
|
+
/**
|
|
45
|
+
* 提交事务
|
|
46
|
+
*
|
|
47
|
+
* @author chitanda
|
|
48
|
+
* @date 2024-01-17 15:01:05
|
|
49
|
+
*/
|
|
50
|
+
commit(): void;
|
|
51
|
+
/**
|
|
52
|
+
* 回滚事务
|
|
53
|
+
*
|
|
54
|
+
* @author chitanda
|
|
55
|
+
* @date 2024-01-17 19:01:43
|
|
56
|
+
*/
|
|
57
|
+
rollback(): void;
|
|
58
|
+
/**
|
|
59
|
+
* 关闭事务
|
|
60
|
+
*
|
|
61
|
+
* @author chitanda
|
|
62
|
+
* @date 2024-01-17 15:01:02
|
|
63
|
+
*/
|
|
64
|
+
close(): void;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/utils/ui-domain/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAElE;;;;;;;GAOG;AACH,qBAAa,WAAY,YAAW,YAAY;IAC9C;;;;;;OAMG;IACH,SAAS,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAa;IAE3D;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAG/B;IAEF;;;;;;OAMG;IACH,IAAI,IAAI,IAAI;IAQZ;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,GAAG,IAAI;IAK5C;;;;;OAKG;IACH,MAAM,IAAI,IAAI;IAUd;;;;;OAKG;IACH,QAAQ,IAAI,IAAI;IAKhB;;;;;OAKG;IACH,KAAK,IAAI,IAAI;CAMd"}
|