@ibiz-template/runtime 0.1.19 → 0.1.21

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 (83) hide show
  1. package/dist/index.esm.js +252 -31
  2. package/dist/index.system.min.js +1 -1
  3. package/dist/index.system.min.js.map +1 -1
  4. package/out/constant/index.d.ts +1 -0
  5. package/out/constant/index.d.ts.map +1 -1
  6. package/out/constant/index.js +1 -0
  7. package/out/constant/view-call-tag.d.ts +14 -0
  8. package/out/constant/view-call-tag.d.ts.map +1 -0
  9. package/out/constant/view-call-tag.js +15 -0
  10. package/out/controller/common/control/control.controller.d.ts +13 -0
  11. package/out/controller/common/control/control.controller.d.ts.map +1 -1
  12. package/out/controller/common/control/control.controller.js +58 -0
  13. package/out/controller/common/control/md-control.controller.d.ts +7 -0
  14. package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
  15. package/out/controller/common/control/md-control.controller.js +27 -2
  16. package/out/controller/control/data-view/data-view.controller.d.ts.map +1 -1
  17. package/out/controller/control/data-view/data-view.controller.js +2 -1
  18. package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
  19. package/out/controller/control/form/edit-form/edit-form.controller.js +36 -7
  20. package/out/controller/control/form/form/form.controller.d.ts +4 -0
  21. package/out/controller/control/form/form/form.controller.d.ts.map +1 -1
  22. package/out/controller/control/form/form/form.controller.js +3 -0
  23. package/out/controller/control/form/search-form/search-form.controller.d.ts.map +1 -1
  24. package/out/controller/control/form/search-form/search-form.controller.js +11 -1
  25. package/out/controller/control/grid/grid/grid.controller.d.ts +1 -1
  26. package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
  27. package/out/controller/control/grid/grid/grid.controller.js +29 -5
  28. package/out/controller/control/list/list.controller.d.ts.map +1 -1
  29. package/out/controller/control/list/list.controller.js +2 -1
  30. package/out/engine/md-view.engine.js +2 -2
  31. package/out/global/global-util/global-util.d.ts +14 -0
  32. package/out/global/global-util/global-util.d.ts.map +1 -1
  33. package/out/global/global-util/global-util.js +26 -0
  34. package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts +1 -0
  35. package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts.map +1 -1
  36. package/out/logic-scheduler/executor/app-ui-logic-executor.js +33 -4
  37. package/out/logic-scheduler/trigger/control-event-trigger.js +1 -1
  38. package/out/logic-scheduler/trigger/view-event-trigger.js +1 -1
  39. package/out/model/data-entity/data-entity.d.ts +11 -0
  40. package/out/model/data-entity/data-entity.d.ts.map +1 -1
  41. package/out/model/data-entity/data-entity.js +14 -0
  42. package/out/model/index.d.ts +1 -0
  43. package/out/model/index.d.ts.map +1 -1
  44. package/out/model/index.js +1 -0
  45. package/out/model/panel/data-container.d.ts +11 -0
  46. package/out/model/panel/data-container.d.ts.map +1 -0
  47. package/out/model/panel/data-container.js +12 -0
  48. package/out/model/panel/index.d.ts +2 -0
  49. package/out/model/panel/index.d.ts.map +1 -0
  50. package/out/model/panel/index.js +1 -0
  51. package/out/service/app-data-entity/app-data-entity.d.ts.map +1 -1
  52. package/out/service/app-data-entity/app-data-entity.js +3 -1
  53. package/out/service/dto/method.dto.js +1 -1
  54. package/out/service/service/entity/method/method.d.ts.map +1 -1
  55. package/out/service/service/entity/method/method.js +3 -0
  56. package/out/service/vo/control.vo.js +2 -2
  57. package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.d.ts.map +1 -1
  58. package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.js +0 -1
  59. package/package.json +3 -3
  60. package/src/constant/index.ts +1 -0
  61. package/src/constant/view-call-tag.ts +14 -0
  62. package/src/controller/common/control/control.controller.ts +67 -0
  63. package/src/controller/common/control/md-control.controller.ts +28 -2
  64. package/src/controller/control/data-view/data-view.controller.ts +2 -1
  65. package/src/controller/control/form/edit-form/edit-form.controller.ts +34 -7
  66. package/src/controller/control/form/form/form.controller.ts +7 -0
  67. package/src/controller/control/form/search-form/search-form.controller.ts +10 -1
  68. package/src/controller/control/grid/grid/grid.controller.ts +28 -5
  69. package/src/controller/control/list/list.controller.ts +2 -1
  70. package/src/engine/md-view.engine.ts +2 -2
  71. package/src/global/global-util/global-util.ts +28 -0
  72. package/src/logic-scheduler/executor/app-ui-logic-executor.ts +44 -7
  73. package/src/logic-scheduler/trigger/control-event-trigger.ts +1 -1
  74. package/src/logic-scheduler/trigger/view-event-trigger.ts +1 -1
  75. package/src/model/data-entity/data-entity.ts +17 -0
  76. package/src/model/index.ts +1 -0
  77. package/src/model/panel/data-container.ts +18 -0
  78. package/src/model/panel/index.ts +1 -0
  79. package/src/service/app-data-entity/app-data-entity.ts +3 -1
  80. package/src/service/dto/method.dto.ts +1 -1
  81. package/src/service/service/entity/method/method.ts +3 -0
  82. package/src/service/vo/control.vo.ts +2 -2
  83. package/src/ui-logic/ui-logic-node/msg-box-node/msg-box-node.ts +0 -1
package/dist/index.esm.js CHANGED
@@ -6991,6 +6991,10 @@ async function getDeACMode(appDEACModeId, entityId, srfappid) {
6991
6991
  });
6992
6992
  return deACMode;
6993
6993
  }
6994
+ async function getFormTypeFieldName(entityId) {
6995
+ const appDataEntity = await ibiz.hub.getAppDataEntity(entityId);
6996
+ return appDataEntity.formTypeAppDEFieldId;
6997
+ }
6994
6998
  function findDELogic(appDELogicId, entity) {
6995
6999
  var _a;
6996
7000
  return (_a = entity.appDELogics) == null ? void 0 : _a.find((item) => item.id === appDELogicId);
@@ -7092,6 +7096,13 @@ function getViewEngines(view) {
7092
7096
  return appViewEngines;
7093
7097
  }
7094
7098
 
7099
+ // src/model/panel/data-container.ts
7100
+ function isDataContainer(panelItem) {
7101
+ return panelItem.itemType === "CONTAINER" && ["CONTAINER_MULTIDATA", "CONTAINER_SINGLEDATA"].includes(
7102
+ panelItem.predefinedType
7103
+ );
7104
+ }
7105
+
7095
7106
  // src/utils/open-redirect-view/open-redirect-view.ts
7096
7107
  async function openRedirectView(appView, context, params = {}, opts = {}) {
7097
7108
  return openDERedirectView(
@@ -8360,6 +8371,12 @@ var SysUIActionTag = /* @__PURE__ */ ((SysUIActionTag2) => {
8360
8371
  return SysUIActionTag2;
8361
8372
  })(SysUIActionTag || {});
8362
8373
 
8374
+ // src/constant/view-call-tag.ts
8375
+ var ViewCallTag = /* @__PURE__ */ ((ViewCallTag2) => {
8376
+ ViewCallTag2["LOAD"] = "Load";
8377
+ return ViewCallTag2;
8378
+ })(ViewCallTag || {});
8379
+
8363
8380
  // src/constant/studio-event.ts
8364
8381
  var StudioViewEvents = class {
8365
8382
  };
@@ -11249,7 +11266,9 @@ var AppDataEntity = class _AppDataEntity {
11249
11266
  * @return {*} {AppDataEntity}
11250
11267
  */
11251
11268
  clone() {
11252
- return new _AppDataEntity(this._entity, this._data);
11269
+ const entity = new _AppDataEntity(this._entity, this._data);
11270
+ entity.srfkey = this.srfkey;
11271
+ return entity;
11253
11272
  }
11254
11273
  /**
11255
11274
  * 合并参数
@@ -11394,7 +11413,7 @@ var MethodDto = class _MethodDto {
11394
11413
  entity.appDEMethodDTOs || [],
11395
11414
  field.refAppDEMethodDTOId
11396
11415
  );
11397
- const dto = new _MethodDto(entity, this.isLocalMode, methodDto);
11416
+ const dto = new _MethodDto(entity, true, methodDto);
11398
11417
  this.dtoMap.set(field.codeName, dto);
11399
11418
  return dto;
11400
11419
  }
@@ -11599,6 +11618,9 @@ var Method = class {
11599
11618
  * @return {*} {IDataEntity}
11600
11619
  */
11601
11620
  createEntity(data) {
11621
+ if (data instanceof AppDataEntity) {
11622
+ return data.clone();
11623
+ }
11602
11624
  return new AppDataEntity(this.entity, data);
11603
11625
  }
11604
11626
  };
@@ -13282,7 +13304,7 @@ var ControlVO = class _ControlVO {
13282
13304
  * @returns {*}
13283
13305
  */
13284
13306
  linkProperty(uiKey, dataKey, isOriginField = true) {
13285
- if (uiKey === "srfuf") {
13307
+ if (uiKey === "srfuf" || uiKey === "srfkey") {
13286
13308
  return;
13287
13309
  }
13288
13310
  if (isOriginField || Object.prototype.hasOwnProperty.call(this.$origin, uiKey)) {
@@ -15770,6 +15792,8 @@ var CodeListEditorController = class extends EditorController {
15770
15792
  };
15771
15793
 
15772
15794
  // src/controller/common/control/control.controller.ts
15795
+ import { NoticeError } from "@ibiz-template/core";
15796
+ import { isNil as isNil13 } from "ramda";
15773
15797
  var ControlController = class extends BaseController {
15774
15798
  /**
15775
15799
  * Creates an instance of ControlController.
@@ -15931,11 +15955,71 @@ var ControlController = class extends BaseController {
15931
15955
  return this.getEventArgs();
15932
15956
  };
15933
15957
  }
15958
+ /**
15959
+ * 执行对应部件行为消息提示
15960
+ * @author lxm
15961
+ * @date 2023-09-07 04:51:21
15962
+ * @param {string} tag
15963
+ * @param {({ default?: string; data?: IData | IData[]; error?: Error })} [opts]
15964
+ * @return {*} {void}
15965
+ */
15966
+ actionNotification(tag, opts) {
15967
+ var _a;
15968
+ const { ctrlMsg } = this.model;
15969
+ const msgItem = (_a = ctrlMsg == null ? void 0 : ctrlMsg.ctrlMsgItems) == null ? void 0 : _a.find((item) => item.name === tag);
15970
+ let message;
15971
+ let duration;
15972
+ if (msgItem && msgItem.content) {
15973
+ duration = isNil13(msgItem.timeout) ? void 0 : msgItem.timeout / 1e3;
15974
+ const scriptParams = { ...this.getEventArgs() };
15975
+ if (opts == null ? void 0 : opts.data) {
15976
+ scriptParams.data = opts.data;
15977
+ }
15978
+ message = ScriptFactory.execScriptFn(
15979
+ scriptParams,
15980
+ "`".concat(msgItem.content, "`"),
15981
+ {
15982
+ isAsync: false,
15983
+ singleRowReturn: true
15984
+ }
15985
+ );
15986
+ } else {
15987
+ const resTag = "CONTROL.".concat(this.model.controlType, ".").concat(tag).toUpperCase();
15988
+ message = ibiz.i18n.t(resTag, "");
15989
+ if (message === resTag) {
15990
+ message = "";
15991
+ }
15992
+ }
15993
+ if (!message && (opts == null ? void 0 : opts.default)) {
15994
+ message = opts.default;
15995
+ }
15996
+ if (!message && (opts == null ? void 0 : opts.error)) {
15997
+ message = message || opts.error.message;
15998
+ }
15999
+ if (!message) {
16000
+ return;
16001
+ }
16002
+ if (opts == null ? void 0 : opts.error) {
16003
+ throw new NoticeError(message, duration);
16004
+ } else {
16005
+ ibiz.message.success(message, duration, duration === 0);
16006
+ }
16007
+ }
15934
16008
  };
15935
16009
 
15936
16010
  // src/controller/common/control/md-control.controller.ts
15937
16011
  import { isElementSame, RuntimeError as RuntimeError23 } from "@ibiz-template/core";
15938
16012
  var MDControlController = class extends ControlController {
16013
+ constructor() {
16014
+ super(...arguments);
16015
+ /**
16016
+ * 实体属性映射,key是id,value是name
16017
+ * @author lxm
16018
+ * @date 2023-09-07 03:16:56
16019
+ * @protected
16020
+ */
16021
+ this.fieldIdNameMap = /* @__PURE__ */ new Map();
16022
+ }
15939
16023
  get _evt() {
15940
16024
  return this.evt;
15941
16025
  }
@@ -15955,7 +16039,14 @@ var MDControlController = class extends ControlController {
15955
16039
  this.state.groups = [];
15956
16040
  }
15957
16041
  async onCreated() {
16042
+ var _a;
15958
16043
  await super.onCreated();
16044
+ const dataEntity = await ibiz.hub.getAppDataEntity(
16045
+ this.model.appDataEntityId
16046
+ );
16047
+ (_a = dataEntity.appDEFields) == null ? void 0 : _a.forEach((field) => {
16048
+ this.fieldIdNameMap.set(field.id, field.name);
16049
+ });
15959
16050
  this.setSort();
15960
16051
  }
15961
16052
  /**
@@ -16034,10 +16125,14 @@ var MDControlController = class extends ControlController {
16034
16125
  });
16035
16126
  } catch (error) {
16036
16127
  await this._evt.emit("onLoadError", void 0);
16128
+ this.actionNotification("FETCHERROR", {
16129
+ error
16130
+ });
16037
16131
  throw error;
16038
16132
  } finally {
16039
16133
  await this.endLoading();
16040
16134
  }
16135
+ this.actionNotification("FETCHSUCCESS");
16041
16136
  return this.state.items;
16042
16137
  }
16043
16138
  /**
@@ -16098,8 +16193,9 @@ var MDControlController = class extends ControlController {
16098
16193
  })
16099
16194
  );
16100
16195
  if ((args == null ? void 0 : args.silent) !== true) {
16101
- ibiz.notification.success({
16102
- desc: "\u6570\u636E[".concat(data.map((item) => item.srfmajortext).join("\u3001"), "]\u5220\u9664\u6210\u529F!")
16196
+ this.actionNotification("REMOVESUCCESS", {
16197
+ data,
16198
+ default: "\u6570\u636E[".concat(data.map((item) => item.srfmajortext).join("\u3001"), "]\u5220\u9664\u6210\u529F!")
16103
16199
  });
16104
16200
  }
16105
16201
  if (needRefresh) {
@@ -16107,6 +16203,10 @@ var MDControlController = class extends ControlController {
16107
16203
  }
16108
16204
  } catch (error) {
16109
16205
  await this._evt.emit("onRemoveError", void 0);
16206
+ this.actionNotification("REMOVEERROR", {
16207
+ error,
16208
+ data
16209
+ });
16110
16210
  throw error;
16111
16211
  } finally {
16112
16212
  await this.endLoading();
@@ -16638,7 +16738,7 @@ import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
16638
16738
  import quarterOfYear from "dayjs/plugin/quarterOfYear";
16639
16739
  import weekOfYear from "dayjs/plugin/weekOfYear";
16640
16740
  import isoWeek from "dayjs/plugin/isoWeek";
16641
- import { clone as clone11, isNil as isNil13, mergeDeepRight } from "ramda";
16741
+ import { clone as clone11, isNil as isNil14, mergeDeepRight } from "ramda";
16642
16742
  dayjs2.extend(minMax);
16643
16743
  dayjs2.extend(isSameOrBefore);
16644
16744
  dayjs2.extend(quarterOfYear);
@@ -16727,10 +16827,10 @@ var BaseSeriesGenerator = class {
16727
16827
  * @return {*} {(string | undefined)}
16728
16828
  */
16729
16829
  translateVal(codeListKey, val, isExclude = false) {
16730
- if (isNil13(val)) {
16830
+ if (isNil14(val)) {
16731
16831
  return void 0;
16732
16832
  }
16733
- if (isNil13(codeListKey)) {
16833
+ if (isNil14(codeListKey)) {
16734
16834
  return val;
16735
16835
  }
16736
16836
  const codeListItems = this.chartGenerator.codeListMap.get(codeListKey);
@@ -16760,7 +16860,7 @@ var BaseSeriesGenerator = class {
16760
16860
  seriesCodeListId,
16761
16861
  item[this.groupField]
16762
16862
  );
16763
- if (isNil13(groupVal)) {
16863
+ if (isNil14(groupVal)) {
16764
16864
  return;
16765
16865
  }
16766
16866
  group = groupVal;
@@ -18373,7 +18473,6 @@ var MsgBoxNode = class extends UILogicNode {
18373
18473
  default:
18374
18474
  throw new ModelError21(this.model, "".concat(buttonsType, "\u6682\u672A\u652F\u6301"));
18375
18475
  }
18376
- console.log(this.model, modalParams);
18377
18476
  const result = await ibiz.modal.confirm(modalParams);
18378
18477
  ctx.setLastReturn(resultTags[result ? 0 : 1]);
18379
18478
  }
@@ -19799,7 +19898,8 @@ var DataViewControlController = class extends MDControlController {
19799
19898
  } else {
19800
19899
  const { minorSortAppDEFieldId, minorSortDir } = this.model;
19801
19900
  if (minorSortAppDEFieldId && minorSortDir) {
19802
- this.state.sortQuery = "".concat(minorSortAppDEFieldId.toLowerCase(), ",").concat(minorSortDir.toLowerCase());
19901
+ const fieldName = this.fieldIdNameMap.get(minorSortAppDEFieldId);
19902
+ this.state.sortQuery = "".concat(fieldName.toLowerCase(), ",").concat(minorSortDir.toLowerCase());
19803
19903
  } else {
19804
19904
  this.state.sortQuery = "";
19805
19905
  }
@@ -20537,6 +20637,9 @@ var FormController = class extends ControlController {
20537
20637
  );
20538
20638
  return values.findIndex((value) => !value) === -1;
20539
20639
  }
20640
+ actionNotification(tag, opts) {
20641
+ super.actionNotification(tag, { data: this.data, ...opts || {} });
20642
+ }
20540
20643
  };
20541
20644
 
20542
20645
  // src/controller/control/form/search-form/search-form.service.ts
@@ -20613,11 +20716,20 @@ var SearchFormController = class extends FormController {
20613
20716
  const params = await this.getDraftParams();
20614
20717
  Object.assign(queryParams, params);
20615
20718
  await this.evt.emit("onBeforeLoadDraft", { params: queryParams });
20616
- const res = await this.service.getDraft(this.context, queryParams);
20719
+ let res;
20720
+ try {
20721
+ res = await this.service.getDraft(this.context, queryParams);
20722
+ } catch (error) {
20723
+ this.actionNotification("GETDRAFTERROR", {
20724
+ error
20725
+ });
20726
+ throw error;
20727
+ }
20617
20728
  this.state.data = res.data;
20618
20729
  mergeDefaultInLeft(this.data, params);
20619
20730
  this.state.isLoaded = true;
20620
20731
  this.formStateNotify("DRAFT" /* DRAFT */);
20732
+ this.actionNotification("GETDRAFTSUCCESS");
20621
20733
  return this.data;
20622
20734
  }
20623
20735
  /**
@@ -22164,6 +22276,9 @@ var EditFormController = class extends FormController {
22164
22276
  res = await this.service.getDraft(this.context, queryParams);
22165
22277
  } catch (error) {
22166
22278
  await this.evt.emit("onLoadDraftError", void 0);
22279
+ this.actionNotification("GETDRAFTERROR", {
22280
+ error
22281
+ });
22167
22282
  throw error;
22168
22283
  } finally {
22169
22284
  await this.endLoading();
@@ -22172,6 +22287,7 @@ var EditFormController = class extends FormController {
22172
22287
  mergeDefaultInLeft2(this.data, params);
22173
22288
  this.formStateNotify("DRAFT" /* DRAFT */);
22174
22289
  await this.evt.emit("onLoadDraftSuccess", void 0);
22290
+ this.actionNotification("GETDRAFTSUCCESS");
22175
22291
  this.state.isLoaded = true;
22176
22292
  return this.data;
22177
22293
  }
@@ -22197,6 +22313,9 @@ var EditFormController = class extends FormController {
22197
22313
  res = await this.service.get(this.context, queryParams);
22198
22314
  } catch (error) {
22199
22315
  await this.evt.emit("onLoadError", void 0);
22316
+ this.actionNotification("GETERROR", {
22317
+ error
22318
+ });
22200
22319
  throw error;
22201
22320
  } finally {
22202
22321
  await this.endLoading();
@@ -22205,6 +22324,7 @@ var EditFormController = class extends FormController {
22205
22324
  this.state.data = res.data;
22206
22325
  this.formStateNotify("LOAD" /* LOAD */);
22207
22326
  await this.evt.emit("onLoadSuccess", void 0);
22327
+ this.actionNotification("GETSUCCESS");
22208
22328
  this.state.isLoaded = true;
22209
22329
  return this.data;
22210
22330
  }
@@ -22225,11 +22345,15 @@ var EditFormController = class extends FormController {
22225
22345
  }
22226
22346
  await this.startLoading();
22227
22347
  await this.evt.emit("onBeforeSave", void 0);
22348
+ const isCreate = this.data.srfuf === 0 /* CREATE */;
22228
22349
  let res;
22229
22350
  try {
22230
- res = this.data.srfuf === 0 /* CREATE */ ? await this.service.create(this.context, this.data) : await this.service.update(this.context, this.data);
22351
+ res = isCreate ? await this.service.create(this.context, this.data) : await this.service.update(this.context, this.data);
22231
22352
  } catch (error) {
22232
22353
  await this.evt.emit("onSaveError", void 0);
22354
+ this.actionNotification("".concat(isCreate ? "CREATE" : "UPDATE", "ERROR"), {
22355
+ error
22356
+ });
22233
22357
  throw error;
22234
22358
  } finally {
22235
22359
  await this.endLoading();
@@ -22240,7 +22364,9 @@ var EditFormController = class extends FormController {
22240
22364
  this.state.modified = false;
22241
22365
  await this.evt.emit("onSaveSuccess", void 0);
22242
22366
  this.formStateNotify("SAVE" /* SAVE */);
22243
- ibiz.message.success("".concat(this.data.srfmajortext || "", "\u4FDD\u5B58\u6210\u529F"));
22367
+ this.actionNotification("".concat(isCreate ? "CREATE" : "UPDATE", "SUCCESS"), {
22368
+ default: "".concat(this.data.srfmajortext || "", "\u4FDD\u5B58\u6210\u529F")
22369
+ });
22244
22370
  return this.data;
22245
22371
  }
22246
22372
  /**
@@ -22267,6 +22393,9 @@ var EditFormController = class extends FormController {
22267
22393
  res = await this.service.remove(this.context, this.params);
22268
22394
  } catch (error) {
22269
22395
  await this.evt.emit("onRemoveError", void 0);
22396
+ this.actionNotification("REMOVEERROR", {
22397
+ error
22398
+ });
22270
22399
  throw error;
22271
22400
  } finally {
22272
22401
  await this.endLoading();
@@ -22276,6 +22405,7 @@ var EditFormController = class extends FormController {
22276
22405
  this.state.data = new ControlVO();
22277
22406
  this.state.modified = false;
22278
22407
  await this.evt.emit("onRemoveSuccess", void 0);
22408
+ this.actionNotification("REMOVESUCCESS");
22279
22409
  return ok;
22280
22410
  }
22281
22411
  /**
@@ -22367,10 +22497,15 @@ var EditFormController = class extends FormController {
22367
22497
  },
22368
22498
  this.data
22369
22499
  );
22500
+ } catch (error) {
22501
+ this.actionNotification("WFSTARTERROR", {
22502
+ error
22503
+ });
22504
+ throw error;
22370
22505
  } finally {
22371
22506
  await this.endLoading();
22372
22507
  }
22373
- ibiz.message.success("\u6D41\u7A0B\u542F\u52A8\u6210\u529F");
22508
+ this.actionNotification("WFSTARTSUCCESS", { default: "\u6D41\u7A0B\u542F\u52A8\u6210\u529F" });
22374
22509
  }
22375
22510
  /**
22376
22511
  * 工作流提交(调用前先确保调用保存)
@@ -22395,10 +22530,15 @@ var EditFormController = class extends FormController {
22395
22530
  },
22396
22531
  this.data
22397
22532
  );
22533
+ } catch (error) {
22534
+ this.actionNotification("WFSUBMITERROR", {
22535
+ error
22536
+ });
22537
+ throw error;
22398
22538
  } finally {
22399
22539
  await this.endLoading();
22400
22540
  }
22401
- ibiz.message.success("\u6D41\u7A0B\u63D0\u4EA4\u6210\u529F");
22541
+ this.actionNotification("WFSUBMITSUCCESS", { default: "\u6D41\u7A0B\u63D0\u4EA4\u6210\u529F" });
22402
22542
  }
22403
22543
  async dataChangeNotify(names) {
22404
22544
  await super.dataChangeNotify(names);
@@ -23798,12 +23938,21 @@ var GridController = class extends MDControlController {
23798
23938
  if (editingRow) {
23799
23939
  throw new RuntimeError38("\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u884C\u7F16\u8F91\u4E2D\u7684\u884C\u7684\u64CD\u4F5C");
23800
23940
  }
23801
- const res = await this.service.getDraft(this.context, this.params);
23941
+ let res;
23942
+ try {
23943
+ res = await this.service.getDraft(this.context, this.params);
23944
+ } catch (error) {
23945
+ this.actionNotification("GETDRAFTERROR", {
23946
+ error
23947
+ });
23948
+ throw error;
23949
+ }
23802
23950
  this.state.items.unshift(res.data);
23803
23951
  const newRow = new GridRowState(res.data, this);
23804
23952
  this.state.rows.unshift(newRow);
23805
23953
  this.gridStateNotify(newRow, "DRAFT" /* DRAFT */);
23806
23954
  this.switchRowEdit(this.state.rows[0], true);
23955
+ this.actionNotification("GETDRAFTSUCCESS", { data: res.data });
23807
23956
  }
23808
23957
  /**
23809
23958
  * 保存
@@ -23843,6 +23992,13 @@ var GridController = class extends MDControlController {
23843
23992
  tempContext[deName] = data.srfkey;
23844
23993
  try {
23845
23994
  res = isCreate ? await this.service.create(tempContext, data) : await this.service.update(tempContext, data);
23995
+ } catch (error) {
23996
+ await this.evt.emit("onSaveError", void 0);
23997
+ this.actionNotification("".concat(isCreate ? "CREATE" : "UPDATE", "ERROR"), {
23998
+ error,
23999
+ data: rowState.data
24000
+ });
24001
+ throw error;
23846
24002
  } finally {
23847
24003
  await this.endLoading();
23848
24004
  }
@@ -23853,6 +24009,10 @@ var GridController = class extends MDControlController {
23853
24009
  rowState.data = res.data;
23854
24010
  rowState.modified = false;
23855
24011
  ibiz.message.success("".concat(res.data.srfmajortext || "", "\u4FDD\u5B58\u6210\u529F"));
24012
+ this.actionNotification("".concat(isCreate ? "CREATE" : "UPDATE", "SUCCESS"), {
24013
+ default: "".concat(res.data.srfmajortext || "", "\u4FDD\u5B58\u6210\u529F"),
24014
+ data: res.data
24015
+ });
23856
24016
  this.gridStateNotify(rowState, "SAVE" /* SAVE */);
23857
24017
  await this.evt.emit("onSaveSuccess", void 0);
23858
24018
  }
@@ -24085,13 +24245,15 @@ var GridController = class extends MDControlController {
24085
24245
  * @param {string} key 排序字段
24086
24246
  * @param {string} order 排序顺序
24087
24247
  */
24088
- setSort(key, order) {
24089
- if (key && order) {
24090
- super.setSort(key, order);
24248
+ setSort(fieldId, order) {
24249
+ if (fieldId && order) {
24250
+ const fieldName = this.fieldIdNameMap.get(fieldId).toLowerCase();
24251
+ super.setSort(fieldName, order);
24091
24252
  } else {
24092
24253
  const { minorSortAppDEFieldId, minorSortDir } = this.model;
24093
24254
  if (minorSortAppDEFieldId && minorSortDir) {
24094
- this.state.sortQuery = "".concat(minorSortAppDEFieldId.toLowerCase(), ",").concat(minorSortDir.toLowerCase());
24255
+ const fieldName = this.fieldIdNameMap.get(minorSortAppDEFieldId);
24256
+ this.state.sortQuery = "".concat(fieldName.toLowerCase(), ",").concat(minorSortDir.toLowerCase());
24095
24257
  } else {
24096
24258
  this.state.sortQuery = "";
24097
24259
  }
@@ -24859,7 +25021,8 @@ var ListController = class extends MDControlController {
24859
25021
  } else {
24860
25022
  const { minorSortAppDEFieldId, minorSortDir } = this.model;
24861
25023
  if (minorSortAppDEFieldId && minorSortDir) {
24862
- this.state.sortQuery = "".concat(minorSortAppDEFieldId.toLowerCase(), ",").concat(minorSortDir.toLowerCase());
25024
+ const fieldName = this.fieldIdNameMap.get(minorSortAppDEFieldId);
25025
+ this.state.sortQuery = "".concat(fieldName.toLowerCase(), ",").concat(minorSortDir.toLowerCase());
24863
25026
  } else {
24864
25027
  this.state.sortQuery = "";
24865
25028
  }
@@ -27564,7 +27727,7 @@ var MDViewEngine = class extends ViewEngineBase {
27564
27727
  this.copy(args);
27565
27728
  return null;
27566
27729
  }
27567
- if (key === "load") {
27730
+ if (key === "Load" /* LOAD */) {
27568
27731
  this.load(args);
27569
27732
  return null;
27570
27733
  }
@@ -27795,6 +27958,32 @@ var GlobalUtil = class {
27795
27958
  */
27796
27959
  this.hbs = new HandlebarsUtil();
27797
27960
  }
27961
+ /**
27962
+ * 显示应用级别的加载提示
27963
+ *
27964
+ * @author chitanda
27965
+ * @date 2023-09-08 10:09:43
27966
+ */
27967
+ showAppLoading() {
27968
+ const el = document.getElementById("app-loading-x");
27969
+ if (el) {
27970
+ el.style.display = "none";
27971
+ }
27972
+ }
27973
+ /**
27974
+ * 隐藏应用级别的加载提示
27975
+ *
27976
+ * @author chitanda
27977
+ * @date 2023-09-08 10:09:15
27978
+ */
27979
+ hiddenAppLoading() {
27980
+ setTimeout(() => {
27981
+ const el = document.getElementById("app-loading-x");
27982
+ if (el) {
27983
+ el.style.display = "none";
27984
+ }
27985
+ }, 300);
27986
+ }
27798
27987
  };
27799
27988
 
27800
27989
  // src/logic-scheduler/executor/logic-executor.ts
@@ -28434,12 +28623,18 @@ var AppUILogicExecutor = class extends LogicExecutor {
28434
28623
  if (!(data == null ? void 0 : data[0])) {
28435
28624
  throw new RuntimeError48("opendata\u6CA1\u6709\u53EF\u64CD\u4F5C\u6570\u636E\uFF01");
28436
28625
  }
28437
- const openViewRef = appUILogic.openDataAppView;
28438
- if (!openViewRef) {
28439
- throw new RuntimeModelError49(
28440
- appUILogic,
28441
- "opendata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE"
28442
- );
28626
+ const openViewRefs = appUILogic.openDataAppViews;
28627
+ let openViewRef;
28628
+ if (openViewRefs) {
28629
+ openViewRef = await this.calcOpenViewRef(appUILogic, parameters);
28630
+ } else {
28631
+ openViewRef = appUILogic.openDataAppView;
28632
+ if (!openViewRef) {
28633
+ throw new RuntimeModelError49(
28634
+ appUILogic,
28635
+ "opendata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE"
28636
+ );
28637
+ }
28443
28638
  }
28444
28639
  const openView = openViewRef.refAppViewId;
28445
28640
  if (!openView) {
@@ -28566,6 +28761,29 @@ var AppUILogicExecutor = class extends LogicExecutor {
28566
28761
  }
28567
28762
  return findView;
28568
28763
  }
28764
+ async calcOpenViewRef(appUILogic, parameters) {
28765
+ const appDataEntityId = parameters.view.model.appDataEntityId;
28766
+ const formTypeName = await getFormTypeFieldName(appDataEntityId);
28767
+ if (!formTypeName) {
28768
+ throw new RuntimeModelError49(
28769
+ appUILogic,
28770
+ "".concat(appDataEntityId, "\u5B9E\u4F53\u7F3A\u5C11\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027")
28771
+ );
28772
+ }
28773
+ const { data } = parameters;
28774
+ const formTypeValue = data[0][formTypeName];
28775
+ if (!formTypeValue) {
28776
+ throw new RuntimeModelError49(appUILogic, "\u6570\u636E\u6E90\u65E0\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027\u503C");
28777
+ }
28778
+ const openViewRefs = appUILogic.openDataAppViews;
28779
+ const findView = openViewRefs == null ? void 0 : openViewRefs.find((item) => item.refMode === formTypeValue);
28780
+ if (!findView) {
28781
+ throw new RuntimeError48(
28782
+ "\u6CA1\u6709\u627E\u5230\u4E0E\u8868\u5355\u7C7B\u578B".concat(formTypeValue, "\u76F8\u5173\u7684\u5B9E\u4F53\u7684\u7F16\u8F91\u89C6\u56FE")
28783
+ );
28784
+ }
28785
+ return findView;
28786
+ }
28569
28787
  };
28570
28788
 
28571
28789
  // src/logic-scheduler/trigger/view-event-trigger.ts
@@ -28582,7 +28800,7 @@ var ViewEventTrigger = class extends LogicTrigger {
28582
28800
  * @type {string[]}
28583
28801
  */
28584
28802
  this.listenEventNames = [];
28585
- const names = logic.eventNames.split(",");
28803
+ const names = logic.eventNames.split(";");
28586
28804
  this.listenEventNames = names.map(
28587
28805
  (name) => StudioViewEvents[name] || name
28588
28806
  );
@@ -28607,7 +28825,7 @@ var ControlEventTrigger = class extends LogicTrigger {
28607
28825
  * @type {string[]}
28608
28826
  */
28609
28827
  this.listenEventNames = [];
28610
- const names = logic.eventNames.split(",");
28828
+ const names = logic.eventNames.split(";");
28611
28829
  this.listenEventNames = names.map(
28612
28830
  (name) => StudioControlEvents[name] || name
28613
28831
  );
@@ -28921,6 +29139,7 @@ export {
28921
29139
  V7AuthService,
28922
29140
  VIEW_PROVIDER_PREFIX,
28923
29141
  ValueExUtil,
29142
+ ViewCallTag,
28924
29143
  ViewController,
28925
29144
  ViewEngineBase,
28926
29145
  ViewLayoutPanelController,
@@ -28970,6 +29189,7 @@ export {
28970
29189
  getDeACMode,
28971
29190
  getEditorProvider,
28972
29191
  getFormDetailProvider,
29192
+ getFormTypeFieldName,
28973
29193
  getGridColumnProvider,
28974
29194
  getMatchResPath,
28975
29195
  getOriginData,
@@ -28987,6 +29207,7 @@ export {
28987
29207
  hasDeCodeName,
28988
29208
  install,
28989
29209
  installCommand,
29210
+ isDataContainer,
28990
29211
  isValueChange,
28991
29212
  matchMainState,
28992
29213
  openRedirectView,