@ibiz-template/runtime 0.7.26 → 0.7.27
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 +324 -250
- package/dist/index.system.min.js +1 -1
- package/out/controller/control/chart/chart.controller.d.ts +3 -1
- package/out/controller/control/chart/chart.controller.d.ts.map +1 -1
- package/out/controller/control/chart/chart.controller.js +5 -1
- package/out/controller/control/chart/generator/base-series-generator.d.ts +8 -0
- package/out/controller/control/chart/generator/base-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/base-series-generator.js +22 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.js +10 -3
- package/out/controller/control/gantt/gantt.controller.d.ts +0 -10
- package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.controller.js +0 -96
- package/out/controller/control/grid/grid/grid.controller.d.ts +5 -5
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +17 -31
- package/out/controller/control/grid/grid/grid.service.d.ts +10 -0
- package/out/controller/control/grid/grid/grid.service.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.service.js +19 -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 +6 -2
- package/out/controller/control/report-panel/generator/bi-generator.d.ts +0 -10
- package/out/controller/control/report-panel/generator/bi-generator.d.ts.map +1 -1
- package/out/controller/control/report-panel/generator/bi-generator.js +5 -62
- package/out/controller/control/report-panel/report-panel.controller.d.ts.map +1 -1
- package/out/controller/control/report-panel/report-panel.controller.js +1 -1
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +24 -85
- package/out/interface/controller/event/control/i-chart.event.d.ts +10 -0
- package/out/interface/controller/event/control/i-chart.event.d.ts.map +1 -1
- package/out/interface/controller/event/control/i-edit-form.event.d.ts +26 -0
- package/out/interface/controller/event/control/i-edit-form.event.d.ts.map +1 -1
- package/out/interface/controller/state/view/i-pickup-tree-view.state.d.ts +8 -0
- package/out/interface/controller/state/view/i-pickup-tree-view.state.d.ts.map +1 -1
- package/out/interface/provider/model-loader.provider.d.ts +2 -2
- package/out/interface/provider/model-loader.provider.d.ts.map +1 -1
- package/out/utils/bi-report-util/bi-report-util.d.ts +33 -2
- package/out/utils/bi-report-util/bi-report-util.d.ts.map +1 -1
- package/out/utils/bi-report-util/bi-report-util.js +193 -9
- package/package.json +5 -5
package/dist/index.esm.js
CHANGED
|
@@ -15107,7 +15107,7 @@ var BIReportUtil = class {
|
|
|
15107
15107
|
params
|
|
15108
15108
|
);
|
|
15109
15109
|
if (res.data) {
|
|
15110
|
-
config = this.
|
|
15110
|
+
config = await this.translateDEReportToConfig(res.data);
|
|
15111
15111
|
}
|
|
15112
15112
|
} catch (error) {
|
|
15113
15113
|
throw new RuntimeError25(error.message);
|
|
@@ -15134,7 +15134,7 @@ var BIReportUtil = class {
|
|
|
15134
15134
|
return result;
|
|
15135
15135
|
}
|
|
15136
15136
|
/**
|
|
15137
|
-
*
|
|
15137
|
+
* 实体报表数据转化配置数据
|
|
15138
15138
|
*
|
|
15139
15139
|
* @author tony001
|
|
15140
15140
|
* @date 2024-06-30 11:06:00
|
|
@@ -15142,7 +15142,7 @@ var BIReportUtil = class {
|
|
|
15142
15142
|
* @param {IData} data
|
|
15143
15143
|
* @return {*} {IData}
|
|
15144
15144
|
*/
|
|
15145
|
-
|
|
15145
|
+
async translateDEReportToConfig(data) {
|
|
15146
15146
|
const config = {};
|
|
15147
15147
|
let biReportUIModel = {};
|
|
15148
15148
|
if (data.bireportuimodel) {
|
|
@@ -15151,7 +15151,9 @@ var BIReportUtil = class {
|
|
|
15151
15151
|
config.selectChartType = (biReportUIModel == null ? void 0 : biReportUIModel.selectChartType) || "NUMBER";
|
|
15152
15152
|
config.reportTag = "bi_report";
|
|
15153
15153
|
config.selectCubeId = data.pssysbicubeid;
|
|
15154
|
+
config.selectedSchemeId = data.pssysbischemeid;
|
|
15154
15155
|
const biReportItems = {};
|
|
15156
|
+
const extendDimension = (biReportUIModel == null ? void 0 : biReportUIModel.extendDimension) || [];
|
|
15155
15157
|
if (data.pssysbireportitems && data.pssysbireportitems.length > 0) {
|
|
15156
15158
|
data.pssysbireportitems.forEach((item) => {
|
|
15157
15159
|
var _a, _b;
|
|
@@ -15163,19 +15165,35 @@ var BIReportUtil = class {
|
|
|
15163
15165
|
pssysbischemeid: item.pssysbischemeid,
|
|
15164
15166
|
pssysbicubemeasureid: item.pssysbicubemeasureid,
|
|
15165
15167
|
pssysbicubeid: item.pssysbicubeid,
|
|
15166
|
-
codename: (_a = item.pssysbicubemeasureid) == null ? void 0 : _a.split(".").pop()
|
|
15168
|
+
codename: (_a = item.pssysbicubemeasureid) == null ? void 0 : _a.split(".").pop(),
|
|
15169
|
+
pssysbicubemeasurename: item.pssysbicubemeasurename
|
|
15167
15170
|
});
|
|
15168
15171
|
}
|
|
15169
15172
|
if (item.birepitemtype === "DIMENSION") {
|
|
15170
15173
|
if (!biReportItems.dimension) {
|
|
15171
15174
|
biReportItems.dimension = [];
|
|
15172
15175
|
}
|
|
15173
|
-
biReportItems.
|
|
15174
|
-
|
|
15175
|
-
|
|
15176
|
-
|
|
15177
|
-
|
|
15178
|
-
|
|
15176
|
+
if (extendDimension.length > 0 && !biReportItems.extendDimension) {
|
|
15177
|
+
biReportItems.extendDimension = [];
|
|
15178
|
+
}
|
|
15179
|
+
const codename = (_b = item.pssysbicubedimensionid) == null ? void 0 : _b.split(".").pop();
|
|
15180
|
+
if (extendDimension.includes(codename)) {
|
|
15181
|
+
biReportItems.extendDimension.push({
|
|
15182
|
+
pssysbischemeid: item.pssysbischemeid,
|
|
15183
|
+
pssysbicubedimensionid: item.pssysbicubedimensionid,
|
|
15184
|
+
pssysbicubeid: item.pssysbicubeid,
|
|
15185
|
+
codename,
|
|
15186
|
+
pssysbicubedimensionname: item.pssysbicubedimensionname
|
|
15187
|
+
});
|
|
15188
|
+
} else {
|
|
15189
|
+
biReportItems.dimension.push({
|
|
15190
|
+
pssysbischemeid: item.pssysbischemeid,
|
|
15191
|
+
pssysbicubedimensionid: item.pssysbicubedimensionid,
|
|
15192
|
+
pssysbicubeid: item.pssysbicubeid,
|
|
15193
|
+
codename,
|
|
15194
|
+
pssysbicubedimensionname: item.pssysbicubedimensionname
|
|
15195
|
+
});
|
|
15196
|
+
}
|
|
15179
15197
|
}
|
|
15180
15198
|
});
|
|
15181
15199
|
}
|
|
@@ -15188,9 +15206,178 @@ var BIReportUtil = class {
|
|
|
15188
15206
|
if (biReportUIModel.style) {
|
|
15189
15207
|
Object.assign(propertyData, { style: biReportUIModel.style });
|
|
15190
15208
|
}
|
|
15209
|
+
if (biReportUIModel.filter) {
|
|
15210
|
+
propertyData.data.filter = biReportUIModel.filter;
|
|
15211
|
+
}
|
|
15191
15212
|
config.propertyData = propertyData;
|
|
15192
15213
|
return config;
|
|
15193
15214
|
}
|
|
15215
|
+
/**
|
|
15216
|
+
* 报表面板数据转化配置界面数据
|
|
15217
|
+
*
|
|
15218
|
+
* @param {IDEReportPanel} model
|
|
15219
|
+
* @return {*} {Promise<IData>}
|
|
15220
|
+
* @memberof BIReportUtil
|
|
15221
|
+
*/
|
|
15222
|
+
async translateReportPanelToConfig(model) {
|
|
15223
|
+
const config = {};
|
|
15224
|
+
const biReportDatas = {};
|
|
15225
|
+
const { appDEReport } = model;
|
|
15226
|
+
const propertyData = {
|
|
15227
|
+
data: biReportDatas
|
|
15228
|
+
};
|
|
15229
|
+
config.reportTag = appDEReport.id;
|
|
15230
|
+
const tempAppBISchemeId = appDEReport.appBISchemeId.split(".").pop();
|
|
15231
|
+
config.selectedSchemeId = tempAppBISchemeId;
|
|
15232
|
+
const {
|
|
15233
|
+
name,
|
|
15234
|
+
appBICubeId,
|
|
15235
|
+
appBIReportDimensions,
|
|
15236
|
+
appBIReportMeasures,
|
|
15237
|
+
reportUIModel
|
|
15238
|
+
} = appDEReport.appBIReport;
|
|
15239
|
+
propertyData.caption = name;
|
|
15240
|
+
config.selectCubeId = "".concat(tempAppBISchemeId, ".").concat(appBICubeId);
|
|
15241
|
+
let extendDimension = [];
|
|
15242
|
+
if (reportUIModel) {
|
|
15243
|
+
const reportUIModelObj = JSON.parse(reportUIModel);
|
|
15244
|
+
config.selectChartType = reportUIModelObj.selectChartType;
|
|
15245
|
+
propertyData.style = reportUIModelObj.style;
|
|
15246
|
+
propertyData.data.filter = reportUIModelObj.filter;
|
|
15247
|
+
if (reportUIModelObj.extendDimension) {
|
|
15248
|
+
extendDimension = reportUIModelObj.extendDimension;
|
|
15249
|
+
}
|
|
15250
|
+
} else {
|
|
15251
|
+
config.selectChartType = "NUMBER";
|
|
15252
|
+
}
|
|
15253
|
+
if (appBIReportMeasures && appBIReportMeasures.length > 0) {
|
|
15254
|
+
appBIReportMeasures.forEach((measure) => {
|
|
15255
|
+
if (!biReportDatas.measure) {
|
|
15256
|
+
biReportDatas.measure = [];
|
|
15257
|
+
}
|
|
15258
|
+
biReportDatas.measure.push({
|
|
15259
|
+
pssysbischemeid: tempAppBISchemeId,
|
|
15260
|
+
pssysbicubemeasureid: "".concat(tempAppBISchemeId, ".").concat(appBICubeId, ".").concat(measure.measureTag),
|
|
15261
|
+
pssysbicubemeasurename: measure.measureName,
|
|
15262
|
+
pssysbicubeid: "".concat(tempAppBISchemeId, ".").concat(appBICubeId),
|
|
15263
|
+
codename: measure.measureTag
|
|
15264
|
+
});
|
|
15265
|
+
});
|
|
15266
|
+
}
|
|
15267
|
+
if (appBIReportDimensions && appBIReportDimensions.length > 0) {
|
|
15268
|
+
appBIReportDimensions.forEach((dimension) => {
|
|
15269
|
+
if (!biReportDatas.dimension) {
|
|
15270
|
+
biReportDatas.dimension = [];
|
|
15271
|
+
}
|
|
15272
|
+
if (extendDimension.length > 0 && !biReportDatas.extendDimension) {
|
|
15273
|
+
biReportDatas.extendDimension = [];
|
|
15274
|
+
}
|
|
15275
|
+
if (extendDimension.includes(dimension.dimensionTag)) {
|
|
15276
|
+
biReportDatas.extendDimension.push({
|
|
15277
|
+
pssysbischemeid: tempAppBISchemeId,
|
|
15278
|
+
pssysbicubedimensionid: "".concat(tempAppBISchemeId, ".").concat(appBICubeId, ".").concat(dimension.dimensionTag),
|
|
15279
|
+
pssysbicubedimensionname: dimension.dimensionName,
|
|
15280
|
+
pssysbicubeid: "".concat(tempAppBISchemeId, ".").concat(appBICubeId),
|
|
15281
|
+
codename: dimension.dimensionTag,
|
|
15282
|
+
pscodelistid: dimension.appCodeListId
|
|
15283
|
+
});
|
|
15284
|
+
} else {
|
|
15285
|
+
biReportDatas.dimension.push({
|
|
15286
|
+
pssysbischemeid: tempAppBISchemeId,
|
|
15287
|
+
pssysbicubedimensionid: "".concat(tempAppBISchemeId, ".").concat(appBICubeId, ".").concat(dimension.dimensionTag),
|
|
15288
|
+
pssysbicubedimensionname: dimension.dimensionName,
|
|
15289
|
+
pssysbicubeid: "".concat(tempAppBISchemeId, ".").concat(appBICubeId),
|
|
15290
|
+
codename: dimension.dimensionTag,
|
|
15291
|
+
pscodelistid: dimension.appCodeListId
|
|
15292
|
+
});
|
|
15293
|
+
}
|
|
15294
|
+
});
|
|
15295
|
+
}
|
|
15296
|
+
config.propertyData = propertyData;
|
|
15297
|
+
return config;
|
|
15298
|
+
}
|
|
15299
|
+
/**
|
|
15300
|
+
* 指定参数数据转化为应用BI报表数据
|
|
15301
|
+
*
|
|
15302
|
+
* @param {{
|
|
15303
|
+
* reportTag: string;
|
|
15304
|
+
* selectChartType: string;
|
|
15305
|
+
* selectCubeId: string;
|
|
15306
|
+
* caption: string;
|
|
15307
|
+
* data: IData;
|
|
15308
|
+
* style: IData;
|
|
15309
|
+
* }} arg
|
|
15310
|
+
* @return {*} {Promise<IData>}
|
|
15311
|
+
* @memberof BIReportUtil
|
|
15312
|
+
*/
|
|
15313
|
+
async translateDataToAppBIReport(arg) {
|
|
15314
|
+
const { reportTag, selectChartType, selectCubeId, caption, data, style } = arg;
|
|
15315
|
+
const app = ibiz.hub.getApp(ibiz.env.appId);
|
|
15316
|
+
const targetData = {
|
|
15317
|
+
pssysbireportitems: [],
|
|
15318
|
+
pssysbischemeid: selectCubeId.split(".")[0],
|
|
15319
|
+
pssysbicubeid: selectCubeId,
|
|
15320
|
+
bireportuimodel: JSON.stringify({
|
|
15321
|
+
selectChartType,
|
|
15322
|
+
style,
|
|
15323
|
+
filter: data == null ? void 0 : data.filter
|
|
15324
|
+
}),
|
|
15325
|
+
pssysappid: app.model.codeName,
|
|
15326
|
+
bireporttag: reportTag,
|
|
15327
|
+
pssysbireportname: caption,
|
|
15328
|
+
validflag: 1
|
|
15329
|
+
};
|
|
15330
|
+
if (data && data.measure) {
|
|
15331
|
+
data.measure.forEach((measure) => {
|
|
15332
|
+
const tempMeasure = {
|
|
15333
|
+
birepitemtype: "MEASURE",
|
|
15334
|
+
pssysbischemeid: measure.pssysbischemeid,
|
|
15335
|
+
pssysbicubemeasureid: measure.pssysbicubemeasureid,
|
|
15336
|
+
pssysbicubeid: measure.pssysbicubeid,
|
|
15337
|
+
pssysbicubename: measure.pssysbicubename,
|
|
15338
|
+
pssysbicubemeasurename: measure.pssysbicubemeasurename,
|
|
15339
|
+
validflag: 1
|
|
15340
|
+
};
|
|
15341
|
+
targetData.pssysbireportitems.push(tempMeasure);
|
|
15342
|
+
});
|
|
15343
|
+
}
|
|
15344
|
+
if (data && data.dimension) {
|
|
15345
|
+
data.dimension.forEach((dimension) => {
|
|
15346
|
+
const tempDimension = {
|
|
15347
|
+
birepitemtype: "DIMENSION",
|
|
15348
|
+
pssysbischemeid: dimension.pssysbischemeid,
|
|
15349
|
+
pssysbicubedimensionid: dimension.pssysbicubedimensionid,
|
|
15350
|
+
pssysbicubeid: dimension.pssysbicubeid,
|
|
15351
|
+
pssysbicubename: dimension.pssysbicubename,
|
|
15352
|
+
pssysbicubedimensionname: dimension.pssysbicubedimensionname,
|
|
15353
|
+
validflag: 1
|
|
15354
|
+
};
|
|
15355
|
+
targetData.pssysbireportitems.push(tempDimension);
|
|
15356
|
+
});
|
|
15357
|
+
}
|
|
15358
|
+
if (data && data.extendDimension) {
|
|
15359
|
+
const extendDimension = [];
|
|
15360
|
+
data.extendDimension.forEach((dimension) => {
|
|
15361
|
+
extendDimension.push(dimension.codename);
|
|
15362
|
+
const tempDimension = {
|
|
15363
|
+
birepitemtype: "DIMENSION",
|
|
15364
|
+
pssysbischemeid: dimension.pssysbischemeid,
|
|
15365
|
+
pssysbicubedimensionid: dimension.pssysbicubedimensionid,
|
|
15366
|
+
pssysbicubeid: dimension.pssysbicubeid,
|
|
15367
|
+
pssysbicubename: dimension.pssysbicubename,
|
|
15368
|
+
pssysbicubedimensionname: dimension.pssysbicubedimensionname,
|
|
15369
|
+
validflag: 1
|
|
15370
|
+
};
|
|
15371
|
+
targetData.pssysbireportitems.push(tempDimension);
|
|
15372
|
+
});
|
|
15373
|
+
const uiModel = JSON.parse(targetData.bireportuimodel);
|
|
15374
|
+
targetData.bireportuimodel = JSON.stringify({
|
|
15375
|
+
...uiModel,
|
|
15376
|
+
extendDimension
|
|
15377
|
+
});
|
|
15378
|
+
}
|
|
15379
|
+
return targetData;
|
|
15380
|
+
}
|
|
15194
15381
|
};
|
|
15195
15382
|
|
|
15196
15383
|
// src/utils/dr-ctrl-util/index.ts
|
|
@@ -20717,6 +20904,23 @@ var BaseSeriesGenerator = class {
|
|
|
20717
20904
|
}
|
|
20718
20905
|
return isExclude ? void 0 : val;
|
|
20719
20906
|
}
|
|
20907
|
+
/**
|
|
20908
|
+
* 获取序列颜色
|
|
20909
|
+
*
|
|
20910
|
+
* @param {string} group
|
|
20911
|
+
* @return {*} {string}
|
|
20912
|
+
* @memberof BaseSeriesGenerator
|
|
20913
|
+
*/
|
|
20914
|
+
getSeriesColor(group) {
|
|
20915
|
+
let color = "";
|
|
20916
|
+
const maps = this.chartGenerator.codeListMap.values();
|
|
20917
|
+
const codeListItems = [...maps].flat();
|
|
20918
|
+
const item = codeListItems.find((x) => x.text === group);
|
|
20919
|
+
if (item) {
|
|
20920
|
+
color = item.color || "";
|
|
20921
|
+
}
|
|
20922
|
+
return color;
|
|
20923
|
+
}
|
|
20720
20924
|
/**
|
|
20721
20925
|
* 准备图表数据
|
|
20722
20926
|
* @return {*}
|
|
@@ -20909,6 +21113,10 @@ var BaseSeriesGenerator = class {
|
|
|
20909
21113
|
if (group !== DEFAULT_GROUP) {
|
|
20910
21114
|
options.name = group;
|
|
20911
21115
|
}
|
|
21116
|
+
const color = this.getSeriesColor(group);
|
|
21117
|
+
if (color) {
|
|
21118
|
+
options.color = color;
|
|
21119
|
+
}
|
|
20912
21120
|
if (this.seriesUserParam) {
|
|
20913
21121
|
options = mergeDeepRight(options, this.seriesUserParam);
|
|
20914
21122
|
}
|
|
@@ -22129,6 +22337,9 @@ var ChartService = class extends MDControlService {
|
|
|
22129
22337
|
|
|
22130
22338
|
// src/controller/control/chart/chart.controller.ts
|
|
22131
22339
|
var ChartController = class extends MDControlController {
|
|
22340
|
+
get _evt() {
|
|
22341
|
+
return this.evt;
|
|
22342
|
+
}
|
|
22132
22343
|
initState() {
|
|
22133
22344
|
super.initState();
|
|
22134
22345
|
this.state.size = 1e3;
|
|
@@ -22347,7 +22558,7 @@ var ChartController = class extends MDControlController {
|
|
|
22347
22558
|
* @author lxm
|
|
22348
22559
|
* @date 2023-06-07 10:03:48
|
|
22349
22560
|
*/
|
|
22350
|
-
updateChart() {
|
|
22561
|
+
async updateChart() {
|
|
22351
22562
|
if (!this.chart) {
|
|
22352
22563
|
throw new RuntimeError43(
|
|
22353
22564
|
ibiz.i18n.t("runtime.controller.control.chart.noInitialised")
|
|
@@ -22358,6 +22569,7 @@ var ChartController = class extends MDControlController {
|
|
|
22358
22569
|
ibiz.i18n.t("runtime.controller.control.chart.noCalculated")
|
|
22359
22570
|
);
|
|
22360
22571
|
}
|
|
22572
|
+
await this._evt.emit("onBeforeUpdate", void 0);
|
|
22361
22573
|
this.chart.setOption(this.options, { notMerge: true });
|
|
22362
22574
|
this.resizeChart();
|
|
22363
22575
|
}
|
|
@@ -29875,18 +30087,22 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
29875
30087
|
* @date 2023-11-22 04:50:19
|
|
29876
30088
|
*/
|
|
29877
30089
|
create(index) {
|
|
30090
|
+
const item = {};
|
|
29878
30091
|
if (this.isSingleData) {
|
|
29879
|
-
this.setValue(
|
|
30092
|
+
this.setValue(item);
|
|
29880
30093
|
} else {
|
|
29881
30094
|
let tempValue = this.value;
|
|
29882
30095
|
tempValue = tempValue ? [...tempValue] : [];
|
|
29883
30096
|
if (index !== void 0) {
|
|
29884
|
-
tempValue.splice(index, 0,
|
|
30097
|
+
tempValue.splice(index, 0, item);
|
|
29885
30098
|
} else {
|
|
29886
|
-
tempValue.push(
|
|
30099
|
+
tempValue.push(item);
|
|
29887
30100
|
}
|
|
29888
30101
|
this.setValue(tempValue);
|
|
29889
30102
|
}
|
|
30103
|
+
this.form.evt.emit("onMDCtrlNew", {
|
|
30104
|
+
args: item
|
|
30105
|
+
});
|
|
29890
30106
|
}
|
|
29891
30107
|
/**
|
|
29892
30108
|
* 删除数据
|
|
@@ -29903,6 +30119,9 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
29903
30119
|
return index !== i;
|
|
29904
30120
|
});
|
|
29905
30121
|
this.setValue(newArr);
|
|
30122
|
+
this.form.evt.emit("onMDCtrlRemove", {
|
|
30123
|
+
args: newArr
|
|
30124
|
+
});
|
|
29906
30125
|
}
|
|
29907
30126
|
/**
|
|
29908
30127
|
* 表单数据变更通知
|
|
@@ -31217,6 +31436,24 @@ var GridService = class extends MDControlService {
|
|
|
31217
31436
|
res = this.handleResponse(res);
|
|
31218
31437
|
return res;
|
|
31219
31438
|
}
|
|
31439
|
+
/**
|
|
31440
|
+
* 移动并排序数据
|
|
31441
|
+
*
|
|
31442
|
+
* @param {IContext} context
|
|
31443
|
+
* @param {ControlVO} data
|
|
31444
|
+
* @param {IData} args
|
|
31445
|
+
* @return {*} {Promise<IHttpResponse<ControlVO[]>>}
|
|
31446
|
+
* @memberof GridService
|
|
31447
|
+
*/
|
|
31448
|
+
async moveOrderItem(context, data, params) {
|
|
31449
|
+
const moveAction = this.model.moveControlAction.appDEMethodId;
|
|
31450
|
+
const deName = calcDeCodeNameById(this.model.appDataEntityId);
|
|
31451
|
+
const tempContext = context.clone();
|
|
31452
|
+
tempContext[deName] = data.srfkey;
|
|
31453
|
+
let res = await this.exec(moveAction, tempContext, params);
|
|
31454
|
+
res = this.handleResponse(res);
|
|
31455
|
+
return res;
|
|
31456
|
+
}
|
|
31220
31457
|
};
|
|
31221
31458
|
|
|
31222
31459
|
// src/controller/control/grid/grid/entity-schema.ts
|
|
@@ -32685,35 +32922,32 @@ var GridController = class extends MDControlController {
|
|
|
32685
32922
|
super.actionNotification(tag, { ...opts || {} });
|
|
32686
32923
|
}
|
|
32687
32924
|
/**
|
|
32688
|
-
*
|
|
32689
|
-
* @
|
|
32690
|
-
* @
|
|
32691
|
-
* @
|
|
32925
|
+
* 拖拽改变
|
|
32926
|
+
* @param dragging 拖拽目标
|
|
32927
|
+
* @param drop 放置目标
|
|
32928
|
+
* @param dropType 放置类型
|
|
32692
32929
|
*/
|
|
32693
|
-
async onDragChange() {
|
|
32694
|
-
|
|
32695
|
-
const
|
|
32696
|
-
|
|
32930
|
+
async onDragChange(dragging, drop, dropType) {
|
|
32931
|
+
var _a;
|
|
32932
|
+
const moveAction = (_a = this.model.moveControlAction) == null ? void 0 : _a.appDEMethodId;
|
|
32933
|
+
if (!moveAction) {
|
|
32934
|
+
throw new RuntimeModelError63(
|
|
32935
|
+
this.model,
|
|
32936
|
+
ibiz.i18n.t("runtime.controller.common.md.noMoveDataCconfig")
|
|
32937
|
+
);
|
|
32938
|
+
}
|
|
32939
|
+
const moveParams = {
|
|
32940
|
+
srftargetkey: drop.data.srfkey,
|
|
32941
|
+
srfmovetype: dropType === "prev" ? "MOVEBEFORE" : "MOVEAFTER"
|
|
32697
32942
|
};
|
|
32698
|
-
const
|
|
32699
|
-
|
|
32700
|
-
|
|
32701
|
-
|
|
32702
|
-
|
|
32703
|
-
|
|
32704
|
-
|
|
32705
|
-
|
|
32706
|
-
modifiedItems.push(item);
|
|
32707
|
-
}
|
|
32708
|
-
} else {
|
|
32709
|
-
if (!item[sortField] || lastSort >= item[sortField]) {
|
|
32710
|
-
item[sortField] = getNextSort(lastSort);
|
|
32711
|
-
modifiedItems.push(item);
|
|
32712
|
-
}
|
|
32713
|
-
lastSort = item[sortField];
|
|
32714
|
-
}
|
|
32715
|
-
});
|
|
32716
|
-
this.updateChangedItems(modifiedItems);
|
|
32943
|
+
const res = await this.service.moveOrderItem(
|
|
32944
|
+
this.context,
|
|
32945
|
+
dragging.data,
|
|
32946
|
+
moveParams
|
|
32947
|
+
);
|
|
32948
|
+
if (res.ok) {
|
|
32949
|
+
this.refresh();
|
|
32950
|
+
}
|
|
32717
32951
|
}
|
|
32718
32952
|
/**
|
|
32719
32953
|
* 更新改变项数据
|
|
@@ -32764,7 +32998,13 @@ var GridController = class extends MDControlController {
|
|
|
32764
32998
|
};
|
|
32765
32999
|
|
|
32766
33000
|
// src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
|
|
32767
|
-
import {
|
|
33001
|
+
import {
|
|
33002
|
+
DataTypes as DataTypes4,
|
|
33003
|
+
ModelError as ModelError29,
|
|
33004
|
+
plus as plus3,
|
|
33005
|
+
base64ToStr,
|
|
33006
|
+
isBase64
|
|
33007
|
+
} from "@ibiz-template/core";
|
|
32768
33008
|
import dayjs6 from "dayjs";
|
|
32769
33009
|
import { debounce as debounce2 } from "lodash-es";
|
|
32770
33010
|
import { clone as clone32, isNil as isNil29 } from "ramda";
|
|
@@ -33061,6 +33301,9 @@ var GridFieldColumnController = class extends GridColumnController {
|
|
|
33061
33301
|
return ValueExUtil.toText(this.model, value);
|
|
33062
33302
|
}
|
|
33063
33303
|
const strVal = "".concat(isNilOrEmpty8(value) ? "" : value);
|
|
33304
|
+
if (Number.isNaN(Number(strVal)) && isBase64(strVal)) {
|
|
33305
|
+
return base64ToStr(strVal);
|
|
33306
|
+
}
|
|
33064
33307
|
if (!this.valueFormat) {
|
|
33065
33308
|
return strVal;
|
|
33066
33309
|
}
|
|
@@ -37126,92 +37369,59 @@ var TreeController = class extends MDControlController {
|
|
|
37126
37369
|
* @return {*} {Promise<void>}
|
|
37127
37370
|
*/
|
|
37128
37371
|
async onNodeDrop(draggingNode, dropNode, dropType) {
|
|
37129
|
-
var _a, _b
|
|
37372
|
+
var _a, _b;
|
|
37130
37373
|
if (dropType === "inner" && !dropNode._leaf && dropNode._children === void 0) {
|
|
37131
37374
|
await this.expandNodeByKey([dropNode._id]);
|
|
37132
37375
|
}
|
|
37133
|
-
const modifiedNodeDatas = [];
|
|
37134
37376
|
const draggingNodeModel = this.getNodeModel(draggingNode._nodeId);
|
|
37135
37377
|
const dropInNode = dropType === "inner" ? dropNode : dropNode._parent;
|
|
37136
|
-
const isChangedParent = (dropNode == null ? void 0 :
|
|
37378
|
+
const isChangedParent = ((_a = dropNode._parent) == null ? void 0 : _a._id) !== ((_b = draggingNode._parent) == null ? void 0 : _b._id);
|
|
37137
37379
|
let orderNodeModel = this.getNodeModel(dropNode._nodeId);
|
|
37138
|
-
if (dropType === "inner" ||
|
|
37380
|
+
if (dropType === "inner" || isChangedParent) {
|
|
37139
37381
|
const dropNodeRs = this.findDropNodeRS(
|
|
37140
37382
|
dropInNode._nodeId,
|
|
37141
37383
|
draggingNodeModel.appDataEntityId
|
|
37142
37384
|
);
|
|
37143
37385
|
if (dropNodeRs) {
|
|
37144
37386
|
draggingNode._deData[dropNodeRs.pickupDEFName] = dropInNode._value;
|
|
37145
|
-
modifiedNodeDatas.push(draggingNode);
|
|
37146
37387
|
orderNodeModel = this.getNodeModel(dropNodeRs.childDETreeNodeId);
|
|
37147
37388
|
}
|
|
37148
|
-
}
|
|
37149
|
-
const originArr = draggingNode._parent._children;
|
|
37150
|
-
originArr.splice(originArr.indexOf(draggingNode), 1);
|
|
37151
|
-
if (dropType === "inner") {
|
|
37152
|
-
if (!dropNode._children) {
|
|
37153
|
-
dropNode._children = [];
|
|
37154
|
-
dropNode._leaf = true;
|
|
37155
|
-
this.state.expandedKeys.push(dropNode._id);
|
|
37156
|
-
}
|
|
37157
|
-
dropNode._children.push(draggingNode);
|
|
37158
|
-
} else {
|
|
37159
|
-
let insertIndex = dropInNode._children.indexOf(dropNode);
|
|
37160
|
-
if (dropType === "next") {
|
|
37161
|
-
insertIndex += 1;
|
|
37162
|
-
}
|
|
37163
|
-
dropInNode._children.splice(insertIndex, 0, draggingNode);
|
|
37164
|
-
}
|
|
37165
|
-
if (dropType === "inner" || isChangedParent) {
|
|
37166
37389
|
draggingNode._parent = dropInNode;
|
|
37167
37390
|
draggingNode._nodeId = orderNodeModel.id;
|
|
37168
37391
|
this.state.expandedKeys = this.calcExpandedKeys([dropInNode]);
|
|
37392
|
+
await this.updateDeNodeData([draggingNode]);
|
|
37169
37393
|
}
|
|
37170
|
-
const {
|
|
37171
|
-
if (
|
|
37172
|
-
|
|
37173
|
-
|
|
37174
|
-
|
|
37175
|
-
|
|
37176
|
-
|
|
37177
|
-
|
|
37178
|
-
const
|
|
37179
|
-
|
|
37180
|
-
|
|
37181
|
-
if (!isAsc) {
|
|
37182
|
-
changedArr.reverse();
|
|
37183
|
-
}
|
|
37184
|
-
const getNextSort = (num) => {
|
|
37185
|
-
return num + (100 - num % 100);
|
|
37186
|
-
};
|
|
37187
|
-
const getSort = (deData) => {
|
|
37188
|
-
return deData[sortField] || 0;
|
|
37394
|
+
const { moveAppDEActionId, appDataEntityId, allowOrder } = orderNodeModel;
|
|
37395
|
+
if (!moveAppDEActionId) {
|
|
37396
|
+
throw new RuntimeModelError66(
|
|
37397
|
+
this.model,
|
|
37398
|
+
ibiz.i18n.t("runtime.controller.common.md.noMoveDataCconfig")
|
|
37399
|
+
);
|
|
37400
|
+
}
|
|
37401
|
+
if (dropType !== "inner" && allowOrder) {
|
|
37402
|
+
const moveParams = {
|
|
37403
|
+
srftargetkey: dropNode.srfkey,
|
|
37404
|
+
srfmovetype: dropType === "prev" ? "MOVEBEFORE" : "MOVEAFTER"
|
|
37189
37405
|
};
|
|
37190
|
-
|
|
37191
|
-
|
|
37192
|
-
|
|
37193
|
-
|
|
37194
|
-
|
|
37195
|
-
|
|
37196
|
-
|
|
37197
|
-
|
|
37198
|
-
|
|
37199
|
-
|
|
37200
|
-
|
|
37201
|
-
|
|
37202
|
-
|
|
37203
|
-
|
|
37204
|
-
}
|
|
37406
|
+
const app = ibiz.hub.getApp(this.context.srfappid);
|
|
37407
|
+
const deName = calcDeCodeNameById(appDataEntityId);
|
|
37408
|
+
const tempContext = this.context.clone();
|
|
37409
|
+
tempContext[deName] = draggingNode.srfkey;
|
|
37410
|
+
const res = await app.deService.exec(
|
|
37411
|
+
appDataEntityId,
|
|
37412
|
+
moveAppDEActionId,
|
|
37413
|
+
tempContext,
|
|
37414
|
+
moveParams
|
|
37415
|
+
);
|
|
37416
|
+
if (res.ok) {
|
|
37417
|
+
if (isChangedParent) {
|
|
37418
|
+
await this.refreshNodeChildren(draggingNode, true);
|
|
37419
|
+
await this.refreshNodeChildren(dropInNode);
|
|
37205
37420
|
} else {
|
|
37206
|
-
|
|
37207
|
-
deData[sortField] = getNextSort(lastSort);
|
|
37208
|
-
modifiedNodeDatas.push(item);
|
|
37209
|
-
}
|
|
37210
|
-
lastSort = getSort(deData);
|
|
37421
|
+
await this.refreshNodeChildren(dropInNode);
|
|
37211
37422
|
}
|
|
37212
|
-
}
|
|
37423
|
+
}
|
|
37213
37424
|
}
|
|
37214
|
-
await this.updateDeNodeData(modifiedNodeDatas);
|
|
37215
37425
|
this._evt.emit("onAfterNodeDrop", { isChangedParent });
|
|
37216
37426
|
}
|
|
37217
37427
|
/**
|
|
@@ -40526,7 +40736,11 @@ var BIReportPanelGenerator = class extends ReportPanelBaseGenerator {
|
|
|
40526
40736
|
* @return {*} {Promise<void>}
|
|
40527
40737
|
*/
|
|
40528
40738
|
async initConfig() {
|
|
40529
|
-
|
|
40739
|
+
const { appDEReport } = this.model;
|
|
40740
|
+
const { appBIReport } = appDEReport;
|
|
40741
|
+
const appBISchemeId = appDEReport.appBISchemeId.split(".").pop();
|
|
40742
|
+
appBIReport.appBISchemeId = appBISchemeId;
|
|
40743
|
+
this.config = appBIReport;
|
|
40530
40744
|
}
|
|
40531
40745
|
/**
|
|
40532
40746
|
* 加载数据
|
|
@@ -40542,71 +40756,6 @@ var BIReportPanelGenerator = class extends ReportPanelBaseGenerator {
|
|
|
40542
40756
|
}
|
|
40543
40757
|
return Promise.resolve(data);
|
|
40544
40758
|
}
|
|
40545
|
-
/**
|
|
40546
|
-
* 转化报表数据到配置数据
|
|
40547
|
-
*
|
|
40548
|
-
* @author tony001
|
|
40549
|
-
* @date 2024-06-28 14:06:43
|
|
40550
|
-
* @private
|
|
40551
|
-
* @param {IModel} model
|
|
40552
|
-
* @return {*} {IData}
|
|
40553
|
-
*/
|
|
40554
|
-
translateReportToConfig(model) {
|
|
40555
|
-
const config = {};
|
|
40556
|
-
const biReportDatas = {};
|
|
40557
|
-
const propertyData = {
|
|
40558
|
-
caption: model.logicName,
|
|
40559
|
-
data: biReportDatas
|
|
40560
|
-
};
|
|
40561
|
-
const { appDEReport } = model;
|
|
40562
|
-
console.log(appDEReport);
|
|
40563
|
-
config.reportTag = appDEReport.id;
|
|
40564
|
-
const tempAppBISchemeId = appDEReport.appBISchemeId.split(".").pop();
|
|
40565
|
-
config.selectedSchemeId = tempAppBISchemeId;
|
|
40566
|
-
const {
|
|
40567
|
-
appBICubeId,
|
|
40568
|
-
appBIReportDimensions,
|
|
40569
|
-
appBIReportMeasures,
|
|
40570
|
-
reportUIModel
|
|
40571
|
-
} = appDEReport.appBIReport;
|
|
40572
|
-
config.selectCubeId = "".concat(tempAppBISchemeId, ".").concat(appBICubeId);
|
|
40573
|
-
if (reportUIModel) {
|
|
40574
|
-
const reportUIModelObj = JSON.parse(reportUIModel);
|
|
40575
|
-
config.selectChartType = reportUIModelObj.selectChartType;
|
|
40576
|
-
propertyData.style = reportUIModelObj.style;
|
|
40577
|
-
} else {
|
|
40578
|
-
config.selectChartType = "NUMBER";
|
|
40579
|
-
}
|
|
40580
|
-
if (appBIReportMeasures && appBIReportMeasures.length > 0) {
|
|
40581
|
-
appBIReportMeasures.forEach((measure) => {
|
|
40582
|
-
if (!biReportDatas.measure) {
|
|
40583
|
-
biReportDatas.measure = [];
|
|
40584
|
-
}
|
|
40585
|
-
biReportDatas.measure.push({
|
|
40586
|
-
pssysbischemeid: tempAppBISchemeId,
|
|
40587
|
-
pssysbicubemeasureid: "".concat(tempAppBISchemeId, ".").concat(appBICubeId, ".").concat(measure.measureTag),
|
|
40588
|
-
pssysbicubeid: "".concat(tempAppBISchemeId, ".").concat(appBICubeId),
|
|
40589
|
-
codename: measure.measureTag
|
|
40590
|
-
});
|
|
40591
|
-
});
|
|
40592
|
-
}
|
|
40593
|
-
if (appBIReportDimensions && appBIReportDimensions.length > 0) {
|
|
40594
|
-
appBIReportDimensions.forEach((dimension) => {
|
|
40595
|
-
if (!biReportDatas.dimension) {
|
|
40596
|
-
biReportDatas.dimension = [];
|
|
40597
|
-
}
|
|
40598
|
-
biReportDatas.dimension.push({
|
|
40599
|
-
pssysbischemeid: tempAppBISchemeId,
|
|
40600
|
-
pssysbicubedimensionid: "".concat(tempAppBISchemeId, ".").concat(appBICubeId, ".").concat(dimension.dimensionTag),
|
|
40601
|
-
pssysbicubeid: "".concat(tempAppBISchemeId, ".").concat(appBICubeId),
|
|
40602
|
-
codename: dimension.dimensionTag,
|
|
40603
|
-
pscodelistid: dimension.appCodeListId
|
|
40604
|
-
});
|
|
40605
|
-
});
|
|
40606
|
-
}
|
|
40607
|
-
config.propertyData = propertyData;
|
|
40608
|
-
return config;
|
|
40609
|
-
}
|
|
40610
40759
|
};
|
|
40611
40760
|
|
|
40612
40761
|
// src/controller/control/report-panel/generator/generator-factory.ts
|
|
@@ -40834,7 +40983,9 @@ var ReportPanelController = class extends ControlController {
|
|
|
40834
40983
|
dismiss: (_data) => modal.dismiss(_data),
|
|
40835
40984
|
context: this.context,
|
|
40836
40985
|
viewParams: this.params,
|
|
40837
|
-
config:
|
|
40986
|
+
config: await ibiz.util.biReport.translateReportPanelToConfig(
|
|
40987
|
+
this.model
|
|
40988
|
+
)
|
|
40838
40989
|
},
|
|
40839
40990
|
{
|
|
40840
40991
|
width: "90%",
|
|
@@ -41674,83 +41825,6 @@ var GanttController = class extends TreeGridExController {
|
|
|
41674
41825
|
}
|
|
41675
41826
|
}
|
|
41676
41827
|
}
|
|
41677
|
-
/**
|
|
41678
|
-
* 处理节点拖入事件
|
|
41679
|
-
*
|
|
41680
|
-
* @param {IGanttNodeData} draggingNode 拖动节点
|
|
41681
|
-
* @param {IGanttNodeData} dropNode 目标节点
|
|
41682
|
-
* @param {('inner' | 'prev' | 'next')} dropType 拖放类型
|
|
41683
|
-
* @return {*} {Promise<void>}
|
|
41684
|
-
* @memberof GanttController
|
|
41685
|
-
*/
|
|
41686
|
-
async onNodeDrop(draggingNode, dropNode, dropType) {
|
|
41687
|
-
var _a, _b;
|
|
41688
|
-
if (dropType === "inner" && !dropNode._leaf && dropNode._children === void 0) {
|
|
41689
|
-
await this.expandNodeByKey([dropNode._id]);
|
|
41690
|
-
}
|
|
41691
|
-
const modifiedNodeDatas = [];
|
|
41692
|
-
const draggingNodeModel = this.getNodeModel(draggingNode._nodeId);
|
|
41693
|
-
const dropInNode = dropType === "inner" ? dropNode : dropNode._parent;
|
|
41694
|
-
let orderNodeModel = this.getNodeModel(dropNode._nodeId);
|
|
41695
|
-
if (dropType === "inner" || ((_a = dropNode._parent) == null ? void 0 : _a._id) !== ((_b = draggingNode._parent) == null ? void 0 : _b._id)) {
|
|
41696
|
-
const dropNodeRs = this.findDropNodeRS(
|
|
41697
|
-
dropInNode._nodeId,
|
|
41698
|
-
draggingNodeModel.appDataEntityId
|
|
41699
|
-
);
|
|
41700
|
-
if (dropNodeRs) {
|
|
41701
|
-
draggingNode._deData[dropNodeRs.pickupDEFName] = dropInNode._value;
|
|
41702
|
-
modifiedNodeDatas.push(draggingNode);
|
|
41703
|
-
orderNodeModel = this.getNodeModel(dropNodeRs.childDETreeNodeId);
|
|
41704
|
-
}
|
|
41705
|
-
draggingNode._parent = dropInNode;
|
|
41706
|
-
draggingNode._nodeId = orderNodeModel.id;
|
|
41707
|
-
}
|
|
41708
|
-
const { sortAppDEFieldId, sortDir, allowOrder } = orderNodeModel;
|
|
41709
|
-
if (allowOrder === true) {
|
|
41710
|
-
if (!sortAppDEFieldId) {
|
|
41711
|
-
throw new RuntimeModelError72(
|
|
41712
|
-
orderNodeModel,
|
|
41713
|
-
ibiz.i18n.t("runtime.controller.control.tree.sortAttribute")
|
|
41714
|
-
);
|
|
41715
|
-
}
|
|
41716
|
-
const sortField = sortAppDEFieldId.toLowerCase();
|
|
41717
|
-
const isAsc = sortDir === "ASC";
|
|
41718
|
-
const changedArr = dropInNode._children;
|
|
41719
|
-
if (!isAsc) {
|
|
41720
|
-
changedArr.reverse();
|
|
41721
|
-
}
|
|
41722
|
-
const getNextSort = (num) => {
|
|
41723
|
-
return num + (100 - num % 100);
|
|
41724
|
-
};
|
|
41725
|
-
const getSort = (deData) => {
|
|
41726
|
-
return deData[sortField] || 0;
|
|
41727
|
-
};
|
|
41728
|
-
let lastSort;
|
|
41729
|
-
changedArr.forEach((item, index) => {
|
|
41730
|
-
const deData = item._deData;
|
|
41731
|
-
if (lastSort === void 0) {
|
|
41732
|
-
if (item === draggingNode) {
|
|
41733
|
-
if (index === 0) {
|
|
41734
|
-
lastSort = 100;
|
|
41735
|
-
} else {
|
|
41736
|
-
lastSort = getNextSort(getSort(changedArr[index - 1]._deData));
|
|
41737
|
-
}
|
|
41738
|
-
deData[sortField] = lastSort;
|
|
41739
|
-
if (modifiedNodeDatas.indexOf(item) === -1) {
|
|
41740
|
-
modifiedNodeDatas.push(item);
|
|
41741
|
-
}
|
|
41742
|
-
}
|
|
41743
|
-
} else {
|
|
41744
|
-
if (lastSort >= getSort(deData)) {
|
|
41745
|
-
deData[sortField] = getNextSort(lastSort);
|
|
41746
|
-
modifiedNodeDatas.push(item);
|
|
41747
|
-
}
|
|
41748
|
-
lastSort = getSort(deData);
|
|
41749
|
-
}
|
|
41750
|
-
});
|
|
41751
|
-
}
|
|
41752
|
-
await this.updateDeNodeData(modifiedNodeDatas);
|
|
41753
|
-
}
|
|
41754
41828
|
onDEDataChange(msg) {
|
|
41755
41829
|
}
|
|
41756
41830
|
};
|