@ibiz-template/runtime 0.7.41-alpha.6 → 0.7.41-alpha.8

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 +1202 -754
  2. package/dist/index.system.min.js +1 -1
  3. package/out/config/global-config.d.ts.map +1 -1
  4. package/out/config/global-config.js +1 -0
  5. package/out/constant/index.d.ts +1 -0
  6. package/out/constant/index.d.ts.map +1 -1
  7. package/out/constant/index.js +1 -0
  8. package/out/constant/predefined-control-render.d.ts +16 -0
  9. package/out/constant/predefined-control-render.d.ts.map +1 -0
  10. package/out/constant/predefined-control-render.js +17 -0
  11. package/out/controller/common/control/control.controller.d.ts.map +1 -1
  12. package/out/controller/common/control/control.controller.js +4 -1
  13. package/out/controller/common/editor/editor.controller.d.ts +8 -0
  14. package/out/controller/common/editor/editor.controller.d.ts.map +1 -1
  15. package/out/controller/common/editor/editor.controller.js +15 -0
  16. package/out/controller/control/chart/generator/index.d.ts +12 -0
  17. package/out/controller/control/chart/generator/index.d.ts.map +1 -0
  18. package/out/controller/control/chart/generator/index.js +11 -0
  19. package/out/controller/control/chart/index.d.ts +1 -0
  20. package/out/controller/control/chart/index.d.ts.map +1 -1
  21. package/out/controller/control/chart/index.js +1 -0
  22. package/out/controller/control/data-view/data-view.controller.d.ts +9 -11
  23. package/out/controller/control/data-view/data-view.controller.d.ts.map +1 -1
  24. package/out/controller/control/data-view/data-view.controller.js +30 -37
  25. package/out/controller/control/form/edit-form/edit-form.service.d.ts.map +1 -1
  26. package/out/controller/control/form/edit-form/edit-form.service.js +5 -1
  27. package/out/controller/control/kanban/kanban.controller.d.ts +39 -12
  28. package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
  29. package/out/controller/control/kanban/kanban.controller.js +168 -53
  30. package/out/controller/control/tree/tree.controller.d.ts +17 -2
  31. package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
  32. package/out/controller/control/tree/tree.controller.js +79 -3
  33. package/out/controller/control/tree/tree.service.d.ts +75 -0
  34. package/out/controller/control/tree/tree.service.d.ts.map +1 -1
  35. package/out/controller/control/tree/tree.service.js +145 -8
  36. package/out/controller/ctx/ctx.js +2 -2
  37. package/out/interface/api/common/global-config/i-api-global-common-config.d.ts +7 -0
  38. package/out/interface/api/common/global-config/i-api-global-common-config.d.ts.map +1 -1
  39. package/out/interface/api/controller/common/i-api-mask-option.d.ts +1 -1
  40. package/out/interface/api/controller/control/i-api-edit-form.controller.d.ts +1 -0
  41. package/out/interface/api/controller/control/i-api-edit-form.controller.d.ts.map +1 -1
  42. package/out/interface/api/controller/control/i-api-kanban.controller.d.ts +2 -0
  43. package/out/interface/api/controller/control/i-api-kanban.controller.d.ts.map +1 -1
  44. package/out/interface/common/i-modal/i-modal.d.ts +3 -0
  45. package/out/interface/common/i-modal/i-modal.d.ts.map +1 -1
  46. package/out/interface/controller/controller/common/i-drag-change-info.d.ts +22 -14
  47. package/out/interface/controller/controller/common/i-drag-change-info.d.ts.map +1 -1
  48. package/out/interface/controller/state/control/i-data-view-control.state.d.ts +8 -0
  49. package/out/interface/controller/state/control/i-data-view-control.state.d.ts.map +1 -1
  50. package/out/interface/controller/state/control/i-kanban.state.d.ts +43 -8
  51. package/out/interface/controller/state/control/i-kanban.state.d.ts.map +1 -1
  52. package/out/interface/util/i-app-util/i-app-util.d.ts +6 -0
  53. package/out/interface/util/i-app-util/i-app-util.d.ts.map +1 -1
  54. package/out/locale/en/index.d.ts +1 -0
  55. package/out/locale/en/index.d.ts.map +1 -1
  56. package/out/locale/en/index.js +1 -0
  57. package/out/locale/zh-CN/index.d.ts +1 -0
  58. package/out/locale/zh-CN/index.d.ts.map +1 -1
  59. package/out/locale/zh-CN/index.js +1 -0
  60. package/out/model/utils/util.d.ts.map +1 -1
  61. package/out/model/utils/util.js +2 -1
  62. package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
  63. package/out/service/utils/dynamic-code-list/dynamic-code-list.js +1 -1
  64. package/out/ui-action/provider/custom-ui-action-provider.js +1 -1
  65. package/out/ui-action/provider/front-ui-action-provider.d.ts.map +1 -1
  66. package/out/ui-action/provider/front-ui-action-provider.js +54 -40
  67. package/out/ui-action/provider/ui-action-provider-base.d.ts +1 -0
  68. package/out/ui-action/provider/ui-action-provider-base.d.ts.map +1 -1
  69. package/out/ui-action/provider/ui-action-provider-base.js +14 -2
  70. package/out/ui-action/uiaction-util.js +2 -2
  71. package/out/ui-logic/ui-logic.d.ts.map +1 -1
  72. package/out/ui-logic/ui-logic.js +5 -1
  73. package/out/utils/handlebars/helpers/abs/abs.d.ts +14 -0
  74. package/out/utils/handlebars/helpers/abs/abs.d.ts.map +1 -0
  75. package/out/utils/handlebars/helpers/abs/abs.js +19 -0
  76. package/out/utils/handlebars/helpers/index.d.ts.map +1 -1
  77. package/out/utils/handlebars/helpers/index.js +2 -0
  78. package/out/utils/handlebars/utils/helper/helper.d.ts.map +1 -1
  79. package/out/utils/handlebars/utils/helper/helper.js +1 -0
  80. package/out/utils/modal/modal.d.ts +3 -0
  81. package/out/utils/modal/modal.d.ts.map +1 -1
  82. package/out/utils/modal/modal.js +7 -0
  83. package/package.json +5 -5
@@ -5,6 +5,7 @@ import { ScriptFactory } from '../../utils';
5
5
  import { UIActionProviderBase } from './ui-action-provider-base';
6
6
  import { openDataImport } from '../../controller/utils';
7
7
  import { SysUIActionTag } from '../../constant';
8
+ import { calcResPath } from '../../service';
8
9
  /**
9
10
  * 前台调用界面行为适配器
10
11
  *
@@ -96,7 +97,7 @@ export class FrontUIActionProvider extends UIActionProviderBase {
96
97
  return result || {};
97
98
  }
98
99
  if (scriptCode) {
99
- const result = (await ScriptFactory.asyncExecScriptFn({ context, params, data, el: event === null || event === void 0 ? void 0 : event.target, view, ctrl }, scriptCode));
100
+ const result = (await ScriptFactory.asyncExecScriptFn({ context, params, data, el: event === null || event === void 0 ? void 0 : event.target, view, ctrl, action }, scriptCode));
100
101
  return result || {};
101
102
  }
102
103
  throw new RuntimeModelError(action, ibiz.i18n.t('runtime.uiAction.missingConfigurationScriptCode'));
@@ -109,52 +110,63 @@ export class FrontUIActionProvider extends UIActionProviderBase {
109
110
  * @return {*}
110
111
  */
111
112
  async executePrint(action, args) {
112
- var _a;
113
- // 处理参数
114
- const { resultContext, resultParams } = await this.handleParams(action, args.context, args.data, args.params);
115
- const appDataEntity = await ibiz.hub.getAppDataEntity(action.appDataEntityId, action.appId);
116
- const appDEPrint = (_a = appDataEntity.appDEPrints) === null || _a === void 0 ? void 0 : _a.find(print => {
117
- return print.id === action.appDEPrintId;
118
- });
119
- if (appDEPrint) {
120
- let requestUrl = '';
121
- if (resultContext &&
122
- resultContext[appDataEntity.codeName.toLowerCase()]) {
123
- // TODO 临时写死printdata, 非标准,后续优化
124
- requestUrl += `/${appDataEntity.deapicodeName2}/printdata/${resultContext[appDataEntity.codeName.toLowerCase()]}`;
125
- }
126
- else {
127
- throw new RuntimeError(ibiz.i18n.t('runtime.uiAction.dataPrimaryKey'));
128
- }
129
- const res = await ibiz.net.request(requestUrl, {
130
- method: 'get',
131
- responseType: 'blob',
132
- params: Object.assign({ srfprinttag: appDEPrint.codeName }, resultParams),
113
+ const execute = async (data) => {
114
+ var _a;
115
+ // 处理参数
116
+ const { resultContext, resultParams } = await this.handleParams(action, args.context, data, args.params);
117
+ const appDataEntity = await ibiz.hub.getAppDataEntity(action.appDataEntityId, action.appId);
118
+ const appDEPrint = (_a = appDataEntity.appDEPrints) === null || _a === void 0 ? void 0 : _a.find(print => {
119
+ return print.id === action.appDEPrintId;
133
120
  });
134
- if (res.ok) {
135
- // 存在srfcontenttype参数需响应文件
136
- if (resultParams && resultParams.srfcontenttype) {
137
- const fileName = ibiz.util.file.getFileName(res);
138
- const href = URL.createObjectURL(res.data);
139
- const a = document.createElement('a');
140
- a.href = href;
141
- a.download = fileName;
142
- document.body.appendChild(a);
143
- a.click();
144
- document.body.removeChild(a);
145
- URL.revokeObjectURL(href);
121
+ if (appDEPrint) {
122
+ let requestUrl = '';
123
+ if (resultContext &&
124
+ resultContext[appDataEntity.codeName.toLowerCase()]) {
125
+ // TODO 临时写死printdata, 非标准,后续优化
126
+ const resPath = calcResPath(resultContext, appDataEntity);
127
+ requestUrl += `${resPath}/${appDataEntity.deapicodeName2}/printdata/${resultContext[appDataEntity.codeName.toLowerCase()]}`;
146
128
  }
147
129
  else {
148
- const link = window.URL.createObjectURL(res.data);
149
- window.open(link, '_blank');
130
+ throw new RuntimeError(ibiz.i18n.t('runtime.uiAction.dataPrimaryKey'));
131
+ }
132
+ const app = await ibiz.hub.getAppAsync(action.appId);
133
+ const res = await app.net.request(requestUrl, {
134
+ method: 'get',
135
+ responseType: 'blob',
136
+ params: Object.assign({ srfprinttag: appDEPrint.codeName }, resultParams),
137
+ });
138
+ if (res.ok) {
139
+ // 存在srfcontenttype参数需响应文件
140
+ if (resultParams && resultParams.srfcontenttype) {
141
+ const fileName = ibiz.util.file.getFileName(res);
142
+ const href = URL.createObjectURL(res.data);
143
+ const a = document.createElement('a');
144
+ a.href = href;
145
+ a.download = fileName;
146
+ document.body.appendChild(a);
147
+ a.click();
148
+ document.body.removeChild(a);
149
+ URL.revokeObjectURL(href);
150
+ }
151
+ else {
152
+ const link = window.URL.createObjectURL(res.data);
153
+ window.open(link, '_blank');
154
+ }
155
+ }
156
+ else {
157
+ throw new RuntimeError(ibiz.i18n.t('runtime.uiAction.printFailure'));
150
158
  }
151
159
  }
152
160
  else {
153
- throw new RuntimeError(ibiz.i18n.t('runtime.uiAction.printFailure'));
161
+ throw new RuntimeError(ibiz.i18n.t('runtime.uiAction.physicalPrint'));
154
162
  }
163
+ };
164
+ const isMultiData = ['MULTIKEY', 'MULTIDATA'].includes(action.actionTarget);
165
+ if (isMultiData) {
166
+ await Promise.all(args.data.map(item => execute([item])));
155
167
  }
156
168
  else {
157
- throw new RuntimeError(ibiz.i18n.t('runtime.uiAction.physicalPrint'));
169
+ await execute(args.data);
158
170
  }
159
171
  }
160
172
  /**
@@ -200,7 +212,8 @@ export class FrontUIActionProvider extends UIActionProviderBase {
200
212
  });
201
213
  if (appDEDataExport) {
202
214
  // TODO 临时写死fetchdefault,应该从appDEDataExport的主表格上获取加载行为,但现在缺主表格模型,后续优化
203
- const url = `/${appDataEntity.deapicodeName2}/exportdata/fetchdefault`;
215
+ const resPath = calcResPath(resultContext, appDataEntity);
216
+ const url = `${resPath}/${appDataEntity.deapicodeName2}/exportdata/fetchdefault`;
204
217
  // 查询参数
205
218
  const queryParam = { srfexporttag: appDEDataExport.codeName };
206
219
  if (resultContext === null || resultContext === void 0 ? void 0 : resultContext.srfdatatype) {
@@ -208,7 +221,8 @@ export class FrontUIActionProvider extends UIActionProviderBase {
208
221
  }
209
222
  // 参数
210
223
  const params = Object.assign(Object.assign({ page: 0, size: appDEDataExport.maxRowCount ? appDEDataExport.maxRowCount : 1000 }, args.params), resultParams);
211
- const res = await ibiz.net.request(url, {
224
+ const app = await ibiz.hub.getAppAsync(action.appId);
225
+ const res = await app.net.request(url, {
212
226
  method: 'post',
213
227
  responseType: 'blob',
214
228
  params: queryParam,
@@ -95,6 +95,7 @@ export declare abstract class UIActionProviderBase implements IUIActionProvider
95
95
  resultContext: IContext;
96
96
  resultData: IData[];
97
97
  resultParams: IParams;
98
+ presetParams: IParams;
98
99
  }>;
99
100
  /**
100
101
  * 计算消息信息(动态,多语言资源)
@@ -1 +1 @@
1
- {"version":3,"file":"ui-action-provider-base.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/ui-action-provider-base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAgC,MAAM,kBAAkB,CAAC;AAChF,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAMzB;;;;;;;GAOG;AACH,8BAAsB,oBAAqB,YAAW,iBAAiB;IACrE;;;;;;;OAOG;IACG,IAAI,CACR,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IAgF3B;;;;;;;;OAQG;IACH,SAAS,CAAC,iBAAiB,CACzB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,eAAe,GACtB,cAAc;IASjB;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,CACnB,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,eAAe,GACpB,eAAe;IAUlB;;;;;;;OAOG;IACG,SAAS,CACb,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,OAAO,CAAC;IAWnB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,UAAU,CACjB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,eAAe,CAAC;IAE3B;;;;;;;;;;;OAWG;IACG,YAAY,CAChB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAOvC;;;;;;;;;;;;;;;;OAgBG;cACa,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EAAE,EACb,MAAM,EAAE,OAAO,GACd,OAAO,CAAC;QACT,aAAa,EAAE,QAAQ,CAAC;QACxB,UAAU,EAAE,KAAK,EAAE,CAAC;QACpB,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;IAqGF;;;;;;;;;OASG;IACH,SAAS,CAAC,WAAW,CACnB,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,MAAM,GAAG,SAAS;IA4CrB;;;;;;;;OAQG;IACH,sBAAsB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;CAc5C"}
1
+ {"version":3,"file":"ui-action-provider-base.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/ui-action-provider-base.ts"],"names":[],"mappings":"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S,CAAC,WAAW,CACnB,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,MAAM,GAAG,SAAS;IA4CrB;;;;;;;;OAQG;IACH,sBAAsB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;CAc5C"}
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-prototype-builtins */
1
2
  import { RuntimeModelError } from '@ibiz-template/core';
2
3
  import { calcDeCodeNameById } from '../../model';
3
4
  import { execUILogic } from '../../ui-logic';
@@ -26,7 +27,7 @@ export class UIActionProviderBase {
26
27
  refreshMode: action.refreshMode,
27
28
  closeView: action.closeEditView,
28
29
  };
29
- const { view } = args;
30
+ const { context, params, data, view } = args;
30
31
  if (action.closeEditView) {
31
32
  view.state.isClosing = true;
32
33
  }
@@ -46,6 +47,11 @@ export class UIActionProviderBase {
46
47
  }
47
48
  // ** 执行不同类型的界面行为独有逻辑,并且合并result
48
49
  const _result = await this.execAction(action, args);
50
+ // 预置属性相关处理
51
+ const { presetParams } = await this.handleParams(action, context, data, params);
52
+ if (presetParams.ignoredirtycheck === 'true') {
53
+ view.modal.ignoreDismissCheck = true;
54
+ }
49
55
  Object.assign(result, _result);
50
56
  // 如果是取消操作则中断后续处理逻辑。
51
57
  if (result.cancel === true) {
@@ -236,7 +242,13 @@ export class UIActionProviderBase {
236
242
  navContexts,
237
243
  navParams,
238
244
  }, tempContext);
239
- return { resultContext, resultData, resultParams };
245
+ // 预置属性(ignoredirtycheck)处理
246
+ const presetParams = {};
247
+ if (resultParams.hasOwnProperty('ignoredirtycheck')) {
248
+ presetParams.ignoredirtycheck = resultParams.ignoredirtycheck;
249
+ delete resultParams.ignoredirtycheck;
250
+ }
251
+ return { resultContext, resultData, resultParams, presetParams };
240
252
  }
241
253
  /**
242
254
  * 计算消息信息(动态,多语言资源)
@@ -46,8 +46,8 @@ export class UIActionUtil {
46
46
  var _a, _b;
47
47
  const result = await this.exec(actionId, params, appId);
48
48
  if (result.closeView) {
49
- // 修复编辑器失焦后,调整数据后直接点击关闭按钮导致无法触发自动保存
50
- // params.view.modal.ignoreDismissCheck = true;
49
+ // 编辑器失焦后,调整数据后直接点击关闭按钮导致无法触发自动保存通过modal中preDismiss钩子执行,shouldDismiss钩子仅负责计算是否可关闭视图参数,不能混为一谈
50
+ params.view.modal.ignoreDismissCheck = true;
51
51
  params.view.closeView({ ok: true });
52
52
  }
53
53
  else if (result.refresh) {
@@ -1 +1 @@
1
- {"version":3,"file":"ui-logic.d.ts","sourceRoot":"","sources":["../../src/ui-logic/ui-logic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAmBL,WAAW,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D;;;;;;;GAOG;AACH,qBAAa,OAAO;IA2BN,SAAS,CAAC,KAAK,EAAE,UAAU;IA1BvC;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAa;IAEtD;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IAExD;;;;;OAKG;gBACmB,KAAK,EAAE,UAAU;IA+FvC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IASpD;;;;;;;;;OASG;IACG,IAAI,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAsBxD;;;;;;;;;;;;;OAaG;cACa,QAAQ,CACtB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,IAAI,CAAC;CAiBjB"}
1
+ {"version":3,"file":"ui-logic.d.ts","sourceRoot":"","sources":["../../src/ui-logic/ui-logic.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAmBL,WAAW,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D;;;;;;;GAOG;AACH,qBAAa,OAAO;IA2BN,SAAS,CAAC,KAAK,EAAE,UAAU;IA1BvC;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAa;IAEtD;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IAExD;;;;;OAKG;gBACmB,KAAK,EAAE,UAAU;IA+FvC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IASpD;;;;;;;;;OASG;IACG,IAAI,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAyBxD;;;;;;;;;;;;;OAaG;cACa,QAAQ,CACtB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,IAAI,CAAC;CAiBjB"}
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable no-await-in-loop */
2
- import { ModelError, RuntimeModelError } from '@ibiz-template/core';
2
+ import { IBizContext, ModelError, RuntimeModelError, } from '@ibiz-template/core';
3
+ import { clone } from 'ramda';
3
4
  import { UILogicContext } from './ui-logic-context';
4
5
  import { AppendParamNode, BindParamNode, CopyParamNode, DataSetNode, DEActionNode, DebugParamNode, DEUIActionNode, EndNode, ExecuteDELogicNode, MsgBoxNode, PFPluginNode, PrepareJSParamNode, RawJSCodeNode, RenewParamNode, ResetParamNode, SortParamNode, StartNode, ThrowExceptionNode, ViewCtrlFireEventNode, ViewCtrlInvokeNode, } from './ui-logic-node';
5
6
  import { UILogicParam } from './ui-logic-param/ui-logic-param';
@@ -156,6 +157,9 @@ export class UILogic {
156
157
  * @return {*} {Promise<IData>}
157
158
  */
158
159
  async exec(parameters) {
160
+ // 克隆传入应用上下文参数和视图参数
161
+ parameters.context = IBizContext.create(parameters.context);
162
+ parameters.params = clone(parameters.params || {});
159
163
  const ctx = new UILogicContext(this.params, parameters);
160
164
  this.initLogicParams(ctx);
161
165
  const { startDEUILogicNodeId } = this.model;
@@ -0,0 +1,14 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 数字绝对值
4
+ *
5
+ * @description 用法 {{abs string }}。效果: 获取数值字符串的绝对值
6
+ * @export
7
+ * @class HelperAbs
8
+ * @extends {HelperBase}
9
+ */
10
+ export declare class HelperAbs extends HelperBase {
11
+ constructor(hbs: IData);
12
+ onExecute(str: string): string;
13
+ }
14
+ //# sourceMappingURL=abs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abs.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/abs/abs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;GAOG;AACH,qBAAa,SAAU,SAAQ,UAAU;gBAC3B,GAAG,EAAE,KAAK;IAItB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAI/B"}
@@ -0,0 +1,19 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 数字绝对值
4
+ *
5
+ * @description 用法 {{abs string }}。效果: 获取数值字符串的绝对值
6
+ * @export
7
+ * @class HelperAbs
8
+ * @extends {HelperBase}
9
+ */
10
+ export class HelperAbs extends HelperBase {
11
+ constructor(hbs) {
12
+ super(hbs, 'abs');
13
+ }
14
+ onExecute(str) {
15
+ if (!str)
16
+ return '';
17
+ return Math.abs(Number(str)).toString();
18
+ }
19
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/handlebars/helpers/index.ts"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAoB/C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/handlebars/helpers/index.ts"],"names":[],"mappings":"AAqBA;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAqB/C"}
@@ -17,6 +17,7 @@ import { HelperPascalCase } from './pascal-case/pascal-case';
17
17
  import { HelperSnakeCase } from './snake-case/snake-case';
18
18
  import { HelperSpinalCase } from './spinal-case/spinal-case';
19
19
  import { HelperUpperCase } from './upper-case/upper-case';
20
+ import { HelperAbs } from './abs/abs';
20
21
  /**
21
22
  * 安装自定义助手
22
23
  *
@@ -25,6 +26,7 @@ import { HelperUpperCase } from './upper-case/upper-case';
25
26
  * @export
26
27
  */
27
28
  export function installHelpers(hsb) {
29
+ new HelperAbs(hsb);
28
30
  new HelperAnd(hsb);
29
31
  new HelperCamelCase(hsb);
30
32
  new HelperConcat(hsb);
@@ -1 +1 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/utils/helper/helper.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,UAAU;IACrB;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,CAoBpC;IAEF;;;;;;;;OAQG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,qBAAqB,CAC1B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,UAAU,CAAC,aAAa,GAChC,MAAM,GAAG,OAAO;CAOpB"}
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/utils/helper/helper.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,UAAU;IACrB;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,CAqBpC;IAEF;;;;;;;;OAQG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,qBAAqB,CAC1B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,UAAU,CAAC,aAAa,GAChC,MAAM,GAAG,OAAO;CAOpB"}
@@ -50,6 +50,7 @@ HelperUtil.helperNames = [
50
50
  'lookup',
51
51
  'log',
52
52
  'and',
53
+ 'abs',
53
54
  'camelCase',
54
55
  'concat',
55
56
  'eq',
@@ -18,6 +18,9 @@ export declare class Modal implements IModal {
18
18
  viewUsage: number;
19
19
  ignoreDismissCheck: boolean;
20
20
  hooks: {
21
+ preDismiss: AsyncSeriesHook<[], {
22
+ allowNext?: boolean | undefined;
23
+ }>;
21
24
  shouldDismiss: AsyncSeriesHook<[], {
22
25
  allowClose?: boolean | undefined;
23
26
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/utils/modal/modal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAErD,KAAK,eAAe,GAAG;IACrB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,S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B,EAAE,OAAO,CAAS;IAEpC,KAAK;;;;;;;;MAIH;gBAEU,IAAI,EAAE,eAAe;IAejC;;;;OAIG;IACH,QAAQ,SAAU,UAAU,KAAG,IAAI,CAKjC;IAEF;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI;IAIlD,OAAO,CAAC,IAAI,GAAE,UAAoC,GAAG,OAAO,CAAC,OAAO,CAAC;IA2B3E;;;;;OAKG;IACH,SAAS,CAAC,OAAO,IAAI,IAAI;CAK1B"}
@@ -7,6 +7,7 @@ export class Modal {
7
7
  this.viewUsage = 4;
8
8
  this.ignoreDismissCheck = false;
9
9
  this.hooks = {
10
+ preDismiss: new AsyncSeriesHook(),
10
11
  shouldDismiss: new AsyncSeriesHook(),
11
12
  beforeDismiss: new AsyncSeriesHook(),
12
13
  };
@@ -42,6 +43,11 @@ export class Modal {
42
43
  }
43
44
  async dismiss(data = { ok: false, data: [] }) {
44
45
  const context = {};
46
+ // 关闭前执行操作
47
+ await this.hooks.preDismiss.call(context);
48
+ if (context.allowNext === false) {
49
+ return false;
50
+ }
45
51
  if (this.ignoreDismissCheck !== true) {
46
52
  // 判断是否执行关闭
47
53
  await this.hooks.shouldDismiss.call(context);
@@ -64,6 +70,7 @@ export class Modal {
64
70
  * @protected
65
71
  */
66
72
  destroy() {
73
+ this.hooks.preDismiss.clear();
67
74
  this.hooks.shouldDismiss.clear();
68
75
  this.hooks.beforeDismiss.clear();
69
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/runtime",
3
- "version": "0.7.41-alpha.6",
3
+ "version": "0.7.41-alpha.8",
4
4
  "description": "运行时逻辑库",
5
5
  "type": "module",
6
6
  "main": "out/index.js",
@@ -37,8 +37,8 @@
37
37
  "jsencrypt": "^3.3.2"
38
38
  },
39
39
  "devDependencies": {
40
- "@ibiz-template/core": "^0.7.41-alpha.2",
41
- "@ibiz/model-core": "^0.1.77",
40
+ "@ibiz-template/core": "^0.7.41-alpha.7",
41
+ "@ibiz/model-core": "^0.1.78",
42
42
  "@types/animejs": "^3.1.12",
43
43
  "@types/path-browserify": "^1.0.2",
44
44
  "@types/qs": "^6.9.11",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "peerDependencies": {
58
58
  "@ibiz-template/core": "^0.6.0",
59
- "@ibiz/model-core": "^0.1.77",
59
+ "@ibiz/model-core": "^0.1.78",
60
60
  "async-validator": "^4.2.5",
61
61
  "dayjs": "^1.11.7",
62
62
  "echarts": "^5.4.3",
@@ -68,5 +68,5 @@
68
68
  "qx-util": "^0.4.8",
69
69
  "ramda": "^0.29.0"
70
70
  },
71
- "gitHead": "3dc00c15d9f7721680f275880724f0a823385faf"
71
+ "gitHead": "b5fa27223c43fe8eaedee3418ebc275aecc8faa1"
72
72
  }