@ibiz-template/runtime 0.7.41-alpha.153 → 0.7.41-alpha.154

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
@@ -50581,12 +50581,36 @@ var EditFormService = class extends FormService {
50581
50581
  * @memberof EditFormService
50582
50582
  */
50583
50583
  async getDraftFrom(context, params) {
50584
- var _a3;
50584
+ var _a3, _b2;
50585
50585
  const { args } = this.getLoadParams(params);
50586
- const deCodeName = calcDeCodeNameById(this.model.appDataEntityId);
50587
- context[deCodeName] = args.srfsourcekey;
50586
+ const appDataEntity = await ibiz.hub.getAppDataEntity(
50587
+ this.model.appDataEntityId,
50588
+ this.model.appId
50589
+ );
50590
+ const draftFromControlActionID = (_a3 = this.model.getDraftFromControlAction) == null ? void 0 : _a3.appDEMethodId;
50591
+ if (draftFromControlActionID) {
50592
+ const draftFromAction = findMethodById(
50593
+ appDataEntity,
50594
+ draftFromControlActionID
50595
+ );
50596
+ if (draftFromAction) {
50597
+ let res2 = await this.exec(
50598
+ draftFromControlActionID,
50599
+ context,
50600
+ void 0,
50601
+ {
50602
+ ...args
50603
+ }
50604
+ );
50605
+ res2 = this.handleResponse(res2);
50606
+ if (res2.ok && res2.data) {
50607
+ this.setDefault(res2.data, context, params, "update");
50608
+ }
50609
+ return res2;
50610
+ }
50611
+ }
50588
50612
  let res = await this.exec(
50589
- ((_a3 = this.model.getControlAction) == null ? void 0 : _a3.appDEMethodId) || "get",
50613
+ ((_b2 = this.model.getControlAction) == null ? void 0 : _b2.appDEMethodId) || "get",
50590
50614
  context,
50591
50615
  void 0,
50592
50616
  args
@@ -51018,7 +51042,8 @@ var EditFormController = class extends FormController {
51018
51042
  );
51019
51043
  const key = appDataEntity.keyAppDEFieldId;
51020
51044
  if (key && this.params[key]) {
51021
- queryParams.srfsourcekey = this.params[key];
51045
+ const deCodeName = calcDeCodeNameById(this.model.appDataEntityId);
51046
+ context[deCodeName] = this.params[key];
51022
51047
  delete queryParams[key];
51023
51048
  delete this.params[key];
51024
51049
  delete queryParams.srfcopymode;