@ibiz-template/runtime 0.7.41-alpha.123 → 0.7.41-alpha.124
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 +71 -10
- package/dist/index.system.min.js +1 -1
- package/out/config/global-config.d.ts.map +1 -1
- package/out/config/global-config.js +1 -0
- package/out/controller/control/form/form/form.controller.js +2 -2
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.d.ts +16 -2
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.js +45 -4
- package/out/controller/utils/data-file-util/data-file-util.js +2 -2
- package/out/interface/api/common/global-config/i-api-global-common-config.d.ts +9 -0
- package/out/interface/api/common/global-config/i-api-global-common-config.d.ts.map +1 -1
- package/out/logic-scheduler/scheduler/logic-scheduler.d.ts +8 -0
- package/out/logic-scheduler/scheduler/logic-scheduler.d.ts.map +1 -1
- package/out/logic-scheduler/scheduler/logic-scheduler.js +17 -0
- package/package.json +2 -2
- package/src/config/global-config.ts +1 -0
- package/src/controller/control/form/form/form.controller.ts +2 -2
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.ts +59 -8
- package/src/controller/utils/data-file-util/data-file-util.ts +2 -2
- package/src/interface/api/common/global-config/i-api-global-common-config.ts +10 -0
- package/src/logic-scheduler/scheduler/logic-scheduler.ts +21 -0
package/dist/index.esm.js
CHANGED
|
@@ -20010,7 +20010,8 @@ var GlobalConfig = class {
|
|
|
20010
20010
|
uiActionPermissionMode: "default",
|
|
20011
20011
|
importTemplNameMode: "default",
|
|
20012
20012
|
aiUploadMaxSize: 5242880,
|
|
20013
|
-
aiAutoQuestion: true
|
|
20013
|
+
aiAutoQuestion: true,
|
|
20014
|
+
asyncImport: false
|
|
20014
20015
|
};
|
|
20015
20016
|
// 全局分页流布局配置
|
|
20016
20017
|
this.drtab = {
|
|
@@ -26155,9 +26156,9 @@ async function importData(file, appDataEntity, dataImport, context, params) {
|
|
|
26155
26156
|
}
|
|
26156
26157
|
async function importData2(opts) {
|
|
26157
26158
|
const result = {
|
|
26158
|
-
isAsync: ibiz.
|
|
26159
|
+
isAsync: ibiz.config.common.asyncImport
|
|
26159
26160
|
};
|
|
26160
|
-
if (ibiz.
|
|
26161
|
+
if (ibiz.config.common.asyncImport) {
|
|
26161
26162
|
asyncImportData(
|
|
26162
26163
|
opts.selectedFile,
|
|
26163
26164
|
opts.appDataEntity,
|
|
@@ -45841,15 +45842,15 @@ var FormController = class extends ControlController {
|
|
|
45841
45842
|
},
|
|
45842
45843
|
200
|
|
45843
45844
|
);
|
|
45844
|
-
this._evt.on("onFormDetailEvent", (event) => {
|
|
45845
|
+
this._evt.on("onFormDetailEvent", async (event) => {
|
|
45845
45846
|
var _a3;
|
|
45846
45847
|
if (this.state.formIsDestroyed)
|
|
45847
45848
|
return;
|
|
45848
|
-
(_a3 = this.scheduler) == null ? void 0 : _a3.
|
|
45849
|
+
await ((_a3 = this.scheduler) == null ? void 0 : _a3.triggerControlItemEvent(
|
|
45849
45850
|
event.formDetailName,
|
|
45850
45851
|
event.formDetailEventName,
|
|
45851
45852
|
event
|
|
45852
|
-
);
|
|
45853
|
+
));
|
|
45853
45854
|
});
|
|
45854
45855
|
}
|
|
45855
45856
|
/**
|
|
@@ -49476,7 +49477,9 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
49476
49477
|
*/
|
|
49477
49478
|
async validate() {
|
|
49478
49479
|
const values = await Promise.all(
|
|
49479
|
-
Array.from(this.repeaterMap.values()).map(
|
|
49480
|
+
Array.from(this.repeaterMap.values()).map(
|
|
49481
|
+
(form) => form.state.isLoaded && form.validate()
|
|
49482
|
+
)
|
|
49480
49483
|
);
|
|
49481
49484
|
return values.findIndex((value) => !value) === -1;
|
|
49482
49485
|
}
|
|
@@ -49487,7 +49490,9 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
49487
49490
|
*/
|
|
49488
49491
|
async silentValidate() {
|
|
49489
49492
|
const values = await Promise.all(
|
|
49490
|
-
Array.from(this.repeaterMap.values()).map(
|
|
49493
|
+
Array.from(this.repeaterMap.values()).map(
|
|
49494
|
+
(form) => form.state.isLoaded && form.silentValidate()
|
|
49495
|
+
)
|
|
49491
49496
|
);
|
|
49492
49497
|
return values.findIndex((value) => !value) === -1;
|
|
49493
49498
|
}
|
|
@@ -49506,14 +49511,37 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
49506
49511
|
args: { oldValue }
|
|
49507
49512
|
});
|
|
49508
49513
|
}
|
|
49514
|
+
/**
|
|
49515
|
+
* @description 自定义事件
|
|
49516
|
+
* @private
|
|
49517
|
+
* @param {{
|
|
49518
|
+
* eventName: string;
|
|
49519
|
+
* index?: number;
|
|
49520
|
+
* eventArg: IData;
|
|
49521
|
+
* }} args
|
|
49522
|
+
* @returns {*} {Promise<void>}
|
|
49523
|
+
* @memberof FormMDCtrlRepeaterController
|
|
49524
|
+
*/
|
|
49525
|
+
async onCustomAction(args) {
|
|
49526
|
+
await this.form.evt.emit("onFormDetailEvent", {
|
|
49527
|
+
formDetailName: this.name || this.model.id,
|
|
49528
|
+
formDetailEventName: "onCustomAction" /* CUSTOMACTION */,
|
|
49529
|
+
args: { ...args, data: this.value }
|
|
49530
|
+
});
|
|
49531
|
+
}
|
|
49509
49532
|
/**
|
|
49510
49533
|
* @description 添加或创建一条数据
|
|
49511
49534
|
* @param {number} [index]
|
|
49512
49535
|
* @memberof FormMDCtrlRepeaterController
|
|
49513
49536
|
*/
|
|
49514
|
-
create(index) {
|
|
49537
|
+
async create(index) {
|
|
49515
49538
|
const item = {};
|
|
49516
49539
|
this.setDefaultValue(item, "create");
|
|
49540
|
+
await this.onCustomAction({
|
|
49541
|
+
index,
|
|
49542
|
+
eventArg: item,
|
|
49543
|
+
eventName: "onBeforeNew"
|
|
49544
|
+
});
|
|
49517
49545
|
if (this.isSingleData) {
|
|
49518
49546
|
this.setValue(item);
|
|
49519
49547
|
} else {
|
|
@@ -49526,6 +49554,11 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
49526
49554
|
}
|
|
49527
49555
|
this.setValue(tempValue);
|
|
49528
49556
|
}
|
|
49557
|
+
await this.onCustomAction({
|
|
49558
|
+
index,
|
|
49559
|
+
eventArg: item,
|
|
49560
|
+
eventName: "onNewSuccess"
|
|
49561
|
+
});
|
|
49529
49562
|
this.form.evt.emit("onMDCtrlNew", {
|
|
49530
49563
|
args: item
|
|
49531
49564
|
});
|
|
@@ -49536,7 +49569,13 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
49536
49569
|
* @returns {*} {void}
|
|
49537
49570
|
* @memberof FormMDCtrlRepeaterController
|
|
49538
49571
|
*/
|
|
49539
|
-
remove(index) {
|
|
49572
|
+
async remove(index) {
|
|
49573
|
+
const item = this.isSingleData ? this.value : this.value[index];
|
|
49574
|
+
await this.onCustomAction({
|
|
49575
|
+
index,
|
|
49576
|
+
eventArg: item,
|
|
49577
|
+
eventName: "onBeforeRemove"
|
|
49578
|
+
});
|
|
49540
49579
|
if (this.isSingleData) {
|
|
49541
49580
|
this.setValue(null);
|
|
49542
49581
|
return;
|
|
@@ -49545,6 +49584,11 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
49545
49584
|
return index !== i;
|
|
49546
49585
|
});
|
|
49547
49586
|
this.setValue(newArr);
|
|
49587
|
+
await this.onCustomAction({
|
|
49588
|
+
index,
|
|
49589
|
+
eventArg: item,
|
|
49590
|
+
eventName: "onRemoveSuccess"
|
|
49591
|
+
});
|
|
49548
49592
|
this.form.evt.emit("onMDCtrlRemove", {
|
|
49549
49593
|
args: newArr
|
|
49550
49594
|
});
|
|
@@ -90534,6 +90578,23 @@ var LogicScheduler = class {
|
|
|
90534
90578
|
};
|
|
90535
90579
|
this.triggerAndExecute(matchParams, executeParams);
|
|
90536
90580
|
}
|
|
90581
|
+
/**
|
|
90582
|
+
* @description 触发部件项事件
|
|
90583
|
+
* @param {string} ctrlItemName 部件项名称
|
|
90584
|
+
* @param {string} eventName 事件名称
|
|
90585
|
+
* @param {Partial<IUILogicParams>} [executeParams] 执行参数
|
|
90586
|
+
* @memberof LogicScheduler
|
|
90587
|
+
*/
|
|
90588
|
+
async triggerControlItemEvent(ctrlItemName, eventName, executeParams) {
|
|
90589
|
+
const matchParams = {
|
|
90590
|
+
eventName,
|
|
90591
|
+
ctrlName: ctrlItemName,
|
|
90592
|
+
triggerType: "CTRLEVENT"
|
|
90593
|
+
};
|
|
90594
|
+
const result = this.triggerAndExecute(matchParams, executeParams);
|
|
90595
|
+
if (result)
|
|
90596
|
+
await Promise.all(result);
|
|
90597
|
+
}
|
|
90537
90598
|
};
|
|
90538
90599
|
|
|
90539
90600
|
// src/logic-scheduler/scheduler/control-logic-scheduler.ts
|