@ibiz-template/runtime 0.2.5 → 0.2.6
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 +123 -32
- 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/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/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/package.json +3 -3
- package/src/controller/common/control/control.controller.ts +50 -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/interface/controller/controller/control/i-control.controller.ts +9 -0
- package/src/service/utils/res-path/res-path.ts +4 -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) => {
|
|
@@ -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
|
* 获取部件类型
|
|
@@ -32914,10 +32949,16 @@ var DashboardController = class extends ControlController {
|
|
|
32914
32949
|
if (!(portletModels == null ? void 0 : portletModels.length)) {
|
|
32915
32950
|
return;
|
|
32916
32951
|
}
|
|
32952
|
+
const ignorePortletTypes = [
|
|
32953
|
+
"CHART" /* CHART */,
|
|
32954
|
+
"APPMENU" /* APP_MENU */,
|
|
32955
|
+
"TOOLBAR" /* TOOLBAR */,
|
|
32956
|
+
"LIST" /* LIST */
|
|
32957
|
+
];
|
|
32917
32958
|
await Promise.all(
|
|
32918
32959
|
portletModels.map(async (portlet) => {
|
|
32919
32960
|
var _a;
|
|
32920
|
-
if (portlet.controlType
|
|
32961
|
+
if (portlet.controlType && ignorePortletTypes.includes(portlet.controlType)) {
|
|
32921
32962
|
return;
|
|
32922
32963
|
}
|
|
32923
32964
|
const provider = await getPortletProvider(portlet);
|
|
@@ -33269,6 +33310,22 @@ var MenuPortletController = class extends PortletPartController {
|
|
|
33269
33310
|
var ChartPortletController = class extends PortletPartController {
|
|
33270
33311
|
};
|
|
33271
33312
|
|
|
33313
|
+
// src/controller/control/dashboard/portlet/actionbar-portlet/actionbar-portlet.controller.ts
|
|
33314
|
+
var ActionBarPortletController = class extends PortletPartController {
|
|
33315
|
+
};
|
|
33316
|
+
|
|
33317
|
+
// src/controller/control/dashboard/portlet/html-portlet/html-portlet.controller.ts
|
|
33318
|
+
var HtmlPortletController = class extends PortletPartController {
|
|
33319
|
+
};
|
|
33320
|
+
|
|
33321
|
+
// src/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.ts
|
|
33322
|
+
var ListPortletController = class extends PortletPartController {
|
|
33323
|
+
};
|
|
33324
|
+
|
|
33325
|
+
// src/controller/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.controller.ts
|
|
33326
|
+
var RawItemPortletController = class extends PortletPartController {
|
|
33327
|
+
};
|
|
33328
|
+
|
|
33272
33329
|
// src/controller/control/data-view/data-view.controller.ts
|
|
33273
33330
|
import { RuntimeModelError as RuntimeModelError48 } from "@ibiz-template/core";
|
|
33274
33331
|
import { isNil as isNil20 } from "ramda";
|
|
@@ -35798,10 +35855,17 @@ var FormMDCtrlContentTypeController = class {
|
|
|
35798
35855
|
async initData() {
|
|
35799
35856
|
const name = this.model.appDEFieldId || this.model.fieldName || this.model.id;
|
|
35800
35857
|
if (name) {
|
|
35858
|
+
const data = this.parent.data[name];
|
|
35801
35859
|
if (this.model.contentType === "REPEATER" && this.model.detailStyle === "STYLE3") {
|
|
35802
|
-
|
|
35860
|
+
if (Array.isArray(data)) {
|
|
35861
|
+
this.parent.state.contentCtrlData = {};
|
|
35862
|
+
} else {
|
|
35863
|
+
this.parent.state.contentCtrlData = data || {};
|
|
35864
|
+
}
|
|
35865
|
+
} else if (!Array.isArray(data)) {
|
|
35866
|
+
this.parent.state.contentCtrlData = [];
|
|
35803
35867
|
} else {
|
|
35804
|
-
this.parent.state.contentCtrlData =
|
|
35868
|
+
this.parent.state.contentCtrlData = data || [];
|
|
35805
35869
|
}
|
|
35806
35870
|
}
|
|
35807
35871
|
}
|
|
@@ -37268,6 +37332,15 @@ var FormMDCtrlController = class extends FormDetailController {
|
|
|
37268
37332
|
if (this.mdCtrlContentController) {
|
|
37269
37333
|
await this.mdCtrlContentController.onInit();
|
|
37270
37334
|
}
|
|
37335
|
+
if (this.form.state.isLoaded) {
|
|
37336
|
+
this.mdCtrlContentController.initData();
|
|
37337
|
+
}
|
|
37338
|
+
this.form.evt.on("onLoadDraftSuccess", () => {
|
|
37339
|
+
this.mdCtrlContentController.initData();
|
|
37340
|
+
});
|
|
37341
|
+
this.form.evt.on("onLoadSuccess", () => {
|
|
37342
|
+
this.mdCtrlContentController.initData();
|
|
37343
|
+
});
|
|
37271
37344
|
}
|
|
37272
37345
|
/**
|
|
37273
37346
|
* 手动通知外部表单值变更
|
|
@@ -37282,16 +37355,6 @@ var FormMDCtrlController = class extends FormDetailController {
|
|
|
37282
37355
|
this.form.setDataValue(name, this.state.contentCtrlData);
|
|
37283
37356
|
}
|
|
37284
37357
|
}
|
|
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
37358
|
/**
|
|
37296
37359
|
* 表单校验,通知子表单进行校验
|
|
37297
37360
|
*
|
|
@@ -37959,9 +38022,7 @@ var GridController = class extends MDControlController {
|
|
|
37959
38022
|
*/
|
|
37960
38023
|
afterRemove(data) {
|
|
37961
38024
|
super.afterRemove(data);
|
|
37962
|
-
const index = this.
|
|
37963
|
-
(item) => item.data.srfkey === data.srfkey
|
|
37964
|
-
);
|
|
38025
|
+
const index = this.findRowStateIndex(data);
|
|
37965
38026
|
this.state.rows.splice(index, 1);
|
|
37966
38027
|
this.state.groups.forEach((item) => {
|
|
37967
38028
|
if (item.children.length) {
|
|
@@ -37982,13 +38043,16 @@ var GridController = class extends MDControlController {
|
|
|
37982
38043
|
*/
|
|
37983
38044
|
async newRow() {
|
|
37984
38045
|
const { enableRowEdit, enableRowNew } = this.model;
|
|
37985
|
-
|
|
38046
|
+
const { editShowMode } = ibiz.config.grid;
|
|
38047
|
+
if (!enableRowEdit || !enableRowNew || !["row", "all"].includes(editShowMode)) {
|
|
37986
38048
|
ibiz.log.error("\u4E0D\u652F\u6301\u65B0\u5EFA\u884C");
|
|
37987
38049
|
return;
|
|
37988
38050
|
}
|
|
37989
|
-
|
|
37990
|
-
|
|
37991
|
-
|
|
38051
|
+
if (editShowMode === "row") {
|
|
38052
|
+
const editingRow = this.state.rows.find((item) => item.showRowEdit);
|
|
38053
|
+
if (editingRow) {
|
|
38054
|
+
throw new RuntimeError45("\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u884C\u7F16\u8F91\u4E2D\u7684\u884C\u7684\u64CD\u4F5C");
|
|
38055
|
+
}
|
|
37992
38056
|
}
|
|
37993
38057
|
const queryParams = { ...this.params };
|
|
37994
38058
|
const defaultData = this.calcDefaultValue({}, true);
|
|
@@ -38008,7 +38072,9 @@ var GridController = class extends MDControlController {
|
|
|
38008
38072
|
const newRow = new GridRowState(draftData, this);
|
|
38009
38073
|
this.state.rows.unshift(newRow);
|
|
38010
38074
|
this.gridStateNotify(newRow, "DRAFT" /* DRAFT */);
|
|
38011
|
-
|
|
38075
|
+
if (editShowMode === "row") {
|
|
38076
|
+
this.switchRowEdit(this.state.rows[0], true);
|
|
38077
|
+
}
|
|
38012
38078
|
this.actionNotification("GETDRAFTSUCCESS", { data: draftData });
|
|
38013
38079
|
}
|
|
38014
38080
|
/**
|
|
@@ -38023,9 +38089,8 @@ var GridController = class extends MDControlController {
|
|
|
38023
38089
|
if (this.state.isSimple) {
|
|
38024
38090
|
return;
|
|
38025
38091
|
}
|
|
38026
|
-
const
|
|
38027
|
-
|
|
38028
|
-
);
|
|
38092
|
+
const isCreate = data.srfuf === 0 /* CREATE */;
|
|
38093
|
+
const rowState = this.findRowState(data);
|
|
38029
38094
|
if (!rowState) {
|
|
38030
38095
|
throw new RuntimeError45("\u884C\u6570\u636E\u4E0D\u5B58\u5728");
|
|
38031
38096
|
}
|
|
@@ -38043,7 +38108,6 @@ var GridController = class extends MDControlController {
|
|
|
38043
38108
|
}
|
|
38044
38109
|
await this.startLoading();
|
|
38045
38110
|
let res;
|
|
38046
|
-
const isCreate = data.srfuf === 0 /* CREATE */;
|
|
38047
38111
|
const deName = calcDeCodeNameById(this.model.appDataEntityId);
|
|
38048
38112
|
const tempContext = this.context.clone();
|
|
38049
38113
|
tempContext[deName] = data.srfkey;
|
|
@@ -38059,9 +38123,7 @@ var GridController = class extends MDControlController {
|
|
|
38059
38123
|
} finally {
|
|
38060
38124
|
await this.endLoading();
|
|
38061
38125
|
}
|
|
38062
|
-
const index = this.
|
|
38063
|
-
(item) => item.srfkey === data.srfkey
|
|
38064
|
-
);
|
|
38126
|
+
const index = this.findRowStateIndex(data);
|
|
38065
38127
|
this.state.items.splice(index, 1, res.data);
|
|
38066
38128
|
rowState.data = res.data;
|
|
38067
38129
|
rowState.modified = false;
|
|
@@ -38504,6 +38566,31 @@ var GridController = class extends MDControlController {
|
|
|
38504
38566
|
});
|
|
38505
38567
|
return result;
|
|
38506
38568
|
}
|
|
38569
|
+
/**
|
|
38570
|
+
* 查找rowState
|
|
38571
|
+
* @author lxm
|
|
38572
|
+
* @date 2023-10-27 07:27:48
|
|
38573
|
+
* @param {IData} data
|
|
38574
|
+
* @return {*} {(IGridRowState)}
|
|
38575
|
+
*/
|
|
38576
|
+
findRowStateIndex(data) {
|
|
38577
|
+
const isCreate = data.srfuf === 0 /* CREATE */;
|
|
38578
|
+
const compareKey = isCreate ? "tempsrfkey" : "srfkey";
|
|
38579
|
+
return this.state.rows.findIndex(
|
|
38580
|
+
(item) => item.data[compareKey] === data[compareKey]
|
|
38581
|
+
);
|
|
38582
|
+
}
|
|
38583
|
+
/**
|
|
38584
|
+
* 查找rowState
|
|
38585
|
+
* @author lxm
|
|
38586
|
+
* @date 2023-10-27 07:27:48
|
|
38587
|
+
* @param {IData} data
|
|
38588
|
+
* @return {*} {(IGridRowState | undefined)}
|
|
38589
|
+
*/
|
|
38590
|
+
findRowState(data) {
|
|
38591
|
+
const index = this.findRowStateIndex(data);
|
|
38592
|
+
return index !== -1 ? this.state.rows[index] : void 0;
|
|
38593
|
+
}
|
|
38507
38594
|
};
|
|
38508
38595
|
|
|
38509
38596
|
// src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
|
|
@@ -44635,6 +44722,7 @@ var RemotePluginItem = class {
|
|
|
44635
44722
|
};
|
|
44636
44723
|
export {
|
|
44637
44724
|
APP_COUNTER_PROVIDER_PREFIX,
|
|
44725
|
+
ActionBarPortletController,
|
|
44638
44726
|
ActivityCounter,
|
|
44639
44727
|
AppCounter,
|
|
44640
44728
|
AppDECounter,
|
|
@@ -44733,11 +44821,13 @@ export {
|
|
|
44733
44821
|
GridService,
|
|
44734
44822
|
GridUAColumnController,
|
|
44735
44823
|
HandlebarsUtil,
|
|
44824
|
+
HtmlPortletController,
|
|
44736
44825
|
HubController,
|
|
44737
44826
|
KanbanController,
|
|
44738
44827
|
KanbanService,
|
|
44739
44828
|
LayoutPanelUtil,
|
|
44740
44829
|
ListController,
|
|
44830
|
+
ListPortletController,
|
|
44741
44831
|
ListService,
|
|
44742
44832
|
LoadingState,
|
|
44743
44833
|
MDControlController,
|
|
@@ -44766,6 +44856,7 @@ export {
|
|
|
44766
44856
|
PortletPartController,
|
|
44767
44857
|
PortletPartState,
|
|
44768
44858
|
QXEventEx,
|
|
44859
|
+
RawItemPortletController,
|
|
44769
44860
|
RawValueUtil,
|
|
44770
44861
|
RegisterCenter,
|
|
44771
44862
|
RemotePluginItem,
|