@ibiz-template/runtime 0.6.11 → 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 +288 -118
- package/dist/index.system.min.js +1 -1
- package/out/command/app/open-app-view/open-app-view.js +2 -2
- 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 -110
- 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/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/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/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/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 +1 -1
- package/package.json +5 -5
package/dist/index.esm.js
CHANGED
|
@@ -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) {
|
|
@@ -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,7 +20690,7 @@ 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: "\
|
|
20693
|
+
title: "\u9000\u51FA\u767B\u5F55",
|
|
20642
20694
|
desc: "\u60A8\u786E\u5B9A\u8981\u9000\u51FA\u767B\u5F55\u5417\uFF1F"
|
|
20643
20695
|
});
|
|
20644
20696
|
if (confirm) {
|
|
@@ -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,109 +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
|
-
let value = item[key];
|
|
27034
|
-
const fieldColumnC = this.fieldColumns[key];
|
|
27035
|
-
if (codeListMap.get(key)) {
|
|
27036
|
-
value = ((_a3 = codeListMap.get(key).find((_item) => {
|
|
27037
|
-
return _item.value === item[key];
|
|
27038
|
-
})) == null ? void 0 : _a3.text) || value;
|
|
27039
|
-
} else if (fieldColumnC) {
|
|
27040
|
-
value = fieldColumnC.formatValue(value) + (fieldColumnC.model.unitName || "");
|
|
27041
|
-
}
|
|
27042
|
-
item[key] = value;
|
|
27043
|
-
});
|
|
27044
|
-
});
|
|
27045
|
-
return cloneData;
|
|
27046
|
-
};
|
|
27047
|
-
const getExportData = async () => {
|
|
27048
|
-
var _a2;
|
|
27049
|
-
const type = (_a2 = _args.params) == null ? void 0 : _a2.type;
|
|
27050
|
-
let data2 = [];
|
|
27051
|
-
if (!type || type === "activatedPage") {
|
|
27052
|
-
data2 = this.state.rows.map((row) => row.data);
|
|
27053
|
-
} else if (type === "maxRowCount" || type === "customPage") {
|
|
27054
|
-
const { size } = this.state;
|
|
27055
|
-
const { startPage, endPage } = _args.params;
|
|
27056
|
-
const params = type === "customPage" ? {
|
|
27057
|
-
page: 0,
|
|
27058
|
-
offset: (startPage - 1) * size,
|
|
27059
|
-
size: (endPage - startPage + 1) * size
|
|
27060
|
-
} : { size: 1e3, page: 0 };
|
|
27061
|
-
data2 = await this.loadData({ viewParam: params });
|
|
27062
|
-
} else if (type === "selectedRows") {
|
|
27063
|
-
data2 = this.getData();
|
|
27064
|
-
}
|
|
27065
|
-
if (data2.length === 0) {
|
|
27066
|
-
throw new RuntimeError55("\u65E0\u5BFC\u51FA\u6570\u636E");
|
|
27067
|
-
}
|
|
27068
|
-
return formatExcelData(data2);
|
|
27069
|
-
};
|
|
27070
|
-
const formatArrayData = (filterVal2, tableData) => {
|
|
27071
|
-
return tableData.map((v) => {
|
|
27072
|
-
return filterVal2.map((j) => {
|
|
27073
|
-
return v[j];
|
|
27074
|
-
});
|
|
27075
|
-
});
|
|
27076
|
-
};
|
|
27077
|
-
let filterVal = [];
|
|
27078
|
-
let header = [];
|
|
27079
|
-
if (this.allExportColumns && this.allExportColumns.length > 0) {
|
|
27080
|
-
filterVal = this.allExportColumns.map(
|
|
27081
|
-
(column) => column.appDEFieldId
|
|
27082
|
-
);
|
|
27083
|
-
header = this.allExportColumns.map(
|
|
27084
|
-
(column) => column.caption
|
|
27085
|
-
);
|
|
27086
|
-
} else {
|
|
27087
|
-
const { degridColumns } = this.model;
|
|
27088
|
-
if (!degridColumns) {
|
|
27089
|
-
throw new RuntimeError55("\u65E0\u8868\u683C\u5217");
|
|
27090
|
-
}
|
|
27091
|
-
filterVal = degridColumns.map((item) => item.id);
|
|
27092
|
-
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");
|
|
27093
27223
|
}
|
|
27094
|
-
const data =
|
|
27095
|
-
|
|
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);
|
|
27096
27228
|
}
|
|
27097
27229
|
/**
|
|
27098
27230
|
* 计算默认值并返回一个对象,对象里的属性就是要填充的默认值
|
|
@@ -27264,7 +27396,7 @@ var GridController = class extends MDControlController {
|
|
|
27264
27396
|
|
|
27265
27397
|
// src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
|
|
27266
27398
|
import { DataTypes as DataTypes4, ModelError as ModelError29, plus as plus2 } from "@ibiz-template/core";
|
|
27267
|
-
import
|
|
27399
|
+
import dayjs6 from "dayjs";
|
|
27268
27400
|
import { debounce as debounce3 } from "lodash-es";
|
|
27269
27401
|
import { clone as clone28, isNil as isNil26 } from "ramda";
|
|
27270
27402
|
var GridFieldColumnController = class extends GridColumnController {
|
|
@@ -27539,7 +27671,7 @@ var GridFieldColumnController = class extends GridColumnController {
|
|
|
27539
27671
|
}
|
|
27540
27672
|
const isDate = DataTypes4.isDate(this.dataType);
|
|
27541
27673
|
if (isDate) {
|
|
27542
|
-
const formatVal =
|
|
27674
|
+
const formatVal = dayjs6(strVal).format(this.valueFormat);
|
|
27543
27675
|
if (formatVal !== "Invalid Date") {
|
|
27544
27676
|
return formatVal;
|
|
27545
27677
|
}
|
|
@@ -29243,6 +29375,7 @@ async function calcFilterModelBySchema(json, appDataEntityId, modelAppId) {
|
|
|
29243
29375
|
// src/controller/control/search-bar/use-searchcond.ts
|
|
29244
29376
|
import { RuntimeError as RuntimeError58, recursiveIterate as recursiveIterate9 } from "@ibiz-template/core";
|
|
29245
29377
|
import { isNil as isNil27 } from "ramda";
|
|
29378
|
+
var ExcludeOPs2 = ["ISNULL" /* IS_NULL */, "ISNOTNULL" /* IS_NOT_NULL */];
|
|
29246
29379
|
function getOriginFilterNodes() {
|
|
29247
29380
|
return [
|
|
29248
29381
|
{
|
|
@@ -29318,7 +29451,7 @@ function calcSearchConds(filterNodes) {
|
|
|
29318
29451
|
let hasError = false;
|
|
29319
29452
|
recursiveIterate9(filterNodes[0], (node) => {
|
|
29320
29453
|
if (node.leaf) {
|
|
29321
|
-
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)) {
|
|
29322
29455
|
hasFilter = true;
|
|
29323
29456
|
} else {
|
|
29324
29457
|
hasError = true;
|
|
@@ -29334,7 +29467,7 @@ function calcSearchConds(filterNodes) {
|
|
|
29334
29467
|
// src/controller/control/search-bar/search-bar-filter-items.controller.ts
|
|
29335
29468
|
import { RuntimeError as RuntimeError59 } from "@ibiz-template/core";
|
|
29336
29469
|
import { clone as clone29 } from "ramda";
|
|
29337
|
-
var
|
|
29470
|
+
var ExcludeOPs3 = [
|
|
29338
29471
|
"ISNULL" /* IS_NULL */,
|
|
29339
29472
|
"ISNOTNULL" /* IS_NOT_NULL */
|
|
29340
29473
|
];
|
|
@@ -32014,6 +32147,7 @@ var KanbanController = class extends DataViewControlController {
|
|
|
32014
32147
|
this.state.batching = false;
|
|
32015
32148
|
this.state.selectGroupKey = "";
|
|
32016
32149
|
this.state.draggable = this.enableEditOrder || this.enableEditGroup;
|
|
32150
|
+
this.state.uaState = {};
|
|
32017
32151
|
}
|
|
32018
32152
|
/**
|
|
32019
32153
|
* 初始化
|
|
@@ -32060,8 +32194,44 @@ var KanbanController = class extends DataViewControlController {
|
|
|
32060
32194
|
);
|
|
32061
32195
|
}
|
|
32062
32196
|
async afterLoad(args, items) {
|
|
32197
|
+
var _a;
|
|
32063
32198
|
this.sortItems(this.state.items);
|
|
32064
|
-
|
|
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;
|
|
32065
32235
|
}
|
|
32066
32236
|
/**
|
|
32067
32237
|
* 当展开批操作工具栏时需进行行点击拦截
|
|
@@ -33033,7 +33203,7 @@ import {
|
|
|
33033
33203
|
RuntimeModelError as RuntimeModelError69
|
|
33034
33204
|
} from "@ibiz-template/core";
|
|
33035
33205
|
import { clone as clone32 } from "ramda";
|
|
33036
|
-
import
|
|
33206
|
+
import dayjs7 from "dayjs";
|
|
33037
33207
|
var TreeGridExNodeColumnController = class {
|
|
33038
33208
|
/**
|
|
33039
33209
|
* @author lxm
|
|
@@ -33331,7 +33501,7 @@ var TreeGridExNodeColumnController = class {
|
|
|
33331
33501
|
}
|
|
33332
33502
|
const isDate = DataTypes5.isDate(this.dataType);
|
|
33333
33503
|
if (isDate || this.fieldColumn.name === "createdate") {
|
|
33334
|
-
const formatVal =
|
|
33504
|
+
const formatVal = dayjs7(strVal).format(this.valueFormat);
|
|
33335
33505
|
if (formatVal !== "Invalid Date") {
|
|
33336
33506
|
return formatVal;
|
|
33337
33507
|
}
|
|
@@ -35092,7 +35262,7 @@ import { QXEvent as QXEvent9 } from "qx-util";
|
|
|
35092
35262
|
import { QXEvent as QXEvent7 } from "qx-util";
|
|
35093
35263
|
import { clone as clone33 } from "ramda";
|
|
35094
35264
|
import { isNil as isNil31, isNumber as isNumber2 } from "lodash-es";
|
|
35095
|
-
import
|
|
35265
|
+
import dayjs8 from "dayjs";
|
|
35096
35266
|
var AsyncActionController = class {
|
|
35097
35267
|
constructor() {
|
|
35098
35268
|
this.evt = new QXEvent7();
|
|
@@ -35163,7 +35333,7 @@ var AsyncActionController = class {
|
|
|
35163
35333
|
];
|
|
35164
35334
|
dateFields.forEach((key) => {
|
|
35165
35335
|
if (isNumber2(data[key])) {
|
|
35166
|
-
data[key] =
|
|
35336
|
+
data[key] = dayjs8(data[key]).format("YYYY-MM-DD HH:mm:ss");
|
|
35167
35337
|
}
|
|
35168
35338
|
});
|
|
35169
35339
|
if (!isNil31(data.actionresult)) {
|
|
@@ -36212,7 +36382,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
36212
36382
|
*/
|
|
36213
36383
|
handleContextParams() {
|
|
36214
36384
|
super.handleContextParams();
|
|
36215
|
-
if (this.view.context.srfsimple
|
|
36385
|
+
if (!this.view.context.srfsimple) {
|
|
36216
36386
|
this.view.context.srfsimple = true;
|
|
36217
36387
|
}
|
|
36218
36388
|
}
|