@ibiz-template/runtime 0.6.13 → 0.6.15
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 +580 -330
- package/dist/index.system.min.js +1 -1
- package/out/controller/common/control/control.controller.d.ts +58 -1
- package/out/controller/common/control/control.controller.d.ts.map +1 -1
- package/out/controller/common/control/control.controller.js +111 -2
- package/out/controller/common/control/md-control.controller.d.ts +16 -22
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +59 -48
- package/out/controller/control/chart/generator/base-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/base-series-generator.js +1 -0
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts +11 -0
- 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 +37 -7
- package/out/controller/control/form/form/form.controller.d.ts +1 -20
- package/out/controller/control/form/form/form.controller.d.ts.map +1 -1
- package/out/controller/control/form/form/form.controller.js +17 -91
- 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-detail/form-detail.state.d.ts +8 -0
- package/out/controller/control/form/form-detail/form-detail/form-detail.state.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-detail/form-detail.state.js +20 -0
- package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-item/form-item.controller.js +9 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.js +6 -3
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +2 -0
- 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 +4 -2
- package/out/controller/control/md-ctrl/md-ctrl.controller.d.ts.map +1 -1
- package/out/controller/control/md-ctrl/md-ctrl.controller.js +3 -1
- package/out/controller/control/panel/panel/panel-item.controller.d.ts.map +1 -1
- package/out/controller/control/panel/panel/panel-item.controller.js +4 -0
- package/out/controller/control/panel/panel/panel-item.state.d.ts +8 -0
- package/out/controller/control/panel/panel/panel-item.state.d.ts.map +1 -1
- package/out/controller/control/panel/panel/panel-item.state.js +20 -0
- package/out/controller/control/report-panel/report-panel.controller.d.ts.map +1 -1
- package/out/controller/control/report-panel/report-panel.controller.js +3 -1
- package/out/controller/control/tree/tree.controller.d.ts +11 -1
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +37 -3
- package/out/controller/utils/data-file-util/data-file-util.d.ts.map +1 -1
- package/out/controller/utils/data-file-util/data-file-util.js +1 -1
- package/out/engine/md-view.engine.d.ts +24 -1
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +60 -7
- package/out/engine/view-base.engine.d.ts +1 -1
- package/out/engine/view-base.engine.d.ts.map +1 -1
- package/out/engine/view-base.engine.js +7 -2
- package/out/interface/controller/state/control/i-tree.state.d.ts +21 -0
- package/out/interface/controller/state/control/i-tree.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/panel-item/i-panel-item.state.d.ts +8 -0
- package/out/interface/controller/state/control/panel-item/i-panel-item.state.d.ts.map +1 -1
- package/out/model/utils/util.d.ts +9 -0
- package/out/model/utils/util.d.ts.map +1 -1
- package/out/model/utils/util.js +12 -0
- package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts +1 -0
- package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
- package/out/service/utils/dynamic-code-list/dynamic-code-list.js +12 -5
- package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts +1 -0
- package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-data-set-node-data.js +1 -0
- package/out/service/vo/tree-node-data/tree-node-data.d.ts +10 -0
- package/out/service/vo/tree-node-data/tree-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-node-data.js +23 -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 +6 -2
- package/package.json +4 -4
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { IControl, IControlLogic, IViewLayoutPanel } from '@ibiz/model-core';
|
|
2
|
-
import { IBizParams } from '@ibiz-template/core';
|
|
3
|
+
import { IBizParams, IPortalMessage } from '@ibiz-template/core';
|
|
3
4
|
import { BaseController } from '..';
|
|
4
5
|
import { CTX } from '../../ctx';
|
|
5
6
|
import { EventBase, IControlController, IControlEvent, IControlState, IViewController, IViewLayoutPanelController } from '../../../interface/controller';
|
|
6
7
|
import { ControllerEvent } from '../../utils';
|
|
7
8
|
import { IDataAbilityParams, IProvider } from '../../../interface';
|
|
8
9
|
import { ControlLogicScheduler } from '../../../logic-scheduler';
|
|
10
|
+
export type DEDataChangeType = 'create' | 'update' | 'remove';
|
|
9
11
|
/**
|
|
10
12
|
* 部件控制器
|
|
11
13
|
*
|
|
@@ -51,6 +53,28 @@ export declare class ControlController<T extends IControl = IControl, S extends
|
|
|
51
53
|
[key: string]: IProvider;
|
|
52
54
|
};
|
|
53
55
|
params: IBizParams;
|
|
56
|
+
/**
|
|
57
|
+
* 触发源key
|
|
58
|
+
*
|
|
59
|
+
* @author tony001
|
|
60
|
+
* @date 2024-03-28 17:03:03
|
|
61
|
+
* @type {string}
|
|
62
|
+
*/
|
|
63
|
+
triggerKey: string;
|
|
64
|
+
/**
|
|
65
|
+
* 等到激活的回调函数集合
|
|
66
|
+
*
|
|
67
|
+
* @author tony001
|
|
68
|
+
* @date 2024-03-28 17:03:15
|
|
69
|
+
*/
|
|
70
|
+
awaitActiveCbs: Map<string, () => void>;
|
|
71
|
+
/**
|
|
72
|
+
* 延迟执行(防抖用)
|
|
73
|
+
*
|
|
74
|
+
* @author tony001
|
|
75
|
+
* @date 2024-03-28 17:03:27
|
|
76
|
+
*/
|
|
77
|
+
delayCbs: Map<string, NodeJS.Timeout>;
|
|
54
78
|
/**
|
|
55
79
|
* Creates an instance of ControlController.
|
|
56
80
|
*
|
|
@@ -184,5 +208,38 @@ export declare class ControlController<T extends IControl = IControl, S extends
|
|
|
184
208
|
data?: IData | IData[];
|
|
185
209
|
error?: Error;
|
|
186
210
|
}): void;
|
|
211
|
+
/**
|
|
212
|
+
* 监听实体数据变更
|
|
213
|
+
*
|
|
214
|
+
* @author tony001
|
|
215
|
+
* @date 2024-03-28 18:03:33
|
|
216
|
+
* @protected
|
|
217
|
+
* @param {IPortalMessage} msg
|
|
218
|
+
*/
|
|
219
|
+
protected onDEDataChange(msg: IPortalMessage): void;
|
|
220
|
+
/**
|
|
221
|
+
* 触发实体数据变更的通知
|
|
222
|
+
*
|
|
223
|
+
* @author tony001
|
|
224
|
+
* @date 2024-03-28 18:03:44
|
|
225
|
+
* @param {('create' | 'update' | 'remove')} type
|
|
226
|
+
* @param {IData} data
|
|
227
|
+
*/
|
|
228
|
+
emitDEDataChange(type: 'create' | 'update' | 'remove', data: IData): void;
|
|
229
|
+
/**
|
|
230
|
+
* 如果当前视图没有激活,则等待激活后执行回调函数
|
|
231
|
+
* - 在执行之前key相同的会替换
|
|
232
|
+
* 如果当前视图已经激活,则立即执行回调函数
|
|
233
|
+
* - delay参数指定延迟执行时间,可以防抖
|
|
234
|
+
*
|
|
235
|
+
* @author tony001
|
|
236
|
+
* @date 2024-03-28 18:03:00
|
|
237
|
+
* @param {() => void} cb
|
|
238
|
+
* @param {{ key: string; delay?: number }} opts
|
|
239
|
+
*/
|
|
240
|
+
doNextActive(cb: () => void, opts: {
|
|
241
|
+
key: string;
|
|
242
|
+
delay?: number;
|
|
243
|
+
}): void;
|
|
187
244
|
}
|
|
188
245
|
//# sourceMappingURL=control.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.controller.d.ts","sourceRoot":"","sources":["../../../../src/controller/common/control/control.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EAEb,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,UAAU,
|
|
1
|
+
{"version":3,"file":"control.controller.d.ts","sourceRoot":"","sources":["../../../../src/controller/common/control/control.controller.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EAEb,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,UAAU,EACV,cAAc,EAGf,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,eAAe,EACf,0BAA0B,EAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAClB,SAAS,EAEV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAMjE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9D;;;;;;;GAOG;AACH,qBAAa,iBAAiB,CAC1B,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAC7B,CAAC,SAAS,aAAa,GAAG,aAAa,EACvC,CAAC,SAAS,aAAa,GAAG,aAAa,CAEzC,SAAQ,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAC9B,YAAW,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE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
import { HttpError, IBizContext, IBizParams, NoticeError, } from '@ibiz-template/core';
|
|
1
|
+
import { HttpError, IBizContext, IBizParams, NoticeError, RuntimeError, } from '@ibiz-template/core';
|
|
2
2
|
import { clone, isNil } from 'ramda';
|
|
3
3
|
import { notNilEmpty } from 'qx-util';
|
|
4
4
|
import { BaseController } from '..';
|
|
5
5
|
import { getControlProvider } from '../../../register';
|
|
6
6
|
import { convertNavData, ScriptFactory } from '../../../utils';
|
|
7
|
-
import { getControlPanel } from '../../../model';
|
|
7
|
+
import { calcDeCodeNameById, getControlPanel } from '../../../model';
|
|
8
|
+
import { ControlVO } from '../../../service';
|
|
8
9
|
/**
|
|
9
10
|
* 部件控制器
|
|
10
11
|
*
|
|
@@ -47,6 +48,28 @@ export class ControlController extends BaseController {
|
|
|
47
48
|
* @type {{ [key: string]: IProvider }}
|
|
48
49
|
*/
|
|
49
50
|
this.providers = {};
|
|
51
|
+
/**
|
|
52
|
+
* 触发源key
|
|
53
|
+
*
|
|
54
|
+
* @author tony001
|
|
55
|
+
* @date 2024-03-28 17:03:03
|
|
56
|
+
* @type {string}
|
|
57
|
+
*/
|
|
58
|
+
this.triggerKey = '';
|
|
59
|
+
/**
|
|
60
|
+
* 等到激活的回调函数集合
|
|
61
|
+
*
|
|
62
|
+
* @author tony001
|
|
63
|
+
* @date 2024-03-28 17:03:15
|
|
64
|
+
*/
|
|
65
|
+
this.awaitActiveCbs = new Map();
|
|
66
|
+
/**
|
|
67
|
+
* 延迟执行(防抖用)
|
|
68
|
+
*
|
|
69
|
+
* @author tony001
|
|
70
|
+
* @date 2024-03-28 17:03:27
|
|
71
|
+
*/
|
|
72
|
+
this.delayCbs = new Map();
|
|
50
73
|
this.registerToCtx();
|
|
51
74
|
// 初始化部件的布局面板
|
|
52
75
|
this.controlPanel = getControlPanel(model);
|
|
@@ -101,6 +124,14 @@ export class ControlController extends BaseController {
|
|
|
101
124
|
this.scheduler.triggerControlEvent(event.targetName, event.eventName, event);
|
|
102
125
|
});
|
|
103
126
|
}
|
|
127
|
+
// 初始化triggerKey
|
|
128
|
+
if (this.model.appDataEntityId) {
|
|
129
|
+
const codeName = calcDeCodeNameById(this.model.appDataEntityId);
|
|
130
|
+
this.triggerKey = `${codeName}@${this.model.controlType}@${this.model.codeName}`;
|
|
131
|
+
}
|
|
132
|
+
// 监听实体数据变更
|
|
133
|
+
this.onDEDataChange = this.onDEDataChange.bind(this);
|
|
134
|
+
ibiz.mc.command.change.on(this.onDEDataChange);
|
|
104
135
|
}
|
|
105
136
|
async onMounted() {
|
|
106
137
|
var _a;
|
|
@@ -109,6 +140,7 @@ export class ControlController extends BaseController {
|
|
|
109
140
|
(_a = this.scheduler) === null || _a === void 0 ? void 0 : _a.startTimerTrigger();
|
|
110
141
|
}
|
|
111
142
|
async onDestroyed() {
|
|
143
|
+
ibiz.mc.command.change.off(this.onDEDataChange);
|
|
112
144
|
await super.onDestroyed();
|
|
113
145
|
if (this.scheduler) {
|
|
114
146
|
this.scheduler.destroy();
|
|
@@ -192,6 +224,13 @@ export class ControlController extends BaseController {
|
|
|
192
224
|
*/
|
|
193
225
|
onActivated() {
|
|
194
226
|
this.state.activated = true;
|
|
227
|
+
// 执行等待激活执行的回调集合,执行完后清空
|
|
228
|
+
if (this.awaitActiveCbs.size > 0) {
|
|
229
|
+
this.awaitActiveCbs.forEach(cb => {
|
|
230
|
+
cb();
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
this.awaitActiveCbs.clear();
|
|
195
234
|
ibiz.log.debug(`视图[${this.model.name}](${this.model.id})激活`);
|
|
196
235
|
}
|
|
197
236
|
/**
|
|
@@ -346,4 +385,74 @@ export class ControlController extends BaseController {
|
|
|
346
385
|
ibiz.message.success(message, duration, duration === 0);
|
|
347
386
|
}
|
|
348
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* 监听实体数据变更
|
|
390
|
+
*
|
|
391
|
+
* @author tony001
|
|
392
|
+
* @date 2024-03-28 18:03:33
|
|
393
|
+
* @protected
|
|
394
|
+
* @param {IPortalMessage} msg
|
|
395
|
+
*/
|
|
396
|
+
onDEDataChange(msg) {
|
|
397
|
+
ibiz.log.debug('onDEDataChange', msg);
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* 触发实体数据变更的通知
|
|
401
|
+
*
|
|
402
|
+
* @author tony001
|
|
403
|
+
* @date 2024-03-28 18:03:44
|
|
404
|
+
* @param {('create' | 'update' | 'remove')} type
|
|
405
|
+
* @param {IData} data
|
|
406
|
+
*/
|
|
407
|
+
emitDEDataChange(type, data) {
|
|
408
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
409
|
+
const msg = (data instanceof ControlVO ? data.$origin : data);
|
|
410
|
+
const meta = { triggerKey: this.triggerKey };
|
|
411
|
+
switch (type) {
|
|
412
|
+
case 'create':
|
|
413
|
+
ibiz.mc.command.create.send(msg, meta);
|
|
414
|
+
break;
|
|
415
|
+
case 'update':
|
|
416
|
+
ibiz.mc.command.update.send(msg, meta);
|
|
417
|
+
break;
|
|
418
|
+
case 'remove':
|
|
419
|
+
ibiz.mc.command.remove.send(msg, meta);
|
|
420
|
+
break;
|
|
421
|
+
default:
|
|
422
|
+
throw new RuntimeError(`不支持的实体数据变更类型: ${type}`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* 如果当前视图没有激活,则等待激活后执行回调函数
|
|
427
|
+
* - 在执行之前key相同的会替换
|
|
428
|
+
* 如果当前视图已经激活,则立即执行回调函数
|
|
429
|
+
* - delay参数指定延迟执行时间,可以防抖
|
|
430
|
+
*
|
|
431
|
+
* @author tony001
|
|
432
|
+
* @date 2024-03-28 18:03:00
|
|
433
|
+
* @param {() => void} cb
|
|
434
|
+
* @param {{ key: string; delay?: number }} opts
|
|
435
|
+
*/
|
|
436
|
+
doNextActive(cb, opts) {
|
|
437
|
+
if (isNil(opts.delay)) {
|
|
438
|
+
opts.delay = 300;
|
|
439
|
+
}
|
|
440
|
+
if (this.state.activated === false) {
|
|
441
|
+
this.awaitActiveCbs.set(opts.key, cb);
|
|
442
|
+
}
|
|
443
|
+
else if (opts.delay) {
|
|
444
|
+
// 清除之前的延迟执行
|
|
445
|
+
const _timer = this.delayCbs.get(opts.key);
|
|
446
|
+
clearTimeout(_timer);
|
|
447
|
+
// 设置新的延迟执行
|
|
448
|
+
const timer = setTimeout(() => {
|
|
449
|
+
cb();
|
|
450
|
+
clearTimeout(this.delayCbs.get(opts.key));
|
|
451
|
+
}, opts.delay);
|
|
452
|
+
this.delayCbs.set(opts.key, timer);
|
|
453
|
+
}
|
|
454
|
+
else {
|
|
455
|
+
cb();
|
|
456
|
+
}
|
|
457
|
+
}
|
|
349
458
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IPortalMessage } from '@ibiz-template/core';
|
|
1
2
|
import { IAppDataEntity, IMDControl } from '@ibiz/model-core';
|
|
2
3
|
import { IMDControlController, IMDControlEvent, IMDControlState, IToolbarController, MDCtrlLoadParams, MDCtrlRemoveParams } from '../../../interface';
|
|
3
4
|
import { MDControlService } from '../../../service';
|
|
@@ -22,14 +23,6 @@ export declare class MDControlController<T extends IMDControl = IMDControl, S ex
|
|
|
22
23
|
* @type {EntityService}
|
|
23
24
|
*/
|
|
24
25
|
service: MDControlService;
|
|
25
|
-
/**
|
|
26
|
-
* 在未激活时记录是否有 command 数据变更事件,有就记录。等待激活时刷新
|
|
27
|
-
*
|
|
28
|
-
* @author chitanda
|
|
29
|
-
* @date 2023-12-13 11:12:19
|
|
30
|
-
* @protected
|
|
31
|
-
*/
|
|
32
|
-
protected commandDataChange: boolean;
|
|
33
26
|
/**
|
|
34
27
|
* 是否设置过排序条件,比如searchBars默认点击分组时设置了
|
|
35
28
|
* @return {*}
|
|
@@ -77,17 +70,6 @@ export declare class MDControlController<T extends IMDControl = IMDControl, S ex
|
|
|
77
70
|
protected get quickToolbarController(): IToolbarController | undefined;
|
|
78
71
|
protected onCreated(): Promise<void>;
|
|
79
72
|
protected onMounted(): Promise<void>;
|
|
80
|
-
protected onDestroyed(): Promise<void>;
|
|
81
|
-
/**
|
|
82
|
-
* 当数据放生变更时,若为当前应用实体数据。则多数据部件进行刷新
|
|
83
|
-
*
|
|
84
|
-
* @author chitanda
|
|
85
|
-
* @date 2023-09-13 17:09:04
|
|
86
|
-
* @protected
|
|
87
|
-
* @param {IData} msg
|
|
88
|
-
*/
|
|
89
|
-
protected onDataChange(msg: IData): void;
|
|
90
|
-
onActivated(): void;
|
|
91
73
|
/**
|
|
92
74
|
* 获取部件默认排序模型
|
|
93
75
|
* @return {*}
|
|
@@ -134,9 +116,11 @@ export declare class MDControlController<T extends IMDControl = IMDControl, S ex
|
|
|
134
116
|
*/
|
|
135
117
|
afterLoad(args: MDCtrlLoadParams, items: IData[]): Promise<IData[]>;
|
|
136
118
|
/**
|
|
137
|
-
* 部件刷新,走初始加载
|
|
138
|
-
*
|
|
139
|
-
* @
|
|
119
|
+
* 部件刷新,走初始加载(规避预置后续刷新和通知刷新同时进行)
|
|
120
|
+
*
|
|
121
|
+
* @author tony001
|
|
122
|
+
* @date 2024-03-28 18:03:00
|
|
123
|
+
* @return {*} {Promise<void>}
|
|
140
124
|
*/
|
|
141
125
|
refresh(): Promise<void>;
|
|
142
126
|
/**
|
|
@@ -206,5 +190,15 @@ export declare class MDControlController<T extends IMDControl = IMDControl, S ex
|
|
|
206
190
|
exportData(_args: {
|
|
207
191
|
event: MouseEvent;
|
|
208
192
|
}): Promise<void>;
|
|
193
|
+
/**
|
|
194
|
+
* 检测实体数据变更
|
|
195
|
+
*
|
|
196
|
+
* @author tony001
|
|
197
|
+
* @date 2024-03-28 18:03:30
|
|
198
|
+
* @protected
|
|
199
|
+
* @param {IPortalMessage} msg
|
|
200
|
+
* @return {*} {void}
|
|
201
|
+
*/
|
|
202
|
+
protected onDEDataChange(msg: IPortalMessage): void;
|
|
209
203
|
}
|
|
210
204
|
//# sourceMappingURL=md-control.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"md-control.controller.d.ts","sourceRoot":"","sources":["../../../../src/controller/common/control/md-control.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"md-control.controller.d.ts","sourceRoot":"","sources":["../../../../src/controller/common/control/md-control.controller.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EAGf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAoB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAS,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;;;;;;;;GASG;AACH,qBAAa,mBAAmB,CAC5B,CAAC,SAAS,UAAU,GAAG,UAAU,EACjC,CAAC,SAAS,eAAe,GAAG,eAAe,EAC3C,CAAC,SAAS,eAAe,GAAG,eAAe,CAE7C,SAAQ,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CACjC,YAAW,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAExC;;;;;;OAMG;IACH,OAAO,EAAG,gBAAgB,CAAC;IAE3B;;;;;OAKG;IACI,SAAS,UAAS;IAEzB,SAAS,KAAK,IAAI,IAAI,eAAe,CAAC,eAAe,CAAC,CAErD;IAED,SAAS,CAAC,SAAS,IAAI,IAAI;IAgB3B;;;;;OAKG;IACH,SAAS,CAAC,cAAc,sBAA6B;IAErD;;;;;;;OAOG;IACH,SAAS,CAAC,UAAU,EAAG,cAAc,CAAC;IAEtC;;;;;;;;OAQG;IACH,SAAS,KAAK,sBAAsB,IAAI,kBAAkB,GAAG,SAAS,CAKrE;IAED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AAI;IAqBtC;;;;;;OAMG;IACG,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB5C;;;;;;OAMG;IACG,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAM9C;;;;;;OAMG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAkCjC;;;;;;OAMG;IACG,UAAU,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,UAAU,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAmC7D;;;;;;;;OAQG;IACH,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;CA0CpD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-classes-per-file */
|
|
2
|
-
import { isElementSame, RuntimeError } from '@ibiz-template/core';
|
|
3
|
-
import {
|
|
2
|
+
import { isElementSame, RuntimeError, } from '@ibiz-template/core';
|
|
3
|
+
import { isNil } from 'ramda';
|
|
4
4
|
import { calcDeCodeNameById } from '../../../model';
|
|
5
5
|
import { Srfuf } from '../../../service';
|
|
6
6
|
import { handleAllSettled } from '../../../utils';
|
|
@@ -18,14 +18,6 @@ import { ControlController } from './control.controller';
|
|
|
18
18
|
export class MDControlController extends ControlController {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
21
|
-
/**
|
|
22
|
-
* 在未激活时记录是否有 command 数据变更事件,有就记录。等待激活时刷新
|
|
23
|
-
*
|
|
24
|
-
* @author chitanda
|
|
25
|
-
* @date 2023-12-13 11:12:19
|
|
26
|
-
* @protected
|
|
27
|
-
*/
|
|
28
|
-
this.commandDataChange = false;
|
|
29
21
|
/**
|
|
30
22
|
* 是否设置过排序条件,比如searchBars默认点击分组时设置了
|
|
31
23
|
* @return {*}
|
|
@@ -93,11 +85,6 @@ export class MDControlController extends ControlController {
|
|
|
93
85
|
(_a = this.dataEntity.appDEFields) === null || _a === void 0 ? void 0 : _a.forEach(field => {
|
|
94
86
|
this.fieldIdNameMap.set(field.id, field.name);
|
|
95
87
|
});
|
|
96
|
-
const fn = this.onDataChange.bind(this);
|
|
97
|
-
this.onDataChange = debounce(msg => {
|
|
98
|
-
fn(msg);
|
|
99
|
-
}, 300);
|
|
100
|
-
ibiz.mc.command.change.on(this.onDataChange);
|
|
101
88
|
// 设置默认排序,只有在没设置过排序才走
|
|
102
89
|
if (!this.isSetSort) {
|
|
103
90
|
this.setSort();
|
|
@@ -110,35 +97,6 @@ export class MDControlController extends ControlController {
|
|
|
110
97
|
this.load({ isInitialLoad: true });
|
|
111
98
|
}
|
|
112
99
|
}
|
|
113
|
-
onDestroyed() {
|
|
114
|
-
ibiz.mc.command.change.off(this.onDataChange);
|
|
115
|
-
return super.onDestroyed();
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* 当数据放生变更时,若为当前应用实体数据。则多数据部件进行刷新
|
|
119
|
-
*
|
|
120
|
-
* @author chitanda
|
|
121
|
-
* @date 2023-09-13 17:09:04
|
|
122
|
-
* @protected
|
|
123
|
-
* @param {IData} msg
|
|
124
|
-
*/
|
|
125
|
-
onDataChange(msg) {
|
|
126
|
-
if (msg.data && msg.data.srfdecodename === this.dataEntity.codeName) {
|
|
127
|
-
if (this.state.activated) {
|
|
128
|
-
this.refresh();
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
this.commandDataChange = true;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
onActivated() {
|
|
136
|
-
super.onActivated();
|
|
137
|
-
if (this.commandDataChange) {
|
|
138
|
-
this.refresh();
|
|
139
|
-
this.commandDataChange = false;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
100
|
/**
|
|
143
101
|
* 获取部件默认排序模型
|
|
144
102
|
* @return {*}
|
|
@@ -294,12 +252,16 @@ export class MDControlController extends ControlController {
|
|
|
294
252
|
return items;
|
|
295
253
|
}
|
|
296
254
|
/**
|
|
297
|
-
* 部件刷新,走初始加载
|
|
298
|
-
*
|
|
299
|
-
* @
|
|
255
|
+
* 部件刷新,走初始加载(规避预置后续刷新和通知刷新同时进行)
|
|
256
|
+
*
|
|
257
|
+
* @author tony001
|
|
258
|
+
* @date 2024-03-28 18:03:00
|
|
259
|
+
* @return {*} {Promise<void>}
|
|
300
260
|
*/
|
|
301
261
|
async refresh() {
|
|
302
|
-
|
|
262
|
+
this.doNextActive(() => this.load({ isInitialLoad: false }), {
|
|
263
|
+
key: 'refresh',
|
|
264
|
+
});
|
|
303
265
|
}
|
|
304
266
|
/**
|
|
305
267
|
* 删除选中的数据
|
|
@@ -358,6 +320,10 @@ export class MDControlController extends ControlController {
|
|
|
358
320
|
}
|
|
359
321
|
this.state.selectedData = [];
|
|
360
322
|
await this._evt.emit('onRemoveSuccess', undefined);
|
|
323
|
+
// 发送对象删除事件
|
|
324
|
+
data.forEach(item => {
|
|
325
|
+
this.emitDEDataChange('remove', item);
|
|
326
|
+
});
|
|
361
327
|
}
|
|
362
328
|
/**
|
|
363
329
|
* 删除每一项
|
|
@@ -529,4 +495,49 @@ export class MDControlController extends ControlController {
|
|
|
529
495
|
// const fileName = `${appEntity.source.logicName}表.xlsx`;
|
|
530
496
|
// downloadFileFromBlob(file, fileName);
|
|
531
497
|
}
|
|
498
|
+
/**
|
|
499
|
+
* 检测实体数据变更
|
|
500
|
+
*
|
|
501
|
+
* @author tony001
|
|
502
|
+
* @date 2024-03-28 18:03:30
|
|
503
|
+
* @protected
|
|
504
|
+
* @param {IPortalMessage} msg
|
|
505
|
+
* @return {*} {void}
|
|
506
|
+
*/
|
|
507
|
+
onDEDataChange(msg) {
|
|
508
|
+
// msg.triggerKey 不为空,且与当前控制器的triggerKey一致时,则不处理
|
|
509
|
+
if (!isNil(msg.triggerKey) && msg.triggerKey === this.triggerKey) {
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
// 非这个实体的数据变更,则不处理
|
|
513
|
+
if (!msg.data ||
|
|
514
|
+
msg.data.srfdecodename !== this.dataEntity.codeName) {
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
let isRefresh = false;
|
|
518
|
+
const { srfkey } = msg.data;
|
|
519
|
+
// 新增一定刷新,修改和删除只有当前多数据部件存在的数据命中后才刷新
|
|
520
|
+
switch (msg.subtype) {
|
|
521
|
+
case 'OBJECTCREATED':
|
|
522
|
+
isRefresh = true;
|
|
523
|
+
break;
|
|
524
|
+
case 'OBJECTUPDATED':
|
|
525
|
+
if (this.state.items.findIndex(item => item.srfkey === srfkey) !== -1) {
|
|
526
|
+
isRefresh = true;
|
|
527
|
+
}
|
|
528
|
+
break;
|
|
529
|
+
case 'OBJECTREMOVED':
|
|
530
|
+
if (this.state.items.findIndex(item => item.srfkey === srfkey) !== -1) {
|
|
531
|
+
isRefresh = true;
|
|
532
|
+
}
|
|
533
|
+
break;
|
|
534
|
+
default:
|
|
535
|
+
break;
|
|
536
|
+
}
|
|
537
|
+
if (isRefresh) {
|
|
538
|
+
this.doNextActive(() => this.load({ isInitialLoad: !!ibiz.env.isMob }), {
|
|
539
|
+
key: 'refresh',
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
}
|
|
532
543
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-series-generator.d.ts","sourceRoot":"","sources":["../../../../../src/controller/control/chart/generator/base-series-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,cAAc,EACf,MAAM,kBAAkB,CAAC;AAO1B,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,EACL,qBAAqB,EAEtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AASnD,cAAc;AACd,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,SAAS,CAAC,EAAE,UAAU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ourceRoot":"","sources":["../../../../../src/controller/control/chart/generator/base-series-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,cAAc,EACf,MAAM,kBAAkB,CAAC;AAO1B,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,EACL,qBAAqB,EAEtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AASnD,cAAc;AACd,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB,CAAC;AACF,sBAAsB;AACtB,MAAM,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAElD,sBAAsB;AACtB,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAEpD,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAE9C,qBAAa,mBAAmB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc;IAiG/D,KAAK,EAAE,CAAC;IACf,SAAS,CAAC,cAAc,EAAE,qBAAqB;IAjGjD;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;;;OAKG;IACH,YAAY,EAAE,UAAU,EAAE,CAAM;IAEhC;;;;;OAKG;IACH,aAAa,EAAE,YAAY,CAAM;IAEjC;;;;;OAK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|
1
2
|
import { IAppDEEditView, IDEEditForm } from '@ibiz/model-core';
|
|
2
3
|
import { IEditFormState, IEditFormEvent, IEditFormController, IViewController, IEditViewState, IEditViewEvent, IDataAbilityParams, FormSaveParams } from '../../../../interface';
|
|
3
4
|
import { FormController } from '../form';
|
|
@@ -137,5 +138,15 @@ export declare class EditFormController extends FormController<IDEEditForm, IEdi
|
|
|
137
138
|
* @param {IData} data
|
|
138
139
|
*/
|
|
139
140
|
setSimpleData(data: IData): void;
|
|
141
|
+
/**
|
|
142
|
+
* 检测实体数据变更
|
|
143
|
+
*
|
|
144
|
+
* @author tony001
|
|
145
|
+
* @date 2024-03-28 18:03:14
|
|
146
|
+
* @protected
|
|
147
|
+
* @param {IPortalMessage} msg
|
|
148
|
+
* @return {*} {void}
|
|
149
|
+
*/
|
|
150
|
+
protected onDEDataChange(msg: IPortalMessage): void;
|
|
140
151
|
}
|
|
141
152
|
//# sourceMappingURL=edit-form.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-form.controller.d.ts","sourceRoot":"","sources":["../../../../../src/controller/control/form/edit-form/edit-form.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"edit-form.controller.d.ts","sourceRoot":"","sources":["../../../../../src/controller/control/form/edit-form/edit-form.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,cAAc,EAIf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAI/D,OAAO,EACL,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;;;;;;GAQG;AACH,qBAAa,kBACX,SAAQ,cAAc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I,OAAO,CAAC,IAAI,CAAC;IAsB/B;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,IAAI,KAAK;IAiB9B;;;;;OAKG;IACH,aAAa,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAsBhC;;;;;;;;OAQG;IACH,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;CAuBpD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { awaitTimeout, IBizContext, isElementSame, mergeInLeft, RuntimeError, } from '@ibiz-template/core';
|
|
2
2
|
import { debounce } from 'lodash-es';
|
|
3
3
|
import { createUUID } from 'qx-util';
|
|
4
|
-
import { clone } from 'ramda';
|
|
4
|
+
import { clone, isNil } from 'ramda';
|
|
5
5
|
import { calcDeCodeNameById, hasDeCodeName } from '../../../../model';
|
|
6
6
|
import { Srfuf, ControlVO } from '../../../../service';
|
|
7
7
|
import { ScriptFactory } from '../../../../utils';
|
|
@@ -250,7 +250,8 @@ export class EditFormController extends FormController {
|
|
|
250
250
|
default: `${this.data.srfmajortext || ''}保存成功`,
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
|
-
|
|
253
|
+
// 发送数据变更事件
|
|
254
|
+
this.emitDEDataChange(isCreate ? 'create' : 'update', res.data);
|
|
254
255
|
return this.data;
|
|
255
256
|
}
|
|
256
257
|
/**
|
|
@@ -292,12 +293,12 @@ export class EditFormController extends FormController {
|
|
|
292
293
|
}
|
|
293
294
|
ok = res.ok;
|
|
294
295
|
}
|
|
296
|
+
this.emitDEDataChange('remove', this.data);
|
|
295
297
|
// 删除完成后都要置空当前表单数据
|
|
296
298
|
this.state.data = new ControlVO();
|
|
297
299
|
this.state.modified = false;
|
|
298
300
|
await this.evt.emit('onRemoveSuccess', undefined);
|
|
299
301
|
this.actionNotification('REMOVESUCCESS');
|
|
300
|
-
ibiz.mc.command.send(this.data.$origin, 'OBJECTREMOVED');
|
|
301
302
|
return ok;
|
|
302
303
|
}
|
|
303
304
|
/**
|
|
@@ -383,9 +384,9 @@ export class EditFormController extends FormController {
|
|
|
383
384
|
const { context, params } = this.handlerAbilityParams(args);
|
|
384
385
|
try {
|
|
385
386
|
await this.service.wfStart(context, params, this.data);
|
|
386
|
-
|
|
387
|
+
this.emitDEDataChange('update', this.data);
|
|
387
388
|
// 刷新预定义todo实体数据
|
|
388
|
-
|
|
389
|
+
this.emitDEDataChange('update', { srfdecodename: 'SysTodo' });
|
|
389
390
|
}
|
|
390
391
|
catch (error) {
|
|
391
392
|
this.actionNotification('WFSTARTERROR', {
|
|
@@ -415,9 +416,9 @@ export class EditFormController extends FormController {
|
|
|
415
416
|
const { context, params } = this.handlerAbilityParams(args);
|
|
416
417
|
try {
|
|
417
418
|
await this.service.wfSubmit(context, params, this.data);
|
|
418
|
-
|
|
419
|
+
this.emitDEDataChange('update', this.data);
|
|
419
420
|
// 刷新预定义todo实体数据
|
|
420
|
-
|
|
421
|
+
this.emitDEDataChange('update', { srfdecodename: 'SysTodo' });
|
|
421
422
|
}
|
|
422
423
|
catch (error) {
|
|
423
424
|
this.actionNotification('WFSUBMITERROR', {
|
|
@@ -515,4 +516,33 @@ export class EditFormController extends FormController {
|
|
|
515
516
|
this.dataChangeNotify(Object.keys(this.state.data));
|
|
516
517
|
}
|
|
517
518
|
}
|
|
519
|
+
/**
|
|
520
|
+
* 检测实体数据变更
|
|
521
|
+
*
|
|
522
|
+
* @author tony001
|
|
523
|
+
* @date 2024-03-28 18:03:14
|
|
524
|
+
* @protected
|
|
525
|
+
* @param {IPortalMessage} msg
|
|
526
|
+
* @return {*} {void}
|
|
527
|
+
*/
|
|
528
|
+
onDEDataChange(msg) {
|
|
529
|
+
var _a;
|
|
530
|
+
// 表单只关心更新
|
|
531
|
+
if (msg.subtype !== 'OBJECTUPDATED') {
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
// msg.triggerKey 不为空,且与当前控制器的triggerKey一致时,则不处理
|
|
535
|
+
if (!isNil(msg.triggerKey) && msg.triggerKey === this.triggerKey) {
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
// 非这个实体的数据变更,则不处理
|
|
539
|
+
// 非当前主键的变更不处理
|
|
540
|
+
const dename = calcDeCodeNameById(this.model.appDataEntityId);
|
|
541
|
+
if (!msg.data ||
|
|
542
|
+
((_a = msg.data.srfdecodename) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== dename ||
|
|
543
|
+
msg.data.srfkey !== this.data.srfkey) {
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
this.doNextActive(() => this.load(), { key: 'load' });
|
|
547
|
+
}
|
|
518
548
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { IControlLogic, IDEForm, IDEFormDetail
|
|
1
|
+
import { IControlLogic, IDEForm, IDEFormDetail } from '@ibiz/model-core';
|
|
2
2
|
import { IFormState, IFormEvent, IFormController, IFormDetailController, IFormDetailProvider } from '../../../../interface';
|
|
3
3
|
import { AppCounter } from '../../../../service';
|
|
4
4
|
import { ControlController } from '../../../common';
|
|
5
5
|
import { FormNotifyState } from '../../../constant';
|
|
6
6
|
import { ControllerEvent } from '../../../utils';
|
|
7
|
-
import { CTX } from '../../../ctx';
|
|
8
7
|
import type { FormGroupPanelController, FormItemController, FormMDCtrlController } from '../form-detail';
|
|
9
8
|
/**
|
|
10
9
|
* 表单控制器
|
|
@@ -73,24 +72,6 @@ export declare abstract class FormController<T extends IDEForm = IDEForm, S exte
|
|
|
73
72
|
*/
|
|
74
73
|
get data(): IData;
|
|
75
74
|
protected initState(): void;
|
|
76
|
-
constructor(model: T, context: IContext, params: IParams, ctx: CTX);
|
|
77
|
-
/**
|
|
78
|
-
* 进行模型预处理
|
|
79
|
-
*
|
|
80
|
-
* @author chitanda
|
|
81
|
-
* @date 2024-02-27 09:02:52
|
|
82
|
-
* @protected
|
|
83
|
-
*/
|
|
84
|
-
protected preprocessModel(model: IDEForm): void;
|
|
85
|
-
/**
|
|
86
|
-
* 递归将表单模型修改为信息态
|
|
87
|
-
*
|
|
88
|
-
* @author chitanda
|
|
89
|
-
* @date 2024-02-27 11:02:43
|
|
90
|
-
* @protected
|
|
91
|
-
* @param {IDEFormGroupBase} model
|
|
92
|
-
*/
|
|
93
|
-
protected deepPreprocessModel(model: IDEFormGroupBase): void;
|
|
94
75
|
/**
|
|
95
76
|
* 通知所有表单成员表单操作过程中的数据变更
|
|
96
77
|
*
|