@ibiz-template/runtime 0.2.5 → 0.2.7
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 +155 -47
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/controller/common/control/control.controller.d.ts +13 -0
- package/out/controller/common/control/control.controller.d.ts.map +1 -1
- package/out/controller/common/control/control.controller.js +33 -2
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +3 -0
- package/out/controller/control/chart/generator/chart-options-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/chart-options-generator.js +9 -5
- package/out/controller/control/chart/generator/funnel-series-generator.d.ts +6 -4
- package/out/controller/control/chart/generator/funnel-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/funnel-series-generator.js +7 -3
- package/out/controller/control/chart/generator/pie-series-generator.d.ts +6 -4
- package/out/controller/control/chart/generator/pie-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/pie-series-generator.js +7 -3
- package/out/controller/control/chart/generator/radar-series-generator.d.ts +1 -1
- package/out/controller/control/chart/generator/radar-series-generator.js +3 -3
- package/out/controller/control/dashboard/dashboard.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/dashboard.controller.js +9 -1
- package/out/controller/control/dashboard/portlet/actionbar-portlet/actionbar-portlet.controller.d.ts +5 -0
- package/out/controller/control/dashboard/portlet/actionbar-portlet/actionbar-portlet.controller.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/actionbar-portlet/actionbar-portlet.controller.js +3 -0
- package/out/controller/control/dashboard/portlet/actionbar-portlet/index.d.ts +2 -0
- package/out/controller/control/dashboard/portlet/actionbar-portlet/index.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/actionbar-portlet/index.js +1 -0
- package/out/controller/control/dashboard/portlet/html-portlet/html-portlet.controller.d.ts +5 -0
- package/out/controller/control/dashboard/portlet/html-portlet/html-portlet.controller.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/html-portlet/html-portlet.controller.js +3 -0
- package/out/controller/control/dashboard/portlet/html-portlet/index.d.ts +2 -0
- package/out/controller/control/dashboard/portlet/html-portlet/index.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/html-portlet/index.js +1 -0
- package/out/controller/control/dashboard/portlet/index.d.ts +4 -0
- package/out/controller/control/dashboard/portlet/index.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/index.js +4 -0
- package/out/controller/control/dashboard/portlet/list-portlet/index.d.ts +2 -0
- package/out/controller/control/dashboard/portlet/list-portlet/index.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/list-portlet/index.js +1 -0
- package/out/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.d.ts +5 -0
- package/out/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.js +3 -0
- package/out/controller/control/dashboard/portlet/rawitem-portlet/index.d.ts +2 -0
- package/out/controller/control/dashboard/portlet/rawitem-portlet/index.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/rawitem-portlet/index.js +1 -0
- package/out/controller/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.controller.d.ts +5 -0
- package/out/controller/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.controller.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.controller.js +3 -0
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.d.ts +2 -2
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-content-type.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-content-type.controller.js +11 -2
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.d.ts +2 -8
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.js +9 -10
- package/out/controller/control/grid/grid/grid.controller.d.ts +17 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +37 -9
- 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 +5 -1
- package/out/controller/control/pickup-view-panel/pickup-view-panel.controller.d.ts +4 -0
- package/out/controller/control/pickup-view-panel/pickup-view-panel.controller.d.ts.map +1 -1
- package/out/controller/control/pickup-view-panel/pickup-view-panel.controller.js +3 -0
- package/out/interface/common/i-global-config/i-global-config.d.ts +8 -0
- package/out/interface/common/i-global-config/i-global-config.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-control.controller.d.ts +11 -0
- package/out/interface/controller/controller/control/i-control.controller.d.ts.map +1 -1
- package/out/service/utils/res-path/res-path.d.ts.map +1 -1
- package/out/service/utils/res-path/res-path.js +4 -2
- package/out/service/vo/control.vo.js +2 -2
- package/package.json +3 -3
- package/src/controller/common/control/control.controller.ts +50 -3
- package/src/controller/common/control/md-control.controller.ts +4 -0
- package/src/controller/control/chart/generator/chart-options-generator.ts +13 -4
- package/src/controller/control/chart/generator/funnel-series-generator.ts +13 -7
- package/src/controller/control/chart/generator/pie-series-generator.ts +13 -7
- package/src/controller/control/chart/generator/radar-series-generator.ts +3 -3
- package/src/controller/control/dashboard/dashboard.controller.ts +11 -1
- package/src/controller/control/dashboard/portlet/actionbar-portlet/actionbar-portlet.controller.ts +4 -0
- package/src/controller/control/dashboard/portlet/actionbar-portlet/index.ts +1 -0
- package/src/controller/control/dashboard/portlet/html-portlet/html-portlet.controller.ts +4 -0
- package/src/controller/control/dashboard/portlet/html-portlet/index.ts +1 -0
- package/src/controller/control/dashboard/portlet/index.ts +4 -0
- package/src/controller/control/dashboard/portlet/list-portlet/index.ts +1 -0
- package/src/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.ts +4 -0
- package/src/controller/control/dashboard/portlet/rawitem-portlet/index.ts +1 -0
- package/src/controller/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.controller.ts +4 -0
- package/src/controller/control/form/form-detail/form-detail/form-detail.controller.ts +2 -2
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-content-type.controller.ts +9 -2
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.ts +12 -11
- package/src/controller/control/grid/grid/grid.controller.ts +46 -15
- package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +5 -1
- package/src/controller/control/pickup-view-panel/pickup-view-panel.controller.ts +7 -0
- package/src/interface/common/i-global-config/i-global-config.ts +9 -0
- package/src/interface/controller/controller/control/i-control.controller.ts +9 -0
- package/src/service/utils/res-path/res-path.ts +4 -2
- package/src/service/vo/control.vo.ts +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -22170,13 +22170,15 @@ var DECache = class {
|
|
|
22170
22170
|
};
|
|
22171
22171
|
|
|
22172
22172
|
// src/service/utils/res-path/res-path.ts
|
|
22173
|
-
var reg =
|
|
22173
|
+
var reg = /\$\{(.*?)\}/g;
|
|
22174
22174
|
function getMatchResPath(context, entity) {
|
|
22175
22175
|
const pathItems = entity.requestPaths || [];
|
|
22176
22176
|
const items = pathItems.map((str) => {
|
|
22177
|
+
const match = str.match(reg);
|
|
22178
|
+
const keys = (match == null ? void 0 : match.map((item) => item.substring(2, item.length - 1))) || [];
|
|
22177
22179
|
return {
|
|
22178
22180
|
path: str,
|
|
22179
|
-
keys
|
|
22181
|
+
keys
|
|
22180
22182
|
};
|
|
22181
22183
|
});
|
|
22182
22184
|
const filterItems = items.filter((item) => {
|
|
@@ -25337,10 +25339,10 @@ var ControlVO = class _ControlVO {
|
|
|
25337
25339
|
if (Object.prototype.hasOwnProperty.call(this.$origin, key)) {
|
|
25338
25340
|
Object.defineProperty(this, key, {
|
|
25339
25341
|
get() {
|
|
25340
|
-
return this.$origin
|
|
25342
|
+
return this.$origin[key];
|
|
25341
25343
|
},
|
|
25342
25344
|
set(val) {
|
|
25343
|
-
this.$origin
|
|
25345
|
+
this.$origin[key] = val;
|
|
25344
25346
|
},
|
|
25345
25347
|
enumerable: false,
|
|
25346
25348
|
configurable: true
|
|
@@ -28753,7 +28755,7 @@ var CodeListEditorController = class extends EditorController {
|
|
|
28753
28755
|
};
|
|
28754
28756
|
|
|
28755
28757
|
// src/controller/common/control/control.controller.ts
|
|
28756
|
-
import { NoticeError } from "@ibiz-template/core";
|
|
28758
|
+
import { IBizContext as IBizContext3, IBizParams, NoticeError } from "@ibiz-template/core";
|
|
28757
28759
|
import { isNil as isNil18 } from "ramda";
|
|
28758
28760
|
import { notNilEmpty as notNilEmpty7 } from "qx-util";
|
|
28759
28761
|
var ControlController = class extends BaseController {
|
|
@@ -28767,7 +28769,12 @@ var ControlController = class extends BaseController {
|
|
|
28767
28769
|
* @param {IParams} [params={}]
|
|
28768
28770
|
*/
|
|
28769
28771
|
constructor(model, context, params, ctx) {
|
|
28770
|
-
super(
|
|
28772
|
+
super(
|
|
28773
|
+
model,
|
|
28774
|
+
IBizContext3.create({}, context),
|
|
28775
|
+
new IBizParams({}, params),
|
|
28776
|
+
ctx
|
|
28777
|
+
);
|
|
28771
28778
|
/**
|
|
28772
28779
|
* 部件参数
|
|
28773
28780
|
*
|
|
@@ -28791,6 +28798,7 @@ var ControlController = class extends BaseController {
|
|
|
28791
28798
|
if (panelModel) {
|
|
28792
28799
|
this.controlPanel = panelModel;
|
|
28793
28800
|
}
|
|
28801
|
+
this.updateContextParams({});
|
|
28794
28802
|
}
|
|
28795
28803
|
get _evt() {
|
|
28796
28804
|
return this.evt;
|
|
@@ -28855,6 +28863,33 @@ var ControlController = class extends BaseController {
|
|
|
28855
28863
|
if (this.scheduler) {
|
|
28856
28864
|
this.scheduler.destroy();
|
|
28857
28865
|
}
|
|
28866
|
+
this.params.destroy();
|
|
28867
|
+
}
|
|
28868
|
+
/**
|
|
28869
|
+
* 处理上下文和导航参数相关的,如自定义导航参数的处理
|
|
28870
|
+
*
|
|
28871
|
+
* @author lxm
|
|
28872
|
+
* @date 2022-09-08 15:09:47
|
|
28873
|
+
* @protected
|
|
28874
|
+
*/
|
|
28875
|
+
updateContextParams(opts) {
|
|
28876
|
+
if (opts.context) {
|
|
28877
|
+
this.context.reset({}, opts.context);
|
|
28878
|
+
}
|
|
28879
|
+
if (opts.params) {
|
|
28880
|
+
this.params.reset({}, opts.params);
|
|
28881
|
+
}
|
|
28882
|
+
const { controlNavContexts, controlNavParams } = this.model;
|
|
28883
|
+
let context = {};
|
|
28884
|
+
if (notNilEmpty7(controlNavContexts)) {
|
|
28885
|
+
context = convertNavData(controlNavContexts, this.params, this.context);
|
|
28886
|
+
}
|
|
28887
|
+
Object.assign(this.context, context);
|
|
28888
|
+
let params = {};
|
|
28889
|
+
if (notNilEmpty7(controlNavParams)) {
|
|
28890
|
+
params = convertNavData(controlNavParams, this.params, this.context);
|
|
28891
|
+
}
|
|
28892
|
+
Object.assign(this.params, params);
|
|
28858
28893
|
}
|
|
28859
28894
|
/**
|
|
28860
28895
|
* 获取部件类型
|
|
@@ -29176,6 +29211,9 @@ var MDControlController = class extends ControlController {
|
|
|
29176
29211
|
} finally {
|
|
29177
29212
|
await this.endLoading();
|
|
29178
29213
|
}
|
|
29214
|
+
this.state.items.forEach((item, index) => {
|
|
29215
|
+
item.srfserialnum = index + 1;
|
|
29216
|
+
});
|
|
29179
29217
|
this.actionNotification("FETCHSUCCESS");
|
|
29180
29218
|
return this.state.items;
|
|
29181
29219
|
}
|
|
@@ -30246,11 +30284,15 @@ var FunnelSeriesGenerator = class extends BaseSeriesGenerator {
|
|
|
30246
30284
|
return options;
|
|
30247
30285
|
}
|
|
30248
30286
|
calcSeriesData(catalogData) {
|
|
30249
|
-
|
|
30287
|
+
const temData = [];
|
|
30288
|
+
catalogData.forEach((catalog, key) => {
|
|
30250
30289
|
var _a;
|
|
30251
|
-
|
|
30252
|
-
|
|
30290
|
+
temData.push({
|
|
30291
|
+
name: key,
|
|
30292
|
+
value: [catalog.value, (_a = catalog.deData) == null ? void 0 : _a.srfkey]
|
|
30293
|
+
});
|
|
30253
30294
|
});
|
|
30295
|
+
return temData;
|
|
30254
30296
|
}
|
|
30255
30297
|
getSrfkeyByParams(params) {
|
|
30256
30298
|
return params.value[1];
|
|
@@ -30266,11 +30308,15 @@ var PieSeriesGenerator = class extends BaseSeriesGenerator {
|
|
|
30266
30308
|
return options;
|
|
30267
30309
|
}
|
|
30268
30310
|
calcSeriesData(catalogData) {
|
|
30269
|
-
|
|
30311
|
+
const temData = [];
|
|
30312
|
+
catalogData.forEach((catalog, key) => {
|
|
30270
30313
|
var _a;
|
|
30271
|
-
|
|
30272
|
-
|
|
30314
|
+
temData.push({
|
|
30315
|
+
name: key,
|
|
30316
|
+
value: [catalog.value, (_a = catalog.deData) == null ? void 0 : _a.srfkey]
|
|
30317
|
+
});
|
|
30273
30318
|
});
|
|
30319
|
+
return temData;
|
|
30274
30320
|
}
|
|
30275
30321
|
getSrfkeyByParams(params) {
|
|
30276
30322
|
return params.value[1];
|
|
@@ -30379,8 +30425,8 @@ var RadarSeriesGenerator = class extends BaseSeriesGenerator {
|
|
|
30379
30425
|
}
|
|
30380
30426
|
const radar = this.chartGenerator.radarMap.get(this.catalogField);
|
|
30381
30427
|
Object.values(groupData).forEach((catalogData) => {
|
|
30382
|
-
|
|
30383
|
-
radar.updateIndicator(
|
|
30428
|
+
catalogData.forEach((catalog, key) => {
|
|
30429
|
+
radar.updateIndicator(key, catalog.value);
|
|
30384
30430
|
});
|
|
30385
30431
|
});
|
|
30386
30432
|
}
|
|
@@ -30549,13 +30595,9 @@ var ChartOptionsGenerator2 = class {
|
|
|
30549
30595
|
return titleOption;
|
|
30550
30596
|
}
|
|
30551
30597
|
calcLegendOption(chartLegend) {
|
|
30552
|
-
var _a;
|
|
30553
30598
|
const { showLegend, legendPos } = chartLegend;
|
|
30554
30599
|
const legendOption = {};
|
|
30555
30600
|
legendOption.show = showLegend;
|
|
30556
|
-
if (((_a = this.model.dechartSerieses) == null ? void 0 : _a.length) === 1) {
|
|
30557
|
-
legendOption.show = false;
|
|
30558
|
-
}
|
|
30559
30601
|
const position = legendPos == null ? void 0 : legendPos.toLowerCase();
|
|
30560
30602
|
if (position === "left" || position === "right") {
|
|
30561
30603
|
legendOption.left = position;
|
|
@@ -30690,6 +30732,9 @@ var ChartOptionsGenerator2 = class {
|
|
|
30690
30732
|
}
|
|
30691
30733
|
});
|
|
30692
30734
|
this.options.series = seriesOption;
|
|
30735
|
+
if (this.seriesGenerators.length === 1 && this.seriesGenerators[0].groupData && Object.keys(this.seriesGenerators[0].groupData).length === 1 && seriesOption[0].type && ["bar", "line", "scatter"].includes(seriesOption[0].type) && this.staticOptions.legend) {
|
|
30736
|
+
this.staticOptions.legend.show = false;
|
|
30737
|
+
}
|
|
30693
30738
|
this.options = mergeDeepRight3(
|
|
30694
30739
|
this.staticOptions,
|
|
30695
30740
|
this.options
|
|
@@ -32914,10 +32959,16 @@ var DashboardController = class extends ControlController {
|
|
|
32914
32959
|
if (!(portletModels == null ? void 0 : portletModels.length)) {
|
|
32915
32960
|
return;
|
|
32916
32961
|
}
|
|
32962
|
+
const ignorePortletTypes = [
|
|
32963
|
+
"CHART" /* CHART */,
|
|
32964
|
+
"APPMENU" /* APP_MENU */,
|
|
32965
|
+
"TOOLBAR" /* TOOLBAR */,
|
|
32966
|
+
"LIST" /* LIST */
|
|
32967
|
+
];
|
|
32917
32968
|
await Promise.all(
|
|
32918
32969
|
portletModels.map(async (portlet) => {
|
|
32919
32970
|
var _a;
|
|
32920
|
-
if (portlet.controlType
|
|
32971
|
+
if (portlet.controlType && ignorePortletTypes.includes(portlet.controlType)) {
|
|
32921
32972
|
return;
|
|
32922
32973
|
}
|
|
32923
32974
|
const provider = await getPortletProvider(portlet);
|
|
@@ -33269,6 +33320,22 @@ var MenuPortletController = class extends PortletPartController {
|
|
|
33269
33320
|
var ChartPortletController = class extends PortletPartController {
|
|
33270
33321
|
};
|
|
33271
33322
|
|
|
33323
|
+
// src/controller/control/dashboard/portlet/actionbar-portlet/actionbar-portlet.controller.ts
|
|
33324
|
+
var ActionBarPortletController = class extends PortletPartController {
|
|
33325
|
+
};
|
|
33326
|
+
|
|
33327
|
+
// src/controller/control/dashboard/portlet/html-portlet/html-portlet.controller.ts
|
|
33328
|
+
var HtmlPortletController = class extends PortletPartController {
|
|
33329
|
+
};
|
|
33330
|
+
|
|
33331
|
+
// src/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.ts
|
|
33332
|
+
var ListPortletController = class extends PortletPartController {
|
|
33333
|
+
};
|
|
33334
|
+
|
|
33335
|
+
// src/controller/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.controller.ts
|
|
33336
|
+
var RawItemPortletController = class extends PortletPartController {
|
|
33337
|
+
};
|
|
33338
|
+
|
|
33272
33339
|
// src/controller/control/data-view/data-view.controller.ts
|
|
33273
33340
|
import { RuntimeModelError as RuntimeModelError48 } from "@ibiz-template/core";
|
|
33274
33341
|
import { isNil as isNil20 } from "ramda";
|
|
@@ -35798,10 +35865,17 @@ var FormMDCtrlContentTypeController = class {
|
|
|
35798
35865
|
async initData() {
|
|
35799
35866
|
const name = this.model.appDEFieldId || this.model.fieldName || this.model.id;
|
|
35800
35867
|
if (name) {
|
|
35868
|
+
const data = this.parent.data[name];
|
|
35801
35869
|
if (this.model.contentType === "REPEATER" && this.model.detailStyle === "STYLE3") {
|
|
35802
|
-
|
|
35870
|
+
if (Array.isArray(data)) {
|
|
35871
|
+
this.parent.state.contentCtrlData = {};
|
|
35872
|
+
} else {
|
|
35873
|
+
this.parent.state.contentCtrlData = data || {};
|
|
35874
|
+
}
|
|
35875
|
+
} else if (!Array.isArray(data)) {
|
|
35876
|
+
this.parent.state.contentCtrlData = [];
|
|
35803
35877
|
} else {
|
|
35804
|
-
this.parent.state.contentCtrlData =
|
|
35878
|
+
this.parent.state.contentCtrlData = data || [];
|
|
35805
35879
|
}
|
|
35806
35880
|
}
|
|
35807
35881
|
}
|
|
@@ -37268,6 +37342,15 @@ var FormMDCtrlController = class extends FormDetailController {
|
|
|
37268
37342
|
if (this.mdCtrlContentController) {
|
|
37269
37343
|
await this.mdCtrlContentController.onInit();
|
|
37270
37344
|
}
|
|
37345
|
+
if (this.form.state.isLoaded) {
|
|
37346
|
+
this.mdCtrlContentController.initData();
|
|
37347
|
+
}
|
|
37348
|
+
this.form.evt.on("onLoadDraftSuccess", () => {
|
|
37349
|
+
this.mdCtrlContentController.initData();
|
|
37350
|
+
});
|
|
37351
|
+
this.form.evt.on("onLoadSuccess", () => {
|
|
37352
|
+
this.mdCtrlContentController.initData();
|
|
37353
|
+
});
|
|
37271
37354
|
}
|
|
37272
37355
|
/**
|
|
37273
37356
|
* 手动通知外部表单值变更
|
|
@@ -37282,16 +37365,6 @@ var FormMDCtrlController = class extends FormDetailController {
|
|
|
37282
37365
|
this.form.setDataValue(name, this.state.contentCtrlData);
|
|
37283
37366
|
}
|
|
37284
37367
|
}
|
|
37285
|
-
/**
|
|
37286
|
-
* 加载数据,要在表单加载完成之后再去加载
|
|
37287
|
-
*
|
|
37288
|
-
* @author zk
|
|
37289
|
-
* @date 2023-07-28 11:07:09
|
|
37290
|
-
* @memberof FormMDCtrlController
|
|
37291
|
-
*/
|
|
37292
|
-
async loadData() {
|
|
37293
|
-
await this.mdCtrlContentController.initData();
|
|
37294
|
-
}
|
|
37295
37368
|
/**
|
|
37296
37369
|
* 表单校验,通知子表单进行校验
|
|
37297
37370
|
*
|
|
@@ -37959,9 +38032,7 @@ var GridController = class extends MDControlController {
|
|
|
37959
38032
|
*/
|
|
37960
38033
|
afterRemove(data) {
|
|
37961
38034
|
super.afterRemove(data);
|
|
37962
|
-
const index = this.
|
|
37963
|
-
(item) => item.data.srfkey === data.srfkey
|
|
37964
|
-
);
|
|
38035
|
+
const index = this.findRowStateIndex(data);
|
|
37965
38036
|
this.state.rows.splice(index, 1);
|
|
37966
38037
|
this.state.groups.forEach((item) => {
|
|
37967
38038
|
if (item.children.length) {
|
|
@@ -37982,13 +38053,16 @@ var GridController = class extends MDControlController {
|
|
|
37982
38053
|
*/
|
|
37983
38054
|
async newRow() {
|
|
37984
38055
|
const { enableRowEdit, enableRowNew } = this.model;
|
|
37985
|
-
|
|
38056
|
+
const { editShowMode } = ibiz.config.grid;
|
|
38057
|
+
if (!enableRowEdit || !enableRowNew || !["row", "all"].includes(editShowMode)) {
|
|
37986
38058
|
ibiz.log.error("\u4E0D\u652F\u6301\u65B0\u5EFA\u884C");
|
|
37987
38059
|
return;
|
|
37988
38060
|
}
|
|
37989
|
-
|
|
37990
|
-
|
|
37991
|
-
|
|
38061
|
+
if (editShowMode === "row") {
|
|
38062
|
+
const editingRow = this.state.rows.find((item) => item.showRowEdit);
|
|
38063
|
+
if (editingRow) {
|
|
38064
|
+
throw new RuntimeError45("\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u884C\u7F16\u8F91\u4E2D\u7684\u884C\u7684\u64CD\u4F5C");
|
|
38065
|
+
}
|
|
37992
38066
|
}
|
|
37993
38067
|
const queryParams = { ...this.params };
|
|
37994
38068
|
const defaultData = this.calcDefaultValue({}, true);
|
|
@@ -38008,7 +38082,9 @@ var GridController = class extends MDControlController {
|
|
|
38008
38082
|
const newRow = new GridRowState(draftData, this);
|
|
38009
38083
|
this.state.rows.unshift(newRow);
|
|
38010
38084
|
this.gridStateNotify(newRow, "DRAFT" /* DRAFT */);
|
|
38011
|
-
|
|
38085
|
+
if (editShowMode === "row") {
|
|
38086
|
+
this.switchRowEdit(this.state.rows[0], true);
|
|
38087
|
+
}
|
|
38012
38088
|
this.actionNotification("GETDRAFTSUCCESS", { data: draftData });
|
|
38013
38089
|
}
|
|
38014
38090
|
/**
|
|
@@ -38023,9 +38099,8 @@ var GridController = class extends MDControlController {
|
|
|
38023
38099
|
if (this.state.isSimple) {
|
|
38024
38100
|
return;
|
|
38025
38101
|
}
|
|
38026
|
-
const
|
|
38027
|
-
|
|
38028
|
-
);
|
|
38102
|
+
const isCreate = data.srfuf === 0 /* CREATE */;
|
|
38103
|
+
const rowState = this.findRowState(data);
|
|
38029
38104
|
if (!rowState) {
|
|
38030
38105
|
throw new RuntimeError45("\u884C\u6570\u636E\u4E0D\u5B58\u5728");
|
|
38031
38106
|
}
|
|
@@ -38043,7 +38118,6 @@ var GridController = class extends MDControlController {
|
|
|
38043
38118
|
}
|
|
38044
38119
|
await this.startLoading();
|
|
38045
38120
|
let res;
|
|
38046
|
-
const isCreate = data.srfuf === 0 /* CREATE */;
|
|
38047
38121
|
const deName = calcDeCodeNameById(this.model.appDataEntityId);
|
|
38048
38122
|
const tempContext = this.context.clone();
|
|
38049
38123
|
tempContext[deName] = data.srfkey;
|
|
@@ -38059,9 +38133,7 @@ var GridController = class extends MDControlController {
|
|
|
38059
38133
|
} finally {
|
|
38060
38134
|
await this.endLoading();
|
|
38061
38135
|
}
|
|
38062
|
-
const index = this.
|
|
38063
|
-
(item) => item.srfkey === data.srfkey
|
|
38064
|
-
);
|
|
38136
|
+
const index = this.findRowStateIndex(data);
|
|
38065
38137
|
this.state.items.splice(index, 1, res.data);
|
|
38066
38138
|
rowState.data = res.data;
|
|
38067
38139
|
rowState.modified = false;
|
|
@@ -38504,6 +38576,31 @@ var GridController = class extends MDControlController {
|
|
|
38504
38576
|
});
|
|
38505
38577
|
return result;
|
|
38506
38578
|
}
|
|
38579
|
+
/**
|
|
38580
|
+
* 查找rowState
|
|
38581
|
+
* @author lxm
|
|
38582
|
+
* @date 2023-10-27 07:27:48
|
|
38583
|
+
* @param {IData} data
|
|
38584
|
+
* @return {*} {(IGridRowState)}
|
|
38585
|
+
*/
|
|
38586
|
+
findRowStateIndex(data) {
|
|
38587
|
+
const isCreate = data.srfuf === 0 /* CREATE */;
|
|
38588
|
+
const compareKey = isCreate ? "tempsrfkey" : "srfkey";
|
|
38589
|
+
return this.state.rows.findIndex(
|
|
38590
|
+
(item) => item.data[compareKey] === data[compareKey]
|
|
38591
|
+
);
|
|
38592
|
+
}
|
|
38593
|
+
/**
|
|
38594
|
+
* 查找rowState
|
|
38595
|
+
* @author lxm
|
|
38596
|
+
* @date 2023-10-27 07:27:48
|
|
38597
|
+
* @param {IData} data
|
|
38598
|
+
* @return {*} {(IGridRowState | undefined)}
|
|
38599
|
+
*/
|
|
38600
|
+
findRowState(data) {
|
|
38601
|
+
const index = this.findRowStateIndex(data);
|
|
38602
|
+
return index !== -1 ? this.state.rows[index] : void 0;
|
|
38603
|
+
}
|
|
38507
38604
|
};
|
|
38508
38605
|
|
|
38509
38606
|
// src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
|
|
@@ -38745,7 +38842,11 @@ var GridFieldColumnController = class extends GridColumnController {
|
|
|
38745
38842
|
}
|
|
38746
38843
|
const isDate = DataTypes3.isDate(this.dataType);
|
|
38747
38844
|
if (isDate) {
|
|
38748
|
-
|
|
38845
|
+
const formatVal = dayjs4(strVal).format(this.valueFormat);
|
|
38846
|
+
if (formatVal !== "Invalid Date") {
|
|
38847
|
+
return formatVal;
|
|
38848
|
+
}
|
|
38849
|
+
return strVal;
|
|
38749
38850
|
}
|
|
38750
38851
|
return ibiz.util.text.format(strVal, this.valueFormat);
|
|
38751
38852
|
}
|
|
@@ -39914,6 +40015,9 @@ var PickupViewPanelController = class extends ControlController {
|
|
|
39914
40015
|
async onCreated() {
|
|
39915
40016
|
await super.onCreated();
|
|
39916
40017
|
this.mountCounter.enroll(this.model.embeddedAppDEViewId);
|
|
40018
|
+
}
|
|
40019
|
+
updateContextParams(opts) {
|
|
40020
|
+
super.updateContextParams(opts);
|
|
39917
40021
|
this.initNavParam();
|
|
39918
40022
|
}
|
|
39919
40023
|
/**
|
|
@@ -44635,6 +44739,7 @@ var RemotePluginItem = class {
|
|
|
44635
44739
|
};
|
|
44636
44740
|
export {
|
|
44637
44741
|
APP_COUNTER_PROVIDER_PREFIX,
|
|
44742
|
+
ActionBarPortletController,
|
|
44638
44743
|
ActivityCounter,
|
|
44639
44744
|
AppCounter,
|
|
44640
44745
|
AppDECounter,
|
|
@@ -44733,11 +44838,13 @@ export {
|
|
|
44733
44838
|
GridService,
|
|
44734
44839
|
GridUAColumnController,
|
|
44735
44840
|
HandlebarsUtil,
|
|
44841
|
+
HtmlPortletController,
|
|
44736
44842
|
HubController,
|
|
44737
44843
|
KanbanController,
|
|
44738
44844
|
KanbanService,
|
|
44739
44845
|
LayoutPanelUtil,
|
|
44740
44846
|
ListController,
|
|
44847
|
+
ListPortletController,
|
|
44741
44848
|
ListService,
|
|
44742
44849
|
LoadingState,
|
|
44743
44850
|
MDControlController,
|
|
@@ -44766,6 +44873,7 @@ export {
|
|
|
44766
44873
|
PortletPartController,
|
|
44767
44874
|
PortletPartState,
|
|
44768
44875
|
QXEventEx,
|
|
44876
|
+
RawItemPortletController,
|
|
44769
44877
|
RawValueUtil,
|
|
44770
44878
|
RegisterCenter,
|
|
44771
44879
|
RemotePluginItem,
|