@ibiz-template/runtime 0.7.41-alpha.56 → 0.7.41-alpha.57

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 CHANGED
@@ -23476,6 +23476,10 @@ var CustomRegister = class {
23476
23476
  case GRIDCOLUMN_PROVIDER_PREFIX:
23477
23477
  case CONTROL_PROVIDER_PREFIX:
23478
23478
  return this.calcKeyByCtrl(opts);
23479
+ case UIACTION_PROVIDER_PREFIX:
23480
+ return this.calcKeyByAction(opts);
23481
+ case DEMETHOD_PROVIDER_PREFIX:
23482
+ return this.calcKeyByMethod(opts);
23479
23483
  default:
23480
23484
  return "";
23481
23485
  }
@@ -23531,6 +23535,50 @@ var CustomRegister = class {
23531
23535
  key = prefix + key;
23532
23536
  return key;
23533
23537
  }
23538
+ /**
23539
+ * @description 通过界面行为模型计算key,其中实体部分无实体的话默认为APP
23540
+ * @static
23541
+ * @param {IRegisterParams} opts
23542
+ * @returns {*} {string}
23543
+ * @memberof CustomRegister
23544
+ */
23545
+ static calcKeyByAction(opts) {
23546
+ const { uiActionModel } = opts;
23547
+ let prefix = "APP";
23548
+ let key = "";
23549
+ if (uiActionModel) {
23550
+ const { appDataEntityId, uiactionTag } = uiActionModel;
23551
+ if (appDataEntityId) {
23552
+ prefix = calcDeCodeNameById(appDataEntityId).toUpperCase();
23553
+ }
23554
+ key += "".concat(prefix);
23555
+ if (uiactionTag) {
23556
+ key += "@".concat(uiactionTag.toUpperCase());
23557
+ }
23558
+ }
23559
+ return key;
23560
+ }
23561
+ /**
23562
+ * @description 通过实体方法模型计算key
23563
+ * @static
23564
+ * @param {IRegisterParams} opts
23565
+ * @returns {*} {string}
23566
+ * @memberof CustomRegister
23567
+ */
23568
+ static calcKeyByMethod(opts) {
23569
+ const { deMethodModel, entityModel } = opts;
23570
+ let key = "";
23571
+ if (deMethodModel) {
23572
+ const { methodType, codeName } = deMethodModel;
23573
+ if (entityModel == null ? void 0 : entityModel.id) {
23574
+ key += calcDeCodeNameById(entityModel.id).toUpperCase();
23575
+ }
23576
+ if (methodType && codeName) {
23577
+ key += "@".concat(methodType.toUpperCase(), "@").concat(codeName.toUpperCase());
23578
+ }
23579
+ }
23580
+ return key;
23581
+ }
23534
23582
  };
23535
23583
 
23536
23584
  // src/register/helper/control-register.ts
@@ -24006,6 +24054,19 @@ function getProvider8(key) {
24006
24054
  async function getUIActionProvider(model) {
24007
24055
  let provider;
24008
24056
  const { uiactionMode, sysPFPluginId, appId: appId2, uiactionTag } = model;
24057
+ const registerKey = CustomRegister.getRegisterKey(UIACTION_PROVIDER_PREFIX, {
24058
+ uiActionModel: model
24059
+ });
24060
+ provider = getProvider8(registerKey);
24061
+ if (!provider) {
24062
+ ibiz.log.debug(
24063
+ ibiz.i18n.t("runtime.register.helper.customRegistration", {
24064
+ registerKey
24065
+ })
24066
+ );
24067
+ } else {
24068
+ return provider;
24069
+ }
24009
24070
  if (sysPFPluginId) {
24010
24071
  const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
24011
24072
  if (pluginKey) {
@@ -24272,9 +24333,23 @@ function getProvider12(key) {
24272
24333
  "".concat(DEMETHOD_PROVIDER_PREFIX, "_").concat(key)
24273
24334
  );
24274
24335
  }
24275
- async function getDEMethodProvider(model) {
24336
+ async function getDEMethodProvider(model, entityModel) {
24276
24337
  let provider;
24277
24338
  const { methodType, sysPFPluginId, appId: appId2 } = model;
24339
+ const registerKey = CustomRegister.getRegisterKey(DEMETHOD_PROVIDER_PREFIX, {
24340
+ deMethodModel: model,
24341
+ entityModel
24342
+ });
24343
+ provider = getProvider12(registerKey);
24344
+ if (!provider) {
24345
+ ibiz.log.debug(
24346
+ ibiz.i18n.t("runtime.register.helper.customRegistration", {
24347
+ registerKey
24348
+ })
24349
+ );
24350
+ } else {
24351
+ return provider;
24352
+ }
24278
24353
  if (sysPFPluginId) {
24279
24354
  const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
24280
24355
  if (pluginKey) {
@@ -29231,7 +29306,7 @@ var DEService = class {
29231
29306
  ibiz.i18n.t("runtime.service.noFoundServiceMethod", { id })
29232
29307
  );
29233
29308
  }
29234
- const provider = await getDEMethodProvider(model);
29309
+ const provider = await getDEMethodProvider(model, this.model);
29235
29310
  if (!provider) {
29236
29311
  throw new ModelError7(
29237
29312
  model,
@@ -53683,7 +53758,13 @@ var FormController = class extends ControlController {
53683
53758
  if (!ignore) {
53684
53759
  this.state.modified = true;
53685
53760
  }
53686
- await this._evt.emit("onFormDataChange", { name: name2, value, oldValue });
53761
+ const realData = this.getReal();
53762
+ await this._evt.emit("onFormDataChange", {
53763
+ name: name2,
53764
+ value,
53765
+ oldValue,
53766
+ realData
53767
+ });
53687
53768
  if (this.state.formIsDestroyed)
53688
53769
  return;
53689
53770
  try {
@@ -56521,7 +56602,7 @@ var FormMDCtrlMDController = class extends FormMDCtrlController {
56521
56602
  * @memberof FormMDCtrlMDController
56522
56603
  */
56523
56604
  async save() {
56524
- if (this.mdController.saveAll) {
56605
+ if (this.mdController && this.mdController.saveAll) {
56525
56606
  await this.mdController.saveAll();
56526
56607
  }
56527
56608
  }