@ibiz-template/runtime 0.6.8 → 0.6.9
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 +241 -64
- package/dist/index.system.min.js +1 -1
- package/out/controller/common/control/control.controller.d.ts.map +1 -1
- package/out/controller/common/control/control.controller.js +6 -2
- package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.js +3 -3
- package/out/controller/control/data-view/data-view.controller.d.ts.map +1 -1
- package/out/controller/control/data-view/data-view.controller.js +5 -5
- package/out/controller/control/form/form/form.controller.d.ts +2 -0
- package/out/controller/control/form/form/form.controller.d.ts.map +1 -1
- package/out/controller/control/form/form/form.controller.js +28 -23
- package/out/controller/control/form/form-detail/form-button/form-button.controller.js +1 -1
- package/out/controller/control/form/form-detail/form-group-panel/form-group-panel.controller.js +1 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +2 -2
- package/out/controller/control/md-ctrl/md-ctrl.controller.js +1 -1
- package/out/controller/control/toolbar/toolbar.controllerr.js +2 -2
- package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-node-column.controller.js +1 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.js +1 -1
- package/out/controller/utils/button-state/button-container.state.d.ts +1 -1
- package/out/controller/utils/button-state/button-container.state.d.ts.map +1 -1
- package/out/controller/utils/button-state/button-container.state.js +2 -2
- package/out/controller/utils/button-state/ui-action-button.state.d.ts +2 -2
- package/out/controller/utils/button-state/ui-action-button.state.d.ts.map +1 -1
- package/out/controller/utils/button-state/ui-action-button.state.js +4 -4
- package/out/de-logic/de-logic.js +1 -1
- package/out/interface/controller/common/button-state/i-button-container.state.d.ts +4 -4
- package/out/interface/controller/common/button-state/i-button-container.state.d.ts.map +1 -1
- package/out/interface/controller/common/button-state/i-button.state.d.ts +4 -4
- package/out/interface/controller/common/button-state/i-button.state.d.ts.map +1 -1
- package/out/interface/service/code-list-item/code-list-item.d.ts +10 -0
- package/out/interface/service/code-list-item/code-list-item.d.ts.map +1 -1
- package/out/interface/service/service/i-app-de-authority.service.d.ts +19 -3
- package/out/interface/service/service/i-app-de-authority.service.d.ts.map +1 -1
- package/out/service/service/authority/authority.service.d.ts +2 -1
- package/out/service/service/authority/authority.service.d.ts.map +1 -1
- package/out/service/service/authority/authority.service.js +5 -4
- package/out/service/service/authority/de-authority.service.d.ts +45 -4
- package/out/service/service/authority/de-authority.service.d.ts.map +1 -1
- package/out/service/service/authority/de-authority.service.js +106 -12
- package/out/service/service/control/control.service.d.ts +9 -0
- package/out/service/service/control/control.service.d.ts.map +1 -1
- package/out/service/service/control/control.service.js +19 -0
- package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts +1 -0
- package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
- package/out/service/utils/dynamic-code-list/dynamic-code-list.js +23 -1
- package/out/service/utils/util/util.d.ts +1 -1
- package/out/service/utils/util/util.d.ts.map +1 -1
- package/out/ui-logic/ui-logic.js +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3327,8 +3327,8 @@ var baseStyle = {
|
|
|
3327
3327
|
position: "fixed",
|
|
3328
3328
|
zIndex: "10000"
|
|
3329
3329
|
};
|
|
3330
|
-
function cloneElement(
|
|
3331
|
-
const element = getAnimationElement(
|
|
3330
|
+
function cloneElement(clone34, teleport = document.body, isRemoveChild = true) {
|
|
3331
|
+
const element = getAnimationElement(clone34);
|
|
3332
3332
|
if (element == null) {
|
|
3333
3333
|
throw new Error("Cannot clone a null or undefined element.");
|
|
3334
3334
|
}
|
|
@@ -3747,11 +3747,11 @@ function arrayContains(arr, val) {
|
|
|
3747
3747
|
});
|
|
3748
3748
|
}
|
|
3749
3749
|
function cloneObject(o) {
|
|
3750
|
-
var
|
|
3750
|
+
var clone34 = {};
|
|
3751
3751
|
for (var p in o) {
|
|
3752
|
-
|
|
3752
|
+
clone34[p] = o[p];
|
|
3753
3753
|
}
|
|
3754
|
-
return
|
|
3754
|
+
return clone34;
|
|
3755
3755
|
}
|
|
3756
3756
|
function replaceObjectProps(o1, o2) {
|
|
3757
3757
|
var o = cloneObject(o1);
|
|
@@ -6568,6 +6568,19 @@ var DynamicCodeListCache = class {
|
|
|
6568
6568
|
}
|
|
6569
6569
|
return result;
|
|
6570
6570
|
}
|
|
6571
|
+
presetconvertData(data) {
|
|
6572
|
+
const result = {};
|
|
6573
|
+
const { color, bkcolor, disabled, id, text, label, value, cls } = data;
|
|
6574
|
+
result.value = value;
|
|
6575
|
+
result.color = color;
|
|
6576
|
+
result.bkcolor = bkcolor;
|
|
6577
|
+
result.text = text;
|
|
6578
|
+
result.id = id;
|
|
6579
|
+
result.id = label;
|
|
6580
|
+
result.disableSelect = disabled;
|
|
6581
|
+
result.cls = cls;
|
|
6582
|
+
return result;
|
|
6583
|
+
}
|
|
6571
6584
|
/**
|
|
6572
6585
|
* 加载服务获取数据,返回代码项
|
|
6573
6586
|
*
|
|
@@ -6612,7 +6625,18 @@ var DynamicCodeListCache = class {
|
|
|
6612
6625
|
"/dictionaries/codelist/".concat(tag),
|
|
6613
6626
|
tempParams
|
|
6614
6627
|
);
|
|
6615
|
-
|
|
6628
|
+
const presetresultItems = [];
|
|
6629
|
+
if (res2.data.items.every((item) => "showorder" in item)) {
|
|
6630
|
+
return res2.data.items.sort(
|
|
6631
|
+
(a, b) => (b.showorder || 0) - (a.showorder || 0)
|
|
6632
|
+
);
|
|
6633
|
+
}
|
|
6634
|
+
if (res2.data.items.length) {
|
|
6635
|
+
res2.data.items.forEach((item) => {
|
|
6636
|
+
presetresultItems.push(this.presetconvertData(item));
|
|
6637
|
+
});
|
|
6638
|
+
}
|
|
6639
|
+
return Object.freeze(presetresultItems);
|
|
6616
6640
|
}
|
|
6617
6641
|
if (!appDataEntityId) {
|
|
6618
6642
|
throw new RuntimeModelError7(this.codeList, "\u672A\u914D\u7F6E\u5E94\u7528\u5B9E\u4F53");
|
|
@@ -8994,8 +9018,30 @@ var ControlService = class {
|
|
|
8994
9018
|
params,
|
|
8995
9019
|
header
|
|
8996
9020
|
);
|
|
9021
|
+
await this.handleItemPrivilege(res.data, context);
|
|
8997
9022
|
return res;
|
|
8998
9023
|
}
|
|
9024
|
+
/**
|
|
9025
|
+
* 处理启用项权限标识
|
|
9026
|
+
*
|
|
9027
|
+
* @protected
|
|
9028
|
+
* @param {IData} data 实体数据
|
|
9029
|
+
* @param {IContext} context 上下文
|
|
9030
|
+
* @memberof ControlService
|
|
9031
|
+
*/
|
|
9032
|
+
async handleItemPrivilege(data, context) {
|
|
9033
|
+
const { enableItemPrivilege, appDataEntityId } = this.model;
|
|
9034
|
+
if (enableItemPrivilege && appDataEntityId) {
|
|
9035
|
+
const deAuthority = await this.app.authority.getService(appDataEntityId);
|
|
9036
|
+
const items = Array.isArray(data) ? data : [data];
|
|
9037
|
+
items.forEach((item) => {
|
|
9038
|
+
deAuthority.setDataAccAction(
|
|
9039
|
+
{ srfkey: item.srfkey, srfsessionid: context.srfsessionid },
|
|
9040
|
+
item.srfdataaccaction
|
|
9041
|
+
);
|
|
9042
|
+
});
|
|
9043
|
+
}
|
|
9044
|
+
}
|
|
8999
9045
|
/**
|
|
9000
9046
|
* 处理自定义请求头
|
|
9001
9047
|
*
|
|
@@ -9206,22 +9252,58 @@ import { RuntimeError as RuntimeError21 } from "@ibiz-template/core";
|
|
|
9206
9252
|
var DeAuthorityService = class {
|
|
9207
9253
|
constructor(entityModel) {
|
|
9208
9254
|
this.entityModel = entityModel;
|
|
9255
|
+
/**
|
|
9256
|
+
* 数据权限MAP
|
|
9257
|
+
*
|
|
9258
|
+
* @protected
|
|
9259
|
+
* @type {Map<string, string>}
|
|
9260
|
+
* @memberof DeAuthorityService
|
|
9261
|
+
*/
|
|
9262
|
+
this.dataAccActionMap = /* @__PURE__ */ new Map();
|
|
9263
|
+
}
|
|
9264
|
+
/**
|
|
9265
|
+
* 设置实体数据权限标识
|
|
9266
|
+
*
|
|
9267
|
+
* @param {IParams} params
|
|
9268
|
+
* @param {string} dataAccAction
|
|
9269
|
+
* @memberof DeAuthorityService
|
|
9270
|
+
*/
|
|
9271
|
+
setDataAccAction(params, dataAccAction) {
|
|
9272
|
+
if (params.srfsessionid) {
|
|
9273
|
+
this.dataAccActionMap.set(
|
|
9274
|
+
"".concat(params.srfsessionid, "-").concat(params.srfkey),
|
|
9275
|
+
dataAccAction
|
|
9276
|
+
);
|
|
9277
|
+
}
|
|
9278
|
+
this.dataAccActionMap.set(params.srfkey, dataAccAction);
|
|
9279
|
+
}
|
|
9280
|
+
/**
|
|
9281
|
+
* 获取实体数据权限标识
|
|
9282
|
+
*
|
|
9283
|
+
* @param {string} key
|
|
9284
|
+
* @return {*} {(string | undefined)}
|
|
9285
|
+
* @memberof DeAuthorityService
|
|
9286
|
+
*/
|
|
9287
|
+
getDataAccAction(key) {
|
|
9288
|
+
return this.dataAccActionMap.get(key);
|
|
9209
9289
|
}
|
|
9210
9290
|
/**
|
|
9211
9291
|
* 通过操作标识计算权限
|
|
9212
9292
|
* @author lxm
|
|
9213
9293
|
* @date 2023-05-10 12:33:10
|
|
9214
9294
|
* @param {string} dataAccessAction 操作标识
|
|
9215
|
-
* @param {IData}
|
|
9216
|
-
* @param {
|
|
9295
|
+
* @param {IData} data 实体数据
|
|
9296
|
+
* @param {IContext} context 上下文
|
|
9217
9297
|
* @return {*} {Promise<boolean>}
|
|
9218
9298
|
*/
|
|
9219
|
-
async calcByDataAccessAction(dataAccessAction, data) {
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9299
|
+
async calcByDataAccessAction(dataAccessAction, data, context) {
|
|
9300
|
+
const deDataAccActionResult = await this.calcDeDataAccAction(
|
|
9301
|
+
dataAccessAction,
|
|
9302
|
+
data,
|
|
9303
|
+
context
|
|
9304
|
+
);
|
|
9305
|
+
if (!deDataAccActionResult) {
|
|
9306
|
+
return false;
|
|
9225
9307
|
}
|
|
9226
9308
|
const mainStateResult = await this.calcByDeMainState(
|
|
9227
9309
|
dataAccessAction,
|
|
@@ -9232,6 +9314,75 @@ var DeAuthorityService = class {
|
|
|
9232
9314
|
}
|
|
9233
9315
|
return true;
|
|
9234
9316
|
}
|
|
9317
|
+
/**
|
|
9318
|
+
* 计算实体附属主实体控制操作标识
|
|
9319
|
+
*/
|
|
9320
|
+
async calcMajorDataAccAction(context) {
|
|
9321
|
+
const { minorAppDERSs } = this.entityModel;
|
|
9322
|
+
if (!minorAppDERSs)
|
|
9323
|
+
return;
|
|
9324
|
+
const appDeRSs = minorAppDERSs == null ? void 0 : minorAppDERSs.find((rs) => {
|
|
9325
|
+
const majorDeName = calcDeCodeNameById(rs.majorAppDataEntityId);
|
|
9326
|
+
return Object.prototype.hasOwnProperty.call(context, majorDeName) && context[majorDeName];
|
|
9327
|
+
});
|
|
9328
|
+
if (!appDeRSs)
|
|
9329
|
+
return;
|
|
9330
|
+
const app = await ibiz.hub.getApp(context.srfappid);
|
|
9331
|
+
const majorAuthorityService = await app.authority.getService(
|
|
9332
|
+
appDeRSs.majorAppDataEntityId
|
|
9333
|
+
);
|
|
9334
|
+
if (!majorAuthorityService)
|
|
9335
|
+
return;
|
|
9336
|
+
const majorAppDeName = calcDeCodeNameById(appDeRSs.majorAppDataEntityId);
|
|
9337
|
+
const majorDataAccAction = majorAuthorityService.getDataAccAction(
|
|
9338
|
+
"".concat(context.srfsessionid, "-").concat(context[majorAppDeName])
|
|
9339
|
+
) || majorAuthorityService.getDataAccAction("".concat(context[majorAppDeName]));
|
|
9340
|
+
return majorDataAccAction;
|
|
9341
|
+
}
|
|
9342
|
+
/**
|
|
9343
|
+
* 计算实体数据权限,根据实体数据访问控制方式计算权限
|
|
9344
|
+
*
|
|
9345
|
+
* 0:无控制 不计算实体数据权限
|
|
9346
|
+
* 1:自控制 根据实体数据中的权限标识计算
|
|
9347
|
+
* 2:附属主实体控制 根据主实体的数据权限标识计算
|
|
9348
|
+
* 3:附属主实体控制(未映射自控)根据主实体的数据权限标识计算,主实体没有权限标识时使用实体数据中的权限标识计算
|
|
9349
|
+
* @param {string} dataAccessAction 操作标识
|
|
9350
|
+
* @param {IData} data 实体数据
|
|
9351
|
+
* @param {IContext} context 上下文
|
|
9352
|
+
* @memberof DeAuthorityService
|
|
9353
|
+
*/
|
|
9354
|
+
async calcDeDataAccAction(dataAccessAction, data, context) {
|
|
9355
|
+
let result = true;
|
|
9356
|
+
let tempDataAccObject;
|
|
9357
|
+
const { dataAccCtrlMode } = this.entityModel;
|
|
9358
|
+
switch (dataAccCtrlMode) {
|
|
9359
|
+
case 1:
|
|
9360
|
+
tempDataAccObject = (data == null ? void 0 : data.srfdataaccaction) ? convertToObject(data.srfdataaccaction) : void 0;
|
|
9361
|
+
break;
|
|
9362
|
+
case 2:
|
|
9363
|
+
tempDataAccObject = convertToObject(
|
|
9364
|
+
await this.calcMajorDataAccAction(context)
|
|
9365
|
+
);
|
|
9366
|
+
break;
|
|
9367
|
+
case 3:
|
|
9368
|
+
tempDataAccObject = convertToObject(
|
|
9369
|
+
await this.calcMajorDataAccAction(context)
|
|
9370
|
+
);
|
|
9371
|
+
if (!Object.prototype.hasOwnProperty.call(
|
|
9372
|
+
tempDataAccObject,
|
|
9373
|
+
dataAccessAction
|
|
9374
|
+
) && data && data.srfdataaccaction) {
|
|
9375
|
+
tempDataAccObject = convertToObject(data.srfdataaccaction);
|
|
9376
|
+
}
|
|
9377
|
+
break;
|
|
9378
|
+
default:
|
|
9379
|
+
break;
|
|
9380
|
+
}
|
|
9381
|
+
if (tempDataAccObject && dataAccessAction && !tempDataAccObject[dataAccessAction]) {
|
|
9382
|
+
result = false;
|
|
9383
|
+
}
|
|
9384
|
+
return result;
|
|
9385
|
+
}
|
|
9235
9386
|
/**
|
|
9236
9387
|
* 通过实体主状态计算权限
|
|
9237
9388
|
* @author lxm
|
|
@@ -9241,7 +9392,7 @@ var DeAuthorityService = class {
|
|
|
9241
9392
|
* @param {string} appDeId 应用实体id
|
|
9242
9393
|
* @return {*} {Promise<boolean>}
|
|
9243
9394
|
*/
|
|
9244
|
-
async calcByDeMainState(dataAccessAction, data) {
|
|
9395
|
+
async calcByDeMainState(dataAccessAction, data = {}) {
|
|
9245
9396
|
let result = true;
|
|
9246
9397
|
const appDataEntity = this.entityModel;
|
|
9247
9398
|
if (!appDataEntity.enableDEMainState) {
|
|
@@ -9385,11 +9536,12 @@ var AuthorityService = class {
|
|
|
9385
9536
|
* @author lxm
|
|
9386
9537
|
* @date 2023-05-10 12:33:10
|
|
9387
9538
|
* @param {string} dataAccessAction 操作标识
|
|
9539
|
+
* @param {IContext} context 上下文
|
|
9388
9540
|
* @param {IData} [data] 实体数据
|
|
9389
9541
|
* @param {string} [appDeId] 应用实体id
|
|
9390
9542
|
* @return {*} {Promise<boolean>}
|
|
9391
9543
|
*/
|
|
9392
|
-
async calcByDataAccessAction(dataAccessAction, data, appDeId) {
|
|
9544
|
+
async calcByDataAccessAction(dataAccessAction, context, data, appDeId) {
|
|
9393
9545
|
const result = true;
|
|
9394
9546
|
if (this.enablePermission) {
|
|
9395
9547
|
const app = await ibiz.hub.getApp(this.appModel.appId);
|
|
@@ -9398,9 +9550,9 @@ var AuthorityService = class {
|
|
|
9398
9550
|
return false;
|
|
9399
9551
|
}
|
|
9400
9552
|
}
|
|
9401
|
-
if (
|
|
9553
|
+
if (appDeId) {
|
|
9402
9554
|
const service = await this.getService(appDeId);
|
|
9403
|
-
return service.calcByDataAccessAction(dataAccessAction, data);
|
|
9555
|
+
return service.calcByDataAccessAction(dataAccessAction, data, context);
|
|
9404
9556
|
}
|
|
9405
9557
|
return result;
|
|
9406
9558
|
}
|
|
@@ -10951,7 +11103,7 @@ var DELogic = class {
|
|
|
10951
11103
|
const bol = await link.exec(ctx);
|
|
10952
11104
|
if (bol && link.dstNode) {
|
|
10953
11105
|
await this.deepExec(link.dstNode, ctx);
|
|
10954
|
-
if (node.model.parallelOutput
|
|
11106
|
+
if (node.model.parallelOutput !== true) {
|
|
10955
11107
|
break;
|
|
10956
11108
|
}
|
|
10957
11109
|
}
|
|
@@ -13956,7 +14108,7 @@ var UIActionButtonState = class {
|
|
|
13956
14108
|
* @param {string} [appDeId] 数据对应的实体id
|
|
13957
14109
|
* @return {*}
|
|
13958
14110
|
*/
|
|
13959
|
-
async calcPermission(data, appDeId) {
|
|
14111
|
+
async calcPermission(context, data, appDeId) {
|
|
13960
14112
|
if (!this.dataAccessAction) {
|
|
13961
14113
|
return;
|
|
13962
14114
|
}
|
|
@@ -13968,15 +14120,16 @@ var UIActionButtonState = class {
|
|
|
13968
14120
|
}
|
|
13969
14121
|
this.permitted = await app.authority.calcByDataAccessAction(
|
|
13970
14122
|
this.dataAccessAction,
|
|
14123
|
+
context,
|
|
13971
14124
|
data,
|
|
13972
14125
|
appDeId
|
|
13973
14126
|
);
|
|
13974
14127
|
}
|
|
13975
|
-
async update(data, appDeId) {
|
|
14128
|
+
async update(context, data, appDeId) {
|
|
13976
14129
|
if (!this.isInit) {
|
|
13977
14130
|
await this.init();
|
|
13978
14131
|
}
|
|
13979
|
-
await this.calcPermission(data, appDeId);
|
|
14132
|
+
await this.calcPermission(context, data, appDeId);
|
|
13980
14133
|
if (!this.permitted) {
|
|
13981
14134
|
this.disabled = true;
|
|
13982
14135
|
this.visible = !this.noPermissionHidden;
|
|
@@ -14025,10 +14178,10 @@ var ButtonContainerState = class {
|
|
|
14025
14178
|
}
|
|
14026
14179
|
});
|
|
14027
14180
|
}
|
|
14028
|
-
async update(data, appDeId) {
|
|
14181
|
+
async update(context, data, appDeId) {
|
|
14029
14182
|
await Promise.all(
|
|
14030
14183
|
this.children.map((child) => {
|
|
14031
|
-
return child.update(data, appDeId);
|
|
14184
|
+
return child.update(context, data, appDeId);
|
|
14032
14185
|
})
|
|
14033
14186
|
);
|
|
14034
14187
|
}
|
|
@@ -15585,7 +15738,12 @@ var CodeListEditorController = class extends EditorController {
|
|
|
15585
15738
|
};
|
|
15586
15739
|
|
|
15587
15740
|
// src/controller/common/control/control.controller.ts
|
|
15588
|
-
import {
|
|
15741
|
+
import {
|
|
15742
|
+
HttpError as HttpError6,
|
|
15743
|
+
IBizContext as IBizContext3,
|
|
15744
|
+
IBizParams,
|
|
15745
|
+
NoticeError as NoticeError2
|
|
15746
|
+
} from "@ibiz-template/core";
|
|
15589
15747
|
import { clone as clone18, isNil as isNil23 } from "ramda";
|
|
15590
15748
|
import { notNilEmpty as notNilEmpty7 } from "qx-util";
|
|
15591
15749
|
var ControlController = class extends BaseController {
|
|
@@ -15912,6 +16070,9 @@ var ControlController = class extends BaseController {
|
|
|
15912
16070
|
return;
|
|
15913
16071
|
}
|
|
15914
16072
|
if (opts == null ? void 0 : opts.error) {
|
|
16073
|
+
if (opts.error instanceof HttpError6 && opts.error.status !== 500) {
|
|
16074
|
+
throw opts.error;
|
|
16075
|
+
}
|
|
15915
16076
|
ibiz.log.error(opts.error);
|
|
15916
16077
|
throw new NoticeError2(message, duration);
|
|
15917
16078
|
} else {
|
|
@@ -19623,7 +19784,7 @@ var UILogic = class {
|
|
|
19623
19784
|
const bol = await link.exec(ctx);
|
|
19624
19785
|
if (bol && link.dstNode) {
|
|
19625
19786
|
await this.deepExec(link.dstNode, ctx);
|
|
19626
|
-
if (node.model.parallelOutput
|
|
19787
|
+
if (node.model.parallelOutput !== true) {
|
|
19627
19788
|
break;
|
|
19628
19789
|
}
|
|
19629
19790
|
}
|
|
@@ -20552,7 +20713,7 @@ var ToolbarController = class extends ControlController {
|
|
|
20552
20713
|
{ childrenFields: ["detoolbarItems"] }
|
|
20553
20714
|
);
|
|
20554
20715
|
if (!this.state.manualCalcButtonState) {
|
|
20555
|
-
await this.calcButtonState();
|
|
20716
|
+
await this.calcButtonState(void 0, this.model.appDataEntityId);
|
|
20556
20717
|
} else {
|
|
20557
20718
|
await this.state.buttonsState.init();
|
|
20558
20719
|
}
|
|
@@ -20584,7 +20745,7 @@ var ToolbarController = class extends ControlController {
|
|
|
20584
20745
|
if (data && data instanceof ControlVO) {
|
|
20585
20746
|
_data = data.getOrigin();
|
|
20586
20747
|
}
|
|
20587
|
-
await this.state.buttonsState.update(_data, appDeId);
|
|
20748
|
+
await this.state.buttonsState.update(this.context, _data, appDeId);
|
|
20588
20749
|
if (this.scheduler) {
|
|
20589
20750
|
const logicParams = {};
|
|
20590
20751
|
if (_data) {
|
|
@@ -20977,6 +21138,7 @@ var PortletPartController = class {
|
|
|
20977
21138
|
}
|
|
20978
21139
|
if (data) {
|
|
20979
21140
|
this.state.actionGroupState.update(
|
|
21141
|
+
this.context,
|
|
20980
21142
|
data,
|
|
20981
21143
|
this.dashboard.view.model.appDataEntityId
|
|
20982
21144
|
);
|
|
@@ -21007,7 +21169,7 @@ var PortletPartController = class {
|
|
|
21007
21169
|
containerState.addState(detail.id, buttonState);
|
|
21008
21170
|
}
|
|
21009
21171
|
});
|
|
21010
|
-
await containerState.update();
|
|
21172
|
+
await containerState.update(this.dashboard.context);
|
|
21011
21173
|
this.state.actionGroupState = containerState;
|
|
21012
21174
|
const { appDataEntityId } = this.dashboard.view.model;
|
|
21013
21175
|
if (appDataEntityId) {
|
|
@@ -21046,7 +21208,7 @@ var PortletPartController = class {
|
|
|
21046
21208
|
async dataChangeNotify(data) {
|
|
21047
21209
|
if (this.state.actionGroupState) {
|
|
21048
21210
|
const { appDataEntityId } = this.dashboard.view.model;
|
|
21049
|
-
this.state.actionGroupState.update(data, appDataEntityId);
|
|
21211
|
+
this.state.actionGroupState.update(this.context, data, appDataEntityId);
|
|
21050
21212
|
}
|
|
21051
21213
|
this.calcDynaClass(data);
|
|
21052
21214
|
}
|
|
@@ -21213,7 +21375,7 @@ var DataViewControlController = class extends MDControlController {
|
|
|
21213
21375
|
containerState.addState(detail.id, buttonState);
|
|
21214
21376
|
}
|
|
21215
21377
|
});
|
|
21216
|
-
await containerState.update();
|
|
21378
|
+
await containerState.update(this.context);
|
|
21217
21379
|
group.groupActionGroupState = containerState;
|
|
21218
21380
|
});
|
|
21219
21381
|
}
|
|
@@ -21251,12 +21413,14 @@ var DataViewControlController = class extends MDControlController {
|
|
|
21251
21413
|
}
|
|
21252
21414
|
if (tempData) {
|
|
21253
21415
|
(_a2 = group.groupActionGroupState) == null ? void 0 : _a2.update(
|
|
21416
|
+
this.context,
|
|
21254
21417
|
tempData,
|
|
21255
21418
|
this.model.appDataEntityId
|
|
21256
21419
|
);
|
|
21257
21420
|
}
|
|
21258
21421
|
} else {
|
|
21259
21422
|
(_b = group.groupActionGroupState) == null ? void 0 : _b.update(
|
|
21423
|
+
this.context,
|
|
21260
21424
|
void 0,
|
|
21261
21425
|
this.model.appDataEntityId
|
|
21262
21426
|
);
|
|
@@ -21268,6 +21432,7 @@ var DataViewControlController = class extends MDControlController {
|
|
|
21268
21432
|
});
|
|
21269
21433
|
if (actionGroup) {
|
|
21270
21434
|
(_a = actionGroup.groupActionGroupState) == null ? void 0 : _a.update(
|
|
21435
|
+
this.context,
|
|
21271
21436
|
actionGroup.selectedData[0],
|
|
21272
21437
|
this.model.appDataEntityId
|
|
21273
21438
|
);
|
|
@@ -21340,7 +21505,7 @@ var DataViewControlController = class extends MDControlController {
|
|
|
21340
21505
|
containerState.addState(detail.id, buttonState);
|
|
21341
21506
|
}
|
|
21342
21507
|
});
|
|
21343
|
-
containerState.update(item.getOrigin());
|
|
21508
|
+
containerState.update(this.context, item.getOrigin());
|
|
21344
21509
|
}
|
|
21345
21510
|
return containerState;
|
|
21346
21511
|
}
|
|
@@ -22332,9 +22497,13 @@ import {
|
|
|
22332
22497
|
debounceAndAsyncMerge,
|
|
22333
22498
|
recursiveIterate as recursiveIterate3
|
|
22334
22499
|
} from "@ibiz-template/core";
|
|
22500
|
+
import { clone as clone24 } from "ramda";
|
|
22335
22501
|
var FormController = class extends ControlController {
|
|
22336
|
-
constructor() {
|
|
22337
|
-
|
|
22502
|
+
constructor(model, context, params, ctx) {
|
|
22503
|
+
if (context && (context.srfreadonly === true || context.srfreadonly === "true")) {
|
|
22504
|
+
model = clone24(model);
|
|
22505
|
+
}
|
|
22506
|
+
super(model, context, params, ctx);
|
|
22338
22507
|
/**
|
|
22339
22508
|
* 所有表单项成员的控制器
|
|
22340
22509
|
*
|
|
@@ -23465,7 +23634,7 @@ var FormButtonController = class extends FormDetailController {
|
|
|
23465
23634
|
async formStateNotify(_state) {
|
|
23466
23635
|
if (this.actionState) {
|
|
23467
23636
|
const deCodeName = calcDeCodeNameById(this.form.model.appDataEntityId);
|
|
23468
|
-
await this.actionState.update(this.data, deCodeName);
|
|
23637
|
+
await this.actionState.update(this.context, this.data, deCodeName);
|
|
23469
23638
|
}
|
|
23470
23639
|
await super.formStateNotify(_state);
|
|
23471
23640
|
}
|
|
@@ -23792,7 +23961,7 @@ var FormGroupPanelController = class extends FormDetailController {
|
|
|
23792
23961
|
containerState.addState(detail.id, buttonState);
|
|
23793
23962
|
}
|
|
23794
23963
|
});
|
|
23795
|
-
await containerState.update();
|
|
23964
|
+
await containerState.update(this.form.context);
|
|
23796
23965
|
this.state.actionGroupState = containerState;
|
|
23797
23966
|
}
|
|
23798
23967
|
/**
|
|
@@ -24542,7 +24711,7 @@ var FormMDCtrlFormController = class extends FormMDCtrlController {
|
|
|
24542
24711
|
|
|
24543
24712
|
// src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.ts
|
|
24544
24713
|
import { ModelError as ModelError28 } from "@ibiz-template/core";
|
|
24545
|
-
import { clone as
|
|
24714
|
+
import { clone as clone25 } from "ramda";
|
|
24546
24715
|
var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
24547
24716
|
constructor() {
|
|
24548
24717
|
super(...arguments);
|
|
@@ -24626,7 +24795,7 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
24626
24795
|
copyFields.forEach((key) => {
|
|
24627
24796
|
tempForm[key] = this.form.model[key];
|
|
24628
24797
|
});
|
|
24629
|
-
this.repeatedForm =
|
|
24798
|
+
this.repeatedForm = clone25(tempForm);
|
|
24630
24799
|
}
|
|
24631
24800
|
/**
|
|
24632
24801
|
* 设置重复器数据(修改主表单里重复器对应属性)
|
|
@@ -24803,7 +24972,7 @@ import {
|
|
|
24803
24972
|
} from "@ibiz-template/core";
|
|
24804
24973
|
import { debounce as debounce2 } from "lodash-es";
|
|
24805
24974
|
import { createUUID as createUUID12 } from "qx-util";
|
|
24806
|
-
import { clone as
|
|
24975
|
+
import { clone as clone26 } from "ramda";
|
|
24807
24976
|
|
|
24808
24977
|
// src/controller/control/form/edit-form/edit-form.service.ts
|
|
24809
24978
|
import {
|
|
@@ -25168,8 +25337,8 @@ var EditFormController = class extends FormController {
|
|
|
25168
25337
|
* @return {*} {Promise<IData>}
|
|
25169
25338
|
*/
|
|
25170
25339
|
async copy() {
|
|
25171
|
-
const context =
|
|
25172
|
-
const queryParams =
|
|
25340
|
+
const context = clone26(this.context);
|
|
25341
|
+
const queryParams = clone26(this.params);
|
|
25173
25342
|
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
25174
25343
|
this.model.appDataEntityId,
|
|
25175
25344
|
this.model.appId
|
|
@@ -25226,7 +25395,7 @@ var EditFormController = class extends FormController {
|
|
|
25226
25395
|
return this.loadDraft();
|
|
25227
25396
|
}
|
|
25228
25397
|
const { context, params } = this.handlerAbilityParams(args);
|
|
25229
|
-
const queryParams =
|
|
25398
|
+
const queryParams = clone26(params);
|
|
25230
25399
|
let res;
|
|
25231
25400
|
try {
|
|
25232
25401
|
await this.startLoading();
|
|
@@ -25799,7 +25968,7 @@ import {
|
|
|
25799
25968
|
RuntimeError as RuntimeError55,
|
|
25800
25969
|
RuntimeModelError as RuntimeModelError62
|
|
25801
25970
|
} from "@ibiz-template/core";
|
|
25802
|
-
import { clone as
|
|
25971
|
+
import { clone as clone27 } from "ramda";
|
|
25803
25972
|
|
|
25804
25973
|
// src/controller/control/grid/grid/grid.service.ts
|
|
25805
25974
|
import { RuntimeModelError as RuntimeModelError61 } from "@ibiz-template/core";
|
|
@@ -26109,7 +26278,7 @@ var GridController = class extends MDControlController {
|
|
|
26109
26278
|
const result = await calcColumnModelBySchema(json, this);
|
|
26110
26279
|
if (result && result.degridColumns.length > 0) {
|
|
26111
26280
|
const { degridColumns, degridDataItems } = result;
|
|
26112
|
-
this.model =
|
|
26281
|
+
this.model = clone27(this.model);
|
|
26113
26282
|
this.model.degridColumns = [
|
|
26114
26283
|
...(this.model.degridColumns || []).filter((item) => {
|
|
26115
26284
|
return degridColumns.findIndex((x) => x.id === item.id) === -1;
|
|
@@ -26190,12 +26359,20 @@ var GridController = class extends MDControlController {
|
|
|
26190
26359
|
});
|
|
26191
26360
|
this.state.rows.forEach((row) => {
|
|
26192
26361
|
Object.values(row.uaColStates).forEach((uaState) => {
|
|
26193
|
-
uaState.update(
|
|
26362
|
+
uaState.update(
|
|
26363
|
+
this.context,
|
|
26364
|
+
row.data.getOrigin(),
|
|
26365
|
+
this.model.appDataEntityId
|
|
26366
|
+
);
|
|
26194
26367
|
});
|
|
26195
26368
|
});
|
|
26196
26369
|
this.state.rows.forEach((row) => {
|
|
26197
26370
|
Object.values(row.uiActionGroupStates).forEach((uaState) => {
|
|
26198
|
-
uaState.update(
|
|
26371
|
+
uaState.update(
|
|
26372
|
+
this.context,
|
|
26373
|
+
row.data.getOrigin(),
|
|
26374
|
+
this.model.appDataEntityId
|
|
26375
|
+
);
|
|
26199
26376
|
});
|
|
26200
26377
|
});
|
|
26201
26378
|
this.calcGroupData(items);
|
|
@@ -26636,7 +26813,7 @@ var GridController = class extends MDControlController {
|
|
|
26636
26813
|
throw new RuntimeError55("\u540C\u65F6\u53EA\u80FD\u6709\u4E00\u884C\u5F00\u542F\u884C\u7F16\u8F91");
|
|
26637
26814
|
}
|
|
26638
26815
|
if (row.data.srfuf === 1 /* UPDATE */) {
|
|
26639
|
-
row.cacheData =
|
|
26816
|
+
row.cacheData = clone27(row.data);
|
|
26640
26817
|
const defaultVal = this.calcDefaultValue(row.data, false);
|
|
26641
26818
|
Object.assign(row.data, defaultVal);
|
|
26642
26819
|
}
|
|
@@ -26805,7 +26982,7 @@ var GridController = class extends MDControlController {
|
|
|
26805
26982
|
}
|
|
26806
26983
|
});
|
|
26807
26984
|
}
|
|
26808
|
-
const cloneData =
|
|
26985
|
+
const cloneData = clone27(
|
|
26809
26986
|
data2.map((item) => {
|
|
26810
26987
|
return item.getOrigin();
|
|
26811
26988
|
})
|
|
@@ -27045,7 +27222,7 @@ var GridController = class extends MDControlController {
|
|
|
27045
27222
|
import { DataTypes as DataTypes4, ModelError as ModelError29, plus as plus2 } from "@ibiz-template/core";
|
|
27046
27223
|
import dayjs5 from "dayjs";
|
|
27047
27224
|
import { debounce as debounce3 } from "lodash-es";
|
|
27048
|
-
import { clone as
|
|
27225
|
+
import { clone as clone28, isNil as isNil26 } from "ramda";
|
|
27049
27226
|
var GridFieldColumnController = class extends GridColumnController {
|
|
27050
27227
|
constructor() {
|
|
27051
27228
|
super(...arguments);
|
|
@@ -27183,7 +27360,7 @@ var GridFieldColumnController = class extends GridColumnController {
|
|
|
27183
27360
|
srfkey: value,
|
|
27184
27361
|
...wfContext
|
|
27185
27362
|
});
|
|
27186
|
-
const tempParams =
|
|
27363
|
+
const tempParams = clone28(this.params);
|
|
27187
27364
|
const { context: newContext, params: newParams } = this.handlePublicParams(
|
|
27188
27365
|
row.data,
|
|
27189
27366
|
tempContext,
|
|
@@ -28577,7 +28754,7 @@ var PickupViewPanelController = class extends ControlController {
|
|
|
28577
28754
|
|
|
28578
28755
|
// src/controller/control/search-bar/search-bar.controller.ts
|
|
28579
28756
|
import { mergeInLeft as mergeInLeft3, recursiveIterate as recursiveIterate10 } from "@ibiz-template/core";
|
|
28580
|
-
import { clone as
|
|
28757
|
+
import { clone as clone29, isNil as isNil28 } from "ramda";
|
|
28581
28758
|
import { isString as isString2 } from "lodash-es";
|
|
28582
28759
|
|
|
28583
28760
|
// src/controller/control/search-bar/search-bar-filter.controller.ts
|
|
@@ -29229,7 +29406,7 @@ var SearchBarController = class extends ControlController {
|
|
|
29229
29406
|
}
|
|
29230
29407
|
});
|
|
29231
29408
|
if (addSearchBarFilters.length > 0) {
|
|
29232
|
-
this.model =
|
|
29409
|
+
this.model = clone29(this.model);
|
|
29233
29410
|
this.model.searchBarFilters = addSearchBarFilters.concat(...mergeFilters);
|
|
29234
29411
|
this.model.enableFilter = true;
|
|
29235
29412
|
}
|
|
@@ -31435,7 +31612,7 @@ var MDCtrlController = class extends MDControlController {
|
|
|
31435
31612
|
containerState.addState(detail.id, buttonState);
|
|
31436
31613
|
}
|
|
31437
31614
|
});
|
|
31438
|
-
containerState.update(row.data.getOrigin());
|
|
31615
|
+
containerState.update(this.context, row.data.getOrigin());
|
|
31439
31616
|
row.uaColStates[group.id] = containerState;
|
|
31440
31617
|
}
|
|
31441
31618
|
/**
|
|
@@ -32069,7 +32246,7 @@ import {
|
|
|
32069
32246
|
awaitTimeout as awaitTimeout3,
|
|
32070
32247
|
recursiveIterate as recursiveIterate12
|
|
32071
32248
|
} from "@ibiz-template/core";
|
|
32072
|
-
import { clone as
|
|
32249
|
+
import { clone as clone30 } from "ramda";
|
|
32073
32250
|
|
|
32074
32251
|
// src/controller/control/tree-grid-ex/tree-grid-ex.service.ts
|
|
32075
32252
|
var TreeGridExService = class extends TreeService {
|
|
@@ -32505,7 +32682,7 @@ var TreeGridExController = class extends TreeController {
|
|
|
32505
32682
|
throw new RuntimeError62("\u540C\u65F6\u53EA\u80FD\u6709\u4E00\u884C\u5F00\u542F\u884C\u7F16\u8F91");
|
|
32506
32683
|
}
|
|
32507
32684
|
if (row.data._deData.srfuf === 1 /* UPDATE */) {
|
|
32508
|
-
row.cacheData =
|
|
32685
|
+
row.cacheData = clone30(row.data);
|
|
32509
32686
|
const defaultVal = this.calcDefaultValue(row.data, false);
|
|
32510
32687
|
Object.assign(row.data, defaultVal);
|
|
32511
32688
|
}
|
|
@@ -32618,7 +32795,7 @@ import {
|
|
|
32618
32795
|
RuntimeError as RuntimeError63,
|
|
32619
32796
|
RuntimeModelError as RuntimeModelError69
|
|
32620
32797
|
} from "@ibiz-template/core";
|
|
32621
|
-
import { clone as
|
|
32798
|
+
import { clone as clone31 } from "ramda";
|
|
32622
32799
|
import dayjs6 from "dayjs";
|
|
32623
32800
|
var TreeGridExNodeColumnController = class {
|
|
32624
32801
|
/**
|
|
@@ -32827,7 +33004,7 @@ var TreeGridExNodeColumnController = class {
|
|
|
32827
33004
|
srfkey: value,
|
|
32828
33005
|
...wfContext
|
|
32829
33006
|
});
|
|
32830
|
-
const tempParams =
|
|
33007
|
+
const tempParams = clone31(this.params);
|
|
32831
33008
|
const { userParam } = this.nodeColumn;
|
|
32832
33009
|
if (userParam) {
|
|
32833
33010
|
const { navigateContexts, navigateParams } = parseUserParams(userParam);
|
|
@@ -32953,7 +33130,7 @@ var TreeGridExNodeColumnController = class {
|
|
|
32953
33130
|
if (state === "LOAD" /* LOAD */ || state === "SAVE" /* SAVE */) {
|
|
32954
33131
|
const uaColState = row.columnActionsStates[this.name];
|
|
32955
33132
|
if (uaColState && row.data._nodeType === "DE") {
|
|
32956
|
-
uaColState.update(row.data._deData);
|
|
33133
|
+
uaColState.update(this.context, row.data._deData);
|
|
32957
33134
|
}
|
|
32958
33135
|
}
|
|
32959
33136
|
}
|
|
@@ -33154,7 +33331,7 @@ var TreeGridExUAColumnController = class extends TreeGridExColumnController {
|
|
|
33154
33331
|
if (state === "LOAD" /* LOAD */ || state === "SAVE" /* SAVE */) {
|
|
33155
33332
|
const uaColState = row.columnActionsStates[this.model.id];
|
|
33156
33333
|
if (uaColState && row.data._nodeType === "DE") {
|
|
33157
|
-
uaColState.update(row.data._deData);
|
|
33334
|
+
uaColState.update(this.context, row.data._deData);
|
|
33158
33335
|
}
|
|
33159
33336
|
}
|
|
33160
33337
|
}
|
|
@@ -34676,7 +34853,7 @@ import { QXEvent as QXEvent9 } from "qx-util";
|
|
|
34676
34853
|
|
|
34677
34854
|
// src/controller/notification/async-action.controller.ts
|
|
34678
34855
|
import { QXEvent as QXEvent7 } from "qx-util";
|
|
34679
|
-
import { clone as
|
|
34856
|
+
import { clone as clone32 } from "ramda";
|
|
34680
34857
|
import { isNil as isNil31, isNumber as isNumber2 } from "lodash-es";
|
|
34681
34858
|
import dayjs7 from "dayjs";
|
|
34682
34859
|
var AsyncActionController = class {
|
|
@@ -34784,7 +34961,7 @@ var AsyncActionController = class {
|
|
|
34784
34961
|
} else {
|
|
34785
34962
|
this.noticeResult(action);
|
|
34786
34963
|
}
|
|
34787
|
-
this.evt.emit("add",
|
|
34964
|
+
this.evt.emit("add", clone32(action));
|
|
34788
34965
|
this.evt.emit("dataChange");
|
|
34789
34966
|
}
|
|
34790
34967
|
/**
|
|
@@ -34806,7 +34983,7 @@ var AsyncActionController = class {
|
|
|
34806
34983
|
}
|
|
34807
34984
|
this.noticeResult(action);
|
|
34808
34985
|
}
|
|
34809
|
-
this.evt.emit("change",
|
|
34986
|
+
this.evt.emit("change", clone32(action));
|
|
34810
34987
|
this.evt.emit("dataChange");
|
|
34811
34988
|
}
|
|
34812
34989
|
noticeResult(action) {
|
|
@@ -35690,7 +35867,7 @@ var ViewEngineBase = class {
|
|
|
35690
35867
|
|
|
35691
35868
|
// src/engine/md-view.engine.ts
|
|
35692
35869
|
import { RuntimeModelError as RuntimeModelError72 } from "@ibiz-template/core";
|
|
35693
|
-
import { clone as
|
|
35870
|
+
import { clone as clone33 } from "ramda";
|
|
35694
35871
|
var MDViewEngine = class extends ViewEngineBase {
|
|
35695
35872
|
/**
|
|
35696
35873
|
* 多数据部件名称
|
|
@@ -35914,7 +36091,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
35914
36091
|
if (!openAppViewLogic) {
|
|
35915
36092
|
throw new RuntimeModelError72(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
|
|
35916
36093
|
}
|
|
35917
|
-
const params =
|
|
36094
|
+
const params = clone33(this.view.params);
|
|
35918
36095
|
if (copyMode) {
|
|
35919
36096
|
params.srfcopymode = copyMode;
|
|
35920
36097
|
}
|