@ibiz-template/runtime 0.1.12-dev.0 → 0.1.12
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 +452 -311
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +9 -0
- package/out/controller/control/app-menu/app-menu.controller.d.ts +1 -1
- package/out/controller/control/app-menu/app-menu.controller.d.ts.map +1 -1
- package/out/controller/control/app-menu/app-menu.controller.js +2 -2
- package/out/controller/control/caption-bar/caption-bar.controller.d.ts.map +1 -1
- package/out/controller/control/caption-bar/caption-bar.controller.js +1 -2
- package/out/controller/control/chart/generator/chart-options-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/chart-options-generator.js +5 -0
- package/out/controller/control/exp-bar/exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/exp-bar.controller.js +19 -0
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts +7 -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 +55 -19
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.d.ts +4 -2
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.js +22 -2
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.controller.d.ts +3 -62
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.controller.js +7 -97
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.d.ts +2 -48
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.js +2 -94
- package/out/controller/control/form/search-form/search-form.controller.js +1 -0
- package/out/controller/control/form/search-form/search-form.service.d.ts +1 -1
- package/out/controller/control/form/search-form/search-form.service.d.ts.map +1 -1
- package/out/controller/control/form/search-form/search-form.service.js +2 -3
- package/out/controller/control/grid/grid/grid-column.controller.d.ts +16 -0
- package/out/controller/control/grid/grid/grid-column.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid-column.controller.js +22 -0
- package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts +8 -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 +20 -1
- package/out/controller/control/index.d.ts +1 -0
- package/out/controller/control/index.d.ts.map +1 -1
- package/out/controller/control/index.js +1 -0
- package/out/controller/control/md-ctrl/index.d.ts +4 -0
- package/out/controller/control/md-ctrl/index.d.ts.map +1 -0
- package/out/controller/control/md-ctrl/index.js +3 -0
- package/out/controller/control/md-ctrl/md-ctrl-row.state.d.ts +34 -0
- package/out/controller/control/md-ctrl/md-ctrl-row.state.d.ts.map +1 -0
- package/out/controller/control/md-ctrl/md-ctrl-row.state.js +31 -0
- package/out/controller/control/md-ctrl/md-ctrl.controller.d.ts +77 -0
- package/out/controller/control/md-ctrl/md-ctrl.controller.d.ts.map +1 -0
- package/out/controller/control/md-ctrl/md-ctrl.controller.js +160 -0
- package/out/controller/control/md-ctrl/md-ctrl.service.d.ts +21 -0
- package/out/controller/control/md-ctrl/md-ctrl.service.d.ts.map +1 -0
- package/out/controller/control/md-ctrl/md-ctrl.service.js +40 -0
- package/out/controller/control/panel/panel/panel-item.controller.js +1 -1
- package/out/controller/control/panel/panel/panel.controller.d.ts.map +1 -1
- package/out/controller/control/panel/panel/panel.controller.js +4 -2
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +15 -6
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +9 -3
- package/out/interface/controller/event/control/i-edit-form.event.d.ts +48 -3
- package/out/interface/controller/event/control/i-edit-form.event.d.ts.map +1 -1
- package/out/interface/controller/event/control/i-form.event.d.ts +27 -0
- package/out/interface/controller/event/control/i-form.event.d.ts.map +1 -1
- package/out/interface/controller/event/control/i-md-control.event.d.ts +57 -14
- package/out/interface/controller/event/control/i-md-control.event.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-exp-bar-control.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-exp-bar-control.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-search-bar.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-search-bar.state.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts +3 -3
- package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.js +3 -3
- package/out/service/service/code-list/code-list.service.d.ts.map +1 -1
- package/out/service/service/code-list/code-list.service.js +1 -1
- package/out/service/utils/dynamic-code-list/dynamic-code-list.js +1 -1
- package/out/ui-action/uiaction-util.js +1 -1
- package/out/utils/script/script-function.d.ts.map +1 -1
- package/out/utils/script/script-function.js +3 -0
- package/package.json +3 -3
- package/src/controller/common/control/md-control.controller.ts +7 -0
- package/src/controller/control/app-menu/app-menu.controller.ts +6 -3
- package/src/controller/control/caption-bar/caption-bar.controller.ts +1 -2
- package/src/controller/control/chart/generator/chart-options-generator.ts +4 -0
- package/src/controller/control/exp-bar/exp-bar.controller.ts +25 -0
- package/src/controller/control/form/edit-form/edit-form.controller.ts +57 -24
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.ts +41 -4
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.controller.ts +11 -159
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.ts +2 -140
- package/src/controller/control/form/search-form/search-form.controller.ts +1 -1
- package/src/controller/control/form/search-form/search-form.service.ts +2 -3
- package/src/controller/control/grid/grid/grid-column.controller.ts +22 -0
- package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +21 -1
- package/src/controller/control/index.ts +1 -0
- package/src/controller/control/md-ctrl/index.ts +3 -0
- package/src/controller/control/md-ctrl/md-ctrl-row.state.ts +40 -0
- package/src/controller/control/md-ctrl/md-ctrl.controller.ts +199 -0
- package/src/controller/control/md-ctrl/md-ctrl.service.ts +40 -0
- package/src/controller/control/panel/panel/panel-item.controller.ts +1 -1
- package/src/controller/control/panel/panel/panel.controller.ts +6 -2
- package/src/controller/control/search-bar/search-bar.controller.ts +21 -8
- package/src/engine/md-view.engine.ts +7 -3
- package/src/interface/controller/event/control/i-edit-form.event.ts +53 -3
- package/src/interface/controller/event/control/i-form.event.ts +30 -0
- package/src/interface/controller/event/control/i-md-control.event.ts +63 -15
- package/src/interface/controller/state/control/i-exp-bar-control.state.ts +8 -0
- package/src/interface/controller/state/control/i-search-bar.state.ts +8 -0
- package/src/logic-scheduler/executor/app-ui-logic-executor.ts +5 -5
- package/src/service/service/code-list/code-list.service.ts +1 -4
- package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +1 -1
- package/src/ui-action/uiaction-util.ts +1 -1
- package/src/utils/script/script-function.ts +3 -0
package/dist/index.esm.js
CHANGED
|
@@ -1357,6 +1357,9 @@ var ScriptFunction = class {
|
|
|
1357
1357
|
openView: ibiz.openView
|
|
1358
1358
|
};
|
|
1359
1359
|
break;
|
|
1360
|
+
case "viewParam":
|
|
1361
|
+
param.viewParam = param.params;
|
|
1362
|
+
break;
|
|
1360
1363
|
case "env":
|
|
1361
1364
|
param.env = ibiz.env;
|
|
1362
1365
|
break;
|
|
@@ -3818,7 +3821,7 @@ var DynamicCodeListCache = class {
|
|
|
3818
3821
|
const app = ibiz.hub.getApp(context.srfappid);
|
|
3819
3822
|
if (this.isPredefined) {
|
|
3820
3823
|
if (!params.size) {
|
|
3821
|
-
params
|
|
3824
|
+
params = { ...params, size: 1e4 };
|
|
3822
3825
|
}
|
|
3823
3826
|
const res2 = await app.net.get(
|
|
3824
3827
|
"/dictionaries/codelist/".concat(this.codeList.codeName),
|
|
@@ -4508,10 +4511,7 @@ var CodeListService = class {
|
|
|
4508
4511
|
var _a;
|
|
4509
4512
|
let text = codeItem.text;
|
|
4510
4513
|
if (codeItem.textLanguageRes) {
|
|
4511
|
-
text = ibiz.i18n.t(
|
|
4512
|
-
codeItem.textLanguageRes.lanResTag,
|
|
4513
|
-
codeItem.textLanguageRes.defaultContent
|
|
4514
|
-
);
|
|
4514
|
+
text = ibiz.i18n.t(codeItem.textLanguageRes.lanResTag, codeItem.text);
|
|
4515
4515
|
}
|
|
4516
4516
|
const _codeItem = {
|
|
4517
4517
|
text,
|
|
@@ -9751,6 +9751,9 @@ var MDControlController = class extends ControlController {
|
|
|
9751
9751
|
await this._evt.emit("onLoadSuccess", {
|
|
9752
9752
|
isInitialLoad
|
|
9753
9753
|
});
|
|
9754
|
+
} catch (error) {
|
|
9755
|
+
await this._evt.emit("onLoadError", void 0);
|
|
9756
|
+
throw error;
|
|
9754
9757
|
} finally {
|
|
9755
9758
|
await this.endLoading();
|
|
9756
9759
|
}
|
|
@@ -9797,6 +9800,7 @@ var MDControlController = class extends ControlController {
|
|
|
9797
9800
|
return;
|
|
9798
9801
|
}
|
|
9799
9802
|
}
|
|
9803
|
+
await this._evt.emit("onBeforeRemove", void 0);
|
|
9800
9804
|
await this.startLoading();
|
|
9801
9805
|
let needRefresh = false;
|
|
9802
9806
|
try {
|
|
@@ -9820,6 +9824,9 @@ var MDControlController = class extends ControlController {
|
|
|
9820
9824
|
if (needRefresh) {
|
|
9821
9825
|
this.refresh();
|
|
9822
9826
|
}
|
|
9827
|
+
} catch (error) {
|
|
9828
|
+
await this._evt.emit("onRemoveError", void 0);
|
|
9829
|
+
throw error;
|
|
9823
9830
|
} finally {
|
|
9824
9831
|
await this.endLoading();
|
|
9825
9832
|
}
|
|
@@ -9953,7 +9960,7 @@ var AppMenuController = class extends ControlController {
|
|
|
9953
9960
|
* @param {string} id
|
|
9954
9961
|
* @return {*} {Promise<void>}
|
|
9955
9962
|
*/
|
|
9956
|
-
async onClickMenuItem(id, event) {
|
|
9963
|
+
async onClickMenuItem(id, event, useDepth = true) {
|
|
9957
9964
|
const menuItem = findRecursiveChild(this.model, id, {
|
|
9958
9965
|
compareField: "id",
|
|
9959
9966
|
childrenFields: ["appMenuItems"]
|
|
@@ -9969,7 +9976,7 @@ var AppMenuController = class extends ControlController {
|
|
|
9969
9976
|
throw new RuntimeModelError21(menuItem, "\u6CA1\u6709\u914D\u7F6E\u5E94\u7528\u529F\u80FD");
|
|
9970
9977
|
}
|
|
9971
9978
|
const tempContext = this.context.clone();
|
|
9972
|
-
if (this.routeDepth) {
|
|
9979
|
+
if (this.routeDepth && useDepth) {
|
|
9973
9980
|
Object.assign(tempContext, {
|
|
9974
9981
|
toRouteDepth: this.routeDepth + 1
|
|
9975
9982
|
});
|
|
@@ -11117,9 +11124,13 @@ var ChartOptionsGenerator2 = class {
|
|
|
11117
11124
|
return titleOption;
|
|
11118
11125
|
}
|
|
11119
11126
|
calcLegendOption(chartLegend) {
|
|
11127
|
+
var _a;
|
|
11120
11128
|
const { showLegend, legendPos } = chartLegend;
|
|
11121
11129
|
const legendOption = {};
|
|
11122
11130
|
legendOption.show = showLegend;
|
|
11131
|
+
if (((_a = this.model.dechartSerieses) == null ? void 0 : _a.length) === 1) {
|
|
11132
|
+
legendOption.show = false;
|
|
11133
|
+
}
|
|
11123
11134
|
const position = legendPos == null ? void 0 : legendPos.toLowerCase();
|
|
11124
11135
|
if (position === "left" || position === "right") {
|
|
11125
11136
|
legendOption.left = position;
|
|
@@ -11390,7 +11401,7 @@ var CaptionBarController = class extends ControlController {
|
|
|
11390
11401
|
if (this.view.model.capLanguageRes) {
|
|
11391
11402
|
this.state.caption = ibiz.i18n.t(
|
|
11392
11403
|
this.view.model.capLanguageRes.lanResTag,
|
|
11393
|
-
this.view.model.
|
|
11404
|
+
this.view.model.caption
|
|
11394
11405
|
);
|
|
11395
11406
|
} else {
|
|
11396
11407
|
this.state.caption = this.view.model.caption;
|
|
@@ -12277,7 +12288,7 @@ var UIActionUtil = class {
|
|
|
12277
12288
|
var _a, _b;
|
|
12278
12289
|
const result = await this.exec(actionId, params);
|
|
12279
12290
|
if (result.closeView) {
|
|
12280
|
-
params.view.closeView();
|
|
12291
|
+
params.view.closeView({ ok: true });
|
|
12281
12292
|
} else if (result.refresh) {
|
|
12282
12293
|
switch (result.refreshMode) {
|
|
12283
12294
|
case 1:
|
|
@@ -13490,8 +13501,34 @@ var ExpBarControlController = class extends ControlController {
|
|
|
13490
13501
|
* @memberof ExpBarControlController
|
|
13491
13502
|
*/
|
|
13492
13503
|
async onCreated() {
|
|
13504
|
+
var _a;
|
|
13493
13505
|
await super.onCreated();
|
|
13494
13506
|
this.childNames.push(this.model.xdataControlName);
|
|
13507
|
+
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
13508
|
+
this.model.appDataEntityId,
|
|
13509
|
+
this.context.srfappid
|
|
13510
|
+
);
|
|
13511
|
+
if (appDataEntity) {
|
|
13512
|
+
const searchFields = (_a = appDataEntity.appDEFields) == null ? void 0 : _a.filter((field) => {
|
|
13513
|
+
return field.enableQuickSearch;
|
|
13514
|
+
});
|
|
13515
|
+
const placeHolders = [];
|
|
13516
|
+
searchFields == null ? void 0 : searchFields.forEach((searchField) => {
|
|
13517
|
+
if ((searchField == null ? void 0 : searchField.lnlanguageRes) && searchField.lnlanguageRes.lanResTag) {
|
|
13518
|
+
placeHolders.push(
|
|
13519
|
+
ibiz.i18n.t(
|
|
13520
|
+
searchField.lnlanguageRes.lanResTag,
|
|
13521
|
+
searchField.logicName
|
|
13522
|
+
)
|
|
13523
|
+
);
|
|
13524
|
+
} else if (searchField == null ? void 0 : searchField.logicName) {
|
|
13525
|
+
placeHolders.push(searchField.logicName);
|
|
13526
|
+
}
|
|
13527
|
+
});
|
|
13528
|
+
if (placeHolders.length > 0) {
|
|
13529
|
+
this.state.placeHolder = placeHolders.join("\u3001");
|
|
13530
|
+
}
|
|
13531
|
+
}
|
|
13495
13532
|
}
|
|
13496
13533
|
/**
|
|
13497
13534
|
* 组件挂载
|
|
@@ -14103,8 +14140,8 @@ var SearchFormService = class extends ControlService {
|
|
|
14103
14140
|
* @param {IParams} [params={}] 视图参数
|
|
14104
14141
|
* @returns {*} {Promise<IHttpResponse>}
|
|
14105
14142
|
*/
|
|
14106
|
-
async getDraft(_context,
|
|
14107
|
-
let res = { ok: true, status: 200, data: {} };
|
|
14143
|
+
async getDraft(_context, params = {}) {
|
|
14144
|
+
let res = { ok: true, status: 200, data: { ...params } };
|
|
14108
14145
|
res = this.handleResponse(res);
|
|
14109
14146
|
return res;
|
|
14110
14147
|
}
|
|
@@ -14164,6 +14201,7 @@ var SearchFormController = class extends FormController {
|
|
|
14164
14201
|
const queryParams = { ...this.params };
|
|
14165
14202
|
const params = await this.getDraftParams();
|
|
14166
14203
|
Object.assign(queryParams, params);
|
|
14204
|
+
await this.evt.emit("onBeforeLoadDraft", { params: queryParams });
|
|
14167
14205
|
const res = await this.service.getDraft(this.context, queryParams);
|
|
14168
14206
|
this.state.data = res.data;
|
|
14169
14207
|
mergeDefaultInLeft(this.data, params);
|
|
@@ -15681,6 +15719,34 @@ var EditFormController = class extends FormController {
|
|
|
15681
15719
|
trailing: true
|
|
15682
15720
|
});
|
|
15683
15721
|
}
|
|
15722
|
+
/**
|
|
15723
|
+
* 加载草稿行为
|
|
15724
|
+
* @author lxm
|
|
15725
|
+
* @date 2023-08-25 02:45:11
|
|
15726
|
+
* @return {*} {Promise<IData>}
|
|
15727
|
+
*/
|
|
15728
|
+
async loadDraft() {
|
|
15729
|
+
const queryParams = { ...this.params };
|
|
15730
|
+
const params = await this.getDraftParams();
|
|
15731
|
+
Object.assign(queryParams, params);
|
|
15732
|
+
let res;
|
|
15733
|
+
try {
|
|
15734
|
+
await this.startLoading();
|
|
15735
|
+
await this.evt.emit("onBeforeLoadDraft", { params: queryParams });
|
|
15736
|
+
res = await this.service.getDraft(this.context, queryParams);
|
|
15737
|
+
} catch (error) {
|
|
15738
|
+
await this.evt.emit("onLoadDraftError", void 0);
|
|
15739
|
+
throw error;
|
|
15740
|
+
} finally {
|
|
15741
|
+
await this.endLoading();
|
|
15742
|
+
}
|
|
15743
|
+
mergeInLeft(this.data, res.data);
|
|
15744
|
+
mergeDefaultInLeft2(this.data, params);
|
|
15745
|
+
this.formStateNotify("DRAFT" /* DRAFT */);
|
|
15746
|
+
await this.evt.emit("onLoadDraftSuccess", void 0);
|
|
15747
|
+
this.state.isLoaded = true;
|
|
15748
|
+
return this.data;
|
|
15749
|
+
}
|
|
15684
15750
|
/**
|
|
15685
15751
|
* 部件加载数据行为
|
|
15686
15752
|
*
|
|
@@ -15692,34 +15758,25 @@ var EditFormController = class extends FormController {
|
|
|
15692
15758
|
this.context,
|
|
15693
15759
|
this.model.appDataEntityId
|
|
15694
15760
|
);
|
|
15695
|
-
const queryParams = { ...this.params };
|
|
15696
|
-
let params = {};
|
|
15697
15761
|
if (isLoadDraft) {
|
|
15698
|
-
|
|
15699
|
-
Object.assign(queryParams, params);
|
|
15762
|
+
return this.loadDraft();
|
|
15700
15763
|
}
|
|
15701
|
-
|
|
15764
|
+
const queryParams = { ...this.params };
|
|
15702
15765
|
let res;
|
|
15703
15766
|
try {
|
|
15704
|
-
|
|
15767
|
+
await this.startLoading();
|
|
15768
|
+
await this.evt.emit("onBeforeLoad", void 0);
|
|
15769
|
+
res = await this.service.get(this.context, queryParams);
|
|
15770
|
+
} catch (error) {
|
|
15771
|
+
await this.evt.emit("onLoadError", void 0);
|
|
15772
|
+
throw error;
|
|
15705
15773
|
} finally {
|
|
15706
15774
|
await this.endLoading();
|
|
15707
15775
|
}
|
|
15708
|
-
if (isLoadDraft) {
|
|
15709
|
-
mergeInLeft(this.data, res.data);
|
|
15710
|
-
} else {
|
|
15711
|
-
this.state.data = res.data;
|
|
15712
|
-
}
|
|
15713
15776
|
this.state.modified = false;
|
|
15714
15777
|
this.state.data = res.data;
|
|
15715
|
-
|
|
15716
|
-
this.
|
|
15717
|
-
isLoadDraft ? "DRAFT" /* DRAFT */ : "LOAD" /* LOAD */
|
|
15718
|
-
);
|
|
15719
|
-
await this.evt.emit(
|
|
15720
|
-
isLoadDraft ? "onLoadDraftSuccess" : "onLoadSuccess",
|
|
15721
|
-
void 0
|
|
15722
|
-
);
|
|
15778
|
+
this.formStateNotify("LOAD" /* LOAD */);
|
|
15779
|
+
await this.evt.emit("onLoadSuccess", void 0);
|
|
15723
15780
|
this.state.isLoaded = true;
|
|
15724
15781
|
return this.data;
|
|
15725
15782
|
}
|
|
@@ -15739,9 +15796,13 @@ var EditFormController = class extends FormController {
|
|
|
15739
15796
|
throw new RuntimeError37("\u8BF7\u68C0\u67E5\u8868\u5355\u586B\u5199\uFF01");
|
|
15740
15797
|
}
|
|
15741
15798
|
await this.startLoading();
|
|
15799
|
+
await this.evt.emit("onBeforeSave", void 0);
|
|
15742
15800
|
let res;
|
|
15743
15801
|
try {
|
|
15744
15802
|
res = this.data.srfuf === 0 /* CREATE */ ? await this.service.create(this.context, this.data) : await this.service.update(this.context, this.data);
|
|
15803
|
+
} catch (error) {
|
|
15804
|
+
await this.evt.emit("onSaveError", void 0);
|
|
15805
|
+
throw error;
|
|
15745
15806
|
} finally {
|
|
15746
15807
|
await this.endLoading();
|
|
15747
15808
|
}
|
|
@@ -15764,6 +15825,7 @@ var EditFormController = class extends FormController {
|
|
|
15764
15825
|
async remove() {
|
|
15765
15826
|
let res;
|
|
15766
15827
|
let ok = false;
|
|
15828
|
+
await this.evt.emit("onBeforeRemove", void 0);
|
|
15767
15829
|
if (this.data.srfuf === 1 /* UPDATE */) {
|
|
15768
15830
|
ok = await ibiz.modal.confirm({
|
|
15769
15831
|
title: "\u63D0\u793A",
|
|
@@ -15775,6 +15837,9 @@ var EditFormController = class extends FormController {
|
|
|
15775
15837
|
await this.startLoading();
|
|
15776
15838
|
try {
|
|
15777
15839
|
res = await this.service.remove(this.context, this.params);
|
|
15840
|
+
} catch (error) {
|
|
15841
|
+
await this.evt.emit("onRemoveError", void 0);
|
|
15842
|
+
throw error;
|
|
15778
15843
|
} finally {
|
|
15779
15844
|
await this.endLoading();
|
|
15780
15845
|
}
|
|
@@ -16324,233 +16389,11 @@ var FormMDCtrlListController = class extends FormMDCtrlControlController {
|
|
|
16324
16389
|
}
|
|
16325
16390
|
};
|
|
16326
16391
|
|
|
16327
|
-
// src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.ts
|
|
16328
|
-
var FormMDCtrlItemController = class extends EditFormController {
|
|
16329
|
-
constructor(model, context, params, ctx, data) {
|
|
16330
|
-
super(model, context, params, ctx);
|
|
16331
|
-
this.state.data = data;
|
|
16332
|
-
this.state.isSimple = true;
|
|
16333
|
-
}
|
|
16334
|
-
async onInit() {
|
|
16335
|
-
await this.initDetailControllers(
|
|
16336
|
-
this.model.deformDetails
|
|
16337
|
-
);
|
|
16338
|
-
}
|
|
16339
|
-
};
|
|
16340
|
-
|
|
16341
|
-
// src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.ts
|
|
16342
|
-
var FormMDCtrlRepeaterFormOneController = class extends FormMDCtrlContentTypeController {
|
|
16343
|
-
constructor() {
|
|
16344
|
-
super(...arguments);
|
|
16345
|
-
/**
|
|
16346
|
-
* 表单项控制器的集合(二维数组)
|
|
16347
|
-
*
|
|
16348
|
-
* @author zk
|
|
16349
|
-
* @date 2023-07-25 05:07:56
|
|
16350
|
-
* @type {Array<Array<FormItemController>>}
|
|
16351
|
-
* @memberof FormMDCtrlController
|
|
16352
|
-
*/
|
|
16353
|
-
this.formDetail = [];
|
|
16354
|
-
this.state = { isInit: false };
|
|
16355
|
-
}
|
|
16356
|
-
/**
|
|
16357
|
-
* 数据
|
|
16358
|
-
*
|
|
16359
|
-
* @author zk
|
|
16360
|
-
* @date 2023-07-31 09:07:25
|
|
16361
|
-
* @readonly
|
|
16362
|
-
* @type {IData[]}
|
|
16363
|
-
* @memberof FormMDCtrlRepeaterFormOneController
|
|
16364
|
-
*/
|
|
16365
|
-
get data() {
|
|
16366
|
-
return this.parent.state.contentCtrlData;
|
|
16367
|
-
}
|
|
16368
|
-
/**
|
|
16369
|
-
* 初始化表单成员控制器
|
|
16370
|
-
*
|
|
16371
|
-
* @author lxm
|
|
16372
|
-
* @date 2022-08-24 21:08:48
|
|
16373
|
-
* @protected
|
|
16374
|
-
*/
|
|
16375
|
-
async initFormMDCtrlItemControllers(details, form = this.parent.form, data = {}, parent = void 0) {
|
|
16376
|
-
const formData = data;
|
|
16377
|
-
const formController = new FormMDCtrlItemController(
|
|
16378
|
-
this.model,
|
|
16379
|
-
this.parent.form.context,
|
|
16380
|
-
this.parent.form.params,
|
|
16381
|
-
this.formCtx,
|
|
16382
|
-
formData
|
|
16383
|
-
);
|
|
16384
|
-
await formController.onInit();
|
|
16385
|
-
formController.evt.on("onFormDataChange", (arg) => {
|
|
16386
|
-
if (arg.data.length > 0) {
|
|
16387
|
-
this.onDataItemChange(arg.data[0]);
|
|
16388
|
-
}
|
|
16389
|
-
});
|
|
16390
|
-
formController.state.isLoaded = true;
|
|
16391
|
-
await Promise.all(
|
|
16392
|
-
details.map(async (detail) => {
|
|
16393
|
-
const detailProvider = await getFormDetailProvider(detail);
|
|
16394
|
-
if (!detailProvider) {
|
|
16395
|
-
return;
|
|
16396
|
-
}
|
|
16397
|
-
form.providers[detail.id] = detailProvider;
|
|
16398
|
-
const detailController = await detailProvider.createController(
|
|
16399
|
-
detail,
|
|
16400
|
-
formController,
|
|
16401
|
-
parent
|
|
16402
|
-
);
|
|
16403
|
-
if (!this.formDetail) {
|
|
16404
|
-
this.formDetail = [];
|
|
16405
|
-
}
|
|
16406
|
-
this.formDetail.push({
|
|
16407
|
-
name: detail.id,
|
|
16408
|
-
detailType: detail.detailType,
|
|
16409
|
-
c: detailController
|
|
16410
|
-
});
|
|
16411
|
-
const childDetails = findChildFormDetails(detail);
|
|
16412
|
-
if (childDetails.length) {
|
|
16413
|
-
await this.initFormMDCtrlItemControllers(
|
|
16414
|
-
childDetails,
|
|
16415
|
-
formController,
|
|
16416
|
-
data,
|
|
16417
|
-
detailController
|
|
16418
|
-
);
|
|
16419
|
-
}
|
|
16420
|
-
})
|
|
16421
|
-
);
|
|
16422
|
-
return data;
|
|
16423
|
-
}
|
|
16424
|
-
/**
|
|
16425
|
-
* 初始化formCtx
|
|
16426
|
-
*
|
|
16427
|
-
* @author zk
|
|
16428
|
-
* @date 2023-07-29 05:07:21
|
|
16429
|
-
* @memberof FormMDCtrlRepeaterFormController
|
|
16430
|
-
*/
|
|
16431
|
-
useFormMdCtrlCtx() {
|
|
16432
|
-
}
|
|
16433
|
-
async initData() {
|
|
16434
|
-
super.initData();
|
|
16435
|
-
await this.initFormMDCtrlItemControllers(
|
|
16436
|
-
this.model.deformDetails,
|
|
16437
|
-
this.parent.form,
|
|
16438
|
-
this.data
|
|
16439
|
-
);
|
|
16440
|
-
this.state.isInit = true;
|
|
16441
|
-
}
|
|
16442
|
-
/**
|
|
16443
|
-
* 内部表单项数据发生改变,同步contentCtrlData并设置外部表单值
|
|
16444
|
-
*
|
|
16445
|
-
* @author zk
|
|
16446
|
-
* @date 2023-07-30 05:07:11
|
|
16447
|
-
* @param {IData} data
|
|
16448
|
-
* @param {number} index
|
|
16449
|
-
* @memberof FormMDCtrlController
|
|
16450
|
-
*/
|
|
16451
|
-
onDataItemChange(data) {
|
|
16452
|
-
this.parent.state.contentCtrlData = data;
|
|
16453
|
-
this.parent.setFormDataValue();
|
|
16454
|
-
}
|
|
16455
|
-
/**
|
|
16456
|
-
* 表单值校验
|
|
16457
|
-
*
|
|
16458
|
-
* @author zzq
|
|
16459
|
-
* @date 2023-08-23 19:07:11
|
|
16460
|
-
* @memberof FormMDCtrlController
|
|
16461
|
-
*/
|
|
16462
|
-
async validate() {
|
|
16463
|
-
const values = [];
|
|
16464
|
-
this.formDetail.forEach((detail) => {
|
|
16465
|
-
if (detail.detailType === "FORMITEM") {
|
|
16466
|
-
const c = detail.c;
|
|
16467
|
-
values.push(c.validate());
|
|
16468
|
-
}
|
|
16469
|
-
});
|
|
16470
|
-
const results = await Promise.all(values);
|
|
16471
|
-
return results.findIndex((value) => !value) === -1;
|
|
16472
|
-
}
|
|
16473
|
-
};
|
|
16474
|
-
|
|
16475
16392
|
// src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.controller.ts
|
|
16476
16393
|
var FormMDCtrlRepeaterFormController = class extends FormMDCtrlContentTypeController {
|
|
16477
16394
|
constructor() {
|
|
16478
16395
|
super(...arguments);
|
|
16479
|
-
|
|
16480
|
-
* 表单项控制器的集合(二维数组)
|
|
16481
|
-
*
|
|
16482
|
-
* @author zk
|
|
16483
|
-
* @date 2023-07-25 05:07:56
|
|
16484
|
-
* @type {Array<Array<FormItemController>>}
|
|
16485
|
-
* @memberof FormMDCtrlController
|
|
16486
|
-
*/
|
|
16487
|
-
this.formDetails = [];
|
|
16488
|
-
/**
|
|
16489
|
-
* uiState
|
|
16490
|
-
*
|
|
16491
|
-
* @author zk
|
|
16492
|
-
* @date 2023-07-31 12:07:07
|
|
16493
|
-
* @type {{ isInit: boolean }}
|
|
16494
|
-
* @memberof FormMDCtrlRepeaterFormController
|
|
16495
|
-
*/
|
|
16496
|
-
this.state = { isInit: false };
|
|
16497
|
-
}
|
|
16498
|
-
/**
|
|
16499
|
-
* 初始化表单成员控制器
|
|
16500
|
-
*
|
|
16501
|
-
* @author lxm
|
|
16502
|
-
* @date 2022-08-24 21:08:48
|
|
16503
|
-
* @protected
|
|
16504
|
-
*/
|
|
16505
|
-
async initFormMDCtrlItemControllers(details, index, form = this.parent.form, data = {}, parent = void 0) {
|
|
16506
|
-
const formData = data;
|
|
16507
|
-
const formController = new FormMDCtrlItemController(
|
|
16508
|
-
this.model,
|
|
16509
|
-
this.parent.form.context,
|
|
16510
|
-
this.parent.form.params,
|
|
16511
|
-
this.formCtx,
|
|
16512
|
-
formData
|
|
16513
|
-
);
|
|
16514
|
-
await formController.onInit();
|
|
16515
|
-
formController.evt.on("onFormDataChange", (arg) => {
|
|
16516
|
-
if (arg.data.length > 0) {
|
|
16517
|
-
this.onDataItemChange(arg.data[0], index);
|
|
16518
|
-
}
|
|
16519
|
-
});
|
|
16520
|
-
formController.state.isLoaded = true;
|
|
16521
|
-
await Promise.all(
|
|
16522
|
-
details.map(async (detail) => {
|
|
16523
|
-
const detailProvider = await getFormDetailProvider(detail);
|
|
16524
|
-
if (!detailProvider) {
|
|
16525
|
-
return;
|
|
16526
|
-
}
|
|
16527
|
-
form.providers[detail.id] = detailProvider;
|
|
16528
|
-
const detailController = await detailProvider.createController(
|
|
16529
|
-
detail,
|
|
16530
|
-
formController,
|
|
16531
|
-
parent
|
|
16532
|
-
);
|
|
16533
|
-
if (!this.formDetails[index]) {
|
|
16534
|
-
this.formDetails[index] = [];
|
|
16535
|
-
}
|
|
16536
|
-
this.formDetails[index].push({
|
|
16537
|
-
name: detail.id,
|
|
16538
|
-
detailType: detail.detailType,
|
|
16539
|
-
c: detailController
|
|
16540
|
-
});
|
|
16541
|
-
const childDetails = findChildFormDetails(detail);
|
|
16542
|
-
if (childDetails.length) {
|
|
16543
|
-
await this.initFormMDCtrlItemControllers(
|
|
16544
|
-
childDetails,
|
|
16545
|
-
index,
|
|
16546
|
-
formController,
|
|
16547
|
-
data,
|
|
16548
|
-
detailController
|
|
16549
|
-
);
|
|
16550
|
-
}
|
|
16551
|
-
})
|
|
16552
|
-
);
|
|
16553
|
-
return data;
|
|
16396
|
+
this.formControllerArray = [];
|
|
16554
16397
|
}
|
|
16555
16398
|
/**
|
|
16556
16399
|
* 数据插入
|
|
@@ -16560,10 +16403,7 @@ var FormMDCtrlRepeaterFormController = class extends FormMDCtrlContentTypeContro
|
|
|
16560
16403
|
* @memberof FormMDCtrlRepeaterFormController
|
|
16561
16404
|
*/
|
|
16562
16405
|
async onDataInsert() {
|
|
16563
|
-
const data =
|
|
16564
|
-
this.model.deformDetails,
|
|
16565
|
-
this.data.length
|
|
16566
|
-
);
|
|
16406
|
+
const data = {};
|
|
16567
16407
|
super.onDataInsert(data);
|
|
16568
16408
|
}
|
|
16569
16409
|
/**
|
|
@@ -16579,57 +16419,54 @@ var FormMDCtrlRepeaterFormController = class extends FormMDCtrlContentTypeContro
|
|
|
16579
16419
|
return;
|
|
16580
16420
|
}
|
|
16581
16421
|
super.onDataRemove(index);
|
|
16582
|
-
this.formDetails.splice(index, 1);
|
|
16583
16422
|
}
|
|
16584
16423
|
/**
|
|
16585
|
-
*
|
|
16424
|
+
* 表单项值规则校验
|
|
16586
16425
|
*
|
|
16587
|
-
* @author
|
|
16588
|
-
* @date 2023-
|
|
16426
|
+
* @author zzq
|
|
16427
|
+
* @date 2023-08-23 17:21:37
|
|
16589
16428
|
* @memberof FormMDCtrlRepeaterFormController
|
|
16590
16429
|
*/
|
|
16591
|
-
|
|
16430
|
+
async validate() {
|
|
16431
|
+
const values = this.formControllerArray.map(
|
|
16432
|
+
(c) => {
|
|
16433
|
+
return c.validate();
|
|
16434
|
+
}
|
|
16435
|
+
);
|
|
16436
|
+
const results = await Promise.all(values);
|
|
16437
|
+
return results.findIndex((value) => !value) === -1;
|
|
16592
16438
|
}
|
|
16439
|
+
setFromController(c) {
|
|
16440
|
+
this.formControllerArray.push(c);
|
|
16441
|
+
}
|
|
16442
|
+
};
|
|
16443
|
+
|
|
16444
|
+
// src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.ts
|
|
16445
|
+
var FormMDCtrlRepeaterFormOneController = class extends FormMDCtrlRepeaterFormController {
|
|
16593
16446
|
/**
|
|
16594
|
-
*
|
|
16447
|
+
* 数据
|
|
16595
16448
|
*
|
|
16596
16449
|
* @author zk
|
|
16597
|
-
* @date 2023-07-31
|
|
16598
|
-
* @
|
|
16450
|
+
* @date 2023-07-31 09:07:25
|
|
16451
|
+
* @readonly
|
|
16452
|
+
* @type {IData[]}
|
|
16453
|
+
* @memberof FormMDCtrlRepeaterFormOneController
|
|
16599
16454
|
*/
|
|
16600
|
-
|
|
16601
|
-
|
|
16602
|
-
await Promise.all(
|
|
16603
|
-
this.data.map(async (item, index) => {
|
|
16604
|
-
await this.initFormMDCtrlItemControllers(
|
|
16605
|
-
this.model.deformDetails,
|
|
16606
|
-
index,
|
|
16607
|
-
this.parent.form,
|
|
16608
|
-
item
|
|
16609
|
-
);
|
|
16610
|
-
})
|
|
16611
|
-
);
|
|
16612
|
-
this.state.isInit = true;
|
|
16455
|
+
get data() {
|
|
16456
|
+
return this.parent.state.contentCtrlData;
|
|
16613
16457
|
}
|
|
16614
16458
|
/**
|
|
16615
|
-
*
|
|
16459
|
+
* 内部表单项数据发生改变,同步contentCtrlData并设置外部表单值
|
|
16616
16460
|
*
|
|
16617
|
-
* @author
|
|
16618
|
-
* @date 2023-
|
|
16619
|
-
* @
|
|
16461
|
+
* @author zk
|
|
16462
|
+
* @date 2023-07-30 05:07:11
|
|
16463
|
+
* @param {IData} data
|
|
16464
|
+
* @param {number} index
|
|
16465
|
+
* @memberof FormMDCtrlController
|
|
16620
16466
|
*/
|
|
16621
|
-
|
|
16622
|
-
|
|
16623
|
-
this.
|
|
16624
|
-
details.forEach((detail) => {
|
|
16625
|
-
if (detail.detailType === "FORMITEM") {
|
|
16626
|
-
const c = detail.c;
|
|
16627
|
-
values.push(c.validate());
|
|
16628
|
-
}
|
|
16629
|
-
});
|
|
16630
|
-
});
|
|
16631
|
-
const results = await Promise.all(values);
|
|
16632
|
-
return results.findIndex((value) => !value) === -1;
|
|
16467
|
+
onDataItemChange(data) {
|
|
16468
|
+
this.parent.state.contentCtrlData = data;
|
|
16469
|
+
this.parent.setFormDataValue();
|
|
16633
16470
|
}
|
|
16634
16471
|
};
|
|
16635
16472
|
|
|
@@ -16845,6 +16682,43 @@ var FormMDCtrlController = class extends FormDetailController {
|
|
|
16845
16682
|
}
|
|
16846
16683
|
};
|
|
16847
16684
|
|
|
16685
|
+
// src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.ts
|
|
16686
|
+
var FormMDCtrlItemController = class extends EditFormController {
|
|
16687
|
+
constructor(model, context, params, ctx, data) {
|
|
16688
|
+
super(model, context, params, ctx);
|
|
16689
|
+
this.state.data = data;
|
|
16690
|
+
this.state.isSimple = true;
|
|
16691
|
+
}
|
|
16692
|
+
async initDetailControllers(details = this.model.deformDetails, form = this, parent = void 0) {
|
|
16693
|
+
await Promise.all(
|
|
16694
|
+
details.map(async (detail) => {
|
|
16695
|
+
const detailProvider = await getFormDetailProvider(detail);
|
|
16696
|
+
if (!detailProvider) {
|
|
16697
|
+
return;
|
|
16698
|
+
}
|
|
16699
|
+
form.providers[detail.id] = detailProvider;
|
|
16700
|
+
const detailController = await detailProvider.createController(
|
|
16701
|
+
detail,
|
|
16702
|
+
form,
|
|
16703
|
+
parent
|
|
16704
|
+
);
|
|
16705
|
+
form.details[detail.id] = detailController;
|
|
16706
|
+
if (detail.detailType === "FORMITEM" || detail.detailType === "MDCTRL") {
|
|
16707
|
+
form.formItems.push(detailController);
|
|
16708
|
+
}
|
|
16709
|
+
const childDetails = findChildFormDetails(detail);
|
|
16710
|
+
if (childDetails.length) {
|
|
16711
|
+
await this.initDetailControllers(
|
|
16712
|
+
childDetails,
|
|
16713
|
+
form,
|
|
16714
|
+
detailController
|
|
16715
|
+
);
|
|
16716
|
+
}
|
|
16717
|
+
})
|
|
16718
|
+
);
|
|
16719
|
+
}
|
|
16720
|
+
};
|
|
16721
|
+
|
|
16848
16722
|
// src/controller/control/form/form-detail/form-page/form-page.state.ts
|
|
16849
16723
|
var FormPageState = class extends FormGroupPanelState {
|
|
16850
16724
|
};
|
|
@@ -16971,6 +16845,28 @@ var GridColumnController = class {
|
|
|
16971
16845
|
return item.id === this.model.id;
|
|
16972
16846
|
});
|
|
16973
16847
|
}
|
|
16848
|
+
/**
|
|
16849
|
+
* 值格式化
|
|
16850
|
+
* @author lxm
|
|
16851
|
+
* @date 2023-08-25 05:03:07
|
|
16852
|
+
* @readonly
|
|
16853
|
+
* @type {(string | undefined)}
|
|
16854
|
+
*/
|
|
16855
|
+
get valueFormat() {
|
|
16856
|
+
var _a;
|
|
16857
|
+
return (_a = this.deGridDataItem) == null ? void 0 : _a.format;
|
|
16858
|
+
}
|
|
16859
|
+
/**
|
|
16860
|
+
* 数据类型(数值)
|
|
16861
|
+
* @author lxm
|
|
16862
|
+
* @date 2023-08-25 05:03:07
|
|
16863
|
+
* @readonly
|
|
16864
|
+
* @type {(string | undefined)}
|
|
16865
|
+
*/
|
|
16866
|
+
get dataType() {
|
|
16867
|
+
var _a;
|
|
16868
|
+
return (_a = this.deGridDataItem) == null ? void 0 : _a.dataType;
|
|
16869
|
+
}
|
|
16974
16870
|
/**
|
|
16975
16871
|
* 子类不可覆盖或重写此方法,在 init 时需要重写的使用 onInit 方法。
|
|
16976
16872
|
*
|
|
@@ -17861,7 +17757,8 @@ var GridController = class extends MDControlController {
|
|
|
17861
17757
|
};
|
|
17862
17758
|
|
|
17863
17759
|
// src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
|
|
17864
|
-
import { ModelError as ModelError25 } from "@ibiz-template/core";
|
|
17760
|
+
import { DataTypes, ModelError as ModelError25 } from "@ibiz-template/core";
|
|
17761
|
+
import dayjs4 from "dayjs";
|
|
17865
17762
|
import { clone as clone14 } from "ramda";
|
|
17866
17763
|
var GridFieldColumnController = class extends GridColumnController {
|
|
17867
17764
|
constructor() {
|
|
@@ -18063,6 +17960,24 @@ var GridFieldColumnController = class extends GridColumnController {
|
|
|
18063
17960
|
}
|
|
18064
17961
|
return formatValue;
|
|
18065
17962
|
}
|
|
17963
|
+
/**
|
|
17964
|
+
* 值格式化
|
|
17965
|
+
* @author lxm
|
|
17966
|
+
* @date 2023-08-25 05:18:11
|
|
17967
|
+
* @param {unknown} value
|
|
17968
|
+
* @return {*} {string}
|
|
17969
|
+
*/
|
|
17970
|
+
formatValue(value = "") {
|
|
17971
|
+
const strVal = "".concat(value);
|
|
17972
|
+
if (!this.valueFormat) {
|
|
17973
|
+
return strVal;
|
|
17974
|
+
}
|
|
17975
|
+
const isDate = DataTypes.isDate(this.dataType);
|
|
17976
|
+
if (isDate) {
|
|
17977
|
+
return dayjs4(strVal).format(this.valueFormat);
|
|
17978
|
+
}
|
|
17979
|
+
return ibiz.util.text.format(strVal, this.valueFormat);
|
|
17980
|
+
}
|
|
18066
17981
|
};
|
|
18067
17982
|
|
|
18068
17983
|
// src/controller/control/grid/grid-column/grid-ua-column/grid-ua-column.controller.ts
|
|
@@ -18677,7 +18592,7 @@ var PanelController = class extends ControlController {
|
|
|
18677
18592
|
parent
|
|
18678
18593
|
);
|
|
18679
18594
|
panel.panelItems[panelItem.id] = panelItemController;
|
|
18680
|
-
if ((_a = panelItem.panelItems) == null ? void 0 : _a.length) {
|
|
18595
|
+
if (((_a = panelItem.panelItems) == null ? void 0 : _a.length) && !panelItemController.isDataContainer) {
|
|
18681
18596
|
await this.initPanelItemControllers(
|
|
18682
18597
|
panelItem.panelItems,
|
|
18683
18598
|
panel,
|
|
@@ -19019,7 +18934,7 @@ var PanelItemController = class {
|
|
|
19019
18934
|
const relatedNames = logic.relatedItemNames || [];
|
|
19020
18935
|
if (mustCalc || isOverlap3(relatedNames, names)) {
|
|
19021
18936
|
try {
|
|
19022
|
-
const ok = verifyPanelGroupLogic(this.
|
|
18937
|
+
const ok = verifyPanelGroupLogic(this.data, logic);
|
|
19023
18938
|
switch (logic.logicCat) {
|
|
19024
18939
|
case "ITEMBLANK":
|
|
19025
18940
|
this.state.required = !ok;
|
|
@@ -19180,6 +19095,7 @@ var SearchBarController = class extends ControlController {
|
|
|
19180
19095
|
initState() {
|
|
19181
19096
|
super.initState();
|
|
19182
19097
|
this.state.query = "";
|
|
19098
|
+
this.state.visible = !!(this.model.enableQuickSearch || this.model.enableGroup || this.model.enableFilter);
|
|
19183
19099
|
}
|
|
19184
19100
|
async onCreated() {
|
|
19185
19101
|
var _a;
|
|
@@ -19189,16 +19105,24 @@ var SearchBarController = class extends ControlController {
|
|
|
19189
19105
|
this.context.srfappid
|
|
19190
19106
|
);
|
|
19191
19107
|
if (appDataEntity) {
|
|
19192
|
-
const
|
|
19108
|
+
const searchFields = (_a = appDataEntity.appDEFields) == null ? void 0 : _a.filter((field) => {
|
|
19193
19109
|
return field.enableQuickSearch;
|
|
19194
19110
|
});
|
|
19195
|
-
|
|
19196
|
-
|
|
19197
|
-
|
|
19198
|
-
|
|
19199
|
-
|
|
19200
|
-
|
|
19201
|
-
|
|
19111
|
+
const placeHolders = [];
|
|
19112
|
+
searchFields == null ? void 0 : searchFields.forEach((searchField) => {
|
|
19113
|
+
if ((searchField == null ? void 0 : searchField.lnlanguageRes) && searchField.lnlanguageRes.lanResTag) {
|
|
19114
|
+
placeHolders.push(
|
|
19115
|
+
ibiz.i18n.t(
|
|
19116
|
+
searchField.lnlanguageRes.lanResTag,
|
|
19117
|
+
searchField.logicName
|
|
19118
|
+
)
|
|
19119
|
+
);
|
|
19120
|
+
} else if (searchField == null ? void 0 : searchField.logicName) {
|
|
19121
|
+
placeHolders.push(searchField.logicName);
|
|
19122
|
+
}
|
|
19123
|
+
});
|
|
19124
|
+
if (placeHolders.length > 0) {
|
|
19125
|
+
this.placeHolder = placeHolders.join("\u3001");
|
|
19202
19126
|
}
|
|
19203
19127
|
}
|
|
19204
19128
|
}
|
|
@@ -20209,6 +20133,216 @@ var WizardPanelController = class extends ControlController {
|
|
|
20209
20133
|
}
|
|
20210
20134
|
};
|
|
20211
20135
|
|
|
20136
|
+
// src/controller/control/md-ctrl/md-ctrl.service.ts
|
|
20137
|
+
var MDCtrlService = class extends MDControlService {
|
|
20138
|
+
/**
|
|
20139
|
+
* 初始化属性映射
|
|
20140
|
+
*
|
|
20141
|
+
* @author lxm
|
|
20142
|
+
* @date 2022-08-31 18:08:37
|
|
20143
|
+
*/
|
|
20144
|
+
initUIDataMap() {
|
|
20145
|
+
var _a;
|
|
20146
|
+
super.initUIDataMap();
|
|
20147
|
+
(_a = this.model.delistDataItems) == null ? void 0 : _a.forEach((item) => {
|
|
20148
|
+
const uiKey = item.id.toLowerCase();
|
|
20149
|
+
const deField = item.appDEFieldId;
|
|
20150
|
+
let mapField;
|
|
20151
|
+
if (deField) {
|
|
20152
|
+
const deFieldKey = deField.toLowerCase();
|
|
20153
|
+
mapField = new UIMapField(uiKey, deFieldKey, {
|
|
20154
|
+
isOriginField: true
|
|
20155
|
+
});
|
|
20156
|
+
} else {
|
|
20157
|
+
mapField = new UIMapField(uiKey, uiKey);
|
|
20158
|
+
}
|
|
20159
|
+
this.dataUIMap.set(uiKey, mapField);
|
|
20160
|
+
});
|
|
20161
|
+
}
|
|
20162
|
+
};
|
|
20163
|
+
|
|
20164
|
+
// src/controller/control/md-ctrl/md-ctrl-row.state.ts
|
|
20165
|
+
var MobMDCtrlRowState = class {
|
|
20166
|
+
/**
|
|
20167
|
+
* Creates an instance of MDCtrlRowState.
|
|
20168
|
+
*
|
|
20169
|
+
* @author chitanda
|
|
20170
|
+
* @date 2023-06-19 18:06:12
|
|
20171
|
+
* @param {ControlVO} data 行数据
|
|
20172
|
+
* @param {IMobMDCtrlController} controller 多数据部件控制器
|
|
20173
|
+
*/
|
|
20174
|
+
constructor(data, controller) {
|
|
20175
|
+
this.data = data;
|
|
20176
|
+
this.controller = controller;
|
|
20177
|
+
/**
|
|
20178
|
+
* 行为状态
|
|
20179
|
+
*
|
|
20180
|
+
* @author chitanda
|
|
20181
|
+
* @date 2023-06-19 18:06:27
|
|
20182
|
+
* @type {{ [p: string]: IButtonContainerState }}
|
|
20183
|
+
*/
|
|
20184
|
+
this.uaColStates = {};
|
|
20185
|
+
this.data = data;
|
|
20186
|
+
}
|
|
20187
|
+
};
|
|
20188
|
+
|
|
20189
|
+
// src/controller/control/md-ctrl/md-ctrl.controller.ts
|
|
20190
|
+
var MDCtrlController = class extends MDControlController {
|
|
20191
|
+
initState() {
|
|
20192
|
+
super.initState();
|
|
20193
|
+
this.state.rows = [];
|
|
20194
|
+
this.state.noSort = this.model.noSort === true;
|
|
20195
|
+
this.state.mdctrlActiveMode = 1;
|
|
20196
|
+
}
|
|
20197
|
+
async onCreated() {
|
|
20198
|
+
await super.onCreated();
|
|
20199
|
+
this.service = new MDCtrlService(this.model);
|
|
20200
|
+
await this.service.init(this.context);
|
|
20201
|
+
this.setSort();
|
|
20202
|
+
}
|
|
20203
|
+
/**
|
|
20204
|
+
* 设置排序
|
|
20205
|
+
*
|
|
20206
|
+
* @author lxm
|
|
20207
|
+
* @date 2022-09-28 13:09:44
|
|
20208
|
+
* @param {string} key 排序字段
|
|
20209
|
+
* @param {string} order 排序顺序
|
|
20210
|
+
*/
|
|
20211
|
+
setSort(key, order) {
|
|
20212
|
+
if (key && order) {
|
|
20213
|
+
super.setSort(key, order);
|
|
20214
|
+
} else {
|
|
20215
|
+
const { minorSortAppDEFieldId, minorSortDir } = this.model;
|
|
20216
|
+
if (minorSortAppDEFieldId && minorSortDir) {
|
|
20217
|
+
this.state.sortQuery = "".concat(minorSortAppDEFieldId.toLowerCase(), ",").concat(minorSortDir.toLowerCase());
|
|
20218
|
+
} else {
|
|
20219
|
+
this.state.sortQuery = "";
|
|
20220
|
+
}
|
|
20221
|
+
}
|
|
20222
|
+
}
|
|
20223
|
+
/**
|
|
20224
|
+
* 加载更多
|
|
20225
|
+
* @author lxm
|
|
20226
|
+
* @date 2023-05-22 07:33:59
|
|
20227
|
+
* @return {*} {Promise<void>}
|
|
20228
|
+
*/
|
|
20229
|
+
async loadMore() {
|
|
20230
|
+
if (this.state.total > this.state.items.length && !this.state.isLoading) {
|
|
20231
|
+
await this.load({ isLoadMore: true });
|
|
20232
|
+
}
|
|
20233
|
+
}
|
|
20234
|
+
/**
|
|
20235
|
+
* 列表多数据刷新 需重置分页
|
|
20236
|
+
*
|
|
20237
|
+
* @author zk
|
|
20238
|
+
* @date 2023-08-11 05:08:20
|
|
20239
|
+
* @return {*} {Promise<void>}
|
|
20240
|
+
* @memberof MDCtrlController
|
|
20241
|
+
*/
|
|
20242
|
+
async refresh() {
|
|
20243
|
+
await this.load({ isInitialLoad: true });
|
|
20244
|
+
}
|
|
20245
|
+
afterLoad(args, items) {
|
|
20246
|
+
if (args.isInitialLoad) {
|
|
20247
|
+
this.state.rows = [];
|
|
20248
|
+
}
|
|
20249
|
+
if (items && items.length > 0) {
|
|
20250
|
+
this.state.rows.push(
|
|
20251
|
+
...items.map((item) => {
|
|
20252
|
+
const row = new MobMDCtrlRowState(item, this);
|
|
20253
|
+
this.initActionStates(row);
|
|
20254
|
+
return row;
|
|
20255
|
+
})
|
|
20256
|
+
);
|
|
20257
|
+
}
|
|
20258
|
+
return super.afterLoad(args, items);
|
|
20259
|
+
}
|
|
20260
|
+
/**
|
|
20261
|
+
* 设置列表数据
|
|
20262
|
+
*
|
|
20263
|
+
* @author zk
|
|
20264
|
+
* @date 2023-05-26 02:05:46
|
|
20265
|
+
* @param {IData[]} items
|
|
20266
|
+
* @memberof ListController
|
|
20267
|
+
*/
|
|
20268
|
+
setData(items) {
|
|
20269
|
+
const rows = items.map((item) => {
|
|
20270
|
+
const row = new MobMDCtrlRowState(item, this);
|
|
20271
|
+
return row;
|
|
20272
|
+
});
|
|
20273
|
+
this.state.rows = rows;
|
|
20274
|
+
}
|
|
20275
|
+
/**
|
|
20276
|
+
* 获取列表数据
|
|
20277
|
+
*
|
|
20278
|
+
* @author zk
|
|
20279
|
+
* @date 2023-05-26 02:05:35
|
|
20280
|
+
* @return {*} {IData[]}
|
|
20281
|
+
* @memberof ListController
|
|
20282
|
+
*/
|
|
20283
|
+
getAllData() {
|
|
20284
|
+
return this.state.rows.map((row) => row.data);
|
|
20285
|
+
}
|
|
20286
|
+
/**
|
|
20287
|
+
* 界面行为组项点击
|
|
20288
|
+
*
|
|
20289
|
+
* @author chitanda
|
|
20290
|
+
* @date 2023-06-19 18:06:18
|
|
20291
|
+
* @param {IUIActionGroupDetail} detail
|
|
20292
|
+
* @param {MDCtrlRowState} row
|
|
20293
|
+
* @param {MouseEvent} event
|
|
20294
|
+
* @return {*} {Promise<void>}
|
|
20295
|
+
*/
|
|
20296
|
+
async onActionClick(detail, row, event) {
|
|
20297
|
+
const actionId = detail.uiactionId;
|
|
20298
|
+
await UIActionUtil.execAndResolved(actionId, {
|
|
20299
|
+
context: this.context,
|
|
20300
|
+
params: this.params,
|
|
20301
|
+
data: [row.data],
|
|
20302
|
+
view: this.view,
|
|
20303
|
+
event
|
|
20304
|
+
});
|
|
20305
|
+
}
|
|
20306
|
+
/**
|
|
20307
|
+
* 初始化按钮状态
|
|
20308
|
+
*
|
|
20309
|
+
* @author chitanda
|
|
20310
|
+
* @date 2023-06-21 16:06:55
|
|
20311
|
+
* @protected
|
|
20312
|
+
* @param {MobMDCtrlRowState} row
|
|
20313
|
+
*/
|
|
20314
|
+
initActionStates(row) {
|
|
20315
|
+
const { deuiactionGroup, deuiactionGroup2 } = this.model;
|
|
20316
|
+
if (deuiactionGroup) {
|
|
20317
|
+
this.initUIActionGroup(row, deuiactionGroup);
|
|
20318
|
+
}
|
|
20319
|
+
if (deuiactionGroup2) {
|
|
20320
|
+
this.initUIActionGroup(row, deuiactionGroup2);
|
|
20321
|
+
}
|
|
20322
|
+
}
|
|
20323
|
+
initUIActionGroup(row, group) {
|
|
20324
|
+
var _a;
|
|
20325
|
+
if (!((_a = group.uiactionGroupDetails) == null ? void 0 : _a.length)) {
|
|
20326
|
+
ibiz.log.debug("\u64CD\u4F5C\u5217\u754C\u9762\u884C\u4E3A\u7EC4\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A");
|
|
20327
|
+
}
|
|
20328
|
+
const containerState = new ButtonContainerState();
|
|
20329
|
+
const details = group.uiactionGroupDetails || [];
|
|
20330
|
+
details.forEach((detail) => {
|
|
20331
|
+
const actionid = detail.uiactionId;
|
|
20332
|
+
if (actionid) {
|
|
20333
|
+
const buttonState = new UIActionButtonState(
|
|
20334
|
+
detail.id,
|
|
20335
|
+
this.context.srfappid,
|
|
20336
|
+
actionid
|
|
20337
|
+
);
|
|
20338
|
+
containerState.addState(detail.id, buttonState);
|
|
20339
|
+
}
|
|
20340
|
+
});
|
|
20341
|
+
containerState.update(row.data.getOrigin());
|
|
20342
|
+
row.uaColStates[group.id] = containerState;
|
|
20343
|
+
}
|
|
20344
|
+
};
|
|
20345
|
+
|
|
20212
20346
|
// src/controller/hub.controller.ts
|
|
20213
20347
|
var HubController = class {
|
|
20214
20348
|
constructor() {
|
|
@@ -20920,7 +21054,9 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
20920
21054
|
event,
|
|
20921
21055
|
view: this.view
|
|
20922
21056
|
}));
|
|
20923
|
-
if (result
|
|
21057
|
+
if (result instanceof Object && result.ok) {
|
|
21058
|
+
this.refresh();
|
|
21059
|
+
} else if (result === -1) {
|
|
20924
21060
|
ibiz.log.warn("\u89C6\u56FE[".concat(this.view.model.codeName, "]\uFF0C\u672A\u914D\u7F6E\u7F16\u8F91\u6253\u5F00\u89C6\u56FE"));
|
|
20925
21061
|
}
|
|
20926
21062
|
}
|
|
@@ -20953,7 +21089,9 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
20953
21089
|
event,
|
|
20954
21090
|
view: this.view
|
|
20955
21091
|
}));
|
|
20956
|
-
if (result
|
|
21092
|
+
if (result instanceof Object && result.ok) {
|
|
21093
|
+
this.refresh();
|
|
21094
|
+
} else if (result === -1) {
|
|
20957
21095
|
throw new RuntimeModelError45(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
|
|
20958
21096
|
}
|
|
20959
21097
|
}
|
|
@@ -21045,7 +21183,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
21045
21183
|
}
|
|
21046
21184
|
calcViewHeaderVisible() {
|
|
21047
21185
|
let showHeader = super.calcViewHeaderVisible();
|
|
21048
|
-
if (!this.searchBar) {
|
|
21186
|
+
if (!this.searchBar || !this.searchBar.state.visible) {
|
|
21049
21187
|
const controller = this.viewLayoutPanel.panelItems.view_searchbar;
|
|
21050
21188
|
if (controller) {
|
|
21051
21189
|
controller.state.visible = false;
|
|
@@ -21752,7 +21890,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
21752
21890
|
if (notNilEmpty7(navParams)) {
|
|
21753
21891
|
tempParams = convertNavData(navParams, params, context, data[0]);
|
|
21754
21892
|
}
|
|
21755
|
-
|
|
21893
|
+
return ibiz.commands.execute(
|
|
21756
21894
|
OpenAppViewCommand.TAG,
|
|
21757
21895
|
openView,
|
|
21758
21896
|
tempContext,
|
|
@@ -21780,7 +21918,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
21780
21918
|
if (enableWizardAdd) {
|
|
21781
21919
|
newViewRef = await this.getWizardNewViewRef(appUILogic, parameters);
|
|
21782
21920
|
if (!newViewRef) {
|
|
21783
|
-
return;
|
|
21921
|
+
return { ok: false };
|
|
21784
21922
|
}
|
|
21785
21923
|
} else if (enableBatchAdd) {
|
|
21786
21924
|
throw new ModelError29(appUILogic, "enableBatchAdd\u6682\u672A\u652F\u6301");
|
|
@@ -21811,7 +21949,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
21811
21949
|
_data.srfkey = void 0;
|
|
21812
21950
|
tempParams = Object.assign(tempParams, _data.$origin);
|
|
21813
21951
|
}
|
|
21814
|
-
|
|
21952
|
+
return ibiz.commands.execute(
|
|
21815
21953
|
OpenAppViewCommand.TAG,
|
|
21816
21954
|
newViewRef.refAppViewId,
|
|
21817
21955
|
tempContext,
|
|
@@ -22163,8 +22301,11 @@ export {
|
|
|
22163
22301
|
LoadingState,
|
|
22164
22302
|
MDControlController,
|
|
22165
22303
|
MDControlService,
|
|
22304
|
+
MDCtrlController,
|
|
22305
|
+
MDCtrlService,
|
|
22166
22306
|
MDViewEngine,
|
|
22167
22307
|
MethodDto,
|
|
22308
|
+
MobMDCtrlRowState,
|
|
22168
22309
|
MobViewController,
|
|
22169
22310
|
Modal,
|
|
22170
22311
|
OpenAppViewCommand,
|