@ibiz-template/runtime 0.7.41-alpha.112 → 0.7.41-alpha.113
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 +84 -25
- package/dist/index.system.min.js +1 -1
- package/out/constant/predefined-attributes.d.ts +5 -1
- package/out/constant/predefined-attributes.d.ts.map +1 -1
- package/out/constant/predefined-attributes.js +4 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts +4 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +35 -6
- package/out/controller/control/md-ctrl/md-ctrl.controller.d.ts +2 -1
- package/out/controller/control/md-ctrl/md-ctrl.controller.d.ts.map +1 -1
- package/out/controller/control/md-ctrl/md-ctrl.controller.js +27 -4
- package/out/controller/utils/data-file-util/data-file-util.d.ts +2 -1
- package/out/controller/utils/data-file-util/data-file-util.d.ts.map +1 -1
- package/out/controller/utils/data-file-util/data-file-util.js +11 -6
- package/out/interface/api/util/i-api-excel-util.d.ts +53 -1
- package/out/interface/api/util/i-api-excel-util.d.ts.map +1 -1
- package/out/interface/provider/i-platform-provider.d.ts +54 -2
- package/out/interface/provider/i-platform-provider.d.ts.map +1 -1
- package/out/platform/provider/platform-provider-base.d.ts.map +1 -1
- package/out/platform/provider/platform-provider-base.js +1 -2
- package/package.json +3 -3
- package/src/constant/predefined-attributes.ts +5 -0
- package/src/controller/control/grid/grid/grid.controller.ts +51 -9
- package/src/controller/control/md-ctrl/md-ctrl.controller.ts +40 -5
- package/src/controller/utils/data-file-util/data-file-util.ts +21 -9
- package/src/interface/api/util/i-api-excel-util.ts +38 -1
- package/src/interface/provider/i-platform-provider.ts +43 -2
- package/src/platform/provider/platform-provider-base.ts +1 -2
package/dist/index.esm.js
CHANGED
|
@@ -21323,6 +21323,7 @@ var PredefinedControlRender = /* @__PURE__ */ ((PredefinedControlRender2) => {
|
|
|
21323
21323
|
var PredefinedAttributes = /* @__PURE__ */ ((PredefinedAttributes2) => {
|
|
21324
21324
|
PredefinedAttributes2["CLASSNAMES"] = "classNames";
|
|
21325
21325
|
PredefinedAttributes2["STYLES"] = "styles";
|
|
21326
|
+
PredefinedAttributes2["BEFORE_FRONT_EXPORT"] = "before-front-export";
|
|
21326
21327
|
return PredefinedAttributes2;
|
|
21327
21328
|
})(PredefinedAttributes || {});
|
|
21328
21329
|
|
|
@@ -26153,7 +26154,7 @@ async function importData2(opts) {
|
|
|
26153
26154
|
}
|
|
26154
26155
|
return result;
|
|
26155
26156
|
}
|
|
26156
|
-
async function exportData(
|
|
26157
|
+
async function exportData(args) {
|
|
26157
26158
|
if (!ibiz.util.getExcelUtil) {
|
|
26158
26159
|
throw new RuntimeError13(
|
|
26159
26160
|
ibiz.i18n.t("runtime.controller.utils.dataFileUtil.noExist")
|
|
@@ -26166,15 +26167,25 @@ async function exportData(header, data, fileName) {
|
|
|
26166
26167
|
);
|
|
26167
26168
|
}
|
|
26168
26169
|
try {
|
|
26169
|
-
|
|
26170
|
+
const {
|
|
26171
|
+
fileName,
|
|
26172
|
+
header,
|
|
26173
|
+
data,
|
|
26174
|
+
rowHeights,
|
|
26175
|
+
colWidths,
|
|
26176
|
+
multiHeader,
|
|
26177
|
+
merges,
|
|
26178
|
+
cellStyle
|
|
26179
|
+
} = args;
|
|
26180
|
+
exportExcel.exportJsonToExcelWithStyle({
|
|
26181
|
+
fileName,
|
|
26170
26182
|
header,
|
|
26171
|
-
// 表头内容 数组格式
|
|
26172
26183
|
data,
|
|
26173
|
-
|
|
26174
|
-
|
|
26175
|
-
|
|
26176
|
-
|
|
26177
|
-
|
|
26184
|
+
rowHeights,
|
|
26185
|
+
colWidths,
|
|
26186
|
+
multiHeader,
|
|
26187
|
+
merges,
|
|
26188
|
+
cellStyle
|
|
26178
26189
|
});
|
|
26179
26190
|
return { ok: true };
|
|
26180
26191
|
} catch (error) {
|
|
@@ -53104,12 +53115,15 @@ var GridController = class extends MDControlController {
|
|
|
53104
53115
|
const { dedataExportId, degridColumns = [] } = this.model;
|
|
53105
53116
|
const excelModel = {
|
|
53106
53117
|
header: [],
|
|
53107
|
-
fields: []
|
|
53118
|
+
fields: [],
|
|
53119
|
+
exportColumns: [],
|
|
53120
|
+
colWidths: []
|
|
53108
53121
|
};
|
|
53109
53122
|
if (dedataExportId) {
|
|
53110
53123
|
if (this.allExportColumns.length) {
|
|
53111
53124
|
excelModel.fields = this.allExportColumns.map((x) => x.appDEFieldId);
|
|
53112
53125
|
excelModel.header = this.allExportColumns.map((x) => x.caption);
|
|
53126
|
+
excelModel.exportColumns = this.allExportColumns;
|
|
53113
53127
|
}
|
|
53114
53128
|
} else {
|
|
53115
53129
|
const exportColumns = this.state.columnStates.filter((column) => {
|
|
@@ -53125,6 +53139,12 @@ var GridController = class extends MDControlController {
|
|
|
53125
53139
|
});
|
|
53126
53140
|
excelModel.fields = exportColumns.map((item) => item.id);
|
|
53127
53141
|
excelModel.header = exportColumns.map((item) => item.caption);
|
|
53142
|
+
excelModel.colWidths = exportColumns.map((item) => {
|
|
53143
|
+
return {
|
|
53144
|
+
wpx: item.width || 150
|
|
53145
|
+
};
|
|
53146
|
+
});
|
|
53147
|
+
excelModel.exportColumns = exportColumns;
|
|
53128
53148
|
}
|
|
53129
53149
|
return excelModel;
|
|
53130
53150
|
}
|
|
@@ -53256,19 +53276,19 @@ var GridController = class extends MDControlController {
|
|
|
53256
53276
|
* @memberof GridController
|
|
53257
53277
|
*/
|
|
53258
53278
|
async exportData(args) {
|
|
53259
|
-
var _a3, _b2;
|
|
53279
|
+
var _a3, _b2, _c;
|
|
53260
53280
|
if ((_a3 = this.dataExport) == null ? void 0 : _a3.enableBackend) {
|
|
53261
53281
|
await this.excuteBackendExport(args.params);
|
|
53262
53282
|
return;
|
|
53263
53283
|
}
|
|
53264
|
-
|
|
53284
|
+
await this.fillExportCodelistMap();
|
|
53285
|
+
const data = await this.getExportData(args.params);
|
|
53286
|
+
const { header, fields, exportColumns, colWidths } = this.getDataExcelModel();
|
|
53265
53287
|
if (!header) {
|
|
53266
53288
|
throw new RuntimeError40(
|
|
53267
53289
|
ibiz.i18n.t("runtime.controller.control.grid.tabularColumns")
|
|
53268
53290
|
);
|
|
53269
53291
|
}
|
|
53270
|
-
await this.fillExportCodelistMap();
|
|
53271
|
-
const data = await this.getExportData(args.params);
|
|
53272
53292
|
const formatData = this.formatExcelData(data, fields);
|
|
53273
53293
|
const table = formatData.map((v) => Object.values(v));
|
|
53274
53294
|
let fileName = this.model.logicName;
|
|
@@ -53280,11 +53300,30 @@ var GridController = class extends MDControlController {
|
|
|
53280
53300
|
now: /* @__PURE__ */ new Date()
|
|
53281
53301
|
});
|
|
53282
53302
|
}
|
|
53283
|
-
|
|
53303
|
+
const frontExportParams = {
|
|
53284
53304
|
header,
|
|
53285
53305
|
data: table,
|
|
53286
|
-
fileName
|
|
53287
|
-
|
|
53306
|
+
fileName,
|
|
53307
|
+
colWidths: () => {
|
|
53308
|
+
return colWidths;
|
|
53309
|
+
}
|
|
53310
|
+
};
|
|
53311
|
+
const frontExportAttri = (_c = this.model.controlAttributes) == null ? void 0 : _c.find((item) => {
|
|
53312
|
+
return item.attrName === "before-front-export" /* BEFORE_FRONT_EXPORT */;
|
|
53313
|
+
});
|
|
53314
|
+
if (frontExportAttri) {
|
|
53315
|
+
const { attrValue } = frontExportAttri;
|
|
53316
|
+
if (attrValue) {
|
|
53317
|
+
const frontExportResult = await ScriptFactory.asyncExecScriptFn(
|
|
53318
|
+
{ exportColumns, data },
|
|
53319
|
+
attrValue
|
|
53320
|
+
);
|
|
53321
|
+
if (frontExportResult) {
|
|
53322
|
+
Object.assign(frontExportParams, frontExportResult);
|
|
53323
|
+
}
|
|
53324
|
+
}
|
|
53325
|
+
}
|
|
53326
|
+
await ibiz.platform.frontExport(frontExportParams);
|
|
53288
53327
|
}
|
|
53289
53328
|
/**
|
|
53290
53329
|
* 计算默认值并返回一个对象,对象里的属性就是要填充的默认值
|
|
@@ -61009,19 +61048,21 @@ var MDCtrlController = class extends MDControlController {
|
|
|
61009
61048
|
}
|
|
61010
61049
|
/**
|
|
61011
61050
|
* @description 获取数据导出模型
|
|
61012
|
-
* @returns {*} {{ header: string[]
|
|
61051
|
+
* @returns {*} {{ header: string[], fields: string[], exportColumns: IData[] }}
|
|
61013
61052
|
* @memberof MDCtrlController
|
|
61014
61053
|
*/
|
|
61015
61054
|
getDataExcelModel() {
|
|
61016
61055
|
const { dedataExportId } = this.model;
|
|
61017
61056
|
const excelModel = {
|
|
61018
61057
|
header: [],
|
|
61019
|
-
fields: []
|
|
61058
|
+
fields: [],
|
|
61059
|
+
exportColumns: []
|
|
61020
61060
|
};
|
|
61021
61061
|
if (dedataExportId) {
|
|
61022
61062
|
if (this.allExportColumns.length) {
|
|
61023
61063
|
excelModel.fields = this.allExportColumns.map((x) => x.appDEFieldId);
|
|
61024
61064
|
excelModel.header = this.allExportColumns.map((x) => x.caption);
|
|
61065
|
+
excelModel.exportColumns = this.allExportColumns;
|
|
61025
61066
|
}
|
|
61026
61067
|
}
|
|
61027
61068
|
return excelModel;
|
|
@@ -61171,12 +61212,12 @@ var MDCtrlController = class extends MDControlController {
|
|
|
61171
61212
|
* @memberof MDCtrlController
|
|
61172
61213
|
*/
|
|
61173
61214
|
async exportData(args = {}) {
|
|
61174
|
-
var _a3;
|
|
61215
|
+
var _a3, _b2;
|
|
61175
61216
|
if ((_a3 = this.dataExport) == null ? void 0 : _a3.enableBackend) {
|
|
61176
61217
|
await this.excuteBackendExport(args.params || {});
|
|
61177
61218
|
return;
|
|
61178
61219
|
}
|
|
61179
|
-
const { header, fields } = this.getDataExcelModel();
|
|
61220
|
+
const { header, fields, exportColumns } = this.getDataExcelModel();
|
|
61180
61221
|
if (!header) {
|
|
61181
61222
|
throw new RuntimeError45(
|
|
61182
61223
|
ibiz.i18n.t("runtime.controller.common.md.tabularColumns")
|
|
@@ -61185,11 +61226,30 @@ var MDCtrlController = class extends MDControlController {
|
|
|
61185
61226
|
const data = await this.getExportData(args.params || {});
|
|
61186
61227
|
const formatData = this.formatExcelData(data, fields);
|
|
61187
61228
|
const table = formatData.map((v) => Object.values(v));
|
|
61188
|
-
|
|
61229
|
+
const frontExportParams = {
|
|
61189
61230
|
header,
|
|
61190
61231
|
data: table,
|
|
61191
|
-
fileName: this.model.logicName
|
|
61192
|
-
|
|
61232
|
+
fileName: this.model.logicName,
|
|
61233
|
+
colWidths: () => {
|
|
61234
|
+
return [];
|
|
61235
|
+
}
|
|
61236
|
+
};
|
|
61237
|
+
const frontExportAttri = (_b2 = this.model.controlAttributes) == null ? void 0 : _b2.find((item) => {
|
|
61238
|
+
return item.attrName === "before-front-export" /* BEFORE_FRONT_EXPORT */;
|
|
61239
|
+
});
|
|
61240
|
+
if (frontExportAttri) {
|
|
61241
|
+
const { attrValue } = frontExportAttri;
|
|
61242
|
+
if (attrValue) {
|
|
61243
|
+
const frontExportResult = await ScriptFactory.asyncExecScriptFn(
|
|
61244
|
+
{ exportColumns, data },
|
|
61245
|
+
attrValue
|
|
61246
|
+
);
|
|
61247
|
+
if (frontExportResult) {
|
|
61248
|
+
Object.assign(frontExportParams, frontExportResult);
|
|
61249
|
+
}
|
|
61250
|
+
}
|
|
61251
|
+
}
|
|
61252
|
+
await ibiz.platform.frontExport(frontExportParams);
|
|
61193
61253
|
}
|
|
61194
61254
|
};
|
|
61195
61255
|
|
|
@@ -68184,8 +68244,7 @@ var PlatformProviderBase = class {
|
|
|
68184
68244
|
* @memberof PlatformProviderBase
|
|
68185
68245
|
*/
|
|
68186
68246
|
async frontExport(args) {
|
|
68187
|
-
|
|
68188
|
-
await exportData(header, data, fileName);
|
|
68247
|
+
await exportData(args);
|
|
68189
68248
|
return true;
|
|
68190
68249
|
}
|
|
68191
68250
|
/**
|