@ibiz-template/runtime 0.4.14 → 0.4.16
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 +364 -7
- package/dist/index.system.min.js +2 -2
- package/out/app-hub.js +1 -1
- package/out/controller/control/gantt/gantt.controller.d.ts +34 -1
- package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.controller.js +74 -0
- package/out/controller/control/gantt/gantt.service.d.ts +13 -0
- package/out/controller/control/gantt/gantt.service.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.service.js +14 -0
- package/out/controller/control/kanban/kanban.controller.d.ts +104 -2
- package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
- package/out/controller/control/kanban/kanban.controller.js +220 -0
- package/out/hub/config/app-config-service.d.ts +1 -0
- package/out/hub/config/app-config-service.d.ts.map +1 -1
- package/out/hub/config/app-config-service.js +1 -0
- package/out/hub/config/app-view-config-service.d.ts +20 -1
- package/out/hub/config/app-view-config-service.d.ts.map +1 -1
- package/out/hub/config/app-view-config-service.js +39 -6
- package/out/interface/common/i-app-view-config-service/i-app-view-config-service.d.ts +8 -0
- package/out/interface/common/i-app-view-config-service/i-app-view-config-service.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-kanban.controller.d.ts +27 -0
- package/out/interface/controller/controller/control/i-kanban.controller.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-gantt.state.d.ts +23 -0
- package/out/interface/controller/state/control/i-gantt.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-kanban.state.d.ts +29 -0
- package/out/interface/controller/state/control/i-kanban.state.d.ts.map +1 -1
- package/out/interface/provider/i-grid-column.provider.d.ts +2 -3
- package/out/interface/provider/i-grid-column.provider.d.ts.map +1 -1
- package/out/service/service/control/md-control.service.d.ts +10 -0
- package/out/service/service/control/md-control.service.d.ts.map +1 -1
- package/out/service/service/control/md-control.service.js +16 -0
- package/package.json +4 -4
- package/src/app-hub.ts +1 -1
- package/src/controller/control/gantt/gantt.controller.ts +91 -0
- package/src/controller/control/gantt/gantt.service.ts +26 -1
- package/src/controller/control/kanban/kanban.controller.ts +258 -1
- package/src/hub/config/app-config-service.ts +1 -0
- package/src/hub/config/app-view-config-service.ts +39 -6
- package/src/interface/common/i-app-view-config-service/i-app-view-config-service.ts +8 -0
- package/src/interface/controller/controller/control/i-kanban.controller.ts +31 -1
- package/src/interface/controller/state/control/i-gantt.state.ts +26 -0
- package/src/interface/controller/state/control/i-kanban.state.ts +33 -0
- package/src/interface/provider/i-grid-column.provider.ts +7 -3
- package/src/service/service/control/md-control.service.ts +24 -0
package/dist/index.esm.js
CHANGED
|
@@ -6108,6 +6108,26 @@ var MDControlService = class extends ControlService {
|
|
|
6108
6108
|
res = this.handleResponse(res);
|
|
6109
6109
|
return res;
|
|
6110
6110
|
}
|
|
6111
|
+
/**
|
|
6112
|
+
* 批量更新数据
|
|
6113
|
+
*
|
|
6114
|
+
* @author chitanda
|
|
6115
|
+
* @date 2023-12-21 10:12:09
|
|
6116
|
+
* @param {IContext} context
|
|
6117
|
+
* @param {ControlVO[]} data
|
|
6118
|
+
* @return {*} {Promise<void>}
|
|
6119
|
+
*/
|
|
6120
|
+
async updateBatch(context, data) {
|
|
6121
|
+
var _a;
|
|
6122
|
+
const updateAction = ((_a = this.model.updateControlAction) == null ? void 0 : _a.appDEMethodId) || "update";
|
|
6123
|
+
let res = await this.exec(
|
|
6124
|
+
updateAction,
|
|
6125
|
+
context,
|
|
6126
|
+
data.map((item) => item.getOrigin())
|
|
6127
|
+
);
|
|
6128
|
+
res = this.handleResponse(res);
|
|
6129
|
+
return res;
|
|
6130
|
+
}
|
|
6111
6131
|
/**
|
|
6112
6132
|
* 导出数据
|
|
6113
6133
|
*
|
|
@@ -9997,20 +10017,43 @@ var AppViewConfigService = class {
|
|
|
9997
10017
|
*/
|
|
9998
10018
|
this.viewConfigs = /* @__PURE__ */ new Map();
|
|
9999
10019
|
}
|
|
10020
|
+
/**
|
|
10021
|
+
* 计算应用视图 标识
|
|
10022
|
+
*
|
|
10023
|
+
* @author chitanda
|
|
10024
|
+
* @date 2023-04-20 18:04:48
|
|
10025
|
+
* @protected
|
|
10026
|
+
* @param {string} tag
|
|
10027
|
+
* @return {*} {string}
|
|
10028
|
+
*/
|
|
10029
|
+
calcAppViewId(tag) {
|
|
10030
|
+
let id = "";
|
|
10031
|
+
if (tag.indexOf(".") !== -1) {
|
|
10032
|
+
const ids = tag.split(".");
|
|
10033
|
+
id = ids[ids.length - 1];
|
|
10034
|
+
} else {
|
|
10035
|
+
id = tag.toLowerCase();
|
|
10036
|
+
}
|
|
10037
|
+
return id;
|
|
10038
|
+
}
|
|
10000
10039
|
has(key) {
|
|
10001
|
-
|
|
10040
|
+
const id = this.calcAppViewId(key);
|
|
10041
|
+
return this.viewConfigs.has(id);
|
|
10002
10042
|
}
|
|
10003
|
-
set(
|
|
10043
|
+
set(key, viewConfig) {
|
|
10044
|
+
const id = this.calcAppViewId(key);
|
|
10004
10045
|
this.viewConfigs.set(id, viewConfig);
|
|
10005
10046
|
}
|
|
10006
10047
|
async get(key) {
|
|
10007
|
-
|
|
10008
|
-
|
|
10048
|
+
const id = this.calcAppViewId(key);
|
|
10049
|
+
if (!this.viewConfigs.has(id)) {
|
|
10050
|
+
const model = await ibiz.hub.getAppView(id);
|
|
10009
10051
|
if (!model) {
|
|
10010
|
-
throw new RuntimeError24("\u89C6\u56FE[".concat(
|
|
10052
|
+
throw new RuntimeError24("\u89C6\u56FE[".concat(id, "]\u4E0D\u5B58\u5728"));
|
|
10011
10053
|
}
|
|
10012
10054
|
this.set(model.id, {
|
|
10013
10055
|
id: model.id,
|
|
10056
|
+
appId: model.appId,
|
|
10014
10057
|
codeName: model.codeName,
|
|
10015
10058
|
openMode: model.openMode,
|
|
10016
10059
|
viewType: model.viewType,
|
|
@@ -10020,7 +10063,7 @@ var AppViewConfigService = class {
|
|
|
10020
10063
|
redirectView: model.redirectView
|
|
10021
10064
|
});
|
|
10022
10065
|
}
|
|
10023
|
-
return this.viewConfigs.get(
|
|
10066
|
+
return this.viewConfigs.get(id);
|
|
10024
10067
|
}
|
|
10025
10068
|
getSync(key) {
|
|
10026
10069
|
if (this.viewConfigs.has(key)) {
|
|
@@ -26199,6 +26242,8 @@ var KanbanController = class extends DataViewControlController {
|
|
|
26199
26242
|
super.initState();
|
|
26200
26243
|
this.state.size = this.model.pagingSize || 1e3;
|
|
26201
26244
|
this.state.updating = false;
|
|
26245
|
+
this.state.batching = false;
|
|
26246
|
+
this.state.selectGroupKey = "";
|
|
26202
26247
|
this.state.draggable = this.enableEditOrder || this.enableEditGroup;
|
|
26203
26248
|
}
|
|
26204
26249
|
/**
|
|
@@ -26210,6 +26255,7 @@ var KanbanController = class extends DataViewControlController {
|
|
|
26210
26255
|
*/
|
|
26211
26256
|
async onCreated() {
|
|
26212
26257
|
await super.onCreated();
|
|
26258
|
+
this.setToolbarHooks();
|
|
26213
26259
|
}
|
|
26214
26260
|
/**
|
|
26215
26261
|
* 本地排序items
|
|
@@ -26248,6 +26294,76 @@ var KanbanController = class extends DataViewControlController {
|
|
|
26248
26294
|
this.sortItems(this.state.items);
|
|
26249
26295
|
return super.afterLoad(args, items);
|
|
26250
26296
|
}
|
|
26297
|
+
/**
|
|
26298
|
+
* 当展开批操作工具栏时需进行行点击拦截
|
|
26299
|
+
*
|
|
26300
|
+
* @param {IData} data
|
|
26301
|
+
* @return {*} {Promise<void>}
|
|
26302
|
+
* @memberof KanbanController
|
|
26303
|
+
*/
|
|
26304
|
+
async onRowClick(data) {
|
|
26305
|
+
const { groupAppDEFieldId } = this.model;
|
|
26306
|
+
if (this.state.batching && groupAppDEFieldId) {
|
|
26307
|
+
const groupVal = data[groupAppDEFieldId];
|
|
26308
|
+
if (groupVal !== this.state.selectGroupKey) {
|
|
26309
|
+
if (this.state.mdctrlActiveMode === 1) {
|
|
26310
|
+
await this.setActive(data);
|
|
26311
|
+
}
|
|
26312
|
+
return;
|
|
26313
|
+
}
|
|
26314
|
+
}
|
|
26315
|
+
super.onRowClick(data);
|
|
26316
|
+
}
|
|
26317
|
+
/**
|
|
26318
|
+
* 点击新建时设置选中分组
|
|
26319
|
+
*
|
|
26320
|
+
* @param {MouseEvent} event
|
|
26321
|
+
* @param {(string | number)} group
|
|
26322
|
+
* @memberof KanbanController
|
|
26323
|
+
*/
|
|
26324
|
+
onClickNew(event, group) {
|
|
26325
|
+
this.setSelectGroup(group);
|
|
26326
|
+
super.onClickNew(event, group);
|
|
26327
|
+
}
|
|
26328
|
+
/**
|
|
26329
|
+
* 分组工具栏需设置选中分组
|
|
26330
|
+
*
|
|
26331
|
+
* @param {IUIActionGroupDetail} detail
|
|
26332
|
+
* @param {MouseEvent} event
|
|
26333
|
+
* @param {IKanbanGroupState} group
|
|
26334
|
+
* @return {*} {Promise<void>}
|
|
26335
|
+
* @memberof KanbanController
|
|
26336
|
+
*/
|
|
26337
|
+
async onGroupToolbarClick(detail, event, group) {
|
|
26338
|
+
this.setSelectGroup(group.key);
|
|
26339
|
+
super.onGroupToolbarClick(detail, event, group);
|
|
26340
|
+
}
|
|
26341
|
+
/**
|
|
26342
|
+
* 分组行为项点击,需携带分组标识
|
|
26343
|
+
*
|
|
26344
|
+
* @param {IUIActionGroupDetail} detail
|
|
26345
|
+
* @param {IData} item
|
|
26346
|
+
* @param {MouseEvent} event
|
|
26347
|
+
* @param {IKanbanGroupState} group
|
|
26348
|
+
* @return {*} {Promise<void>}
|
|
26349
|
+
* @memberof KanbanController
|
|
26350
|
+
*/
|
|
26351
|
+
async onGroupActionClick(detail, item, event, group) {
|
|
26352
|
+
this.setSelectGroup(group.key);
|
|
26353
|
+
const params = { ...this.params, srfgroup: group };
|
|
26354
|
+
const actionId = detail.uiactionId;
|
|
26355
|
+
await UIActionUtil.execAndResolved(
|
|
26356
|
+
actionId,
|
|
26357
|
+
{
|
|
26358
|
+
context: this.context,
|
|
26359
|
+
params,
|
|
26360
|
+
data: [item],
|
|
26361
|
+
view: this.view,
|
|
26362
|
+
event
|
|
26363
|
+
},
|
|
26364
|
+
detail.appId
|
|
26365
|
+
);
|
|
26366
|
+
}
|
|
26251
26367
|
handleDataGroup() {
|
|
26252
26368
|
if (!this.model.enableGroup || this.model.groupMode === "NONE") {
|
|
26253
26369
|
throw new RuntimeError57("\u770B\u677F\u90E8\u4EF6\u5FC5\u987B\u5F00\u542F\u5206\u7EC4");
|
|
@@ -26443,6 +26559,152 @@ var KanbanController = class extends DataViewControlController {
|
|
|
26443
26559
|
await this.afterLoad({}, this.state.items);
|
|
26444
26560
|
}
|
|
26445
26561
|
}
|
|
26562
|
+
/**
|
|
26563
|
+
* 获取是否全屏
|
|
26564
|
+
*
|
|
26565
|
+
* @return {*} {boolean}
|
|
26566
|
+
* @memberof KanbanController
|
|
26567
|
+
*/
|
|
26568
|
+
getFullscreen() {
|
|
26569
|
+
const value = document.isFullScreen || document.mozIsFullScreen || document.webkitIsFullScreen;
|
|
26570
|
+
return value;
|
|
26571
|
+
}
|
|
26572
|
+
/**
|
|
26573
|
+
* 触发全屏
|
|
26574
|
+
*
|
|
26575
|
+
* @param {IData} container
|
|
26576
|
+
* @memberof KanbanController
|
|
26577
|
+
*/
|
|
26578
|
+
onFullScreen(container) {
|
|
26579
|
+
const isFull = this.getFullscreen();
|
|
26580
|
+
if (!isFull) {
|
|
26581
|
+
if (container) {
|
|
26582
|
+
if (container.webkitRequestFullscreen) {
|
|
26583
|
+
container.webkitRequestFullscreen();
|
|
26584
|
+
} else if (container.mozRequestFullScreen) {
|
|
26585
|
+
container.mozRequestFullScreen();
|
|
26586
|
+
} else if (container.msRequestFullscreen) {
|
|
26587
|
+
container.msRequestFullscreen();
|
|
26588
|
+
} else if (container.requestFullscreen) {
|
|
26589
|
+
container.requestFullscreen();
|
|
26590
|
+
}
|
|
26591
|
+
}
|
|
26592
|
+
} else if (document.documentElement.requestFullScreen) {
|
|
26593
|
+
document.exitFullScreen();
|
|
26594
|
+
} else if (document.documentElement.webkitRequestFullScreen) {
|
|
26595
|
+
document.webkitCancelFullScreen();
|
|
26596
|
+
} else if (document.documentElement.mozRequestFullScreen) {
|
|
26597
|
+
document.mozCancelFullScreen();
|
|
26598
|
+
}
|
|
26599
|
+
return !isFull;
|
|
26600
|
+
}
|
|
26601
|
+
/**
|
|
26602
|
+
* 设置选中分组标识
|
|
26603
|
+
*
|
|
26604
|
+
* @param {(string | number)} key
|
|
26605
|
+
* @memberof KanbanController
|
|
26606
|
+
*/
|
|
26607
|
+
setSelectGroup(key) {
|
|
26608
|
+
if (!this.state.batching) {
|
|
26609
|
+
this.state.selectGroupKey = key;
|
|
26610
|
+
}
|
|
26611
|
+
}
|
|
26612
|
+
/**
|
|
26613
|
+
* 设置分组控制器
|
|
26614
|
+
*
|
|
26615
|
+
* @param {string} groupKey
|
|
26616
|
+
* @param {('quickToolbarController' | 'batchToolbarController')} name
|
|
26617
|
+
* @param {IToolbarController} c
|
|
26618
|
+
* @memberof KanbanController
|
|
26619
|
+
*/
|
|
26620
|
+
setGroupController(groupKey, name, c) {
|
|
26621
|
+
const group = this.state.groups.find((x) => x.key === groupKey);
|
|
26622
|
+
if (group) {
|
|
26623
|
+
group[name] = c;
|
|
26624
|
+
}
|
|
26625
|
+
}
|
|
26626
|
+
/**
|
|
26627
|
+
* 设置工具栏hook
|
|
26628
|
+
*
|
|
26629
|
+
* @memberof KanbanController
|
|
26630
|
+
*/
|
|
26631
|
+
setToolbarHooks() {
|
|
26632
|
+
this.listenNewController((name, c) => {
|
|
26633
|
+
if (name.startsWith("".concat(this.model.name, "_quicktoolbar")) || name.startsWith("".concat(this.model.name, "_groupquicktoolbar"))) {
|
|
26634
|
+
this.setQuickToolbarClickHook(name, c);
|
|
26635
|
+
}
|
|
26636
|
+
if (name.startsWith("".concat(this.model.name, "_batchtoolbar"))) {
|
|
26637
|
+
this.setBatchToolbarClickHook(name, c);
|
|
26638
|
+
}
|
|
26639
|
+
});
|
|
26640
|
+
}
|
|
26641
|
+
/**
|
|
26642
|
+
* 设置快捷工具栏点击事件hook
|
|
26643
|
+
*
|
|
26644
|
+
* @param {string} name
|
|
26645
|
+
* @param {IToolbarController} c
|
|
26646
|
+
* @memberof KanbanController
|
|
26647
|
+
*/
|
|
26648
|
+
setQuickToolbarClickHook(name, c) {
|
|
26649
|
+
const key = name.split("quicktoolbar_")[1];
|
|
26650
|
+
this.setGroupController(
|
|
26651
|
+
key,
|
|
26652
|
+
"quickToolbarController",
|
|
26653
|
+
c
|
|
26654
|
+
);
|
|
26655
|
+
c.evt.on("onClick", (event) => {
|
|
26656
|
+
const groupKey = event.targetName.split("quicktoolbar_")[1];
|
|
26657
|
+
this.setSelectGroup(groupKey);
|
|
26658
|
+
Object.assign(event.params, { srfgroup: groupKey });
|
|
26659
|
+
});
|
|
26660
|
+
}
|
|
26661
|
+
/**
|
|
26662
|
+
* 设置批工具栏点击事件hook
|
|
26663
|
+
*
|
|
26664
|
+
* @param {string} name
|
|
26665
|
+
* @param {IToolbarController} c
|
|
26666
|
+
* @memberof KanbanController
|
|
26667
|
+
*/
|
|
26668
|
+
setBatchToolbarClickHook(name, c) {
|
|
26669
|
+
const key = name.split("batchtoolbar_")[1];
|
|
26670
|
+
this.setGroupController(
|
|
26671
|
+
key,
|
|
26672
|
+
"batchToolbarController",
|
|
26673
|
+
c
|
|
26674
|
+
);
|
|
26675
|
+
c.evt.on("onClick", (event) => {
|
|
26676
|
+
const groupKey = event.targetName.split("batchtoolbar_")[1];
|
|
26677
|
+
this.setSelectGroup(groupKey);
|
|
26678
|
+
Object.assign(event.params, { srfgroup: groupKey });
|
|
26679
|
+
});
|
|
26680
|
+
}
|
|
26681
|
+
/**
|
|
26682
|
+
* 打开批操作工具栏
|
|
26683
|
+
*
|
|
26684
|
+
* @param {string} groupKey
|
|
26685
|
+
* @memberof KanbanController
|
|
26686
|
+
*/
|
|
26687
|
+
openBatch(groupKey) {
|
|
26688
|
+
this.state.selectGroupKey = groupKey;
|
|
26689
|
+
this.state.batching = true;
|
|
26690
|
+
this.state.selectedData = [];
|
|
26691
|
+
this.state.groups.forEach((group) => {
|
|
26692
|
+
group.selectedData = [];
|
|
26693
|
+
});
|
|
26694
|
+
}
|
|
26695
|
+
/**
|
|
26696
|
+
* 关闭批操作工具栏
|
|
26697
|
+
*
|
|
26698
|
+
* @memberof KanbanController
|
|
26699
|
+
*/
|
|
26700
|
+
closeBatch() {
|
|
26701
|
+
this.state.selectGroupKey = "";
|
|
26702
|
+
this.state.batching = false;
|
|
26703
|
+
this.state.selectedData = [];
|
|
26704
|
+
this.state.groups.forEach((group) => {
|
|
26705
|
+
group.selectedData = [];
|
|
26706
|
+
});
|
|
26707
|
+
}
|
|
26446
26708
|
};
|
|
26447
26709
|
|
|
26448
26710
|
// src/controller/control/tree-grid-ex/tree-grid-ex.controller.ts
|
|
@@ -27544,6 +27806,25 @@ import { recursiveIterate as recursiveIterate12 } from "@ibiz-template/core";
|
|
|
27544
27806
|
// src/controller/control/gantt/gantt.service.ts
|
|
27545
27807
|
import { ModelError as ModelError30 } from "@ibiz-template/core";
|
|
27546
27808
|
var GanttService = class extends TreeService {
|
|
27809
|
+
/**
|
|
27810
|
+
* 执行实体服务
|
|
27811
|
+
*
|
|
27812
|
+
* @protected
|
|
27813
|
+
* @param {string} appDataEntityId 实体标识
|
|
27814
|
+
* @param {string} actionName 行为标识
|
|
27815
|
+
* @param {IContext} context 上下文
|
|
27816
|
+
* @param {IParams} params 参数
|
|
27817
|
+
* @return {*} {Promise<IHttpResponse<IData>>}
|
|
27818
|
+
* @memberof GanttService
|
|
27819
|
+
*/
|
|
27820
|
+
execDeService(appDataEntityId, actionName, context, params) {
|
|
27821
|
+
return this.app.deService.exec(
|
|
27822
|
+
appDataEntityId,
|
|
27823
|
+
actionName,
|
|
27824
|
+
context,
|
|
27825
|
+
params
|
|
27826
|
+
);
|
|
27827
|
+
}
|
|
27547
27828
|
/**
|
|
27548
27829
|
* 获取子节点数据
|
|
27549
27830
|
*
|
|
@@ -27836,6 +28117,16 @@ var GanttController = class extends MDControlController {
|
|
|
27836
28117
|
this.state.query = "";
|
|
27837
28118
|
this.state.columnStates = [];
|
|
27838
28119
|
this.state.rootNodes = [];
|
|
28120
|
+
this.state.ganttStyle = {};
|
|
28121
|
+
}
|
|
28122
|
+
/**
|
|
28123
|
+
* 当数据放生变更时,若为当前应用实体数据。则多数据部件进行刷新
|
|
28124
|
+
* 临时重写 防止错误刷新整个甘特图
|
|
28125
|
+
* @protected
|
|
28126
|
+
* @param {IData} msg
|
|
28127
|
+
* @memberof GanttController
|
|
28128
|
+
*/
|
|
28129
|
+
onDataChange(msg) {
|
|
27839
28130
|
}
|
|
27840
28131
|
async onCreated() {
|
|
27841
28132
|
var _a, _b;
|
|
@@ -27963,6 +28254,15 @@ var GanttController = class extends MDControlController {
|
|
|
27963
28254
|
}
|
|
27964
28255
|
});
|
|
27965
28256
|
}
|
|
28257
|
+
/**
|
|
28258
|
+
* 设置甘特图样式
|
|
28259
|
+
*
|
|
28260
|
+
* @param {IGanttStyle} style
|
|
28261
|
+
* @memberof GanttController
|
|
28262
|
+
*/
|
|
28263
|
+
setGanttStyle(style) {
|
|
28264
|
+
this.state.ganttStyle = style;
|
|
28265
|
+
}
|
|
27966
28266
|
/**
|
|
27967
28267
|
* 加载
|
|
27968
28268
|
*
|
|
@@ -28171,6 +28471,63 @@ var GanttController = class extends MDControlController {
|
|
|
28171
28471
|
params: { ...this.params, ...nodeData.params || {} }
|
|
28172
28472
|
};
|
|
28173
28473
|
}
|
|
28474
|
+
/**
|
|
28475
|
+
* 转化节点数据项
|
|
28476
|
+
* vo -> do
|
|
28477
|
+
* @param {IDETreeNode} nodeModel 节点模型
|
|
28478
|
+
* @param {IData} data 数据
|
|
28479
|
+
* @memberof GanttController
|
|
28480
|
+
*/
|
|
28481
|
+
transformNodeDataItem(nodeModel, data) {
|
|
28482
|
+
var _a;
|
|
28483
|
+
const dataItem = {};
|
|
28484
|
+
(_a = nodeModel.detreeNodeDataItems) == null ? void 0 : _a.forEach((item) => {
|
|
28485
|
+
if (item.id && item.appDEFieldId && data.hasOwnProperty(item.id.toLowerCase())) {
|
|
28486
|
+
Object.assign(dataItem, {
|
|
28487
|
+
[item.appDEFieldId.toLowerCase()]: data[item.id.toLowerCase()]
|
|
28488
|
+
});
|
|
28489
|
+
}
|
|
28490
|
+
});
|
|
28491
|
+
return dataItem;
|
|
28492
|
+
}
|
|
28493
|
+
/**
|
|
28494
|
+
* 更新节点数据
|
|
28495
|
+
*
|
|
28496
|
+
* @param {(IGanttNodeData | IData)} nodeData 节点数据
|
|
28497
|
+
* @param {IData} data 更新数据
|
|
28498
|
+
* @param {boolean} [isTransformData=false] 是否转化数据项
|
|
28499
|
+
* @return {*}
|
|
28500
|
+
* @memberof GanttController
|
|
28501
|
+
*/
|
|
28502
|
+
async updateNodeData(nodeData, data, isTransformData = false) {
|
|
28503
|
+
const key = nodeData.srfkey ? "srfkey" : "id";
|
|
28504
|
+
const currentNode = this.state.items.find(
|
|
28505
|
+
(item) => item[key] === nodeData[key]
|
|
28506
|
+
);
|
|
28507
|
+
if (!currentNode || !currentNode.srfkey) {
|
|
28508
|
+
ibiz.log.error("\u627E\u4E0D\u5230\u5BF9\u5E94\u7684\u52A8\u6001\u5B9E\u4F53\u6811\u8282\u70B9\u6570\u636E", nodeData);
|
|
28509
|
+
return;
|
|
28510
|
+
}
|
|
28511
|
+
const nodeModel = this.getNodeModel(currentNode.nodeId);
|
|
28512
|
+
if (nodeModel) {
|
|
28513
|
+
const newData = isTransformData ? this.transformNodeDataItem(nodeModel, data) : data;
|
|
28514
|
+
if (Object.keys(newData).length > 0) {
|
|
28515
|
+
const [, entityCodename] = nodeModel.appDataEntityId.split(".");
|
|
28516
|
+
const tempContext = Object.assign(this.context.clone(), {
|
|
28517
|
+
[entityCodename]: currentNode.srfkey
|
|
28518
|
+
});
|
|
28519
|
+
const response = await this.service.execDeService(
|
|
28520
|
+
nodeModel.appDataEntityId,
|
|
28521
|
+
"update",
|
|
28522
|
+
tempContext,
|
|
28523
|
+
newData
|
|
28524
|
+
);
|
|
28525
|
+
if (response.status === 200) {
|
|
28526
|
+
this.refreshNodeChildren(nodeData, true);
|
|
28527
|
+
}
|
|
28528
|
+
}
|
|
28529
|
+
}
|
|
28530
|
+
}
|
|
28174
28531
|
/**
|
|
28175
28532
|
* 刷新指定树节点的子节点数据
|
|
28176
28533
|
*
|
|
@@ -28323,7 +28680,7 @@ var AppHub = class {
|
|
|
28323
28680
|
* @param {IAppView} model
|
|
28324
28681
|
*/
|
|
28325
28682
|
registerAppView(model) {
|
|
28326
|
-
this.views.set(model.codeName, model);
|
|
28683
|
+
this.views.set(model.codeName.toLowerCase(), model);
|
|
28327
28684
|
}
|
|
28328
28685
|
/**
|
|
28329
28686
|
* 注册应用实体
|