@ibiz-template/runtime 0.4.14 → 0.4.15

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.
Files changed (27) hide show
  1. package/dist/index.esm.js +314 -0
  2. package/dist/index.system.min.js +2 -2
  3. package/out/controller/control/gantt/gantt.controller.d.ts +34 -1
  4. package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
  5. package/out/controller/control/gantt/gantt.controller.js +74 -0
  6. package/out/controller/control/gantt/gantt.service.d.ts +13 -0
  7. package/out/controller/control/gantt/gantt.service.d.ts.map +1 -1
  8. package/out/controller/control/gantt/gantt.service.js +14 -0
  9. package/out/controller/control/kanban/kanban.controller.d.ts +104 -2
  10. package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
  11. package/out/controller/control/kanban/kanban.controller.js +220 -0
  12. package/out/interface/controller/controller/control/i-kanban.controller.d.ts +27 -0
  13. package/out/interface/controller/controller/control/i-kanban.controller.d.ts.map +1 -1
  14. package/out/interface/controller/state/control/i-gantt.state.d.ts +23 -0
  15. package/out/interface/controller/state/control/i-gantt.state.d.ts.map +1 -1
  16. package/out/interface/controller/state/control/i-kanban.state.d.ts +29 -0
  17. package/out/interface/controller/state/control/i-kanban.state.d.ts.map +1 -1
  18. package/out/interface/provider/i-grid-column.provider.d.ts +2 -3
  19. package/out/interface/provider/i-grid-column.provider.d.ts.map +1 -1
  20. package/package.json +4 -4
  21. package/src/controller/control/gantt/gantt.controller.ts +91 -0
  22. package/src/controller/control/gantt/gantt.service.ts +26 -1
  23. package/src/controller/control/kanban/kanban.controller.ts +258 -1
  24. package/src/interface/controller/controller/control/i-kanban.controller.ts +31 -1
  25. package/src/interface/controller/state/control/i-gantt.state.ts +26 -0
  26. package/src/interface/controller/state/control/i-kanban.state.ts +33 -0
  27. package/src/interface/provider/i-grid-column.provider.ts +7 -3
package/dist/index.esm.js CHANGED
@@ -26199,6 +26199,8 @@ var KanbanController = class extends DataViewControlController {
26199
26199
  super.initState();
26200
26200
  this.state.size = this.model.pagingSize || 1e3;
26201
26201
  this.state.updating = false;
26202
+ this.state.batching = false;
26203
+ this.state.selectGroupKey = "";
26202
26204
  this.state.draggable = this.enableEditOrder || this.enableEditGroup;
26203
26205
  }
26204
26206
  /**
@@ -26210,6 +26212,7 @@ var KanbanController = class extends DataViewControlController {
26210
26212
  */
26211
26213
  async onCreated() {
26212
26214
  await super.onCreated();
26215
+ this.setToolbarHooks();
26213
26216
  }
26214
26217
  /**
26215
26218
  * 本地排序items
@@ -26248,6 +26251,76 @@ var KanbanController = class extends DataViewControlController {
26248
26251
  this.sortItems(this.state.items);
26249
26252
  return super.afterLoad(args, items);
26250
26253
  }
26254
+ /**
26255
+ * 当展开批操作工具栏时需进行行点击拦截
26256
+ *
26257
+ * @param {IData} data
26258
+ * @return {*} {Promise<void>}
26259
+ * @memberof KanbanController
26260
+ */
26261
+ async onRowClick(data) {
26262
+ const { groupAppDEFieldId } = this.model;
26263
+ if (this.state.batching && groupAppDEFieldId) {
26264
+ const groupVal = data[groupAppDEFieldId];
26265
+ if (groupVal !== this.state.selectGroupKey) {
26266
+ if (this.state.mdctrlActiveMode === 1) {
26267
+ await this.setActive(data);
26268
+ }
26269
+ return;
26270
+ }
26271
+ }
26272
+ super.onRowClick(data);
26273
+ }
26274
+ /**
26275
+ * 点击新建时设置选中分组
26276
+ *
26277
+ * @param {MouseEvent} event
26278
+ * @param {(string | number)} group
26279
+ * @memberof KanbanController
26280
+ */
26281
+ onClickNew(event, group) {
26282
+ this.setSelectGroup(group);
26283
+ super.onClickNew(event, group);
26284
+ }
26285
+ /**
26286
+ * 分组工具栏需设置选中分组
26287
+ *
26288
+ * @param {IUIActionGroupDetail} detail
26289
+ * @param {MouseEvent} event
26290
+ * @param {IKanbanGroupState} group
26291
+ * @return {*} {Promise<void>}
26292
+ * @memberof KanbanController
26293
+ */
26294
+ async onGroupToolbarClick(detail, event, group) {
26295
+ this.setSelectGroup(group.key);
26296
+ super.onGroupToolbarClick(detail, event, group);
26297
+ }
26298
+ /**
26299
+ * 分组行为项点击,需携带分组标识
26300
+ *
26301
+ * @param {IUIActionGroupDetail} detail
26302
+ * @param {IData} item
26303
+ * @param {MouseEvent} event
26304
+ * @param {IKanbanGroupState} group
26305
+ * @return {*} {Promise<void>}
26306
+ * @memberof KanbanController
26307
+ */
26308
+ async onGroupActionClick(detail, item, event, group) {
26309
+ this.setSelectGroup(group.key);
26310
+ const params = { ...this.params, srfgroup: group };
26311
+ const actionId = detail.uiactionId;
26312
+ await UIActionUtil.execAndResolved(
26313
+ actionId,
26314
+ {
26315
+ context: this.context,
26316
+ params,
26317
+ data: [item],
26318
+ view: this.view,
26319
+ event
26320
+ },
26321
+ detail.appId
26322
+ );
26323
+ }
26251
26324
  handleDataGroup() {
26252
26325
  if (!this.model.enableGroup || this.model.groupMode === "NONE") {
26253
26326
  throw new RuntimeError57("\u770B\u677F\u90E8\u4EF6\u5FC5\u987B\u5F00\u542F\u5206\u7EC4");
@@ -26443,6 +26516,152 @@ var KanbanController = class extends DataViewControlController {
26443
26516
  await this.afterLoad({}, this.state.items);
26444
26517
  }
26445
26518
  }
26519
+ /**
26520
+ * 获取是否全屏
26521
+ *
26522
+ * @return {*} {boolean}
26523
+ * @memberof KanbanController
26524
+ */
26525
+ getFullscreen() {
26526
+ const value = document.isFullScreen || document.mozIsFullScreen || document.webkitIsFullScreen;
26527
+ return value;
26528
+ }
26529
+ /**
26530
+ * 触发全屏
26531
+ *
26532
+ * @param {IData} container
26533
+ * @memberof KanbanController
26534
+ */
26535
+ onFullScreen(container) {
26536
+ const isFull = this.getFullscreen();
26537
+ if (!isFull) {
26538
+ if (container) {
26539
+ if (container.webkitRequestFullscreen) {
26540
+ container.webkitRequestFullscreen();
26541
+ } else if (container.mozRequestFullScreen) {
26542
+ container.mozRequestFullScreen();
26543
+ } else if (container.msRequestFullscreen) {
26544
+ container.msRequestFullscreen();
26545
+ } else if (container.requestFullscreen) {
26546
+ container.requestFullscreen();
26547
+ }
26548
+ }
26549
+ } else if (document.documentElement.requestFullScreen) {
26550
+ document.exitFullScreen();
26551
+ } else if (document.documentElement.webkitRequestFullScreen) {
26552
+ document.webkitCancelFullScreen();
26553
+ } else if (document.documentElement.mozRequestFullScreen) {
26554
+ document.mozCancelFullScreen();
26555
+ }
26556
+ return !isFull;
26557
+ }
26558
+ /**
26559
+ * 设置选中分组标识
26560
+ *
26561
+ * @param {(string | number)} key
26562
+ * @memberof KanbanController
26563
+ */
26564
+ setSelectGroup(key) {
26565
+ if (!this.state.batching) {
26566
+ this.state.selectGroupKey = key;
26567
+ }
26568
+ }
26569
+ /**
26570
+ * 设置分组控制器
26571
+ *
26572
+ * @param {string} groupKey
26573
+ * @param {('quickToolbarController' | 'batchToolbarController')} name
26574
+ * @param {IToolbarController} c
26575
+ * @memberof KanbanController
26576
+ */
26577
+ setGroupController(groupKey, name, c) {
26578
+ const group = this.state.groups.find((x) => x.key === groupKey);
26579
+ if (group) {
26580
+ group[name] = c;
26581
+ }
26582
+ }
26583
+ /**
26584
+ * 设置工具栏hook
26585
+ *
26586
+ * @memberof KanbanController
26587
+ */
26588
+ setToolbarHooks() {
26589
+ this.listenNewController((name, c) => {
26590
+ if (name.startsWith("".concat(this.model.name, "_quicktoolbar")) || name.startsWith("".concat(this.model.name, "_groupquicktoolbar"))) {
26591
+ this.setQuickToolbarClickHook(name, c);
26592
+ }
26593
+ if (name.startsWith("".concat(this.model.name, "_batchtoolbar"))) {
26594
+ this.setBatchToolbarClickHook(name, c);
26595
+ }
26596
+ });
26597
+ }
26598
+ /**
26599
+ * 设置快捷工具栏点击事件hook
26600
+ *
26601
+ * @param {string} name
26602
+ * @param {IToolbarController} c
26603
+ * @memberof KanbanController
26604
+ */
26605
+ setQuickToolbarClickHook(name, c) {
26606
+ const key = name.split("quicktoolbar_")[1];
26607
+ this.setGroupController(
26608
+ key,
26609
+ "quickToolbarController",
26610
+ c
26611
+ );
26612
+ c.evt.on("onClick", (event) => {
26613
+ const groupKey = event.targetName.split("quicktoolbar_")[1];
26614
+ this.setSelectGroup(groupKey);
26615
+ Object.assign(event.params, { srfgroup: groupKey });
26616
+ });
26617
+ }
26618
+ /**
26619
+ * 设置批工具栏点击事件hook
26620
+ *
26621
+ * @param {string} name
26622
+ * @param {IToolbarController} c
26623
+ * @memberof KanbanController
26624
+ */
26625
+ setBatchToolbarClickHook(name, c) {
26626
+ const key = name.split("batchtoolbar_")[1];
26627
+ this.setGroupController(
26628
+ key,
26629
+ "batchToolbarController",
26630
+ c
26631
+ );
26632
+ c.evt.on("onClick", (event) => {
26633
+ const groupKey = event.targetName.split("batchtoolbar_")[1];
26634
+ this.setSelectGroup(groupKey);
26635
+ Object.assign(event.params, { srfgroup: groupKey });
26636
+ });
26637
+ }
26638
+ /**
26639
+ * 打开批操作工具栏
26640
+ *
26641
+ * @param {string} groupKey
26642
+ * @memberof KanbanController
26643
+ */
26644
+ openBatch(groupKey) {
26645
+ this.state.selectGroupKey = groupKey;
26646
+ this.state.batching = true;
26647
+ this.state.selectedData = [];
26648
+ this.state.groups.forEach((group) => {
26649
+ group.selectedData = [];
26650
+ });
26651
+ }
26652
+ /**
26653
+ * 关闭批操作工具栏
26654
+ *
26655
+ * @memberof KanbanController
26656
+ */
26657
+ closeBatch() {
26658
+ this.state.selectGroupKey = "";
26659
+ this.state.batching = false;
26660
+ this.state.selectedData = [];
26661
+ this.state.groups.forEach((group) => {
26662
+ group.selectedData = [];
26663
+ });
26664
+ }
26446
26665
  };
26447
26666
 
26448
26667
  // src/controller/control/tree-grid-ex/tree-grid-ex.controller.ts
@@ -27544,6 +27763,25 @@ import { recursiveIterate as recursiveIterate12 } from "@ibiz-template/core";
27544
27763
  // src/controller/control/gantt/gantt.service.ts
27545
27764
  import { ModelError as ModelError30 } from "@ibiz-template/core";
27546
27765
  var GanttService = class extends TreeService {
27766
+ /**
27767
+ * 执行实体服务
27768
+ *
27769
+ * @protected
27770
+ * @param {string} appDataEntityId 实体标识
27771
+ * @param {string} actionName 行为标识
27772
+ * @param {IContext} context 上下文
27773
+ * @param {IParams} params 参数
27774
+ * @return {*} {Promise<IHttpResponse<IData>>}
27775
+ * @memberof GanttService
27776
+ */
27777
+ execDeService(appDataEntityId, actionName, context, params) {
27778
+ return this.app.deService.exec(
27779
+ appDataEntityId,
27780
+ actionName,
27781
+ context,
27782
+ params
27783
+ );
27784
+ }
27547
27785
  /**
27548
27786
  * 获取子节点数据
27549
27787
  *
@@ -27836,6 +28074,16 @@ var GanttController = class extends MDControlController {
27836
28074
  this.state.query = "";
27837
28075
  this.state.columnStates = [];
27838
28076
  this.state.rootNodes = [];
28077
+ this.state.ganttStyle = {};
28078
+ }
28079
+ /**
28080
+ * 当数据放生变更时,若为当前应用实体数据。则多数据部件进行刷新
28081
+ * 临时重写 防止错误刷新整个甘特图
28082
+ * @protected
28083
+ * @param {IData} msg
28084
+ * @memberof GanttController
28085
+ */
28086
+ onDataChange(msg) {
27839
28087
  }
27840
28088
  async onCreated() {
27841
28089
  var _a, _b;
@@ -27963,6 +28211,15 @@ var GanttController = class extends MDControlController {
27963
28211
  }
27964
28212
  });
27965
28213
  }
28214
+ /**
28215
+ * 设置甘特图样式
28216
+ *
28217
+ * @param {IGanttStyle} style
28218
+ * @memberof GanttController
28219
+ */
28220
+ setGanttStyle(style) {
28221
+ this.state.ganttStyle = style;
28222
+ }
27966
28223
  /**
27967
28224
  * 加载
27968
28225
  *
@@ -28171,6 +28428,63 @@ var GanttController = class extends MDControlController {
28171
28428
  params: { ...this.params, ...nodeData.params || {} }
28172
28429
  };
28173
28430
  }
28431
+ /**
28432
+ * 转化节点数据项
28433
+ * vo -> do
28434
+ * @param {IDETreeNode} nodeModel 节点模型
28435
+ * @param {IData} data 数据
28436
+ * @memberof GanttController
28437
+ */
28438
+ transformNodeDataItem(nodeModel, data) {
28439
+ var _a;
28440
+ const dataItem = {};
28441
+ (_a = nodeModel.detreeNodeDataItems) == null ? void 0 : _a.forEach((item) => {
28442
+ if (item.id && item.appDEFieldId && data.hasOwnProperty(item.id.toLowerCase())) {
28443
+ Object.assign(dataItem, {
28444
+ [item.appDEFieldId.toLowerCase()]: data[item.id.toLowerCase()]
28445
+ });
28446
+ }
28447
+ });
28448
+ return dataItem;
28449
+ }
28450
+ /**
28451
+ * 更新节点数据
28452
+ *
28453
+ * @param {(IGanttNodeData | IData)} nodeData 节点数据
28454
+ * @param {IData} data 更新数据
28455
+ * @param {boolean} [isTransformData=false] 是否转化数据项
28456
+ * @return {*}
28457
+ * @memberof GanttController
28458
+ */
28459
+ async updateNodeData(nodeData, data, isTransformData = false) {
28460
+ const key = nodeData.srfkey ? "srfkey" : "id";
28461
+ const currentNode = this.state.items.find(
28462
+ (item) => item[key] === nodeData[key]
28463
+ );
28464
+ if (!currentNode || !currentNode.srfkey) {
28465
+ ibiz.log.error("\u627E\u4E0D\u5230\u5BF9\u5E94\u7684\u52A8\u6001\u5B9E\u4F53\u6811\u8282\u70B9\u6570\u636E", nodeData);
28466
+ return;
28467
+ }
28468
+ const nodeModel = this.getNodeModel(currentNode.nodeId);
28469
+ if (nodeModel) {
28470
+ const newData = isTransformData ? this.transformNodeDataItem(nodeModel, data) : data;
28471
+ if (Object.keys(newData).length > 0) {
28472
+ const [, entityCodename] = nodeModel.appDataEntityId.split(".");
28473
+ const tempContext = Object.assign(this.context.clone(), {
28474
+ [entityCodename]: currentNode.srfkey
28475
+ });
28476
+ const response = await this.service.execDeService(
28477
+ nodeModel.appDataEntityId,
28478
+ "update",
28479
+ tempContext,
28480
+ newData
28481
+ );
28482
+ if (response.status === 200) {
28483
+ this.refreshNodeChildren(nodeData, true);
28484
+ }
28485
+ }
28486
+ }
28487
+ }
28174
28488
  /**
28175
28489
  * 刷新指定树节点的子节点数据
28176
28490
  *