@ibiz-template/runtime 0.7.41-alpha.122 → 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 +78 -15
- 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.d.ts +11 -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 +10 -8
- 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 +22 -11
- 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 = {
|
|
@@ -26117,7 +26118,8 @@ async function importData(file, appDataEntity, dataImport, context, params) {
|
|
|
26117
26118
|
url = resPath + url;
|
|
26118
26119
|
}
|
|
26119
26120
|
const result = {
|
|
26120
|
-
isAsync: false
|
|
26121
|
+
isAsync: false,
|
|
26122
|
+
showTitle: true
|
|
26121
26123
|
};
|
|
26122
26124
|
try {
|
|
26123
26125
|
const app = ibiz.hub.getApp(context == null ? void 0 : context.srfappid);
|
|
@@ -26134,28 +26136,29 @@ async function importData(file, appDataEntity, dataImport, context, params) {
|
|
|
26134
26136
|
);
|
|
26135
26137
|
if (res.ok && res.data) {
|
|
26136
26138
|
Object.assign(result, res.data);
|
|
26137
|
-
if (res.data
|
|
26138
|
-
result.
|
|
26139
|
+
if (res.data.errormessage || res.data.message) {
|
|
26140
|
+
result.showTitle = false;
|
|
26139
26141
|
}
|
|
26140
26142
|
if (res.data && res.data.errorinfo && !res.data.message && !res.data.errormessage) {
|
|
26141
26143
|
const errorInfos = Object.values(res.data.errorinfo);
|
|
26142
26144
|
if (errorInfos.length > 0) {
|
|
26143
|
-
result.
|
|
26145
|
+
result.errormessage = errorInfos.map((item) => item.errorInfo).join("\r\n");
|
|
26144
26146
|
}
|
|
26145
26147
|
}
|
|
26146
26148
|
}
|
|
26147
26149
|
} catch (error) {
|
|
26148
26150
|
if (error instanceof Error) {
|
|
26149
|
-
result.
|
|
26151
|
+
result.errormessage = error.message;
|
|
26152
|
+
result.showTitle = false;
|
|
26150
26153
|
}
|
|
26151
26154
|
}
|
|
26152
26155
|
return result;
|
|
26153
26156
|
}
|
|
26154
26157
|
async function importData2(opts) {
|
|
26155
26158
|
const result = {
|
|
26156
|
-
isAsync: ibiz.
|
|
26159
|
+
isAsync: ibiz.config.common.asyncImport
|
|
26157
26160
|
};
|
|
26158
|
-
if (ibiz.
|
|
26161
|
+
if (ibiz.config.common.asyncImport) {
|
|
26159
26162
|
asyncImportData(
|
|
26160
26163
|
opts.selectedFile,
|
|
26161
26164
|
opts.appDataEntity,
|
|
@@ -45839,15 +45842,15 @@ var FormController = class extends ControlController {
|
|
|
45839
45842
|
},
|
|
45840
45843
|
200
|
|
45841
45844
|
);
|
|
45842
|
-
this._evt.on("onFormDetailEvent", (event) => {
|
|
45845
|
+
this._evt.on("onFormDetailEvent", async (event) => {
|
|
45843
45846
|
var _a3;
|
|
45844
45847
|
if (this.state.formIsDestroyed)
|
|
45845
45848
|
return;
|
|
45846
|
-
(_a3 = this.scheduler) == null ? void 0 : _a3.
|
|
45849
|
+
await ((_a3 = this.scheduler) == null ? void 0 : _a3.triggerControlItemEvent(
|
|
45847
45850
|
event.formDetailName,
|
|
45848
45851
|
event.formDetailEventName,
|
|
45849
45852
|
event
|
|
45850
|
-
);
|
|
45853
|
+
));
|
|
45851
45854
|
});
|
|
45852
45855
|
}
|
|
45853
45856
|
/**
|
|
@@ -49474,7 +49477,9 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
49474
49477
|
*/
|
|
49475
49478
|
async validate() {
|
|
49476
49479
|
const values = await Promise.all(
|
|
49477
|
-
Array.from(this.repeaterMap.values()).map(
|
|
49480
|
+
Array.from(this.repeaterMap.values()).map(
|
|
49481
|
+
(form) => form.state.isLoaded && form.validate()
|
|
49482
|
+
)
|
|
49478
49483
|
);
|
|
49479
49484
|
return values.findIndex((value) => !value) === -1;
|
|
49480
49485
|
}
|
|
@@ -49485,7 +49490,9 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
49485
49490
|
*/
|
|
49486
49491
|
async silentValidate() {
|
|
49487
49492
|
const values = await Promise.all(
|
|
49488
|
-
Array.from(this.repeaterMap.values()).map(
|
|
49493
|
+
Array.from(this.repeaterMap.values()).map(
|
|
49494
|
+
(form) => form.state.isLoaded && form.silentValidate()
|
|
49495
|
+
)
|
|
49489
49496
|
);
|
|
49490
49497
|
return values.findIndex((value) => !value) === -1;
|
|
49491
49498
|
}
|
|
@@ -49504,14 +49511,37 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
49504
49511
|
args: { oldValue }
|
|
49505
49512
|
});
|
|
49506
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
|
+
}
|
|
49507
49532
|
/**
|
|
49508
49533
|
* @description 添加或创建一条数据
|
|
49509
49534
|
* @param {number} [index]
|
|
49510
49535
|
* @memberof FormMDCtrlRepeaterController
|
|
49511
49536
|
*/
|
|
49512
|
-
create(index) {
|
|
49537
|
+
async create(index) {
|
|
49513
49538
|
const item = {};
|
|
49514
49539
|
this.setDefaultValue(item, "create");
|
|
49540
|
+
await this.onCustomAction({
|
|
49541
|
+
index,
|
|
49542
|
+
eventArg: item,
|
|
49543
|
+
eventName: "onBeforeNew"
|
|
49544
|
+
});
|
|
49515
49545
|
if (this.isSingleData) {
|
|
49516
49546
|
this.setValue(item);
|
|
49517
49547
|
} else {
|
|
@@ -49524,6 +49554,11 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
49524
49554
|
}
|
|
49525
49555
|
this.setValue(tempValue);
|
|
49526
49556
|
}
|
|
49557
|
+
await this.onCustomAction({
|
|
49558
|
+
index,
|
|
49559
|
+
eventArg: item,
|
|
49560
|
+
eventName: "onNewSuccess"
|
|
49561
|
+
});
|
|
49527
49562
|
this.form.evt.emit("onMDCtrlNew", {
|
|
49528
49563
|
args: item
|
|
49529
49564
|
});
|
|
@@ -49534,7 +49569,13 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
49534
49569
|
* @returns {*} {void}
|
|
49535
49570
|
* @memberof FormMDCtrlRepeaterController
|
|
49536
49571
|
*/
|
|
49537
|
-
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
|
+
});
|
|
49538
49579
|
if (this.isSingleData) {
|
|
49539
49580
|
this.setValue(null);
|
|
49540
49581
|
return;
|
|
@@ -49543,6 +49584,11 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
49543
49584
|
return index !== i;
|
|
49544
49585
|
});
|
|
49545
49586
|
this.setValue(newArr);
|
|
49587
|
+
await this.onCustomAction({
|
|
49588
|
+
index,
|
|
49589
|
+
eventArg: item,
|
|
49590
|
+
eventName: "onRemoveSuccess"
|
|
49591
|
+
});
|
|
49546
49592
|
this.form.evt.emit("onMDCtrlRemove", {
|
|
49547
49593
|
args: newArr
|
|
49548
49594
|
});
|
|
@@ -90532,6 +90578,23 @@ var LogicScheduler = class {
|
|
|
90532
90578
|
};
|
|
90533
90579
|
this.triggerAndExecute(matchParams, executeParams);
|
|
90534
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
|
+
}
|
|
90535
90598
|
};
|
|
90536
90599
|
|
|
90537
90600
|
// src/logic-scheduler/scheduler/control-logic-scheduler.ts
|