@ibiz-template/runtime 0.6.10 → 0.6.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 +302 -120
- package/dist/index.system.min.js +1 -1
- package/out/command/app/open-app-view/open-app-view.js +2 -2
- package/out/controller/common/base.controller.d.ts +1 -1
- package/out/controller/common/base.controller.d.ts.map +1 -1
- package/out/controller/common/control/control.controller.d.ts +1 -1
- package/out/controller/common/control/control.controller.d.ts.map +1 -1
- 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 +8 -2
- package/out/controller/control/grid/grid/grid-row.state.d.ts +2 -0
- package/out/controller/control/grid/grid/grid-row.state.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid-row.state.js +15 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts +46 -3
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +161 -102
- package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
- package/out/controller/control/kanban/kanban.controller.js +32 -1
- package/out/controller/control/search-bar/use-searchcond.d.ts.map +1 -1
- package/out/controller/control/search-bar/use-searchcond.js +4 -1
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts +1 -0
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts.map +1 -1
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.js +8 -1
- package/out/controller/control/toolbar/toolbar.controllerr.js +1 -1
- package/out/de-logic/de-logic-node/prepare-param-node/prepare-param-node.js +2 -2
- package/out/engine/md-view.engine.js +1 -1
- package/out/interface/controller/controller/control/i-control.controller.d.ts +8 -1
- package/out/interface/controller/controller/control/i-control.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-tab-exp-panel.controller.d.ts +6 -0
- package/out/interface/controller/controller/control/i-tab-exp-panel.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/panel-item/i-panel-item.controller.d.ts +7 -0
- package/out/interface/controller/controller/control/panel-item/i-panel-item.controller.d.ts.map +1 -1
- package/out/interface/controller/event/view/i-tab-search-view.event.d.ts +12 -0
- package/out/interface/controller/event/view/i-tab-search-view.event.d.ts.map +1 -0
- package/out/interface/controller/event/view/i-tab-search-view.event.js +1 -0
- package/out/interface/controller/event/view/index.d.ts +1 -0
- package/out/interface/controller/event/view/index.d.ts.map +1 -1
- package/out/interface/controller/event/view/index.js +1 -0
- package/out/interface/controller/state/control/i-drbar.state.d.ts +14 -0
- package/out/interface/controller/state/control/i-drbar.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-grid.state.d.ts +14 -0
- package/out/interface/controller/state/control/i-grid.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-kanban.state.d.ts +11 -0
- package/out/interface/controller/state/control/i-kanban.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-tab-exp-panel.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-tab-exp-panel.state.d.ts.map +1 -1
- package/out/interface/controller/state/view/i-tab-search-view.state.d.ts +20 -0
- package/out/interface/controller/state/view/i-tab-search-view.state.d.ts.map +1 -0
- package/out/interface/controller/state/view/i-tab-search-view.state.js +1 -0
- package/out/interface/controller/state/view/index.d.ts +1 -0
- package/out/interface/controller/state/view/index.d.ts.map +1 -1
- package/out/interface/controller/state/view/index.js +1 -0
- package/out/interface/util/i-message-util/i-message-util.d.ts +51 -0
- package/out/interface/util/i-message-util/i-message-util.d.ts.map +1 -1
- package/out/interface/util/index.d.ts +1 -1
- package/out/interface/util/index.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.d.ts +10 -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 +43 -1
- package/out/ui-action/provider/loginout-ui-action-provider.js +2 -2
- package/out/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.js +2 -2
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -10562,7 +10562,7 @@ var PrepareParamNode = class extends DELogicNode {
|
|
|
10562
10562
|
nodeParams.map((nodeParam) => {
|
|
10563
10563
|
let result;
|
|
10564
10564
|
let originValue;
|
|
10565
|
-
if (nodeParam.dstDELogicParamId) {
|
|
10565
|
+
if (nodeParam.dstDELogicParamId && ibiz.env.logLevel === "DEBUG") {
|
|
10566
10566
|
originValue = clone10(ctx.params[nodeParam.dstDELogicParamId]);
|
|
10567
10567
|
}
|
|
10568
10568
|
switch (nodeParam.paramAction) {
|
|
@@ -13098,8 +13098,8 @@ var _OpenAppViewCommand = class _OpenAppViewCommand {
|
|
|
13098
13098
|
*/
|
|
13099
13099
|
async exec(appViewId, _context, params = {}, opts = {}) {
|
|
13100
13100
|
const context = clone17(_context);
|
|
13101
|
-
if (context.srfsimple
|
|
13102
|
-
context.srfsimple
|
|
13101
|
+
if (context.srfsimple) {
|
|
13102
|
+
delete context.srfsimple;
|
|
13103
13103
|
}
|
|
13104
13104
|
const appView = await ibiz.hub.config.view.get(appViewId);
|
|
13105
13105
|
if (!appView) {
|
|
@@ -18975,7 +18975,7 @@ var PrepareJSParamNode = class extends UILogicNode {
|
|
|
18975
18975
|
}
|
|
18976
18976
|
for (const nodeParam of nodeParams) {
|
|
18977
18977
|
let originValue;
|
|
18978
|
-
if (nodeParam.dstDEUILogicParamId) {
|
|
18978
|
+
if (nodeParam.dstDEUILogicParamId && ibiz.env.logLevel === "DEBUG") {
|
|
18979
18979
|
originValue = clone22(ctx.params[nodeParam.dstDEUILogicParamId]);
|
|
18980
18980
|
}
|
|
18981
18981
|
switch (nodeParam.paramAction) {
|
|
@@ -20365,6 +20365,7 @@ import {
|
|
|
20365
20365
|
ModelError as ModelError26,
|
|
20366
20366
|
RuntimeError as RuntimeError48
|
|
20367
20367
|
} from "@ibiz-template/core";
|
|
20368
|
+
import { mergeRight as mergeRight3 } from "ramda";
|
|
20368
20369
|
var FrontUIActionProvider = class extends UIActionProviderBase {
|
|
20369
20370
|
async execAction(action, args) {
|
|
20370
20371
|
const { context, params, data, event, noWaitRoute } = args;
|
|
@@ -20417,6 +20418,9 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
|
|
|
20417
20418
|
case "OTHER":
|
|
20418
20419
|
actionResult = this.doOther(action, args);
|
|
20419
20420
|
break;
|
|
20421
|
+
case "EDITFORM":
|
|
20422
|
+
actionResult = await this.openEditForm(action, args);
|
|
20423
|
+
break;
|
|
20420
20424
|
default:
|
|
20421
20425
|
throw new ModelError26(
|
|
20422
20426
|
action,
|
|
@@ -20434,7 +20438,6 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
|
|
|
20434
20438
|
* @param {IUILogicParams} args
|
|
20435
20439
|
* @return {*}
|
|
20436
20440
|
*/
|
|
20437
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20438
20441
|
doOther(action, args) {
|
|
20439
20442
|
const { scriptCode } = action;
|
|
20440
20443
|
const { context, params, data, event, view } = args;
|
|
@@ -20612,6 +20615,55 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
|
|
|
20612
20615
|
throw new RuntimeError48("\u6CA1\u6709\u627E\u5230\u5B9E\u4F53\u5BFC\u51FA\u9879");
|
|
20613
20616
|
}
|
|
20614
20617
|
}
|
|
20618
|
+
/**
|
|
20619
|
+
* 打开编辑表单
|
|
20620
|
+
* @author lxm
|
|
20621
|
+
* @date 2024-03-21 03:54:01
|
|
20622
|
+
* @protected
|
|
20623
|
+
* @param {IAppDEUIAction} action
|
|
20624
|
+
* @param {IUILogicParams} args
|
|
20625
|
+
* @return {*} {IUIActionResult}
|
|
20626
|
+
*/
|
|
20627
|
+
async openEditForm(action, args) {
|
|
20628
|
+
console.log(action.deeditForm, args);
|
|
20629
|
+
const actionResult = {};
|
|
20630
|
+
const { context, params, data, event } = args;
|
|
20631
|
+
if (!event) {
|
|
20632
|
+
throw new RuntimeError48("\u7F3A\u5C11\u539F\u751FJS\u4E8B\u4EF6\u5BF9\u8C61");
|
|
20633
|
+
}
|
|
20634
|
+
const { resultContext, resultParams } = await this.handleParams(
|
|
20635
|
+
action,
|
|
20636
|
+
context,
|
|
20637
|
+
data,
|
|
20638
|
+
params
|
|
20639
|
+
);
|
|
20640
|
+
const options = this.handleViewOptionParams(resultParams).modalOption || {};
|
|
20641
|
+
const popoverOpts = mergeRight3(
|
|
20642
|
+
{
|
|
20643
|
+
autoClose: true
|
|
20644
|
+
},
|
|
20645
|
+
options
|
|
20646
|
+
);
|
|
20647
|
+
let hasSave = false;
|
|
20648
|
+
await ibiz.overlay.popover(
|
|
20649
|
+
event.target,
|
|
20650
|
+
"IBizControlShell",
|
|
20651
|
+
{
|
|
20652
|
+
context: resultContext,
|
|
20653
|
+
params: resultParams,
|
|
20654
|
+
modelData: action.deeditForm,
|
|
20655
|
+
onSaveSuccess: () => {
|
|
20656
|
+
console.log("\u4FDD\u5B58\u6210\u529F");
|
|
20657
|
+
hasSave = true;
|
|
20658
|
+
}
|
|
20659
|
+
},
|
|
20660
|
+
popoverOpts
|
|
20661
|
+
);
|
|
20662
|
+
if (!hasSave) {
|
|
20663
|
+
actionResult.cancel = true;
|
|
20664
|
+
}
|
|
20665
|
+
return actionResult;
|
|
20666
|
+
}
|
|
20615
20667
|
};
|
|
20616
20668
|
|
|
20617
20669
|
// src/ui-action/provider/wf-withdraw-ui-action-provider.ts
|
|
@@ -20638,8 +20690,8 @@ var WFWithdrawUIActionProvider = class extends UIActionProviderBase {
|
|
|
20638
20690
|
var LoginOutUIActionProvider = class extends UIActionProviderBase {
|
|
20639
20691
|
async execAction(_action, _params) {
|
|
20640
20692
|
const confirm = await ibiz.confirm.info({
|
|
20641
|
-
title: "\
|
|
20642
|
-
desc: "\u60A8\u786E\u5B9A\u8981\u9000\u51FA\u767B\u5F55\u5417\uFF1F
|
|
20693
|
+
title: "\u9000\u51FA\u767B\u5F55",
|
|
20694
|
+
desc: "\u60A8\u786E\u5B9A\u8981\u9000\u51FA\u767B\u5F55\u5417\uFF1F"
|
|
20643
20695
|
});
|
|
20644
20696
|
if (confirm) {
|
|
20645
20697
|
const bol = await ibiz.hub.controller.logout();
|
|
@@ -20729,7 +20781,7 @@ var ToolbarController = class extends ControlController {
|
|
|
20729
20781
|
recursiveIterate2(
|
|
20730
20782
|
this.model,
|
|
20731
20783
|
(item) => {
|
|
20732
|
-
if (item.itemType
|
|
20784
|
+
if (item.itemType) {
|
|
20733
20785
|
const uiItem = item;
|
|
20734
20786
|
const buttonState = new UIActionButtonState(
|
|
20735
20787
|
uiItem.id,
|
|
@@ -25006,6 +25058,8 @@ var FormTabPanelController = class extends FormDetailController {
|
|
|
25006
25058
|
// src/controller/control/form/edit-form/edit-form.controller.ts
|
|
25007
25059
|
import {
|
|
25008
25060
|
awaitTimeout,
|
|
25061
|
+
IBizContext as IBizContext4,
|
|
25062
|
+
isElementSame as isElementSame2,
|
|
25009
25063
|
mergeInLeft as mergeInLeft2,
|
|
25010
25064
|
RuntimeError as RuntimeError54
|
|
25011
25065
|
} from "@ibiz-template/core";
|
|
@@ -25722,6 +25776,7 @@ var EditFormController = class extends FormController {
|
|
|
25722
25776
|
switch (autoSaveMode) {
|
|
25723
25777
|
case 3:
|
|
25724
25778
|
saveParam.data = this.getDiffData();
|
|
25779
|
+
saveParam.context = IBizContext4.create({ srfsimple: true });
|
|
25725
25780
|
break;
|
|
25726
25781
|
default:
|
|
25727
25782
|
}
|
|
@@ -25744,7 +25799,11 @@ var EditFormController = class extends FormController {
|
|
|
25744
25799
|
const { data } = this.state;
|
|
25745
25800
|
const diffData = {};
|
|
25746
25801
|
Object.keys(data).forEach((key) => {
|
|
25747
|
-
if (data[key]
|
|
25802
|
+
if (Array.isArray(data[key])) {
|
|
25803
|
+
if (!isElementSame2(data[key], this.oldData[key])) {
|
|
25804
|
+
diffData[key] = data[key];
|
|
25805
|
+
}
|
|
25806
|
+
} else if (data[key] !== this.oldData[key] || key === data.srfkeyfield) {
|
|
25748
25807
|
diffData[key] = data[key];
|
|
25749
25808
|
}
|
|
25750
25809
|
});
|
|
@@ -25976,6 +26035,7 @@ var GridRowState = class {
|
|
|
25976
26035
|
*/
|
|
25977
26036
|
this.processing = false;
|
|
25978
26037
|
this.data = data;
|
|
26038
|
+
this.oldData = data.clone();
|
|
25979
26039
|
Object.keys(this.data).forEach((key) => {
|
|
25980
26040
|
if (this.errors[key] === void 0) {
|
|
25981
26041
|
this.errors[key] = null;
|
|
@@ -25996,6 +26056,17 @@ var GridRowState = class {
|
|
|
25996
26056
|
};
|
|
25997
26057
|
});
|
|
25998
26058
|
}
|
|
26059
|
+
getDiffData() {
|
|
26060
|
+
const diffData = {};
|
|
26061
|
+
Object.keys(this.data).forEach((key) => {
|
|
26062
|
+
if (this.data[key] !== this.oldData[key] || key === this.data.srfkeyfield) {
|
|
26063
|
+
diffData[key] = this.data[key];
|
|
26064
|
+
}
|
|
26065
|
+
});
|
|
26066
|
+
diffData.srfuf = this.data.srfuf;
|
|
26067
|
+
diffData.srfkey = this.data.srfkey;
|
|
26068
|
+
return new ControlVO(diffData, this.oldData.$dataUIMap);
|
|
26069
|
+
}
|
|
25999
26070
|
};
|
|
26000
26071
|
|
|
26001
26072
|
// src/controller/control/grid/grid/grid.controller.ts
|
|
@@ -26008,6 +26079,7 @@ import {
|
|
|
26008
26079
|
RuntimeModelError as RuntimeModelError62
|
|
26009
26080
|
} from "@ibiz-template/core";
|
|
26010
26081
|
import { clone as clone27 } from "ramda";
|
|
26082
|
+
import dayjs5 from "dayjs";
|
|
26011
26083
|
|
|
26012
26084
|
// src/controller/control/grid/grid/grid.service.ts
|
|
26013
26085
|
import { RuntimeModelError as RuntimeModelError61 } from "@ibiz-template/core";
|
|
@@ -26219,6 +26291,44 @@ var GridController = class extends MDControlController {
|
|
|
26219
26291
|
* @type {string}
|
|
26220
26292
|
*/
|
|
26221
26293
|
this.aggTitle = "\u5408\u8BA1";
|
|
26294
|
+
/**
|
|
26295
|
+
* 数据导出参数
|
|
26296
|
+
* @author zzq
|
|
26297
|
+
* @date 2024-03-20 16:11:00
|
|
26298
|
+
* @type {IData}
|
|
26299
|
+
*/
|
|
26300
|
+
this.dataExportParam = {};
|
|
26301
|
+
/**
|
|
26302
|
+
* 数据导出列
|
|
26303
|
+
* @author lxm
|
|
26304
|
+
* @date 2023-08-07 04:11:00
|
|
26305
|
+
* @type {IDEDataExport}
|
|
26306
|
+
*/
|
|
26307
|
+
this.allExportColumns = [];
|
|
26308
|
+
/**
|
|
26309
|
+
* 数据导出代码表
|
|
26310
|
+
* @author zzq
|
|
26311
|
+
* @date 2024-03-20 16:11:00
|
|
26312
|
+
* @type {Map<string, readonly CodeListItem[]>}
|
|
26313
|
+
*/
|
|
26314
|
+
this.allExportCodelistMap = /* @__PURE__ */ new Map();
|
|
26315
|
+
/**
|
|
26316
|
+
* 值格式化
|
|
26317
|
+
* @return {string}
|
|
26318
|
+
* @author: zzq
|
|
26319
|
+
* @Date: 2024-03-20 17:54:16
|
|
26320
|
+
*/
|
|
26321
|
+
this.formatValue = (valueFormat, value = "") => {
|
|
26322
|
+
const strVal = "".concat(value);
|
|
26323
|
+
if (!valueFormat) {
|
|
26324
|
+
return strVal;
|
|
26325
|
+
}
|
|
26326
|
+
if (dayjs5(strVal, valueFormat, true).isValid()) {
|
|
26327
|
+
const formatVal = dayjs5(strVal).format(valueFormat);
|
|
26328
|
+
return formatVal;
|
|
26329
|
+
}
|
|
26330
|
+
return ibiz.util.text.format(strVal, valueFormat);
|
|
26331
|
+
};
|
|
26222
26332
|
}
|
|
26223
26333
|
get _evt() {
|
|
26224
26334
|
return this.evt;
|
|
@@ -26296,6 +26406,7 @@ var GridController = class extends MDControlController {
|
|
|
26296
26406
|
200
|
|
26297
26407
|
);
|
|
26298
26408
|
await this.initGroup();
|
|
26409
|
+
await this.initExportData();
|
|
26299
26410
|
}
|
|
26300
26411
|
/**
|
|
26301
26412
|
* 根据jsonschema初始化自定义表格列
|
|
@@ -26332,6 +26443,52 @@ var GridController = class extends MDControlController {
|
|
|
26332
26443
|
];
|
|
26333
26444
|
}
|
|
26334
26445
|
}
|
|
26446
|
+
/**
|
|
26447
|
+
* 初始化数据导出对象
|
|
26448
|
+
* @author zzq
|
|
26449
|
+
* @date 2024-03-20 16:10:17
|
|
26450
|
+
* @protected
|
|
26451
|
+
* @return {*} {Promise<void>}
|
|
26452
|
+
*/
|
|
26453
|
+
async initExportData() {
|
|
26454
|
+
var _a;
|
|
26455
|
+
if (this.model.dedataExportId) {
|
|
26456
|
+
this.dataExport = (_a = this.dataEntity.appDEDataExports) == null ? void 0 : _a.find((dataExport) => {
|
|
26457
|
+
return dataExport.id === this.model.dedataExportId;
|
|
26458
|
+
});
|
|
26459
|
+
if (this.dataExport) {
|
|
26460
|
+
this.allExportColumns = await this.findAllExportColumns(
|
|
26461
|
+
this.dataExport
|
|
26462
|
+
);
|
|
26463
|
+
}
|
|
26464
|
+
}
|
|
26465
|
+
if (this.allExportColumns.length > 0) {
|
|
26466
|
+
this.allExportColumns.forEach((exportColumn) => {
|
|
26467
|
+
if (exportColumn.codeListItems) {
|
|
26468
|
+
this.allExportCodelistMap.set(
|
|
26469
|
+
exportColumn.appDEFieldId,
|
|
26470
|
+
exportColumn.codeListItems
|
|
26471
|
+
);
|
|
26472
|
+
}
|
|
26473
|
+
});
|
|
26474
|
+
this.dataExportParam.fields = this.allExportColumns.map(
|
|
26475
|
+
(x) => x.appDEFieldId
|
|
26476
|
+
);
|
|
26477
|
+
this.dataExportParam.header = this.allExportColumns.map((x) => x.caption);
|
|
26478
|
+
} else {
|
|
26479
|
+
Object.keys(this.fieldColumns).forEach((key) => {
|
|
26480
|
+
if (this.fieldColumns[key].codeList) {
|
|
26481
|
+
this.allExportCodelistMap.set(
|
|
26482
|
+
key,
|
|
26483
|
+
this.fieldColumns[key].codeListItems
|
|
26484
|
+
);
|
|
26485
|
+
}
|
|
26486
|
+
});
|
|
26487
|
+
const { degridColumns = [] } = this.model;
|
|
26488
|
+
this.dataExportParam.fields = degridColumns.map((item) => item.id);
|
|
26489
|
+
this.dataExportParam.header = degridColumns.map((item) => item.caption);
|
|
26490
|
+
}
|
|
26491
|
+
}
|
|
26335
26492
|
/**
|
|
26336
26493
|
* 初始化表格分组
|
|
26337
26494
|
* @author lxm
|
|
@@ -26600,6 +26757,9 @@ var GridController = class extends MDControlController {
|
|
|
26600
26757
|
if (!isValid) {
|
|
26601
26758
|
throw new RuntimeError55("\u884C\u6570\u636E\u6821\u9A8C\u4E0D\u901A\u8FC7\uFF0C\u4FDD\u5B58\u53D6\u6D88");
|
|
26602
26759
|
}
|
|
26760
|
+
if (this.model.enableRowEditChangedOnly) {
|
|
26761
|
+
data = rowState.getDiffData();
|
|
26762
|
+
}
|
|
26603
26763
|
let res;
|
|
26604
26764
|
const deName = calcDeCodeNameById(this.model.appDataEntityId);
|
|
26605
26765
|
const tempContext = this.context.clone();
|
|
@@ -26617,6 +26777,7 @@ var GridController = class extends MDControlController {
|
|
|
26617
26777
|
const index = this.findRowStateIndex(data);
|
|
26618
26778
|
this.state.items.splice(index, 1, res.data);
|
|
26619
26779
|
rowState.data = res.data;
|
|
26780
|
+
rowState.oldData = res.data.clone();
|
|
26620
26781
|
rowState.modified = false;
|
|
26621
26782
|
this.gridStateNotify(rowState, "SAVE" /* SAVE */);
|
|
26622
26783
|
await this._evt.emit("onSaveSuccess", void 0);
|
|
@@ -26981,7 +27142,72 @@ var GridController = class extends MDControlController {
|
|
|
26981
27142
|
if (exportColumnsPromises) {
|
|
26982
27143
|
return Promise.all(exportColumnsPromises);
|
|
26983
27144
|
}
|
|
26984
|
-
return
|
|
27145
|
+
return [];
|
|
27146
|
+
}
|
|
27147
|
+
/**
|
|
27148
|
+
* 格式化导出数据
|
|
27149
|
+
* @return {string}
|
|
27150
|
+
* @author: zzq
|
|
27151
|
+
* @Date: 2024-03-20 17:54:16
|
|
27152
|
+
*/
|
|
27153
|
+
formatExcelData(data) {
|
|
27154
|
+
const { fields = [] } = this.dataExportParam;
|
|
27155
|
+
const cloneData = clone27(
|
|
27156
|
+
data.map((item) => {
|
|
27157
|
+
return fields.reduce((obj, key) => {
|
|
27158
|
+
obj[key] = item[key];
|
|
27159
|
+
return obj;
|
|
27160
|
+
}, {});
|
|
27161
|
+
})
|
|
27162
|
+
);
|
|
27163
|
+
cloneData.forEach((item) => {
|
|
27164
|
+
Object.keys(item).forEach((key) => {
|
|
27165
|
+
var _a;
|
|
27166
|
+
let value = item[key];
|
|
27167
|
+
const exportColumn = this.allExportColumns.find(
|
|
27168
|
+
(c) => c.appDEFieldId === key
|
|
27169
|
+
);
|
|
27170
|
+
const fieldColumnC = this.fieldColumns[key];
|
|
27171
|
+
const format = (exportColumn == null ? void 0 : exportColumn.format) || (fieldColumnC == null ? void 0 : fieldColumnC.valueFormat);
|
|
27172
|
+
const unitName = (fieldColumnC == null ? void 0 : fieldColumnC.model.unitName) || "";
|
|
27173
|
+
if (this.allExportCodelistMap.get(key)) {
|
|
27174
|
+
value = ((_a = this.allExportCodelistMap.get(key).find((x) => x.value === item[key])) == null ? void 0 : _a.text) || value;
|
|
27175
|
+
} else {
|
|
27176
|
+
value = this.formatValue(format, value) + unitName;
|
|
27177
|
+
}
|
|
27178
|
+
item[key] = value;
|
|
27179
|
+
});
|
|
27180
|
+
});
|
|
27181
|
+
return cloneData;
|
|
27182
|
+
}
|
|
27183
|
+
/**
|
|
27184
|
+
* 获取导出数据
|
|
27185
|
+
* @return {Promise<IData[]>}
|
|
27186
|
+
* @author: zzq
|
|
27187
|
+
* @Date: 2024-03-20 17:54:16
|
|
27188
|
+
*/
|
|
27189
|
+
async getExportData(params) {
|
|
27190
|
+
var _a;
|
|
27191
|
+
const { type } = params;
|
|
27192
|
+
let data = [];
|
|
27193
|
+
if (!type || type === "activatedPage") {
|
|
27194
|
+
data = this.state.rows.map((row) => row.data);
|
|
27195
|
+
} else if (type === "maxRowCount" || type === "customPage") {
|
|
27196
|
+
const { size } = this.state;
|
|
27197
|
+
const { startPage, endPage } = params;
|
|
27198
|
+
const viewParam = type === "customPage" ? {
|
|
27199
|
+
page: 0,
|
|
27200
|
+
offset: (startPage - 1) * size,
|
|
27201
|
+
size: (endPage - startPage + 1) * size
|
|
27202
|
+
} : { size: ((_a = this.dataExport) == null ? void 0 : _a.maxRowCount) || 1e3, page: 0 };
|
|
27203
|
+
data = await this.loadData({ viewParam });
|
|
27204
|
+
} else if (type === "selectedRows") {
|
|
27205
|
+
data = this.getData();
|
|
27206
|
+
}
|
|
27207
|
+
if (data.length === 0) {
|
|
27208
|
+
throw new RuntimeError55("\u65E0\u5BFC\u51FA\u6570\u636E");
|
|
27209
|
+
}
|
|
27210
|
+
return data;
|
|
26985
27211
|
}
|
|
26986
27212
|
/**
|
|
26987
27213
|
* 数据导出
|
|
@@ -26990,104 +27216,15 @@ var GridController = class extends MDControlController {
|
|
|
26990
27216
|
* @returns {*} {Promise<void>}
|
|
26991
27217
|
* @memberof MDControlController
|
|
26992
27218
|
*/
|
|
26993
|
-
async exportData(
|
|
26994
|
-
|
|
26995
|
-
if (
|
|
26996
|
-
|
|
26997
|
-
return dataExport.id === this.model.dedataExportId;
|
|
26998
|
-
});
|
|
26999
|
-
if (this.dataExport) {
|
|
27000
|
-
this.allExportColumns = await this.findAllExportColumns(
|
|
27001
|
-
this.dataExport
|
|
27002
|
-
);
|
|
27003
|
-
}
|
|
27004
|
-
}
|
|
27005
|
-
const formatExcelData = (data2) => {
|
|
27006
|
-
var _a2;
|
|
27007
|
-
const codeListMap = /* @__PURE__ */ new Map();
|
|
27008
|
-
if (this.allExportColumns && this.allExportColumns.length > 0) {
|
|
27009
|
-
(_a2 = this.allExportColumns) == null ? void 0 : _a2.forEach((exportColumn) => {
|
|
27010
|
-
if (exportColumn.codeListItems) {
|
|
27011
|
-
codeListMap.set(
|
|
27012
|
-
exportColumn.appDEFieldId,
|
|
27013
|
-
exportColumn.codeListItems
|
|
27014
|
-
);
|
|
27015
|
-
}
|
|
27016
|
-
});
|
|
27017
|
-
} else {
|
|
27018
|
-
Object.keys(this.fieldColumns).forEach((key) => {
|
|
27019
|
-
if (this.fieldColumns[key].codeList) {
|
|
27020
|
-
codeListMap.set(key, this.fieldColumns[key].codeListItems);
|
|
27021
|
-
}
|
|
27022
|
-
});
|
|
27023
|
-
}
|
|
27024
|
-
const cloneData = clone27(
|
|
27025
|
-
data2.map((item) => {
|
|
27026
|
-
return item.getOrigin();
|
|
27027
|
-
})
|
|
27028
|
-
);
|
|
27029
|
-
cloneData.forEach((item) => {
|
|
27030
|
-
const fields = Object.keys(item);
|
|
27031
|
-
fields.forEach((key) => {
|
|
27032
|
-
var _a3;
|
|
27033
|
-
if (codeListMap.get(key)) {
|
|
27034
|
-
item[key] = ((_a3 = codeListMap.get(key).find((_item) => {
|
|
27035
|
-
return _item.value === item[key];
|
|
27036
|
-
})) == null ? void 0 : _a3.text) || item[key];
|
|
27037
|
-
}
|
|
27038
|
-
});
|
|
27039
|
-
});
|
|
27040
|
-
return cloneData;
|
|
27041
|
-
};
|
|
27042
|
-
const getExportData = async () => {
|
|
27043
|
-
var _a2;
|
|
27044
|
-
const type = (_a2 = _args.params) == null ? void 0 : _a2.type;
|
|
27045
|
-
let data2 = [];
|
|
27046
|
-
if (!type || type === "activatedPage") {
|
|
27047
|
-
data2 = this.state.rows.map((row) => row.data);
|
|
27048
|
-
} else if (type === "maxRowCount" || type === "customPage") {
|
|
27049
|
-
const { size } = this.state;
|
|
27050
|
-
const { startPage, endPage } = _args.params;
|
|
27051
|
-
const params = type === "customPage" ? {
|
|
27052
|
-
page: 0,
|
|
27053
|
-
offset: (startPage - 1) * size,
|
|
27054
|
-
size: (endPage - startPage + 1) * size
|
|
27055
|
-
} : { size: 1e3, page: 0 };
|
|
27056
|
-
data2 = await this.loadData({ viewParam: params });
|
|
27057
|
-
} else if (type === "selectedRows") {
|
|
27058
|
-
data2 = this.getData();
|
|
27059
|
-
}
|
|
27060
|
-
if (data2.length === 0) {
|
|
27061
|
-
throw new RuntimeError55("\u65E0\u5BFC\u51FA\u6570\u636E");
|
|
27062
|
-
}
|
|
27063
|
-
return formatExcelData(data2);
|
|
27064
|
-
};
|
|
27065
|
-
const formatArrayData = (filterVal2, tableData) => {
|
|
27066
|
-
return tableData.map((v) => {
|
|
27067
|
-
return filterVal2.map((j) => {
|
|
27068
|
-
return v[j];
|
|
27069
|
-
});
|
|
27070
|
-
});
|
|
27071
|
-
};
|
|
27072
|
-
let filterVal = [];
|
|
27073
|
-
let header = [];
|
|
27074
|
-
if (this.allExportColumns && this.allExportColumns.length > 0) {
|
|
27075
|
-
filterVal = this.allExportColumns.map(
|
|
27076
|
-
(column) => column.appDEFieldId
|
|
27077
|
-
);
|
|
27078
|
-
header = this.allExportColumns.map(
|
|
27079
|
-
(column) => column.caption
|
|
27080
|
-
);
|
|
27081
|
-
} else {
|
|
27082
|
-
const { degridColumns } = this.model;
|
|
27083
|
-
if (!degridColumns) {
|
|
27084
|
-
throw new RuntimeError55("\u65E0\u8868\u683C\u5217");
|
|
27085
|
-
}
|
|
27086
|
-
filterVal = degridColumns.map((item) => item.id);
|
|
27087
|
-
header = degridColumns.map((item) => item.caption);
|
|
27219
|
+
async exportData(args) {
|
|
27220
|
+
const { header } = this.dataExportParam;
|
|
27221
|
+
if (!header) {
|
|
27222
|
+
throw new RuntimeError55("\u65E0\u8868\u683C\u5217");
|
|
27088
27223
|
}
|
|
27089
|
-
const data =
|
|
27090
|
-
|
|
27224
|
+
const data = await this.getExportData(args.params);
|
|
27225
|
+
const formatData = this.formatExcelData(data);
|
|
27226
|
+
const table = formatData.map((v) => Object.values(v));
|
|
27227
|
+
await exportData(header, table, this.model.logicName);
|
|
27091
27228
|
}
|
|
27092
27229
|
/**
|
|
27093
27230
|
* 计算默认值并返回一个对象,对象里的属性就是要填充的默认值
|
|
@@ -27259,7 +27396,7 @@ var GridController = class extends MDControlController {
|
|
|
27259
27396
|
|
|
27260
27397
|
// src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
|
|
27261
27398
|
import { DataTypes as DataTypes4, ModelError as ModelError29, plus as plus2 } from "@ibiz-template/core";
|
|
27262
|
-
import
|
|
27399
|
+
import dayjs6 from "dayjs";
|
|
27263
27400
|
import { debounce as debounce3 } from "lodash-es";
|
|
27264
27401
|
import { clone as clone28, isNil as isNil26 } from "ramda";
|
|
27265
27402
|
var GridFieldColumnController = class extends GridColumnController {
|
|
@@ -27534,7 +27671,7 @@ var GridFieldColumnController = class extends GridColumnController {
|
|
|
27534
27671
|
}
|
|
27535
27672
|
const isDate = DataTypes4.isDate(this.dataType);
|
|
27536
27673
|
if (isDate) {
|
|
27537
|
-
const formatVal =
|
|
27674
|
+
const formatVal = dayjs6(strVal).format(this.valueFormat);
|
|
27538
27675
|
if (formatVal !== "Invalid Date") {
|
|
27539
27676
|
return formatVal;
|
|
27540
27677
|
}
|
|
@@ -29238,6 +29375,7 @@ async function calcFilterModelBySchema(json, appDataEntityId, modelAppId) {
|
|
|
29238
29375
|
// src/controller/control/search-bar/use-searchcond.ts
|
|
29239
29376
|
import { RuntimeError as RuntimeError58, recursiveIterate as recursiveIterate9 } from "@ibiz-template/core";
|
|
29240
29377
|
import { isNil as isNil27 } from "ramda";
|
|
29378
|
+
var ExcludeOPs2 = ["ISNULL" /* IS_NULL */, "ISNOTNULL" /* IS_NOT_NULL */];
|
|
29241
29379
|
function getOriginFilterNodes() {
|
|
29242
29380
|
return [
|
|
29243
29381
|
{
|
|
@@ -29313,7 +29451,7 @@ function calcSearchConds(filterNodes) {
|
|
|
29313
29451
|
let hasError = false;
|
|
29314
29452
|
recursiveIterate9(filterNodes[0], (node) => {
|
|
29315
29453
|
if (node.leaf) {
|
|
29316
|
-
if (node.field && node.valueOP && !isNil27(node.value)) {
|
|
29454
|
+
if (node.field && node.valueOP && !isNil27(node.value) || node.field && node.valueOP && ExcludeOPs2.includes(node.valueOP)) {
|
|
29317
29455
|
hasFilter = true;
|
|
29318
29456
|
} else {
|
|
29319
29457
|
hasError = true;
|
|
@@ -29329,7 +29467,7 @@ function calcSearchConds(filterNodes) {
|
|
|
29329
29467
|
// src/controller/control/search-bar/search-bar-filter-items.controller.ts
|
|
29330
29468
|
import { RuntimeError as RuntimeError59 } from "@ibiz-template/core";
|
|
29331
29469
|
import { clone as clone29 } from "ramda";
|
|
29332
|
-
var
|
|
29470
|
+
var ExcludeOPs3 = [
|
|
29333
29471
|
"ISNULL" /* IS_NULL */,
|
|
29334
29472
|
"ISNOTNULL" /* IS_NOT_NULL */
|
|
29335
29473
|
];
|
|
@@ -29981,6 +30119,7 @@ var SearchBarController = class extends ControlController {
|
|
|
29981
30119
|
};
|
|
29982
30120
|
|
|
29983
30121
|
// src/controller/control/tab-exp-panel/tab-exp-panel.controller.ts
|
|
30122
|
+
import { createUUID as createUUID13 } from "qx-util";
|
|
29984
30123
|
var TabExpPanelController = class extends ControlController {
|
|
29985
30124
|
constructor() {
|
|
29986
30125
|
super(...arguments);
|
|
@@ -30039,6 +30178,7 @@ var TabExpPanelController = class extends ControlController {
|
|
|
30039
30178
|
super.initState();
|
|
30040
30179
|
this.state.tabPages = [];
|
|
30041
30180
|
this.state.activeName = "";
|
|
30181
|
+
this.state.expViewParams = {};
|
|
30042
30182
|
}
|
|
30043
30183
|
/**
|
|
30044
30184
|
* 创建完成
|
|
@@ -30192,7 +30332,7 @@ var TabExpPanelController = class extends ControlController {
|
|
|
30192
30332
|
const context = Object.assign(this.context.clone(), resultContext, {
|
|
30193
30333
|
currentSrfNav: this.state.activeName
|
|
30194
30334
|
});
|
|
30195
|
-
const params = { ...resultParams };
|
|
30335
|
+
const params = { ...resultParams, ...this.state.expViewParams };
|
|
30196
30336
|
return { context, params };
|
|
30197
30337
|
}
|
|
30198
30338
|
/**
|
|
@@ -30215,6 +30355,11 @@ var TabExpPanelController = class extends ControlController {
|
|
|
30215
30355
|
modalOptions: { replace: true }
|
|
30216
30356
|
};
|
|
30217
30357
|
}
|
|
30358
|
+
refresh() {
|
|
30359
|
+
const navViewMsg = this.getNavViewMsg(this.activeTabViewPanelModel);
|
|
30360
|
+
navViewMsg.key += createUUID13();
|
|
30361
|
+
this.evt.emit("onNavViewChange", { navViewMsg });
|
|
30362
|
+
}
|
|
30218
30363
|
};
|
|
30219
30364
|
|
|
30220
30365
|
// src/controller/control/tree/tree.controller.ts
|
|
@@ -32002,6 +32147,7 @@ var KanbanController = class extends DataViewControlController {
|
|
|
32002
32147
|
this.state.batching = false;
|
|
32003
32148
|
this.state.selectGroupKey = "";
|
|
32004
32149
|
this.state.draggable = this.enableEditOrder || this.enableEditGroup;
|
|
32150
|
+
this.state.uaState = {};
|
|
32005
32151
|
}
|
|
32006
32152
|
/**
|
|
32007
32153
|
* 初始化
|
|
@@ -32048,8 +32194,44 @@ var KanbanController = class extends DataViewControlController {
|
|
|
32048
32194
|
);
|
|
32049
32195
|
}
|
|
32050
32196
|
async afterLoad(args, items) {
|
|
32197
|
+
var _a;
|
|
32051
32198
|
this.sortItems(this.state.items);
|
|
32052
|
-
|
|
32199
|
+
super.afterLoad(args, items);
|
|
32200
|
+
const actions = [];
|
|
32201
|
+
(_a = this.model.dedataViewItems) == null ? void 0 : _a.forEach((item) => {
|
|
32202
|
+
if (item.itemType === "ACTIONITEM") {
|
|
32203
|
+
if (item.deuiactionGroup && item.deuiactionGroup.uiactionGroupDetails) {
|
|
32204
|
+
actions.push(...item.deuiactionGroup.uiactionGroupDetails);
|
|
32205
|
+
}
|
|
32206
|
+
}
|
|
32207
|
+
});
|
|
32208
|
+
if (actions && actions.length > 0) {
|
|
32209
|
+
items.forEach((item) => {
|
|
32210
|
+
const containerState = new ButtonContainerState();
|
|
32211
|
+
actions.forEach((action) => {
|
|
32212
|
+
const actionid = action.uiactionId;
|
|
32213
|
+
if (actionid) {
|
|
32214
|
+
const buttonState = new UIActionButtonState(
|
|
32215
|
+
action.id,
|
|
32216
|
+
this.context.srfappid,
|
|
32217
|
+
actionid
|
|
32218
|
+
);
|
|
32219
|
+
containerState.addState(action.id, buttonState);
|
|
32220
|
+
}
|
|
32221
|
+
});
|
|
32222
|
+
this.state.uaState[item.srfkey] = containerState;
|
|
32223
|
+
});
|
|
32224
|
+
}
|
|
32225
|
+
items.forEach((item) => {
|
|
32226
|
+
if (this.state.uaState[item.srfkey] && Object.keys(this.state.uaState[item.srfkey]).length > 0) {
|
|
32227
|
+
this.state.uaState[item.srfkey].update(
|
|
32228
|
+
this.context,
|
|
32229
|
+
item.getOrigin(),
|
|
32230
|
+
this.model.appDataEntityId
|
|
32231
|
+
);
|
|
32232
|
+
}
|
|
32233
|
+
});
|
|
32234
|
+
return items;
|
|
32053
32235
|
}
|
|
32054
32236
|
/**
|
|
32055
32237
|
* 当展开批操作工具栏时需进行行点击拦截
|
|
@@ -33021,7 +33203,7 @@ import {
|
|
|
33021
33203
|
RuntimeModelError as RuntimeModelError69
|
|
33022
33204
|
} from "@ibiz-template/core";
|
|
33023
33205
|
import { clone as clone32 } from "ramda";
|
|
33024
|
-
import
|
|
33206
|
+
import dayjs7 from "dayjs";
|
|
33025
33207
|
var TreeGridExNodeColumnController = class {
|
|
33026
33208
|
/**
|
|
33027
33209
|
* @author lxm
|
|
@@ -33319,7 +33501,7 @@ var TreeGridExNodeColumnController = class {
|
|
|
33319
33501
|
}
|
|
33320
33502
|
const isDate = DataTypes5.isDate(this.dataType);
|
|
33321
33503
|
if (isDate || this.fieldColumn.name === "createdate") {
|
|
33322
|
-
const formatVal =
|
|
33504
|
+
const formatVal = dayjs7(strVal).format(this.valueFormat);
|
|
33323
33505
|
if (formatVal !== "Invalid Date") {
|
|
33324
33506
|
return formatVal;
|
|
33325
33507
|
}
|
|
@@ -33632,7 +33814,7 @@ var TreeGridService = class extends GridService {
|
|
|
33632
33814
|
|
|
33633
33815
|
// src/controller/control/medit-view-panel/medit-view-panel.controller.ts
|
|
33634
33816
|
import { RuntimeError as RuntimeError65 } from "@ibiz-template/core";
|
|
33635
|
-
import { createUUID as
|
|
33817
|
+
import { createUUID as createUUID14 } from "qx-util";
|
|
33636
33818
|
|
|
33637
33819
|
// src/controller/control/medit-view-panel/medit-view-panel.service.ts
|
|
33638
33820
|
var MEditViewPanelService = class extends MDControlService {
|
|
@@ -33719,7 +33901,7 @@ var MEditViewPanelController = class extends MDControlController {
|
|
|
33719
33901
|
*/
|
|
33720
33902
|
handlePanelItemParams(arg) {
|
|
33721
33903
|
const [{ parameterName }] = this.parameters;
|
|
33722
|
-
const id = arg[parameterName] ? arg[parameterName] : "mockId:".concat(
|
|
33904
|
+
const id = arg[parameterName] ? arg[parameterName] : "mockId:".concat(createUUID14());
|
|
33723
33905
|
const item = {
|
|
33724
33906
|
id,
|
|
33725
33907
|
context: this.context.clone(),
|
|
@@ -35080,7 +35262,7 @@ import { QXEvent as QXEvent9 } from "qx-util";
|
|
|
35080
35262
|
import { QXEvent as QXEvent7 } from "qx-util";
|
|
35081
35263
|
import { clone as clone33 } from "ramda";
|
|
35082
35264
|
import { isNil as isNil31, isNumber as isNumber2 } from "lodash-es";
|
|
35083
|
-
import
|
|
35265
|
+
import dayjs8 from "dayjs";
|
|
35084
35266
|
var AsyncActionController = class {
|
|
35085
35267
|
constructor() {
|
|
35086
35268
|
this.evt = new QXEvent7();
|
|
@@ -35151,7 +35333,7 @@ var AsyncActionController = class {
|
|
|
35151
35333
|
];
|
|
35152
35334
|
dateFields.forEach((key) => {
|
|
35153
35335
|
if (isNumber2(data[key])) {
|
|
35154
|
-
data[key] =
|
|
35336
|
+
data[key] = dayjs8(data[key]).format("YYYY-MM-DD HH:mm:ss");
|
|
35155
35337
|
}
|
|
35156
35338
|
});
|
|
35157
35339
|
if (!isNil31(data.actionresult)) {
|
|
@@ -36200,7 +36382,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
36200
36382
|
*/
|
|
36201
36383
|
handleContextParams() {
|
|
36202
36384
|
super.handleContextParams();
|
|
36203
|
-
if (this.view.context.srfsimple
|
|
36385
|
+
if (!this.view.context.srfsimple) {
|
|
36204
36386
|
this.view.context.srfsimple = true;
|
|
36205
36387
|
}
|
|
36206
36388
|
}
|