@ibiz-template/runtime 0.7.41-alpha.13 → 0.7.41-alpha.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 (64) hide show
  1. package/dist/index.esm.js +185 -58
  2. package/dist/index.system.min.js +1 -1
  3. package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
  4. package/out/controller/common/control/md-control.controller.js +2 -2
  5. package/out/controller/control/calendar/calendar.controller.d.ts.map +1 -1
  6. package/out/controller/control/calendar/calendar.controller.js +8 -1
  7. package/out/controller/control/exp-bar/calendar-exp-bar.controller.d.ts.map +1 -1
  8. package/out/controller/control/exp-bar/calendar-exp-bar.controller.js +2 -0
  9. package/out/controller/control/exp-bar/exp-bar.controller.d.ts.map +1 -1
  10. package/out/controller/control/exp-bar/exp-bar.controller.js +1 -1
  11. package/out/controller/control/form/form-detail/form-item/form-item.controller.js +1 -1
  12. package/out/controller/control/kanban/kanban.controller.d.ts +12 -5
  13. package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
  14. package/out/controller/control/kanban/kanban.controller.js +42 -13
  15. package/out/controller/control/medit-view-panel/medit-view-panel.controller.d.ts +25 -9
  16. package/out/controller/control/medit-view-panel/medit-view-panel.controller.d.ts.map +1 -1
  17. package/out/controller/control/medit-view-panel/medit-view-panel.controller.js +49 -21
  18. package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts +20 -0
  19. package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts.map +1 -1
  20. package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.js +25 -0
  21. package/out/controller/control/toolbar/toolbar.controller.d.ts +1 -1
  22. package/out/controller/control/toolbar/toolbar.controller.d.ts.map +1 -1
  23. package/out/controller/control/toolbar/toolbar.controller.js +8 -2
  24. package/out/controller/control/wizard-panel/wizard-panel.controller.d.ts +1 -1
  25. package/out/controller/control/wizard-panel/wizard-panel.controller.d.ts.map +1 -1
  26. package/out/controller/control/wizard-panel/wizard-panel.controller.js +5 -4
  27. package/out/controller/utils/view-msg/view-msg-controller.d.ts.map +1 -1
  28. package/out/controller/utils/view-msg/view-msg-controller.js +5 -3
  29. package/out/engine/md-view.engine.d.ts.map +1 -1
  30. package/out/engine/md-view.engine.js +6 -6
  31. package/out/interface/api/common/i-api-map-options.d.ts +62 -0
  32. package/out/interface/api/common/i-api-map-options.d.ts.map +1 -0
  33. package/out/interface/api/common/i-api-map-options.js +1 -0
  34. package/out/interface/api/common/index.d.ts +1 -0
  35. package/out/interface/api/common/index.d.ts.map +1 -1
  36. package/out/interface/api/controller/control/i-api-drbar.controller.d.ts +6 -0
  37. package/out/interface/api/controller/control/i-api-drbar.controller.d.ts.map +1 -1
  38. package/out/interface/api/controller/control/i-api-drtab.controller.d.ts +6 -0
  39. package/out/interface/api/controller/control/i-api-drtab.controller.d.ts.map +1 -1
  40. package/out/interface/api/controller/control/i-api-map.controller.d.ts +2 -2
  41. package/out/interface/api/controller/control/i-api-medit-view-panel.controller.d.ts +27 -1
  42. package/out/interface/api/controller/control/i-api-medit-view-panel.controller.d.ts.map +1 -1
  43. package/out/interface/api/controller/control/i-api-tab-exp-panel.controller.d.ts +6 -0
  44. package/out/interface/api/controller/control/i-api-tab-exp-panel.controller.d.ts.map +1 -1
  45. package/out/interface/api/state/control/i-api-tab-exp-panel.state.d.ts +6 -0
  46. package/out/interface/api/state/control/i-api-tab-exp-panel.state.d.ts.map +1 -1
  47. package/out/interface/controller/controller/control/i-toolbar.controller.d.ts +2 -1
  48. package/out/interface/controller/controller/control/i-toolbar.controller.d.ts.map +1 -1
  49. package/out/interface/controller/event/control/i-drbar.event.d.ts +13 -0
  50. package/out/interface/controller/event/control/i-drbar.event.d.ts.map +1 -1
  51. package/out/interface/controller/event/control/i-drtab.event.d.ts +13 -0
  52. package/out/interface/controller/event/control/i-drtab.event.d.ts.map +1 -1
  53. package/out/interface/controller/event/control/i-medit-view-panel.event.d.ts +25 -0
  54. package/out/interface/controller/event/control/i-medit-view-panel.event.d.ts.map +1 -1
  55. package/out/interface/controller/event/control/i-wizard-panel.event.d.ts +12 -0
  56. package/out/interface/controller/event/control/i-wizard-panel.event.d.ts.map +1 -1
  57. package/out/interface/controller/state/control/i-kanban.state.d.ts +9 -9
  58. package/out/interface/controller/state/control/i-kanban.state.d.ts.map +1 -1
  59. package/out/logic-scheduler/trigger/item-dyna-logic-trigger.d.ts.map +1 -1
  60. package/out/logic-scheduler/trigger/item-dyna-logic-trigger.js +3 -2
  61. package/out/service/vo/calendar-item-data/calendar-item-data.d.ts +4 -0
  62. package/out/service/vo/calendar-item-data/calendar-item-data.d.ts.map +1 -1
  63. package/out/service/vo/calendar-item-data/calendar-item-data.js +14 -6
  64. package/package.json +3 -3
package/dist/index.esm.js CHANGED
@@ -25043,7 +25043,10 @@ var CalendarItemData = class {
25043
25043
  }
25044
25044
  get bkColor() {
25045
25045
  const fieldName = this.model.bkcolorAppDEFieldId;
25046
- return fieldName && this.data[fieldName] ? this.data[fieldName] : this.model.bkcolor;
25046
+ return this._bkColor || (fieldName && this.data[fieldName] ? this.data[fieldName] : this.model.bkcolor);
25047
+ }
25048
+ set bkColor(_val) {
25049
+ this._bkColor = _val;
25047
25050
  }
25048
25051
  get beginTime() {
25049
25052
  const fieldName = this.model.beginTimeAppDEFieldId;
@@ -25051,7 +25054,10 @@ var CalendarItemData = class {
25051
25054
  }
25052
25055
  get color() {
25053
25056
  const fieldName = this.model.colorAppDEFieldId;
25054
- return fieldName && this.data[fieldName] ? this.data[fieldName] : this.model.color;
25057
+ return this._color || (fieldName && this.data[fieldName] ? this.data[fieldName] : this.model.color);
25058
+ }
25059
+ set color(_val) {
25060
+ this._color = _val;
25055
25061
  }
25056
25062
  get content() {
25057
25063
  const fieldName = this.model.contentAppDEFieldId;
@@ -35395,7 +35401,7 @@ var ViewMsgController = class _ViewMsgController {
35395
35401
  * @return {*} {Promise<void>}
35396
35402
  */
35397
35403
  async init(context) {
35398
- var _a3, _b2;
35404
+ var _a3, _b2, _c;
35399
35405
  const appModel = ibiz.hub.getApp(context.srfappid).model;
35400
35406
  const msgGroup = (_a3 = appModel.appViewMsgGroups) == null ? void 0 : _a3.find(
35401
35407
  (item) => item.id === this.msgGroupId
@@ -35408,10 +35414,12 @@ var ViewMsgController = class _ViewMsgController {
35408
35414
  );
35409
35415
  }
35410
35416
  this.msgGroup = msgGroup;
35411
- const msgDetailsViewMsgIds = msgGroup.appViewMsgGroupDetails.map(
35417
+ const msgDetailsViewMsgIds = (_b2 = msgGroup.appViewMsgGroupDetails) == null ? void 0 : _b2.map(
35412
35418
  (item) => item.appViewMsgId
35413
35419
  );
35414
- (_b2 = appModel.appViewMsgs) == null ? void 0 : _b2.forEach((item) => {
35420
+ if (!msgDetailsViewMsgIds)
35421
+ return;
35422
+ (_c = appModel.appViewMsgs) == null ? void 0 : _c.forEach((item) => {
35415
35423
  const index = msgDetailsViewMsgIds.indexOf(item.id);
35416
35424
  if (index !== -1) {
35417
35425
  this.viewMsgMap.set(item.id, item);
@@ -38148,11 +38156,13 @@ var MDControlController = class extends ControlController {
38148
38156
  const data = selection == null ? void 0 : selection[0];
38149
38157
  (_a3 = this.batchToolbarController) == null ? void 0 : _a3.calcButtonState(
38150
38158
  data,
38151
- this.model.appDataEntityId
38159
+ this.model.appDataEntityId,
38160
+ { view: this.view, ctrl: this }
38152
38161
  );
38153
38162
  (_b2 = this.quickToolbarController) == null ? void 0 : _b2.calcButtonState(
38154
38163
  data,
38155
- this.model.appDataEntityId
38164
+ this.model.appDataEntityId,
38165
+ { view: this.view, ctrl: this }
38156
38166
  );
38157
38167
  }
38158
38168
  /**
@@ -42152,7 +42162,10 @@ var ToolbarController = class extends ControlController {
42152
42162
  );
42153
42163
  await this.initToolbarItemProviders();
42154
42164
  if (!this.state.manualCalcButtonState) {
42155
- await this.calcButtonState(void 0, this.model.appDataEntityId);
42165
+ await this.calcButtonState(void 0, this.model.appDataEntityId, {
42166
+ view: this.view,
42167
+ ctrl: this
42168
+ });
42156
42169
  } else {
42157
42170
  await this.state.buttonsState.init();
42158
42171
  }
@@ -42202,7 +42215,7 @@ var ToolbarController = class extends ControlController {
42202
42215
  await this.doUIAction(item, event, params);
42203
42216
  }
42204
42217
  }
42205
- async calcButtonState(data, appDeId) {
42218
+ async calcButtonState(data, appDeId, _params = {}) {
42206
42219
  let _data = data;
42207
42220
  if (data && data instanceof ControlVO) {
42208
42221
  _data = data.getOrigin();
@@ -42216,6 +42229,9 @@ var ToolbarController = class extends ControlController {
42216
42229
  });
42217
42230
  if (this.scheduler) {
42218
42231
  const logicParams = {};
42232
+ if (_params) {
42233
+ Object.assign(logicParams, { ..._params });
42234
+ }
42219
42235
  if (_data) {
42220
42236
  logicParams.data = [_data];
42221
42237
  }
@@ -42583,7 +42599,15 @@ var CalendarController = class extends MDControlController {
42583
42599
  * @memberof CalendarController
42584
42600
  */
42585
42601
  async afterLoad(args, items) {
42586
- await super.afterLoad(args, items);
42602
+ if (args.isInitialLoad || this.refreshMode === "nocache") {
42603
+ this.state.selectedData = [];
42604
+ } else if (this.refreshMode === "cache") {
42605
+ this.state.selectedData = this.state.items.filter(
42606
+ (item) => this.state.selectedData.find(
42607
+ (select) => select.deData.tempsrfkey === item.deData.tempsrfkey
42608
+ )
42609
+ );
42610
+ }
42587
42611
  this.sortItems(this.state.items);
42588
42612
  this.calcShowMode(this.state.items);
42589
42613
  await this.handleDataGroup();
@@ -49780,7 +49804,8 @@ var ExpBarControlController = class extends ControlController {
49780
49804
  this.xDataController.evt.on("onSelectionChange", async (event) => {
49781
49805
  this.toolbarController.calcButtonState(
49782
49806
  event.data[0],
49783
- this.model.appDataEntityId
49807
+ this.model.appDataEntityId,
49808
+ event
49784
49809
  );
49785
49810
  });
49786
49811
  }
@@ -50094,13 +50119,15 @@ var CalendarExpBarController = class extends ExpBarControlController {
50094
50119
  key: item.navId,
50095
50120
  context,
50096
50121
  params,
50097
- viewId: itemModel.navAppViewId
50122
+ viewId: itemModel.navAppViewId,
50123
+ isCache: this.isCache
50098
50124
  };
50099
50125
  }
50100
50126
  return {
50101
50127
  key: item.navId,
50102
50128
  context: this.context,
50103
- params: this.params
50129
+ params: this.params,
50130
+ isCache: this.isCache
50104
50131
  };
50105
50132
  }
50106
50133
  };
@@ -52741,7 +52768,7 @@ var FormItemController = class extends FormDetailController {
52741
52768
  });
52742
52769
  }
52743
52770
  if (isReset) {
52744
- this.setDataValue(null, this.name);
52771
+ await this.setDataValue(null, this.name);
52745
52772
  }
52746
52773
  if (name2.includes(this.name) || name2.includes(this.valueItemName)) {
52747
52774
  this.validate();
@@ -59791,6 +59818,7 @@ var TabExpPanelController = class extends ControlController {
59791
59818
  */
59792
59819
  async onCreated() {
59793
59820
  await super.onCreated();
59821
+ await this.initCounter();
59794
59822
  this.layoutPanel = this.view.layoutPanel;
59795
59823
  this.initTabPages();
59796
59824
  this.initIconCaption();
@@ -59808,7 +59836,8 @@ var TabExpPanelController = class extends ControlController {
59808
59836
  caption: panel.caption,
59809
59837
  tabTag: panel.id,
59810
59838
  class: panel.sysCss ? [panel.sysCss.cssName] : [],
59811
- sysImage: panel.sysImage
59839
+ sysImage: panel.sysImage,
59840
+ counterId: panel.counterId
59812
59841
  });
59813
59842
  });
59814
59843
  this.state.tabPages = tabPages;
@@ -59963,6 +59992,32 @@ var TabExpPanelController = class extends ControlController {
59963
59992
  navViewMsg.key += createUUID16();
59964
59993
  this.evt.emit("onNavViewChange", { navViewMsg });
59965
59994
  }
59995
+ /**
59996
+ * @description 初始化计数器
59997
+ * @protected
59998
+ * @returns {*} {Promise<void>}
59999
+ * @memberof TabExpPanelController
60000
+ */
60001
+ async initCounter() {
60002
+ const { appCounterRefs } = this.model;
60003
+ const appCounterRef = appCounterRefs == null ? void 0 : appCounterRefs[0];
60004
+ if (appCounterRef) {
60005
+ this.counter = await CounterService.getCounterByRef(
60006
+ appCounterRef,
60007
+ this.context,
60008
+ { ...this.params }
60009
+ );
60010
+ }
60011
+ }
60012
+ /**
60013
+ * @description 设置激活项
60014
+ * @param {string} name
60015
+ * @memberof TabExpPanelController
60016
+ */
60017
+ setActive(name2) {
60018
+ this.state.activeName = name2;
60019
+ this.handleTabChange();
60020
+ }
59966
60021
  };
59967
60022
 
59968
60023
  // src/controller/control/tree/tree.controller.ts
@@ -61978,10 +62033,10 @@ var WizardPanelController = class extends ControlController {
61978
62033
  const formController = event.ctrl;
61979
62034
  this.formControllers.set(activeFormTag, formController);
61980
62035
  formController.evt.on("onFormDataChange", (evt) => {
61981
- this.calcButtonState(evt.data[0]);
62036
+ this.calcButtonState(evt.data[0], formController);
61982
62037
  });
61983
62038
  const data = await formController.load();
61984
- this.calcButtonState(formController.data);
62039
+ this.calcButtonState(formController.data, formController);
61985
62040
  Object.assign(this.formData, data);
61986
62041
  }
61987
62042
  /**
@@ -62012,7 +62067,6 @@ var WizardPanelController = class extends ControlController {
62012
62067
  throw new RuntimeError59(
62013
62068
  ibiz.i18n.t("runtime.controller.control.wizardPanel.noConfiguration")
62014
62069
  );
62015
- return;
62016
62070
  }
62017
62071
  const wizardForm = this.model.dewizard.dewizardForms.find(
62018
62072
  (form) => {
@@ -62066,6 +62120,7 @@ var WizardPanelController = class extends ControlController {
62066
62120
  this.state.activeFormTag = this.firstForm.formTag;
62067
62121
  this.tagHistory.push(this.firstForm.formTag);
62068
62122
  }
62123
+ this.evt.emit("onInitialized", void 0);
62069
62124
  }
62070
62125
  /**
62071
62126
  * 执行完成操作
@@ -62223,7 +62278,7 @@ var WizardPanelController = class extends ControlController {
62223
62278
  * @param item 数据
62224
62279
  * @memberof WizardPanelController
62225
62280
  */
62226
- async calcButtonState(item) {
62281
+ async calcButtonState(item, _form) {
62227
62282
  var _a3;
62228
62283
  const { activeWizardForm } = this;
62229
62284
  if (activeWizardForm) {
@@ -62238,6 +62293,7 @@ var WizardPanelController = class extends ControlController {
62238
62293
  buttonState.visible = !!ScriptFactory.execScriptFn(
62239
62294
  {
62240
62295
  view: this.view,
62296
+ ctrl: _form,
62241
62297
  context: this.context,
62242
62298
  params: this.params,
62243
62299
  data,
@@ -62624,6 +62680,7 @@ var MDCtrlController = class extends MDControlController {
62624
62680
  import {
62625
62681
  DataTypes as DataTypes6,
62626
62682
  RuntimeError as RuntimeError60,
62683
+ isElementSame as isElementSame5,
62627
62684
  RuntimeModelError as RuntimeModelError69
62628
62685
  } from "@ibiz-template/core";
62629
62686
  import { clone as clone46, isNil as isNil37 } from "ramda";
@@ -62728,7 +62785,7 @@ var KanbanController = class extends DataViewControlController {
62728
62785
  this.state.selectGroupKey = "";
62729
62786
  this.state.readonly = !!(this.context.srfreadonly === true || this.context.srfreadonly === "true");
62730
62787
  this.state.draggable = this.enableEditOrder || this.enableEditGroup;
62731
- this.state.lanes = [];
62788
+ this.state.swimlanes = [];
62732
62789
  }
62733
62790
  /**
62734
62791
  * 初始化
@@ -62814,7 +62871,7 @@ var KanbanController = class extends DataViewControlController {
62814
62871
  * @description 点击新建并设置设置选中分组
62815
62872
  * @param {MouseEvent} event
62816
62873
  * @param {(string | number)} group 分组
62817
- * @param {IKanbanLane} [lane] 泳道
62874
+ * @param {IKanbanSwimlane} [lane] 泳道
62818
62875
  * @memberof KanbanController
62819
62876
  */
62820
62877
  onClickNew(event, group, lane) {
@@ -62866,7 +62923,7 @@ var KanbanController = class extends DataViewControlController {
62866
62923
  * @param {IData} item
62867
62924
  * @param {MouseEvent} event
62868
62925
  * @param {IKanbanGroupState} group
62869
- * @param {IKanbanLane} [lane]
62926
+ * @param {IKanbanSwimlane} [lane]
62870
62927
  * @returns {*} {Promise<void>}
62871
62928
  * @memberof KanbanController
62872
62929
  */
@@ -62906,7 +62963,7 @@ var KanbanController = class extends DataViewControlController {
62906
62963
  const { swimlaneCodeListId, swimlaneAppDEFieldId } = this.model;
62907
62964
  if (!swimlaneAppDEFieldId)
62908
62965
  return;
62909
- let lanes = [];
62966
+ let swimlanes = [];
62910
62967
  const unclassified = {
62911
62968
  count: 0,
62912
62969
  key: void 0,
@@ -62921,7 +62978,7 @@ var KanbanController = class extends DataViewControlController {
62921
62978
  this.context,
62922
62979
  this.params
62923
62980
  );
62924
- lanes = codeListItems.map((item) => {
62981
+ swimlanes = codeListItems.map((item) => {
62925
62982
  var _a3;
62926
62983
  return {
62927
62984
  count: 0,
@@ -62931,7 +62988,7 @@ var KanbanController = class extends DataViewControlController {
62931
62988
  };
62932
62989
  });
62933
62990
  items.forEach((item) => {
62934
- const lane = lanes.find(
62991
+ const lane = swimlanes.find(
62935
62992
  (l) => {
62936
62993
  var _a3;
62937
62994
  return l.key === ((_a3 = item[swimlaneAppDEFieldId]) == null ? void 0 : _a3.toLowerCase());
@@ -62947,11 +63004,13 @@ var KanbanController = class extends DataViewControlController {
62947
63004
  const textDEFieldId = getParentTextAppDEFieldId(swimlaneAppDEFieldId, this.dataEntity) || swimlaneAppDEFieldId;
62948
63005
  items.forEach((item) => {
62949
63006
  if (item[swimlaneAppDEFieldId]) {
62950
- const lane = lanes.find((l) => l.key === item[swimlaneAppDEFieldId]);
63007
+ const lane = swimlanes.find(
63008
+ (l) => l.key === item[swimlaneAppDEFieldId]
63009
+ );
62951
63010
  if (lane) {
62952
63011
  lane.count += 1;
62953
63012
  } else {
62954
- lanes.push({
63013
+ swimlanes.push({
62955
63014
  count: 1,
62956
63015
  isExpand: true,
62957
63016
  key: item[swimlaneAppDEFieldId],
@@ -62964,8 +63023,8 @@ var KanbanController = class extends DataViewControlController {
62964
63023
  });
62965
63024
  }
62966
63025
  if (unclassified.count)
62967
- lanes.push(unclassified);
62968
- this.state.lanes = lanes;
63026
+ swimlanes.push(unclassified);
63027
+ this.state.swimlanes = swimlanes;
62969
63028
  }
62970
63029
  /**
62971
63030
  * 处理代码表分组
@@ -63260,9 +63319,8 @@ var KanbanController = class extends DataViewControlController {
63260
63319
  * @memberof KanbanController
63261
63320
  */
63262
63321
  setSelectGroup(key) {
63263
- if (!this.state.batching) {
63322
+ if (!this.state.batching)
63264
63323
  this.state.selectGroupKey = key;
63265
- }
63266
63324
  }
63267
63325
  /**
63268
63326
  * 设置分组控制器
@@ -63360,6 +63418,38 @@ var KanbanController = class extends DataViewControlController {
63360
63418
  group.selectedData = [];
63361
63419
  });
63362
63420
  }
63421
+ /**
63422
+ * @description 设置选中
63423
+ * @param {IData[]} selection
63424
+ * @param {boolean} [isEmit=true]
63425
+ * @memberof KanbanController
63426
+ */
63427
+ setSelection(selection, isEmit = true) {
63428
+ const { selectedData } = this.state;
63429
+ if (!isElementSame5(selectedData, selection)) {
63430
+ this.state.selectedData = selection;
63431
+ if (isEmit) {
63432
+ this._evt.emit("onSelectionChange", {
63433
+ data: selection
63434
+ });
63435
+ }
63436
+ }
63437
+ const data = selection == null ? void 0 : selection[0];
63438
+ const batchtoolbar = this.view.getController(
63439
+ "".concat(this.model.name, "_batchtoolbar_").concat(this.state.selectGroupKey)
63440
+ );
63441
+ const quicktoolbar = this.view.getController(
63442
+ "".concat(this.model.name, "_quicktoolbar_").concat(this.state.selectGroupKey)
63443
+ );
63444
+ batchtoolbar == null ? void 0 : batchtoolbar.calcButtonState(data, this.model.appDataEntityId, {
63445
+ view: this.view,
63446
+ ctrl: this
63447
+ });
63448
+ quicktoolbar == null ? void 0 : quicktoolbar.calcButtonState(data, this.model.appDataEntityId, {
63449
+ view: this.view,
63450
+ ctrl: this
63451
+ });
63452
+ }
63363
63453
  };
63364
63454
 
63365
63455
  // src/controller/control/tree-grid-ex/tree-grid-ex.controller.ts
@@ -64813,6 +64903,12 @@ var MEditViewPanelController = class extends MDControlController {
64813
64903
  *
64814
64904
  */
64815
64905
  this.parameters = [];
64906
+ /**
64907
+ * @description 嵌入视图
64908
+ * @type {Map<string, IViewController>}
64909
+ * @memberof MEditViewPanelController
64910
+ */
64911
+ this.embedViews = /* @__PURE__ */ new Map();
64816
64912
  }
64817
64913
  async onCreated() {
64818
64914
  await super.onCreated();
@@ -64940,6 +65036,10 @@ var MEditViewPanelController = class extends MDControlController {
64940
65036
  if (this.model.panelStyle === "TAB_TOP") {
64941
65037
  this.state.activeTab = this.state.panelUiItems[this.state.panelUiItems.length - 1].id;
64942
65038
  }
65039
+ const data = this.state.panelUiItems.find(
65040
+ (item) => item.id === this.state.activeTab
65041
+ );
65042
+ this.evt.emit("onAddSuccess", { data });
64943
65043
  }
64944
65044
  /**
64945
65045
  * 处理删除
@@ -64950,30 +65050,21 @@ var MEditViewPanelController = class extends MDControlController {
64950
65050
  */
64951
65051
  async handleDelete(item) {
64952
65052
  this.state.isNeedScroll = false;
64953
- if (item.data.srfuf === 0) {
64954
- const index = this.state.panelUiItems.findIndex((value) => {
64955
- return value === item;
64956
- });
64957
- this.state.panelUiItems.splice(index, 1);
64958
- } else {
64959
- await this.remove({ data: [item.data], notRefresh: true });
64960
- }
64961
- }
64962
- /**
64963
- * 处理tab删除
64964
- * @param {IPanelUiItem} item
64965
- * @return {*}
64966
- * @author: zhujiamin
64967
- * @Date: 2023-10-17 14:21:57
64968
- */
64969
- async handleTabDelete(item, index) {
65053
+ const index = this.state.panelUiItems.findIndex((value) => {
65054
+ return value === item;
65055
+ });
64970
65056
  let isBackToEnd = false;
64971
65057
  if (item.id === this.state.activeTab && index === this.state.panelUiItems.length - 1) {
64972
65058
  if (index > 0) {
64973
65059
  isBackToEnd = true;
64974
65060
  }
64975
65061
  }
64976
- await this.handleDelete(item);
65062
+ if (item.data.srfuf === 0) {
65063
+ this.state.panelUiItems.splice(index, 1);
65064
+ this.evt.emit("onRemoveSuccess", void 0);
65065
+ } else {
65066
+ await this.remove({ data: [item.data], notRefresh: true });
65067
+ }
64977
65068
  if (isBackToEnd) {
64978
65069
  this.state.activeTab = this.state.panelUiItems[this.state.panelUiItems.length - 1].id;
64979
65070
  }
@@ -65031,6 +65122,35 @@ var MEditViewPanelController = class extends MDControlController {
65031
65122
  this.state.activeTab = this.state.panelUiItems[panelUiItemIndex].id;
65032
65123
  }
65033
65124
  }
65125
+ /**
65126
+ * @description 切换标签页
65127
+ * @param {string} name
65128
+ * @memberof MEditViewPanelController
65129
+ */
65130
+ onTabChange(name2) {
65131
+ const data = this.state.panelUiItems.find((item) => item.id === name2);
65132
+ this.evt.emit("onTabChange", { data });
65133
+ }
65134
+ /**
65135
+ * @description 监听视图创建
65136
+ * @param {EventBase} event
65137
+ * @memberof MEditViewPanelController
65138
+ */
65139
+ onViewCreated(event, id) {
65140
+ const { view } = event;
65141
+ this.embedViews.set(id, view);
65142
+ view.evt.on("onDestroyed", () => {
65143
+ this.embedViews.delete(id);
65144
+ });
65145
+ }
65146
+ /**
65147
+ * @description 获取激活视图控制器
65148
+ * @returns {*} {(IViewController | undefined)}
65149
+ * @memberof MEditViewPanelController
65150
+ */
65151
+ getActiveView() {
65152
+ return this.embedViews.get(this.state.activeTab);
65153
+ }
65034
65154
  };
65035
65155
 
65036
65156
  // src/controller/control/map/map.service.ts
@@ -77225,11 +77345,13 @@ var MDViewEngine = class extends ViewEngineBase {
77225
77345
  var _a3, _b2;
77226
77346
  (_a3 = this.toolbar) == null ? void 0 : _a3.calcButtonState(
77227
77347
  event.data[0],
77228
- this.xdataControl.model.appDataEntityId
77348
+ this.xdataControl.model.appDataEntityId,
77349
+ event
77229
77350
  );
77230
77351
  (_b2 = this.tabToolbar) == null ? void 0 : _b2.calcButtonState(
77231
77352
  event.data[0],
77232
- this.xdataControl.model.appDataEntityId
77353
+ this.xdataControl.model.appDataEntityId,
77354
+ event
77233
77355
  );
77234
77356
  });
77235
77357
  this.xdataControl.evt.on("onBeforeLoad", () => {
@@ -77239,11 +77361,13 @@ var MDViewEngine = class extends ViewEngineBase {
77239
77361
  var _a3, _b2;
77240
77362
  (_a3 = this.toolbar) == null ? void 0 : _a3.calcButtonState(
77241
77363
  void 0,
77242
- this.xdataControl.model.appDataEntityId
77364
+ this.xdataControl.model.appDataEntityId,
77365
+ event
77243
77366
  );
77244
77367
  (_b2 = this.tabToolbar) == null ? void 0 : _b2.calcButtonState(
77245
77368
  void 0,
77246
- this.xdataControl.model.appDataEntityId
77369
+ this.xdataControl.model.appDataEntityId,
77370
+ event
77247
77371
  );
77248
77372
  this.view.evt.emit("onDataChange", { ...event, actionType: "LOAD" });
77249
77373
  });
@@ -77258,11 +77382,13 @@ var MDViewEngine = class extends ViewEngineBase {
77258
77382
  if (((_a3 = event.data) == null ? void 0 : _a3.length) > 0) {
77259
77383
  (_b2 = this.toolbar) == null ? void 0 : _b2.calcButtonState(
77260
77384
  event.data[0],
77261
- this.xdataControl.model.appDataEntityId
77385
+ this.xdataControl.model.appDataEntityId,
77386
+ event
77262
77387
  );
77263
77388
  (_c = this.tabToolbar) == null ? void 0 : _c.calcButtonState(
77264
77389
  event.data[0],
77265
- this.xdataControl.model.appDataEntityId
77390
+ this.xdataControl.model.appDataEntityId,
77391
+ event
77266
77392
  );
77267
77393
  }
77268
77394
  });
@@ -78743,15 +78869,16 @@ var ItemDynaLogicTrigger = class extends LogicTrigger {
78743
78869
  }
78744
78870
  bindScriptExecutor(executor) {
78745
78871
  executor.init(
78746
- ["context", "viewparams", "data", "env", "view"],
78872
+ ["context", "viewparams", "data", "env", "view", "ctrl"],
78747
78873
  (executeParams) => {
78748
- const { context, params, data, view } = executeParams;
78874
+ const { context, params, data, view, ctrl } = executeParams;
78749
78875
  return {
78750
78876
  context,
78751
78877
  params,
78752
78878
  data: (data == null ? void 0 : data[0]) || {},
78753
78879
  env: ibiz.env,
78754
- view
78880
+ view,
78881
+ ctrl
78755
78882
  };
78756
78883
  },
78757
78884
  {