@ibiz-template/runtime 0.4.16 → 0.4.17-dev.0
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 +477 -355
- package/dist/index.system.min.js +2 -2
- package/out/app-hub.d.ts +8 -0
- package/out/app-hub.d.ts.map +1 -1
- package/out/app-hub.js +13 -0
- package/out/controller/common/base.controller.d.ts +1 -0
- package/out/controller/common/base.controller.d.ts.map +1 -1
- package/out/controller/common/base.controller.js +2 -0
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +9 -3
- package/out/controller/common/view/wf-step-trace-view.controller.d.ts.map +1 -1
- package/out/controller/common/view/wf-step-trace-view.controller.js +3 -2
- package/out/controller/control/calendar/calendar.service.d.ts +3 -3
- package/out/controller/control/calendar/calendar.service.d.ts.map +1 -1
- package/out/controller/control/calendar/calendar.service.js +2 -2
- package/out/controller/control/form/edit-form/edit-form.service.d.ts +18 -18
- package/out/controller/control/form/edit-form/edit-form.service.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.service.js +11 -11
- package/out/controller/control/form/form/form.service.d.ts +2 -2
- package/out/controller/control/form/form/form.service.d.ts.map +1 -1
- package/out/controller/control/form/form/form.service.js +1 -1
- package/out/controller/control/form/search-form/search-form.service.d.ts +2 -2
- package/out/controller/control/form/search-form/search-form.service.d.ts.map +1 -1
- package/out/controller/control/form/search-form/search-form.service.js +1 -1
- package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.controller.js +1 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +1 -1
- package/out/controller/control/grid/grid/grid.service.d.ts +2 -2
- package/out/controller/control/grid/grid/grid.service.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.service.js +2 -2
- package/out/controller/control/kanban/kanban.service.d.ts +2 -2
- package/out/controller/control/kanban/kanban.service.d.ts.map +1 -1
- package/out/controller/control/kanban/kanban.service.js +1 -1
- package/out/controller/control/map/map.service.d.ts +1 -1
- package/out/controller/control/map/map.service.js +1 -1
- package/out/controller/control/report-panel/report-panel.service.d.ts +2 -2
- package/out/controller/control/report-panel/report-panel.service.d.ts.map +1 -1
- package/out/controller/control/report-panel/report-panel.service.js +1 -1
- package/out/controller/control/tree/tree.service.d.ts +2 -2
- package/out/controller/control/tree/tree.service.d.ts.map +1 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.d.ts.map +1 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.js +1 -0
- package/out/controller/control/wizard-panel/wizard-panel.service.d.ts +4 -4
- package/out/controller/control/wizard-panel/wizard-panel.service.d.ts.map +1 -1
- package/out/controller/control/wizard-panel/wizard-panel.service.js +2 -2
- package/out/controller/utils/value-default/value-default.d.ts +1 -1
- package/out/controller/utils/value-default/value-default.d.ts.map +1 -1
- package/out/de-logic/de-logic-context.d.ts +5 -5
- package/out/de-logic/de-logic-context.d.ts.map +1 -1
- package/out/de-logic/de-logic-context.js +1 -1
- package/out/de-logic/de-logic-link/de-logic-link-group-cond/de-logic-link-group-cond.d.ts +2 -2
- package/out/de-logic/de-logic-link/de-logic-link-group-cond/de-logic-link-group-cond.d.ts.map +1 -1
- package/out/de-logic/de-logic-link/de-logic-link-group-cond/de-logic-link-group-cond.js +1 -1
- package/out/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.d.ts +2 -2
- package/out/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.d.ts.map +1 -1
- package/out/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.js +1 -1
- package/out/de-logic/de-logic-link/de-logic-link.d.ts +1 -1
- package/out/de-logic/de-logic-link/de-logic-link.js +1 -1
- package/out/de-logic/de-logic-node/de-logic-node.d.ts +1 -1
- package/out/de-logic/de-logic-param/de-logic-param.d.ts +1 -1
- package/out/de-logic/de-logic-param/de-logic-param.js +1 -1
- package/out/de-logic/de-logic.d.ts +3 -3
- package/out/de-logic/de-logic.d.ts.map +1 -1
- package/out/de-logic/de-logic.js +2 -2
- package/out/de-logic/index.d.ts +8 -8
- package/out/de-logic/index.d.ts.map +1 -1
- package/out/de-logic/index.js +5 -5
- package/out/install.d.ts.map +1 -1
- package/out/install.js +3 -0
- package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts +8 -0
- package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts.map +1 -1
- package/out/interface/common/i-data-ability-params/i-data-ability-params.d.ts +1 -1
- package/out/interface/common/i-data-ability-params/i-data-ability-params.d.ts.map +1 -1
- package/out/interface/controller/controller/i.controller.d.ts +8 -0
- package/out/interface/controller/controller/i.controller.d.ts.map +1 -1
- package/out/interface/provider/i-de-method.provider.d.ts +10 -1
- package/out/interface/provider/i-de-method.provider.d.ts.map +1 -1
- package/out/interface/provider/i-grid-column.provider.d.ts +2 -2
- package/out/interface/provider/i-grid-column.provider.d.ts.map +1 -1
- package/out/interface/service/service/i-app-de.service.d.ts +49 -43
- package/out/interface/service/service/i-app-de.service.d.ts.map +1 -1
- package/out/interface/service/service/i-file.service.d.ts +2 -2
- package/out/interface/service/service/i-file.service.d.ts.map +1 -1
- package/out/interface/service/service/i-wf.service.d.ts +12 -12
- package/out/interface/service/service/i-wf.service.d.ts.map +1 -1
- package/out/register/helper/grid-column-register.d.ts +2 -2
- package/out/register/helper/grid-column-register.d.ts.map +1 -1
- package/out/register/helper/grid-column-register.js +0 -14
- package/out/service/de-service-util.d.ts +26 -13
- package/out/service/de-service-util.d.ts.map +1 -1
- package/out/service/de-service-util.js +45 -16
- package/out/service/dto/method.dto.d.ts +20 -8
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +33 -15
- package/out/service/service/authority/authority.service.d.ts +1 -1
- package/out/service/service/authority/authority.service.js +1 -1
- package/out/service/service/code-list/code-list.service.d.ts +3 -3
- package/out/service/service/code-list/code-list.service.d.ts.map +1 -1
- package/out/service/service/code-list/code-list.service.js +2 -2
- package/out/service/service/control/control.service.d.ts +2 -2
- package/out/service/service/control/control.service.d.ts.map +1 -1
- package/out/service/service/control/control.service.js +1 -1
- package/out/service/service/control/md-control.service.d.ts +13 -13
- package/out/service/service/control/md-control.service.d.ts.map +1 -1
- package/out/service/service/control/md-control.service.js +7 -7
- package/out/service/service/counter/counter.service.d.ts +3 -3
- package/out/service/service/counter/counter.service.d.ts.map +1 -1
- package/out/service/service/counter/counter.service.js +1 -1
- package/out/service/service/entity/de.service.d.ts +46 -28
- package/out/service/service/entity/de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.js +35 -71
- package/out/service/service/entity/method/de-action.d.ts +23 -33
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +18 -35
- package/out/service/service/entity/method/fetch.d.ts +3 -4
- package/out/service/service/entity/method/fetch.d.ts.map +1 -1
- package/out/service/service/entity/method/fetch.js +3 -8
- package/out/service/service/entity/method/method-input.d.ts +10 -5
- package/out/service/service/entity/method/method-input.d.ts.map +1 -1
- package/out/service/service/entity/method/method-input.js +9 -8
- package/out/service/service/entity/method/method-renturn.d.ts +10 -7
- package/out/service/service/entity/method/method-renturn.d.ts.map +1 -1
- package/out/service/service/entity/method/method-renturn.js +9 -9
- package/out/service/service/entity/method/method.d.ts +11 -27
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +9 -21
- package/out/service/service/entity/method/provider/de-action-de-method.provider.d.ts +2 -2
- package/out/service/service/entity/method/provider/de-action-de-method.provider.d.ts.map +1 -1
- package/out/service/service/entity/method/provider/de-action-de-method.provider.js +2 -2
- package/out/service/service/entity/method/provider/fetch-de-method.provider.d.ts +2 -2
- package/out/service/service/entity/method/provider/fetch-de-method.provider.d.ts.map +1 -1
- package/out/service/service/entity/method/provider/fetch-de-method.provider.js +3 -3
- package/out/service/service/file/file.service.d.ts +2 -2
- package/out/service/service/file/file.service.d.ts.map +1 -1
- package/out/service/service/file/file.service.js +1 -1
- package/out/service/service/work-flow/work-flow.service.d.ts +28 -28
- package/out/service/service/work-flow/work-flow.service.d.ts.map +1 -1
- package/out/service/service/work-flow/work-flow.service.js +15 -15
- package/out/service/utils/app-counter/app-counter.d.ts +7 -7
- package/out/service/utils/app-counter/app-counter.d.ts.map +1 -1
- package/out/service/utils/app-counter/app-counter.js +3 -3
- package/out/service/utils/app-counter/app-de-counter.d.ts +2 -2
- package/out/service/utils/app-counter/app-de-counter.d.ts.map +1 -1
- package/out/service/utils/app-counter/app-de-counter.js +1 -1
- package/out/service/utils/de-cache/de-cache.d.ts +44 -39
- package/out/service/utils/de-cache/de-cache.d.ts.map +1 -1
- package/out/service/utils/de-cache/de-cache.js +115 -75
- package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts +2 -2
- package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
- package/out/service/utils/dynamic-code-list/dynamic-code-list.js +2 -2
- package/out/service/utils/res-path/res-path.d.ts +4 -4
- package/out/service/utils/res-path/res-path.d.ts.map +1 -1
- package/out/service/utils/res-path/res-path.js +2 -2
- package/out/service/utils/search-filter/search-filter.d.ts +2 -2
- package/out/service/utils/search-filter/search-filter.d.ts.map +1 -1
- package/out/service/utils/service-exist-util/service-exist-util.d.ts +2 -2
- package/out/service/utils/service-exist-util/service-exist-util.d.ts.map +1 -1
- package/out/service/utils/service-exist-util/service-exist-util.js +1 -1
- package/out/types.d.ts +9 -0
- package/out/types.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-param/ui-logic-param.js +1 -1
- package/out/utils/index.d.ts +2 -0
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +2 -0
- package/out/utils/nav-params/calc-nav-params.d.ts +2 -2
- package/out/utils/nav-params/calc-nav-params.d.ts.map +1 -1
- package/out/utils/nav-params/calc-nav-params.js +1 -1
- package/out/utils/open-redirect-view/open-redirect-view.js +1 -1
- package/out/utils/ui-domain/ui-domain.d.ts +35 -0
- package/out/utils/ui-domain/ui-domain.d.ts.map +1 -0
- package/out/utils/ui-domain/ui-domain.js +42 -0
- package/out/utils/ui-domain-manager/ui-domain-manager.d.ts +47 -0
- package/out/utils/ui-domain-manager/ui-domain-manager.d.ts.map +1 -0
- package/out/utils/ui-domain-manager/ui-domain-manager.js +62 -0
- package/package.json +3 -3
- package/src/app-hub.ts +14 -0
- package/src/controller/common/base.controller.ts +3 -0
- package/src/controller/common/view/view.controller.ts +9 -3
- package/src/controller/common/view/wf-step-trace-view.controller.ts +4 -2
- package/src/controller/control/calendar/calendar.service.ts +4 -4
- package/src/controller/control/form/edit-form/edit-form.service.ts +23 -18
- package/src/controller/control/form/form/form.service.ts +2 -2
- package/src/controller/control/form/search-form/search-form.service.ts +2 -2
- package/src/controller/control/gantt/gantt.controller.ts +2 -1
- package/src/controller/control/grid/grid/grid.controller.ts +1 -0
- package/src/controller/control/grid/grid/grid.service.ts +3 -2
- package/src/controller/control/kanban/kanban.service.ts +2 -2
- package/src/controller/control/map/map.service.ts +1 -1
- package/src/controller/control/report-panel/report-panel.service.ts +2 -2
- package/src/controller/control/tree/tree.service.ts +2 -2
- package/src/controller/control/tree-grid-ex/tree-grid-ex.controller.ts +2 -1
- package/src/controller/control/wizard-panel/wizard-panel.service.ts +4 -4
- package/src/controller/utils/value-default/value-default.ts +1 -1
- package/src/de-logic/de-logic-context.ts +5 -5
- package/src/de-logic/de-logic-link/de-logic-link-group-cond/de-logic-link-group-cond.ts +2 -2
- package/src/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.ts +2 -2
- package/src/de-logic/de-logic-link/de-logic-link.ts +1 -1
- package/src/de-logic/de-logic-node/de-logic-node.ts +1 -1
- package/src/de-logic/de-logic-param/de-logic-param.ts +1 -1
- package/src/de-logic/de-logic.ts +3 -3
- package/src/de-logic/index.ts +10 -10
- package/src/install.ts +3 -0
- package/src/interface/common/i-app-hub-service/i-app-hub-service.ts +9 -0
- package/src/interface/common/i-data-ability-params/i-data-ability-params.ts +1 -1
- package/src/interface/controller/controller/i.controller.ts +9 -0
- package/src/interface/provider/i-de-method.provider.ts +10 -0
- package/src/interface/provider/i-grid-column.provider.ts +2 -7
- package/src/interface/service/service/i-app-de.service.ts +51 -44
- package/src/interface/service/service/i-file.service.ts +2 -2
- package/src/interface/service/service/i-wf.service.ts +12 -12
- package/src/register/helper/grid-column-register.ts +2 -17
- package/src/service/de-service-util.ts +59 -27
- package/src/service/dto/method.dto.ts +39 -19
- package/src/service/service/authority/authority.service.ts +1 -1
- package/src/service/service/code-list/code-list.service.ts +3 -3
- package/src/service/service/control/control.service.ts +2 -2
- package/src/service/service/control/md-control.service.ts +16 -13
- package/src/service/service/counter/counter.service.ts +3 -3
- package/src/service/service/entity/de.service.ts +57 -89
- package/src/service/service/entity/method/de-action.ts +29 -47
- package/src/service/service/entity/method/fetch.ts +5 -11
- package/src/service/service/entity/method/method-input.ts +10 -9
- package/src/service/service/entity/method/method-renturn.ts +10 -11
- package/src/service/service/entity/method/method.ts +12 -35
- package/src/service/service/entity/method/provider/de-action-de-method.provider.ts +4 -2
- package/src/service/service/entity/method/provider/fetch-de-method.provider.ts +4 -2
- package/src/service/service/file/file.service.ts +2 -2
- package/src/service/service/work-flow/work-flow.service.ts +30 -30
- package/src/service/utils/app-counter/app-counter.ts +7 -7
- package/src/service/utils/app-counter/app-de-counter.ts +2 -2
- package/src/service/utils/de-cache/de-cache.ts +124 -85
- package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +2 -5
- package/src/service/utils/res-path/res-path.ts +4 -4
- package/src/service/utils/search-filter/search-filter.ts +2 -2
- package/src/service/utils/service-exist-util/service-exist-util.ts +2 -2
- package/src/types.ts +10 -0
- package/src/ui-logic/ui-logic-param/ui-logic-param.ts +1 -1
- package/src/utils/index.ts +2 -0
- package/src/utils/nav-params/calc-nav-params.ts +2 -2
- package/src/utils/open-redirect-view/open-redirect-view.ts +1 -1
- package/src/utils/ui-domain/ui-domain.ts +52 -0
- package/src/utils/ui-domain-manager/ui-domain-manager.ts +64 -0
- package/out/service/service/entity/util/util.d.ts +0 -13
- package/out/service/service/entity/util/util.d.ts.map +0 -1
- package/out/service/service/entity/util/util.js +0 -14
- package/src/service/service/entity/util/util.ts +0 -18
package/dist/index.esm.js
CHANGED
|
@@ -1113,7 +1113,7 @@ async function openDERedirectView(appView, context, params = {}, opts = {}) {
|
|
|
1113
1113
|
context[key] = curData[key] || context[key] || params[key];
|
|
1114
1114
|
const actionId = appView.getDataAppDEActionId;
|
|
1115
1115
|
const app = ibiz.hub.getApp(appView.appId);
|
|
1116
|
-
const service = await app.deService.getService(entityId);
|
|
1116
|
+
const service = await app.deService.getService(context, entityId);
|
|
1117
1117
|
ibiz.loading.showRedirect();
|
|
1118
1118
|
try {
|
|
1119
1119
|
const res = await service.exec(actionId || "get", context, params);
|
|
@@ -2697,6 +2697,96 @@ var ThemeUtil = class {
|
|
|
2697
2697
|
}
|
|
2698
2698
|
};
|
|
2699
2699
|
|
|
2700
|
+
// src/utils/ui-domain/ui-domain.ts
|
|
2701
|
+
import { createUUID } from "qx-util";
|
|
2702
|
+
var UIDomain = class {
|
|
2703
|
+
/**
|
|
2704
|
+
* Creates an instance of UIDomain.
|
|
2705
|
+
*
|
|
2706
|
+
* @author chitanda
|
|
2707
|
+
* @date 2023-12-22 16:12:03
|
|
2708
|
+
* @param {string} appId
|
|
2709
|
+
* @param {string} [id]
|
|
2710
|
+
*/
|
|
2711
|
+
constructor(id) {
|
|
2712
|
+
if (id) {
|
|
2713
|
+
this.id = id;
|
|
2714
|
+
} else {
|
|
2715
|
+
this.id = createUUID();
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
/**
|
|
2719
|
+
* 界面域销毁
|
|
2720
|
+
*
|
|
2721
|
+
* @author chitanda
|
|
2722
|
+
* @date 2023-12-22 15:12:49
|
|
2723
|
+
*/
|
|
2724
|
+
destroy() {
|
|
2725
|
+
const apps = ibiz.hub.getAllApps();
|
|
2726
|
+
apps.forEach((app) => {
|
|
2727
|
+
app.deService.reset({
|
|
2728
|
+
srfappid: app.appId,
|
|
2729
|
+
srfsessionid: this.id
|
|
2730
|
+
});
|
|
2731
|
+
});
|
|
2732
|
+
}
|
|
2733
|
+
};
|
|
2734
|
+
|
|
2735
|
+
// src/utils/ui-domain-manager/ui-domain-manager.ts
|
|
2736
|
+
var UIDomainManager = class {
|
|
2737
|
+
constructor() {
|
|
2738
|
+
/**
|
|
2739
|
+
* 界面域实例缓存
|
|
2740
|
+
*
|
|
2741
|
+
* @author chitanda
|
|
2742
|
+
* @date 2023-12-22 15:12:53
|
|
2743
|
+
* @protected
|
|
2744
|
+
* @type {Map<string, UIDomain>}
|
|
2745
|
+
*/
|
|
2746
|
+
this.domainMap = /* @__PURE__ */ new Map();
|
|
2747
|
+
}
|
|
2748
|
+
/**
|
|
2749
|
+
* 创建域
|
|
2750
|
+
*
|
|
2751
|
+
* @author chitanda
|
|
2752
|
+
* @date 2023-12-22 16:12:44
|
|
2753
|
+
* @param {string} [id] 可选,不传则自动生成
|
|
2754
|
+
* @return {*} {UIDomain}
|
|
2755
|
+
*/
|
|
2756
|
+
create(id) {
|
|
2757
|
+
const domain = new UIDomain(id);
|
|
2758
|
+
this.domainMap.set(domain.id, domain);
|
|
2759
|
+
return domain;
|
|
2760
|
+
}
|
|
2761
|
+
/**
|
|
2762
|
+
* 获取域
|
|
2763
|
+
*
|
|
2764
|
+
* @author chitanda
|
|
2765
|
+
* @date 2023-12-22 15:12:17
|
|
2766
|
+
* @param {string} id
|
|
2767
|
+
* @return {*} {UIDomain}
|
|
2768
|
+
*/
|
|
2769
|
+
get(id) {
|
|
2770
|
+
if (this.domainMap.has(id)) {
|
|
2771
|
+
return this.domainMap.get(id);
|
|
2772
|
+
}
|
|
2773
|
+
throw new Error("\u65E0\u6548\u7684\u754C\u9762\u57DF\u6807\u8BC6[".concat(id, "]"));
|
|
2774
|
+
}
|
|
2775
|
+
/**
|
|
2776
|
+
* 销毁域
|
|
2777
|
+
*
|
|
2778
|
+
* @author chitanda
|
|
2779
|
+
* @date 2023-12-22 15:12:03
|
|
2780
|
+
* @param {string} id
|
|
2781
|
+
*/
|
|
2782
|
+
destroy(id) {
|
|
2783
|
+
if (this.domainMap.has(id)) {
|
|
2784
|
+
this.domainMap.get(id).destroy();
|
|
2785
|
+
this.domainMap.delete(id);
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2788
|
+
};
|
|
2789
|
+
|
|
2700
2790
|
// src/utils/raw-value-util/raw-value-util.ts
|
|
2701
2791
|
var RawValueUtil = class {
|
|
2702
2792
|
/**
|
|
@@ -3340,7 +3430,6 @@ function getProvider5(key) {
|
|
|
3340
3430
|
async function getGridColumnProvider(model) {
|
|
3341
3431
|
let provider;
|
|
3342
3432
|
const { columnType, enableRowEdit, sysPFPluginId, appId } = model;
|
|
3343
|
-
const { renderSysPFPluginId } = model;
|
|
3344
3433
|
if (sysPFPluginId) {
|
|
3345
3434
|
const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
|
|
3346
3435
|
if (pluginKey) {
|
|
@@ -3352,17 +3441,6 @@ async function getGridColumnProvider(model) {
|
|
|
3352
3441
|
return provider;
|
|
3353
3442
|
}
|
|
3354
3443
|
}
|
|
3355
|
-
if (renderSysPFPluginId) {
|
|
3356
|
-
const pluginKey = await getPluginRegisterKey(renderSysPFPluginId, appId);
|
|
3357
|
-
if (pluginKey) {
|
|
3358
|
-
provider = getProvider5(pluginKey);
|
|
3359
|
-
}
|
|
3360
|
-
if (!provider) {
|
|
3361
|
-
ibiz.log.error("\u627E\u4E0D\u5230\u6811\u8868\u683C\u5217\u63D2\u4EF6".concat(pluginKey, "\u5BF9\u5E94\u7684\u9002\u914D\u5668"));
|
|
3362
|
-
} else {
|
|
3363
|
-
return provider;
|
|
3364
|
-
}
|
|
3365
|
-
}
|
|
3366
3444
|
const key = enableRowEdit ? "".concat(columnType, "_EDIT") : columnType;
|
|
3367
3445
|
provider = getProvider5(key);
|
|
3368
3446
|
if (!provider) {
|
|
@@ -3770,7 +3848,7 @@ var AppCounter = class {
|
|
|
3770
3848
|
*
|
|
3771
3849
|
* @author chitanda
|
|
3772
3850
|
* @date 2022-10-26 19:10:24
|
|
3773
|
-
* @param {
|
|
3851
|
+
* @param {IContext} [context]
|
|
3774
3852
|
* @param {IParams} [params]
|
|
3775
3853
|
*/
|
|
3776
3854
|
async init(context, params) {
|
|
@@ -3784,7 +3862,7 @@ var AppCounter = class {
|
|
|
3784
3862
|
* @author chitanda
|
|
3785
3863
|
* @date 2022-10-26 19:10:58
|
|
3786
3864
|
* @protected
|
|
3787
|
-
* @param {
|
|
3865
|
+
* @param {IContext} [context]
|
|
3788
3866
|
* @param {IParams} [params]
|
|
3789
3867
|
*/
|
|
3790
3868
|
setParams(context, params) {
|
|
@@ -3839,7 +3917,7 @@ var AppCounter = class {
|
|
|
3839
3917
|
*
|
|
3840
3918
|
* @author chitanda
|
|
3841
3919
|
* @date 2022-10-26 19:10:46
|
|
3842
|
-
* @param {
|
|
3920
|
+
* @param {IContext} [context]
|
|
3843
3921
|
* @param {IParams} [params]
|
|
3844
3922
|
* @return {*} {Promise<IData>}
|
|
3845
3923
|
*/
|
|
@@ -3904,7 +3982,7 @@ var AppDECounter = class extends AppCounter {
|
|
|
3904
3982
|
*
|
|
3905
3983
|
* @author chitanda
|
|
3906
3984
|
* @date 2022-10-26 19:10:24
|
|
3907
|
-
* @param {
|
|
3985
|
+
* @param {IContext} [context]
|
|
3908
3986
|
* @param {IParams} [params]
|
|
3909
3987
|
*/
|
|
3910
3988
|
async init(context, params) {
|
|
@@ -4142,7 +4220,7 @@ var DynamicCodeListCache = class {
|
|
|
4142
4220
|
* @param {IParams} [params={}]
|
|
4143
4221
|
* @returns {*} {Promise<CodeListItem[]>}
|
|
4144
4222
|
*/
|
|
4145
|
-
async load(context
|
|
4223
|
+
async load(context, params = {}) {
|
|
4146
4224
|
const app = ibiz.hub.getApp(context.srfappid);
|
|
4147
4225
|
const {
|
|
4148
4226
|
appDataEntityId,
|
|
@@ -4236,7 +4314,7 @@ var DynamicCodeListCache = class {
|
|
|
4236
4314
|
* @param {IParams} [params={}]
|
|
4237
4315
|
* @returns {*} {Promise<IData[]>}
|
|
4238
4316
|
*/
|
|
4239
|
-
async get(context
|
|
4317
|
+
async get(context, params = {}) {
|
|
4240
4318
|
if (this.initPromise) {
|
|
4241
4319
|
await this.initPromise;
|
|
4242
4320
|
}
|
|
@@ -4268,7 +4346,7 @@ var DynamicCodeListCache = class {
|
|
|
4268
4346
|
|
|
4269
4347
|
// src/service/utils/de-cache/de-cache.ts
|
|
4270
4348
|
import { where, equals, clone as clone4, isNil as isNil5, isEmpty as isEmpty5 } from "ramda";
|
|
4271
|
-
import { createUUID } from "qx-util";
|
|
4349
|
+
import { ascSort, createUUID as createUUID2 } from "qx-util";
|
|
4272
4350
|
import { RuntimeError as RuntimeError13 } from "@ibiz-template/core";
|
|
4273
4351
|
|
|
4274
4352
|
// src/service/utils/service-exist-util/service-exist-util.ts
|
|
@@ -4293,6 +4371,13 @@ function isExistSessionId(funcName, context) {
|
|
|
4293
4371
|
|
|
4294
4372
|
// src/service/utils/de-cache/de-cache.ts
|
|
4295
4373
|
var DECache = class {
|
|
4374
|
+
/**
|
|
4375
|
+
* Creates an instance of DECache.
|
|
4376
|
+
*
|
|
4377
|
+
* @author chitanda
|
|
4378
|
+
* @date 2023-12-22 13:12:40
|
|
4379
|
+
* @param {IAppDataEntity} entity 应用实体模型
|
|
4380
|
+
*/
|
|
4296
4381
|
constructor(entity) {
|
|
4297
4382
|
this.entity = entity;
|
|
4298
4383
|
/**
|
|
@@ -4300,7 +4385,7 @@ var DECache = class {
|
|
|
4300
4385
|
*
|
|
4301
4386
|
* @author chitanda
|
|
4302
4387
|
* @date 2022-08-17 23:08:08
|
|
4303
|
-
* @type {Map<string,
|
|
4388
|
+
* @type {Map<string, IDataEntity>}
|
|
4304
4389
|
*/
|
|
4305
4390
|
this.cacheMap = /* @__PURE__ */ new Map();
|
|
4306
4391
|
}
|
|
@@ -4321,12 +4406,11 @@ var DECache = class {
|
|
|
4321
4406
|
*
|
|
4322
4407
|
* @author chitanda
|
|
4323
4408
|
* @date 2022-05-10 17:05:45
|
|
4324
|
-
* @param {
|
|
4409
|
+
* @param {IContext} context
|
|
4325
4410
|
* @param {IDataEntity} entity
|
|
4326
4411
|
*/
|
|
4327
|
-
forceAdd(
|
|
4328
|
-
const
|
|
4329
|
-
const data = map.get(entity.srfkey);
|
|
4412
|
+
forceAdd(_context, entity) {
|
|
4413
|
+
const data = this.cacheMap.get(entity.srfkey);
|
|
4330
4414
|
if (data) {
|
|
4331
4415
|
data.assign(entity);
|
|
4332
4416
|
ibiz.log.warn("forceAdd", entity.srfkey, entity);
|
|
@@ -4337,12 +4421,11 @@ var DECache = class {
|
|
|
4337
4421
|
*
|
|
4338
4422
|
* @author chitanda
|
|
4339
4423
|
* @date 2022-05-10 17:05:27
|
|
4340
|
-
* @param {
|
|
4424
|
+
* @param {IContext} context
|
|
4341
4425
|
* @param {IDataEntity} entity
|
|
4342
4426
|
*/
|
|
4343
|
-
forceUpdate(
|
|
4344
|
-
|
|
4345
|
-
map.set(entity.srfkey, clone4(entity));
|
|
4427
|
+
forceUpdate(_context, entity) {
|
|
4428
|
+
this.cacheMap.set(entity.srfkey, clone4(entity));
|
|
4346
4429
|
ibiz.log.warn("forceUpdate", entity.srfkey, entity);
|
|
4347
4430
|
}
|
|
4348
4431
|
/**
|
|
@@ -4350,12 +4433,11 @@ var DECache = class {
|
|
|
4350
4433
|
*
|
|
4351
4434
|
* @author chitanda
|
|
4352
4435
|
* @date 2022-05-10 17:05:08
|
|
4353
|
-
* @param {
|
|
4436
|
+
* @param {IContext} context
|
|
4354
4437
|
* @param {string} srfKey
|
|
4355
4438
|
*/
|
|
4356
|
-
forceDelete(
|
|
4357
|
-
|
|
4358
|
-
map.delete(srfKey);
|
|
4439
|
+
forceDelete(_context, srfKey) {
|
|
4440
|
+
this.cacheMap.delete(srfKey);
|
|
4359
4441
|
ibiz.log.warn("forceDelete", srfKey);
|
|
4360
4442
|
}
|
|
4361
4443
|
/**
|
|
@@ -4378,11 +4460,10 @@ var DECache = class {
|
|
|
4378
4460
|
try {
|
|
4379
4461
|
isExistSessionId("add", context);
|
|
4380
4462
|
if (isNil5(entity.srfkey) || isEmpty5(entity.srfkey)) {
|
|
4381
|
-
entity.srfkey =
|
|
4463
|
+
entity.srfkey = createUUID2();
|
|
4382
4464
|
}
|
|
4383
4465
|
entity.srftempdate = (/* @__PURE__ */ new Date()).getTime();
|
|
4384
|
-
|
|
4385
|
-
map.set(entity.srfkey, clone4(entity));
|
|
4466
|
+
this.cacheMap.set(entity.srfkey, clone4(entity));
|
|
4386
4467
|
ibiz.log.warn("add", entity.srfkey, entity);
|
|
4387
4468
|
return entity;
|
|
4388
4469
|
} catch (err) {
|
|
@@ -4401,8 +4482,7 @@ var DECache = class {
|
|
|
4401
4482
|
get(context, srfKey) {
|
|
4402
4483
|
try {
|
|
4403
4484
|
isExistSessionId("get", context);
|
|
4404
|
-
const
|
|
4405
|
-
const data = map.get(srfKey);
|
|
4485
|
+
const data = this.cacheMap.get(srfKey);
|
|
4406
4486
|
ibiz.log.warn("get", srfKey, data);
|
|
4407
4487
|
return clone4(data);
|
|
4408
4488
|
} catch (err) {
|
|
@@ -4413,7 +4493,7 @@ var DECache = class {
|
|
|
4413
4493
|
/**
|
|
4414
4494
|
* 更新数据
|
|
4415
4495
|
*
|
|
4416
|
-
* @param {
|
|
4496
|
+
* @param {IContext} context
|
|
4417
4497
|
* @param {IDataEntity} entity
|
|
4418
4498
|
* @return {*} {IDataEntity}
|
|
4419
4499
|
* @memberof EntityCache
|
|
@@ -4432,11 +4512,10 @@ var DECache = class {
|
|
|
4432
4512
|
isExistSessionId("update", context);
|
|
4433
4513
|
isExistSrfKey("update", entity);
|
|
4434
4514
|
entity.srftempdate = (/* @__PURE__ */ new Date()).getTime();
|
|
4435
|
-
const
|
|
4436
|
-
const data = map.get(oldKey);
|
|
4515
|
+
const data = this.cacheMap.get(oldKey);
|
|
4437
4516
|
if (data) {
|
|
4438
4517
|
data.assign(entity);
|
|
4439
|
-
|
|
4518
|
+
this.cacheMap.set(oldKey, data);
|
|
4440
4519
|
ibiz.log.warn("update", oldKey, entity);
|
|
4441
4520
|
return clone4(data);
|
|
4442
4521
|
}
|
|
@@ -4449,7 +4528,7 @@ var DECache = class {
|
|
|
4449
4528
|
/**
|
|
4450
4529
|
* 删除数据
|
|
4451
4530
|
*
|
|
4452
|
-
* @param {
|
|
4531
|
+
* @param {IContext} context
|
|
4453
4532
|
* @param {string} srfKey
|
|
4454
4533
|
* @return {*} {(IDataEntity | null)}
|
|
4455
4534
|
* @memberof EntityCache
|
|
@@ -4457,12 +4536,11 @@ var DECache = class {
|
|
|
4457
4536
|
delete(context, srfKey) {
|
|
4458
4537
|
try {
|
|
4459
4538
|
isExistSessionId("delete", context);
|
|
4460
|
-
const map = this.getCacheByTag(context);
|
|
4461
4539
|
const key = srfKey;
|
|
4462
|
-
if (
|
|
4463
|
-
const data =
|
|
4540
|
+
if (this.cacheMap.has(key)) {
|
|
4541
|
+
const data = this.cacheMap.get(key);
|
|
4464
4542
|
data.srftempdate = (/* @__PURE__ */ new Date()).getTime();
|
|
4465
|
-
|
|
4543
|
+
this.cacheMap.delete(key);
|
|
4466
4544
|
ibiz.log.warn("delete", key);
|
|
4467
4545
|
return data;
|
|
4468
4546
|
}
|
|
@@ -4477,22 +4555,21 @@ var DECache = class {
|
|
|
4477
4555
|
*
|
|
4478
4556
|
* @author chitanda
|
|
4479
4557
|
* @date 2022-03-23 11:03:52
|
|
4480
|
-
* @param {
|
|
4558
|
+
* @param {IContext} context
|
|
4481
4559
|
* @param {IDataEntity[]} entities
|
|
4482
4560
|
* @return {*} {IDataEntity[]}
|
|
4483
4561
|
*/
|
|
4484
4562
|
createBatch(context, entities) {
|
|
4485
4563
|
try {
|
|
4486
4564
|
isExistSessionId("add", context);
|
|
4487
|
-
const map = this.getCacheByTag(context);
|
|
4488
4565
|
for (let i = 0; i < entities.length; i++) {
|
|
4489
4566
|
const entity = entities[i];
|
|
4490
4567
|
if (isNil5(entity.srfkey) || isEmpty5(entity.srfkey)) {
|
|
4491
|
-
entity.srfkey =
|
|
4568
|
+
entity.srfkey = createUUID2();
|
|
4492
4569
|
}
|
|
4493
4570
|
entity.srftempdate = (/* @__PURE__ */ new Date()).getTime();
|
|
4494
4571
|
const data = clone4(entity);
|
|
4495
|
-
|
|
4572
|
+
this.cacheMap.set(entity.srfkey, data);
|
|
4496
4573
|
entities[i] = data;
|
|
4497
4574
|
ibiz.log.warn("add", entity.srfkey, entity);
|
|
4498
4575
|
}
|
|
@@ -4507,22 +4584,21 @@ var DECache = class {
|
|
|
4507
4584
|
*
|
|
4508
4585
|
* @author chitanda
|
|
4509
4586
|
* @date 2022-03-23 10:03:17
|
|
4510
|
-
* @param {
|
|
4587
|
+
* @param {IContext} context
|
|
4511
4588
|
* @param {IDataEntity[]} entities
|
|
4512
4589
|
* @return {*} {IDataEntity[]}
|
|
4513
4590
|
*/
|
|
4514
4591
|
updateBatch(context, entities) {
|
|
4515
4592
|
try {
|
|
4516
4593
|
isExistSessionId("update", context);
|
|
4517
|
-
const map = this.getCacheByTag(context);
|
|
4518
4594
|
for (let i = 0; i < entities.length; i++) {
|
|
4519
4595
|
const entity = entities[i];
|
|
4520
4596
|
isExistSrfKey("update", entity);
|
|
4521
4597
|
entity.srftempdate = (/* @__PURE__ */ new Date()).getTime();
|
|
4522
|
-
const data =
|
|
4598
|
+
const data = this.cacheMap.get(entity.srfkey);
|
|
4523
4599
|
if (data) {
|
|
4524
4600
|
data.assign(entity);
|
|
4525
|
-
|
|
4601
|
+
this.cacheMap.set(entity.srfkey, data);
|
|
4526
4602
|
ibiz.log.warn("update", entity.srfkey, entity);
|
|
4527
4603
|
entities[i] = clone4(data);
|
|
4528
4604
|
} else {
|
|
@@ -4542,7 +4618,7 @@ var DECache = class {
|
|
|
4542
4618
|
*
|
|
4543
4619
|
* @author chitanda
|
|
4544
4620
|
* @date 2022-03-23 10:03:40
|
|
4545
|
-
* @param {
|
|
4621
|
+
* @param {IContext} context 上下文
|
|
4546
4622
|
* @param {string[]} srfKeys 需要删除的数据主键
|
|
4547
4623
|
* @return {*} {string[]} 未能删除的数据主键
|
|
4548
4624
|
*/
|
|
@@ -4553,11 +4629,10 @@ var DECache = class {
|
|
|
4553
4629
|
ibiz.log.error(err);
|
|
4554
4630
|
return srfKeys;
|
|
4555
4631
|
}
|
|
4556
|
-
const map = this.getCacheByTag(context);
|
|
4557
4632
|
const notRemoveKeys = [];
|
|
4558
4633
|
for (let i = 0; i < srfKeys.length; i++) {
|
|
4559
4634
|
const key = srfKeys[i];
|
|
4560
|
-
if (!
|
|
4635
|
+
if (!this.cacheMap.has(key)) {
|
|
4561
4636
|
notRemoveKeys.push(key);
|
|
4562
4637
|
}
|
|
4563
4638
|
}
|
|
@@ -4568,7 +4643,7 @@ var DECache = class {
|
|
|
4568
4643
|
}
|
|
4569
4644
|
for (let i = 0; i < srfKeys.length; i++) {
|
|
4570
4645
|
const key = srfKeys[i];
|
|
4571
|
-
|
|
4646
|
+
this.cacheMap.delete(key);
|
|
4572
4647
|
ibiz.log.warn("delete", key);
|
|
4573
4648
|
}
|
|
4574
4649
|
return [];
|
|
@@ -4578,32 +4653,77 @@ var DECache = class {
|
|
|
4578
4653
|
*
|
|
4579
4654
|
* @author chitanda
|
|
4580
4655
|
* @date 2022-08-17 23:08:06
|
|
4581
|
-
* @param {
|
|
4656
|
+
* @param {IContext} context
|
|
4582
4657
|
* @param {string} srfkey
|
|
4583
4658
|
* @return {*} {boolean}
|
|
4584
4659
|
*/
|
|
4585
|
-
checkData(
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4660
|
+
checkData(_context, srfkey) {
|
|
4661
|
+
return !!this.cacheMap.get(srfkey);
|
|
4662
|
+
}
|
|
4663
|
+
/**
|
|
4664
|
+
* 获取当前已经缓存的数据
|
|
4665
|
+
*
|
|
4666
|
+
* @author chitanda
|
|
4667
|
+
* @date 2023-12-22 14:12:57
|
|
4668
|
+
* @return {*} {IDataEntity[]}
|
|
4669
|
+
*/
|
|
4670
|
+
getList() {
|
|
4671
|
+
const values = this.cacheMap.values();
|
|
4672
|
+
return Array.from(values);
|
|
4589
4673
|
}
|
|
4590
4674
|
/**
|
|
4591
4675
|
* 根据条件查找数据,未设置条件默认返回全部
|
|
4592
4676
|
*
|
|
4593
4677
|
* @author chitanda
|
|
4594
|
-
* @date
|
|
4595
|
-
* @param {
|
|
4678
|
+
* @date 2023-12-22 13:12:28
|
|
4679
|
+
* @param {IContext} context
|
|
4680
|
+
* @param {IParams} [params={}]
|
|
4596
4681
|
* @return {*} {IDataEntity[]}
|
|
4597
4682
|
*/
|
|
4598
|
-
|
|
4683
|
+
select(context, params = {}) {
|
|
4599
4684
|
try {
|
|
4600
4685
|
isExistSessionId("getList", context);
|
|
4601
|
-
const
|
|
4602
|
-
|
|
4603
|
-
|
|
4686
|
+
const values = this.cacheMap.values();
|
|
4687
|
+
let items = Array.from(values);
|
|
4688
|
+
items = ascSort(items, "srfordervalue");
|
|
4689
|
+
const data = {};
|
|
4690
|
+
const nullData = {};
|
|
4691
|
+
const undefinedData = {};
|
|
4692
|
+
const emptyData = {};
|
|
4693
|
+
if (params.srfkey) {
|
|
4694
|
+
data.srfkey = equals(params.srfkey);
|
|
4695
|
+
delete params.srfkey;
|
|
4696
|
+
}
|
|
4697
|
+
for (const key in params) {
|
|
4698
|
+
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
4699
|
+
const val = params[key];
|
|
4700
|
+
if (val == null) {
|
|
4701
|
+
nullData[key] = equals(null);
|
|
4702
|
+
undefinedData[key] = equals(void 0);
|
|
4703
|
+
emptyData[key] = equals("");
|
|
4704
|
+
} else {
|
|
4705
|
+
data[key] = equals(val);
|
|
4706
|
+
}
|
|
4707
|
+
}
|
|
4708
|
+
}
|
|
4709
|
+
if (!isEmpty5(data)) {
|
|
4710
|
+
const pred = where(data);
|
|
4711
|
+
const nullPred = where(nullData);
|
|
4712
|
+
const undefinedPred = where(undefinedData);
|
|
4713
|
+
const emptyPred = where(emptyData);
|
|
4714
|
+
items = items.filter((obj) => {
|
|
4715
|
+
if (isEmpty5(nullData)) {
|
|
4716
|
+
if (pred(obj)) {
|
|
4717
|
+
return true;
|
|
4718
|
+
}
|
|
4719
|
+
} else if (pred(obj) && (nullPred(obj) || undefinedPred(obj) || emptyPred(obj))) {
|
|
4720
|
+
return true;
|
|
4721
|
+
}
|
|
4722
|
+
return false;
|
|
4723
|
+
});
|
|
4604
4724
|
}
|
|
4605
|
-
const
|
|
4606
|
-
return
|
|
4725
|
+
const list = items.map((obj) => obj.clone());
|
|
4726
|
+
return list;
|
|
4607
4727
|
} catch (err) {
|
|
4608
4728
|
ibiz.log.error(err);
|
|
4609
4729
|
return [];
|
|
@@ -4632,33 +4752,13 @@ var DECache = class {
|
|
|
4632
4752
|
return where(data);
|
|
4633
4753
|
}
|
|
4634
4754
|
/**
|
|
4635
|
-
*
|
|
4636
|
-
*
|
|
4637
|
-
* @author chitanda
|
|
4638
|
-
* @date 2022-08-17 23:08:54
|
|
4639
|
-
* @param {IParams} context
|
|
4640
|
-
*/
|
|
4641
|
-
clear(context) {
|
|
4642
|
-
const tag = context.srfsessionid;
|
|
4643
|
-
if (this.cacheMap.size > 0) {
|
|
4644
|
-
this.cacheMap.delete(tag);
|
|
4645
|
-
}
|
|
4646
|
-
}
|
|
4647
|
-
/**
|
|
4648
|
-
* 根据标识获取map组
|
|
4755
|
+
* 清空缓存
|
|
4649
4756
|
*
|
|
4650
4757
|
* @author chitanda
|
|
4651
|
-
* @date
|
|
4652
|
-
* @private
|
|
4653
|
-
* @param {IParams} context
|
|
4654
|
-
* @return {*} {Map<string, IDataEntity>}
|
|
4758
|
+
* @date 2023-12-22 13:12:17
|
|
4655
4759
|
*/
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
if (!this.cacheMap.has(tag)) {
|
|
4659
|
-
this.cacheMap.set(tag, /* @__PURE__ */ new Map());
|
|
4660
|
-
}
|
|
4661
|
-
return this.cacheMap.get(tag);
|
|
4760
|
+
clear() {
|
|
4761
|
+
this.cacheMap.clear();
|
|
4662
4762
|
}
|
|
4663
4763
|
/**
|
|
4664
4764
|
* 根据联合键值计算主键并赋值
|
|
@@ -4957,7 +5057,7 @@ var CodeListService = class {
|
|
|
4957
5057
|
* @param {IAppCodeList} codeList
|
|
4958
5058
|
* @returns {*} {IData[]}
|
|
4959
5059
|
*/
|
|
4960
|
-
async getDynamicCodeList(codeList, context
|
|
5060
|
+
async getDynamicCodeList(codeList, context, params = {}) {
|
|
4961
5061
|
let dynamicCache;
|
|
4962
5062
|
const codeName = codeList.codeName;
|
|
4963
5063
|
if (this.cache.has(codeName)) {
|
|
@@ -4975,7 +5075,7 @@ var CodeListService = class {
|
|
|
4975
5075
|
* @author chitanda
|
|
4976
5076
|
* @date 2022-08-25 15:08:45
|
|
4977
5077
|
* @param {string} tag
|
|
4978
|
-
* @param {
|
|
5078
|
+
* @param {IContext} [context]
|
|
4979
5079
|
* @param {IParams} [params]
|
|
4980
5080
|
* @return {*} {Promise<CodeListItem[]>}
|
|
4981
5081
|
*/
|
|
@@ -5078,7 +5178,7 @@ var CounterService = class {
|
|
|
5078
5178
|
* @date 2022-10-26 20:10:20
|
|
5079
5179
|
* @static
|
|
5080
5180
|
* @param {IAppCounterRef} model
|
|
5081
|
-
* @param {
|
|
5181
|
+
* @param {IContext} context
|
|
5082
5182
|
* @param {IParams} params
|
|
5083
5183
|
* @return {*} {Promise<AppCounter>}
|
|
5084
5184
|
*/
|
|
@@ -5106,8 +5206,6 @@ import {
|
|
|
5106
5206
|
ModelError as ModelError5,
|
|
5107
5207
|
RuntimeError as RuntimeError16
|
|
5108
5208
|
} from "@ibiz-template/core";
|
|
5109
|
-
import { equals as equals2, isEmpty as isEmpty7, where as where2 } from "ramda";
|
|
5110
|
-
import { ascSort } from "qx-util";
|
|
5111
5209
|
|
|
5112
5210
|
// src/service/service/work-flow/work-flow.service.ts
|
|
5113
5211
|
import { RuntimeError as RuntimeError15 } from "@ibiz-template/core";
|
|
@@ -5149,7 +5247,7 @@ var WorkFlowService = class {
|
|
|
5149
5247
|
*
|
|
5150
5248
|
* @private
|
|
5151
5249
|
* @param {IData} data
|
|
5152
|
-
* @param {
|
|
5250
|
+
* @param {IContext} context
|
|
5153
5251
|
* @returns {*}
|
|
5154
5252
|
* @memberof WorkFlowService
|
|
5155
5253
|
*/
|
|
@@ -5165,7 +5263,7 @@ var WorkFlowService = class {
|
|
|
5165
5263
|
* @author zk
|
|
5166
5264
|
* @date 2023-11-06 06:11:07
|
|
5167
5265
|
* @private
|
|
5168
|
-
* @param {
|
|
5266
|
+
* @param {IContext} context
|
|
5169
5267
|
* @return {*} {string}
|
|
5170
5268
|
* @memberof WorkFlowService
|
|
5171
5269
|
*/
|
|
@@ -5177,7 +5275,7 @@ var WorkFlowService = class {
|
|
|
5177
5275
|
*
|
|
5178
5276
|
* @author lxm
|
|
5179
5277
|
* @date 2022-09-29 14:09:45
|
|
5180
|
-
* @param {
|
|
5278
|
+
* @param {IContext} context
|
|
5181
5279
|
* @returns {*} {Promise<IHttpResponse<IData>>}
|
|
5182
5280
|
*/
|
|
5183
5281
|
async getWFStep(context) {
|
|
@@ -5191,7 +5289,7 @@ var WorkFlowService = class {
|
|
|
5191
5289
|
*
|
|
5192
5290
|
* @author lxm
|
|
5193
5291
|
* @date 2022-09-29 14:09:52
|
|
5194
|
-
* @param {
|
|
5292
|
+
* @param {IContext} context 路径参数
|
|
5195
5293
|
* @param {IData} data 数据
|
|
5196
5294
|
* @returns {*} {Promise<IHttpResponse<IData>>}
|
|
5197
5295
|
*/
|
|
@@ -5208,7 +5306,7 @@ var WorkFlowService = class {
|
|
|
5208
5306
|
*
|
|
5209
5307
|
* @author lxm
|
|
5210
5308
|
* @date 2022-09-29 14:09:45
|
|
5211
|
-
* @param {
|
|
5309
|
+
* @param {IContext} context
|
|
5212
5310
|
* @returns {*} {Promise<IHttpResponse<IData>>}
|
|
5213
5311
|
*/
|
|
5214
5312
|
async getWFHistory(context) {
|
|
@@ -5224,7 +5322,7 @@ var WorkFlowService = class {
|
|
|
5224
5322
|
*
|
|
5225
5323
|
* @author lxm
|
|
5226
5324
|
* @date 2022-10-27 16:10:13
|
|
5227
|
-
* @param {
|
|
5325
|
+
* @param {IContext} context
|
|
5228
5326
|
* @returns {*} {Promise<IHttpResponse<IData>>}
|
|
5229
5327
|
*/
|
|
5230
5328
|
async getWFProcessDiagram(context) {
|
|
@@ -5255,7 +5353,7 @@ var WorkFlowService = class {
|
|
|
5255
5353
|
*
|
|
5256
5354
|
* @author lxm
|
|
5257
5355
|
* @date 2022-09-30 17:09:51
|
|
5258
|
-
* @param {
|
|
5356
|
+
* @param {IContext} context 路径参数
|
|
5259
5357
|
* @param {IParams} params 请求参数
|
|
5260
5358
|
* @param {IData} data 数据
|
|
5261
5359
|
* @returns {*} {Promise<IHttpResponse<IData>>}
|
|
@@ -5274,7 +5372,7 @@ var WorkFlowService = class {
|
|
|
5274
5372
|
*
|
|
5275
5373
|
* @author lxm
|
|
5276
5374
|
* @date 2022-09-30 17:09:51
|
|
5277
|
-
* @param {
|
|
5375
|
+
* @param {IContext} context 路径参数
|
|
5278
5376
|
* @param {IParams} params 请求参数
|
|
5279
5377
|
* @param {IData} data 数据
|
|
5280
5378
|
* @returns {*} {Promise<IHttpResponse<IData>>}
|
|
@@ -5293,7 +5391,7 @@ var WorkFlowService = class {
|
|
|
5293
5391
|
*
|
|
5294
5392
|
* @author lxm
|
|
5295
5393
|
* @date 2022-09-30 17:09:51
|
|
5296
|
-
* @param {
|
|
5394
|
+
* @param {IContext} context 路径参数
|
|
5297
5395
|
* @param {IParams} params 请求参数
|
|
5298
5396
|
* @param {IData} data 数据
|
|
5299
5397
|
* @returns {*} {Promise<IHttpResponse<IData>>}
|
|
@@ -5312,7 +5410,7 @@ var WorkFlowService = class {
|
|
|
5312
5410
|
*
|
|
5313
5411
|
* @author lxm
|
|
5314
5412
|
* @date 2022-09-30 17:09:51
|
|
5315
|
-
* @param {
|
|
5413
|
+
* @param {IContext} context 路径参数
|
|
5316
5414
|
* @param {IParams} params 请求参数
|
|
5317
5415
|
* @param {IData} data 数据
|
|
5318
5416
|
* @returns {*} {Promise<IHttpResponse<IData>>}
|
|
@@ -5331,7 +5429,7 @@ var WorkFlowService = class {
|
|
|
5331
5429
|
*
|
|
5332
5430
|
* @author lxm
|
|
5333
5431
|
* @date 2022-09-30 17:09:51
|
|
5334
|
-
* @param {
|
|
5432
|
+
* @param {IContext} context 路径参数
|
|
5335
5433
|
* @param {IParams} params 请求参数
|
|
5336
5434
|
* @param {IData} data 数据
|
|
5337
5435
|
* @returns {*} {Promise<IHttpResponse<IData>>}
|
|
@@ -5350,7 +5448,7 @@ var WorkFlowService = class {
|
|
|
5350
5448
|
*
|
|
5351
5449
|
* @author lxm
|
|
5352
5450
|
* @date 2022-09-30 17:09:51
|
|
5353
|
-
* @param {
|
|
5451
|
+
* @param {IContext} context 路径参数
|
|
5354
5452
|
* @param {IParams} params 请求参数
|
|
5355
5453
|
* @param {IData} data 数据
|
|
5356
5454
|
* @returns {*} {Promise<IHttpResponse<IData>>}
|
|
@@ -5369,7 +5467,7 @@ var WorkFlowService = class {
|
|
|
5369
5467
|
*
|
|
5370
5468
|
* @author lxm
|
|
5371
5469
|
* @date 2022-09-30 17:09:51
|
|
5372
|
-
* @param {
|
|
5470
|
+
* @param {IContext} context 路径参数
|
|
5373
5471
|
* @param {IParams} params 请求参数
|
|
5374
5472
|
* @param {IData} data 数据
|
|
5375
5473
|
* @returns {*} {Promise<IHttpResponse<IData>>}
|
|
@@ -5388,7 +5486,7 @@ var WorkFlowService = class {
|
|
|
5388
5486
|
*
|
|
5389
5487
|
* @author lxm
|
|
5390
5488
|
* @date 2022-09-30 17:09:51
|
|
5391
|
-
* @param {
|
|
5489
|
+
* @param {IContext} context 路径参数
|
|
5392
5490
|
* @param {IParams} params 请求参数
|
|
5393
5491
|
* @param {IData} data 数据
|
|
5394
5492
|
* @returns {*} {Promise<IHttpResponse<IData>>}
|
|
@@ -5408,7 +5506,7 @@ var WorkFlowService = class {
|
|
|
5408
5506
|
* @author lxm
|
|
5409
5507
|
* @date 2022-09-30 17:09:38
|
|
5410
5508
|
* @param {string} methodName 接口名称
|
|
5411
|
-
* @param {
|
|
5509
|
+
* @param {IContext} context 路径参数
|
|
5412
5510
|
* @param {IParams} [params={}] 查询参数
|
|
5413
5511
|
* @param {IData} [data={}] 主数据数据
|
|
5414
5512
|
* @returns {*} {Promise<IHttpResponse<IData>>}
|
|
@@ -5454,7 +5552,7 @@ var FileService = class {
|
|
|
5454
5552
|
* @date 2022-11-25 14:11:53
|
|
5455
5553
|
* @param {IDEDataExport} dataExport 导出模型
|
|
5456
5554
|
* @param {string} fetchAction 查询方法
|
|
5457
|
-
* @param {
|
|
5555
|
+
* @param {IContext} context 上下文
|
|
5458
5556
|
* @param {IParams} params 请求参数
|
|
5459
5557
|
* @returns {*} {Promise<IHttpResponse<Blob>>}
|
|
5460
5558
|
*/
|
|
@@ -5472,13 +5570,15 @@ var FileService = class {
|
|
|
5472
5570
|
// src/service/service/entity/de.service.ts
|
|
5473
5571
|
var DEService = class {
|
|
5474
5572
|
/**
|
|
5475
|
-
* Creates an instance of
|
|
5573
|
+
* Creates an instance of DEService.
|
|
5476
5574
|
*
|
|
5477
5575
|
* @author chitanda
|
|
5478
|
-
* @date
|
|
5479
|
-
* @param {
|
|
5576
|
+
* @date 2023-12-22 13:12:21
|
|
5577
|
+
* @param {string} srfSessionId 当前实体会话标识
|
|
5578
|
+
* @param {IAppDataEntity} model 实体模型
|
|
5480
5579
|
*/
|
|
5481
|
-
constructor(model) {
|
|
5580
|
+
constructor(srfSessionId, model) {
|
|
5581
|
+
this.srfSessionId = srfSessionId;
|
|
5482
5582
|
this.model = model;
|
|
5483
5583
|
/**
|
|
5484
5584
|
* 请求方法实例
|
|
@@ -5489,6 +5589,14 @@ var DEService = class {
|
|
|
5489
5589
|
* @type {Map<string, Method>}
|
|
5490
5590
|
*/
|
|
5491
5591
|
this.methodMap = /* @__PURE__ */ new Map();
|
|
5592
|
+
/**
|
|
5593
|
+
* 是否为本地模式(临时数据模式)服务
|
|
5594
|
+
*
|
|
5595
|
+
* @author chitanda
|
|
5596
|
+
* @date 2023-12-22 16:12:13
|
|
5597
|
+
* @type {boolean}
|
|
5598
|
+
*/
|
|
5599
|
+
this.isLocalMode = false;
|
|
5492
5600
|
this.local = new DECache(model);
|
|
5493
5601
|
this.configCache = new ConfigService(
|
|
5494
5602
|
model.appId,
|
|
@@ -5518,7 +5626,10 @@ var DEService = class {
|
|
|
5518
5626
|
if (!provider) {
|
|
5519
5627
|
throw new ModelError5(model, "\u672A\u652F\u6301\u7684\u670D\u52A1\u65B9\u6CD5\u7C7B\u578B: ".concat(model.methodType));
|
|
5520
5628
|
}
|
|
5521
|
-
const method = provider.create(this.model, model, {
|
|
5629
|
+
const method = provider.create(this, this.model, model, {
|
|
5630
|
+
acMode,
|
|
5631
|
+
localMode: this.isLocalMode
|
|
5632
|
+
});
|
|
5522
5633
|
this.methodMap.set(cacheId, method);
|
|
5523
5634
|
return method;
|
|
5524
5635
|
}
|
|
@@ -5528,7 +5639,7 @@ var DEService = class {
|
|
|
5528
5639
|
* @author chitanda
|
|
5529
5640
|
* @date 2022-09-13 19:09:55
|
|
5530
5641
|
* @param {string} id 执行服务方法标识
|
|
5531
|
-
* @param {
|
|
5642
|
+
* @param {IContext} context
|
|
5532
5643
|
* @param {IData} [params={}] 请求参数
|
|
5533
5644
|
* @param {IParams} [params2={}] 查询参数
|
|
5534
5645
|
* @return {*} {Promise<IHttpResponse>}
|
|
@@ -5579,51 +5690,12 @@ var DEService = class {
|
|
|
5579
5690
|
/**
|
|
5580
5691
|
* 查询本地数据,根据属性
|
|
5581
5692
|
*
|
|
5582
|
-
* @param {
|
|
5693
|
+
* @param {IContext} context
|
|
5583
5694
|
* @param {IParams} params 根据多实体属性查找,例:{ name: '张三', age: 18, parent: null }
|
|
5584
5695
|
* @return {*} {Promise<IDataEntity[]>}
|
|
5585
5696
|
*/
|
|
5586
5697
|
async selectLocal(context, params = {}) {
|
|
5587
|
-
|
|
5588
|
-
items = ascSort(items, "srfordervalue");
|
|
5589
|
-
const data = {};
|
|
5590
|
-
const nullData = {};
|
|
5591
|
-
const undefinedData = {};
|
|
5592
|
-
const emptyData = {};
|
|
5593
|
-
if (params.srfkey) {
|
|
5594
|
-
data.srfkey = equals2(params.srfkey);
|
|
5595
|
-
delete params.srfkey;
|
|
5596
|
-
}
|
|
5597
|
-
for (const key in params) {
|
|
5598
|
-
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
5599
|
-
const val = params[key];
|
|
5600
|
-
if (val == null) {
|
|
5601
|
-
nullData[key] = equals2(null);
|
|
5602
|
-
undefinedData[key] = equals2(void 0);
|
|
5603
|
-
emptyData[key] = equals2("");
|
|
5604
|
-
} else {
|
|
5605
|
-
data[key] = equals2(val);
|
|
5606
|
-
}
|
|
5607
|
-
}
|
|
5608
|
-
}
|
|
5609
|
-
if (!isEmpty7(data)) {
|
|
5610
|
-
const pred = where2(data);
|
|
5611
|
-
const nullPred = where2(nullData);
|
|
5612
|
-
const undefinedPred = where2(undefinedData);
|
|
5613
|
-
const emptyPred = where2(emptyData);
|
|
5614
|
-
items = items.filter((obj) => {
|
|
5615
|
-
if (isEmpty7(nullData)) {
|
|
5616
|
-
if (pred(obj)) {
|
|
5617
|
-
return true;
|
|
5618
|
-
}
|
|
5619
|
-
} else if (pred(obj) && (nullPred(obj) || undefinedPred(obj) || emptyPred(obj))) {
|
|
5620
|
-
return true;
|
|
5621
|
-
}
|
|
5622
|
-
return false;
|
|
5623
|
-
});
|
|
5624
|
-
}
|
|
5625
|
-
const list = items.map((obj) => obj.clone());
|
|
5626
|
-
return list;
|
|
5698
|
+
return this.local.select(context, params);
|
|
5627
5699
|
}
|
|
5628
5700
|
/**
|
|
5629
5701
|
* 执行服务方法 ac 模式
|
|
@@ -5631,7 +5703,7 @@ var DEService = class {
|
|
|
5631
5703
|
* @author chitanda
|
|
5632
5704
|
* @date 2022-09-13 19:09:55
|
|
5633
5705
|
* @param {string} id 执行服务方法标识
|
|
5634
|
-
* @param {
|
|
5706
|
+
* @param {IContext} context
|
|
5635
5707
|
* @param {IData} [params={}] 请求参数
|
|
5636
5708
|
* @param {IParams} [params2={}] 查询参数
|
|
5637
5709
|
* @return {*} {Promise<IHttpResponse>}
|
|
@@ -5649,7 +5721,7 @@ var DEService = class {
|
|
|
5649
5721
|
* @author chitanda
|
|
5650
5722
|
* @date 2023-10-16 16:10:16
|
|
5651
5723
|
* @param {(data: IPortalAsyncAction) => void} onmessage
|
|
5652
|
-
* @param {
|
|
5724
|
+
* @param {IContext} context
|
|
5653
5725
|
* @param {IParams} [params={}]
|
|
5654
5726
|
* @param {IData} [data={}]
|
|
5655
5727
|
* @return {*} {Promise<void>}
|
|
@@ -5687,7 +5759,7 @@ var DEService = class {
|
|
|
5687
5759
|
*
|
|
5688
5760
|
* @author chitanda
|
|
5689
5761
|
* @date 2023-10-26 14:10:58
|
|
5690
|
-
* @param {
|
|
5762
|
+
* @param {IContext} context
|
|
5691
5763
|
* @param {IParams} [params={}]
|
|
5692
5764
|
* @param {IData} [data={}]
|
|
5693
5765
|
* @return {*} {Promise<IHttpResponse>}
|
|
@@ -5703,7 +5775,7 @@ var DEService = class {
|
|
|
5703
5775
|
* @author chitanda
|
|
5704
5776
|
* @date 2023-10-26 14:10:25
|
|
5705
5777
|
* @protected
|
|
5706
|
-
* @param {
|
|
5778
|
+
* @param {IContext} context
|
|
5707
5779
|
* @param {boolean} [isHistories=false]
|
|
5708
5780
|
* @return {*} {string}
|
|
5709
5781
|
*/
|
|
@@ -5713,13 +5785,23 @@ var DEService = class {
|
|
|
5713
5785
|
const resPath = calcResPath(context, this.model);
|
|
5714
5786
|
return resPath + curPath;
|
|
5715
5787
|
}
|
|
5788
|
+
/**
|
|
5789
|
+
* 服务实例销毁
|
|
5790
|
+
*
|
|
5791
|
+
* @author chitanda
|
|
5792
|
+
* @date 2023-12-22 14:12:11
|
|
5793
|
+
* @return {*} {Promise<void>}
|
|
5794
|
+
*/
|
|
5795
|
+
async destroy() {
|
|
5796
|
+
this.local.clear();
|
|
5797
|
+
}
|
|
5716
5798
|
};
|
|
5717
5799
|
|
|
5718
5800
|
// src/service/service/control/control.service.ts
|
|
5719
5801
|
import { clone as clone6 } from "@ibiz-template/core";
|
|
5720
5802
|
|
|
5721
5803
|
// src/service/vo/control.vo.ts
|
|
5722
|
-
import { createUUID as
|
|
5804
|
+
import { createUUID as createUUID3 } from "qx-util";
|
|
5723
5805
|
import { clone as clone5, isNil as isNil7 } from "ramda";
|
|
5724
5806
|
|
|
5725
5807
|
// src/service/constant/srfuf.ts
|
|
@@ -5818,7 +5900,7 @@ var ControlVO = class _ControlVO {
|
|
|
5818
5900
|
enumerable: false,
|
|
5819
5901
|
configurable: true,
|
|
5820
5902
|
writable: true,
|
|
5821
|
-
value: isNil7(this.srfkey) ?
|
|
5903
|
+
value: isNil7(this.srfkey) ? createUUID3() : this.srfkey
|
|
5822
5904
|
});
|
|
5823
5905
|
}
|
|
5824
5906
|
Object.defineProperty(this, "srfuf", {
|
|
@@ -5971,7 +6053,7 @@ var ControlService = class {
|
|
|
5971
6053
|
* @author lxm
|
|
5972
6054
|
* @date 2022-08-31 17:08:41
|
|
5973
6055
|
* @param {string} methodName 方法名
|
|
5974
|
-
* @param {
|
|
6056
|
+
* @param {IContext} context 上下文
|
|
5975
6057
|
* @param {IParams} [params={}] 视图参数或数据
|
|
5976
6058
|
* @returns {*} {Promise<IHttpResponse>}
|
|
5977
6059
|
*/
|
|
@@ -6018,7 +6100,7 @@ var MDControlService = class extends ControlService {
|
|
|
6018
6100
|
*
|
|
6019
6101
|
* @author lxm
|
|
6020
6102
|
* @date 2022-08-31 17:08:41
|
|
6021
|
-
* @param {
|
|
6103
|
+
* @param {IContext} context 上下文
|
|
6022
6104
|
* @param {IParams} [params={}] 视图参数
|
|
6023
6105
|
* @returns {*} {Promise<IHttpResponse>}
|
|
6024
6106
|
*/
|
|
@@ -6034,7 +6116,7 @@ var MDControlService = class extends ControlService {
|
|
|
6034
6116
|
*
|
|
6035
6117
|
* @author lxm
|
|
6036
6118
|
* @date 2022-08-31 17:08:41
|
|
6037
|
-
* @param {
|
|
6119
|
+
* @param {IContext} context 上下文
|
|
6038
6120
|
* @param {IParams} [params={}] 视图参数
|
|
6039
6121
|
* @returns {*} {Promise<IHttpResponse>}
|
|
6040
6122
|
*/
|
|
@@ -6050,7 +6132,7 @@ var MDControlService = class extends ControlService {
|
|
|
6050
6132
|
*
|
|
6051
6133
|
* @author lxm
|
|
6052
6134
|
* @date 2022-08-31 17:08:41
|
|
6053
|
-
* @param {
|
|
6135
|
+
* @param {IContext} context 上下文
|
|
6054
6136
|
* @param {IParams} [params={}] 视图参数
|
|
6055
6137
|
* @returns {*} {Promise<IHttpResponse>}
|
|
6056
6138
|
*/
|
|
@@ -6066,7 +6148,7 @@ var MDControlService = class extends ControlService {
|
|
|
6066
6148
|
*
|
|
6067
6149
|
* @author lxm
|
|
6068
6150
|
* @date 2022-09-07 19:09:48
|
|
6069
|
-
* @param {
|
|
6151
|
+
* @param {IContext} context 上下文
|
|
6070
6152
|
* @param {IParams} [params={}] 视图参数
|
|
6071
6153
|
* @returns {*}
|
|
6072
6154
|
*/
|
|
@@ -6081,7 +6163,7 @@ var MDControlService = class extends ControlService {
|
|
|
6081
6163
|
*
|
|
6082
6164
|
* @author lxm
|
|
6083
6165
|
* @date 2022-09-07 19:09:11
|
|
6084
|
-
* @param {
|
|
6166
|
+
* @param {IContext} context 上下文
|
|
6085
6167
|
* @param {ControlVO} data 数据
|
|
6086
6168
|
* @returns {*}
|
|
6087
6169
|
*/
|
|
@@ -6097,7 +6179,7 @@ var MDControlService = class extends ControlService {
|
|
|
6097
6179
|
*
|
|
6098
6180
|
* @author lxm
|
|
6099
6181
|
* @date 2022-09-07 19:09:11
|
|
6100
|
-
* @param {
|
|
6182
|
+
* @param {IContext} context 上下文
|
|
6101
6183
|
* @param {ControlVO} data 数据
|
|
6102
6184
|
* @returns {*}
|
|
6103
6185
|
*/
|
|
@@ -6134,7 +6216,7 @@ var MDControlService = class extends ControlService {
|
|
|
6134
6216
|
* @author lxm
|
|
6135
6217
|
* @date 2022-11-25 14:11:09
|
|
6136
6218
|
* @param {IPSDEDataExport} dataExport 导出模型
|
|
6137
|
-
* @param {
|
|
6219
|
+
* @param {IContext} context 上下文
|
|
6138
6220
|
* @param {IParams} [params={}] 请求参数
|
|
6139
6221
|
* @returns {*} {Promise<IHttpResponse>}
|
|
6140
6222
|
*/
|
|
@@ -6300,7 +6382,7 @@ var AuthorityService = class {
|
|
|
6300
6382
|
* @author chitanda
|
|
6301
6383
|
* @date 2022-12-23 10:12:24
|
|
6302
6384
|
* @param {string} id 实体标识
|
|
6303
|
-
* @param {
|
|
6385
|
+
* @param {IContext} [context] 上下文,用于计算模型所属沙箱环境
|
|
6304
6386
|
* @return {*} {Promise<IAppDEService>}
|
|
6305
6387
|
*/
|
|
6306
6388
|
async getService(id) {
|
|
@@ -6498,7 +6580,7 @@ import { isArray as isArray4 } from "lodash-es";
|
|
|
6498
6580
|
// src/service/app-data-entity/app-data-entity.ts
|
|
6499
6581
|
import { clone as clone7, isNil as isNil9 } from "ramda";
|
|
6500
6582
|
import { DataTypes } from "@ibiz-template/core";
|
|
6501
|
-
import { createUUID as
|
|
6583
|
+
import { createUUID as createUUID4 } from "qx-util";
|
|
6502
6584
|
var AppDataEntity = class _AppDataEntity {
|
|
6503
6585
|
get srfuf() {
|
|
6504
6586
|
return this.srfkey === this.tempsrfkey ? 1 /* UPDATE */ : 0 /* CREATE */;
|
|
@@ -6580,7 +6662,7 @@ var AppDataEntity = class _AppDataEntity {
|
|
|
6580
6662
|
enumerable: false,
|
|
6581
6663
|
configurable: true,
|
|
6582
6664
|
writable: true,
|
|
6583
|
-
value: isNil9(this.srfkey) ?
|
|
6665
|
+
value: isNil9(this.srfkey) ? createUUID4() : this.srfkey
|
|
6584
6666
|
});
|
|
6585
6667
|
this.defineProperties();
|
|
6586
6668
|
}
|
|
@@ -6688,9 +6770,10 @@ var AppDataEntity = class _AppDataEntity {
|
|
|
6688
6770
|
// src/service/dto/method.dto.ts
|
|
6689
6771
|
import { ModelError as ModelError6 } from "@ibiz-template/core";
|
|
6690
6772
|
var MethodDto = class _MethodDto {
|
|
6691
|
-
constructor(entity,
|
|
6773
|
+
constructor(service, entity, isLocalMode, dto) {
|
|
6774
|
+
this.service = service;
|
|
6692
6775
|
this.entity = entity;
|
|
6693
|
-
this.isLocalMode =
|
|
6776
|
+
this.isLocalMode = isLocalMode;
|
|
6694
6777
|
this.dto = dto;
|
|
6695
6778
|
this.dtoMap = /* @__PURE__ */ new Map();
|
|
6696
6779
|
if (dto) {
|
|
@@ -6700,6 +6783,18 @@ var MethodDto = class _MethodDto {
|
|
|
6700
6783
|
this.fields = [];
|
|
6701
6784
|
}
|
|
6702
6785
|
}
|
|
6786
|
+
/**
|
|
6787
|
+
* 查找本地 DTO 存储数据
|
|
6788
|
+
*
|
|
6789
|
+
* @author chitanda
|
|
6790
|
+
* @date 2023-12-22 14:12:19
|
|
6791
|
+
* @param {IContext} context
|
|
6792
|
+
* @param {IParams} [params]
|
|
6793
|
+
* @return {*} {IDataEntity[]}
|
|
6794
|
+
*/
|
|
6795
|
+
select(context, params) {
|
|
6796
|
+
return this.service.local.select(context, params);
|
|
6797
|
+
}
|
|
6703
6798
|
/**
|
|
6704
6799
|
* 转换数组成ListMap
|
|
6705
6800
|
*
|
|
@@ -6732,7 +6827,7 @@ var MethodDto = class _MethodDto {
|
|
|
6732
6827
|
*
|
|
6733
6828
|
* @author chitanda
|
|
6734
6829
|
* @date 2022-10-10 23:10:33
|
|
6735
|
-
* @param {
|
|
6830
|
+
* @param {IContext} context
|
|
6736
6831
|
* @param {IData} data
|
|
6737
6832
|
* @return {*} {Promise<IData>}
|
|
6738
6833
|
*/
|
|
@@ -6759,13 +6854,12 @@ var MethodDto = class _MethodDto {
|
|
|
6759
6854
|
if (!field.refAppDataEntityId) {
|
|
6760
6855
|
break;
|
|
6761
6856
|
}
|
|
6762
|
-
const dto = await this.getFieldDto(field);
|
|
6763
|
-
const
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
});
|
|
6857
|
+
const dto = await this.getFieldDto(context, field);
|
|
6858
|
+
const filterParams = {};
|
|
6859
|
+
if (field.refPickupAppDEFieldId) {
|
|
6860
|
+
filterParams[field.refPickupAppDEFieldId] = data.srfkey;
|
|
6861
|
+
}
|
|
6862
|
+
const items = await dto.select(context, filterParams);
|
|
6769
6863
|
if (items) {
|
|
6770
6864
|
const arr = [];
|
|
6771
6865
|
for (let j = 0; j < items.length; j++) {
|
|
@@ -6790,14 +6884,13 @@ var MethodDto = class _MethodDto {
|
|
|
6790
6884
|
*
|
|
6791
6885
|
* @author chitanda
|
|
6792
6886
|
* @date 2022-10-10 23:10:50
|
|
6793
|
-
* @param {
|
|
6887
|
+
* @param {IContext} context
|
|
6794
6888
|
* @param {IData[]} data
|
|
6795
6889
|
* @return {*} {Promise<AppDataEntity[]>}
|
|
6796
6890
|
*/
|
|
6797
6891
|
async sets(context, data) {
|
|
6798
|
-
const service = await this.app.deService.getService(this.entity.id);
|
|
6799
6892
|
if (this.isLocalMode) {
|
|
6800
|
-
service.local.clear(
|
|
6893
|
+
this.service.local.clear();
|
|
6801
6894
|
}
|
|
6802
6895
|
return Promise.all(
|
|
6803
6896
|
data.map(async (datum) => {
|
|
@@ -6809,12 +6902,13 @@ var MethodDto = class _MethodDto {
|
|
|
6809
6902
|
if (!field.refAppDataEntityId) {
|
|
6810
6903
|
return;
|
|
6811
6904
|
}
|
|
6812
|
-
const dto = await this.getFieldDto(field);
|
|
6905
|
+
const dto = await this.getFieldDto(context, field);
|
|
6813
6906
|
const items = datum[key];
|
|
6814
6907
|
if (items) {
|
|
6815
6908
|
const pKey = datum[this.entity.keyAppDEFieldId];
|
|
6816
6909
|
items.forEach((item) => {
|
|
6817
6910
|
item.srfpkey = pKey;
|
|
6911
|
+
item[field.refPickupAppDEFieldId] = pKey;
|
|
6818
6912
|
});
|
|
6819
6913
|
await dto.sets(context, items);
|
|
6820
6914
|
} else {
|
|
@@ -6827,7 +6921,7 @@ var MethodDto = class _MethodDto {
|
|
|
6827
6921
|
}
|
|
6828
6922
|
const entityData = new AppDataEntity(this.entity, datum);
|
|
6829
6923
|
if (this.isLocalMode) {
|
|
6830
|
-
await service.local.add(context, entityData);
|
|
6924
|
+
await this.service.local.add(context, entityData);
|
|
6831
6925
|
}
|
|
6832
6926
|
return entityData;
|
|
6833
6927
|
})
|
|
@@ -6837,12 +6931,13 @@ var MethodDto = class _MethodDto {
|
|
|
6837
6931
|
* 获取子属性 DTO
|
|
6838
6932
|
*
|
|
6839
6933
|
* @author chitanda
|
|
6840
|
-
* @date
|
|
6934
|
+
* @date 2023-12-22 13:12:06
|
|
6841
6935
|
* @protected
|
|
6936
|
+
* @param {IContext} context
|
|
6842
6937
|
* @param {IAppDEMethodDTOField} field
|
|
6843
6938
|
* @return {*} {Promise<MethodDto>}
|
|
6844
6939
|
*/
|
|
6845
|
-
async getFieldDto(field) {
|
|
6940
|
+
async getFieldDto(context, field) {
|
|
6846
6941
|
if (this.dtoMap.has(field.codeName)) {
|
|
6847
6942
|
return this.dtoMap.get(field.codeName);
|
|
6848
6943
|
}
|
|
@@ -6854,29 +6949,31 @@ var MethodDto = class _MethodDto {
|
|
|
6854
6949
|
entity.appDEMethodDTOs || [],
|
|
6855
6950
|
field.refAppDEMethodDTOId
|
|
6856
6951
|
);
|
|
6857
|
-
const
|
|
6952
|
+
const service = await this.app.deService.getService(context, entity.id);
|
|
6953
|
+
service.isLocalMode = true;
|
|
6954
|
+
const dto = new _MethodDto(service, entity, true, methodDto);
|
|
6858
6955
|
this.dtoMap.set(field.codeName, dto);
|
|
6859
6956
|
return dto;
|
|
6860
6957
|
}
|
|
6861
6958
|
};
|
|
6862
6959
|
|
|
6863
|
-
// src/service/service/entity/util/util.ts
|
|
6864
|
-
function isLocalMode(method) {
|
|
6865
|
-
return method.actionType === "BUILTIN" || method.dataSetType === "DATAQUERY";
|
|
6866
|
-
}
|
|
6867
|
-
|
|
6868
6960
|
// src/service/service/entity/method/method-input.ts
|
|
6869
6961
|
var MethodInput = class {
|
|
6870
6962
|
/**
|
|
6871
6963
|
* Creates an instance of MethodInput.
|
|
6964
|
+
*
|
|
6872
6965
|
* @author chitanda
|
|
6873
|
-
* @date 2023-
|
|
6966
|
+
* @date 2023-12-22 13:12:57
|
|
6967
|
+
* @param {IAppDEService} service
|
|
6874
6968
|
* @param {IAppDataEntity} entity
|
|
6875
6969
|
* @param {IAppDEMethod} method
|
|
6970
|
+
* @param {boolean} [isLocalMode=false]
|
|
6876
6971
|
*/
|
|
6877
|
-
constructor(entity, method) {
|
|
6972
|
+
constructor(service, entity, method, isLocalMode = false) {
|
|
6973
|
+
this.service = service;
|
|
6878
6974
|
this.entity = entity;
|
|
6879
6975
|
this.method = method;
|
|
6976
|
+
this.isLocalMode = isLocalMode;
|
|
6880
6977
|
const input = method.appDEMethodInput;
|
|
6881
6978
|
if (input) {
|
|
6882
6979
|
const methodDto = findModelChild(
|
|
@@ -6884,19 +6981,16 @@ var MethodInput = class {
|
|
|
6884
6981
|
input.appDEMethodDTOId
|
|
6885
6982
|
);
|
|
6886
6983
|
if (methodDto) {
|
|
6887
|
-
this.dto = new MethodDto(entity, this.isLocalMode, methodDto);
|
|
6984
|
+
this.dto = new MethodDto(service, entity, this.isLocalMode, methodDto);
|
|
6888
6985
|
}
|
|
6889
6986
|
}
|
|
6890
6987
|
}
|
|
6891
|
-
get isLocalMode() {
|
|
6892
|
-
return isLocalMode(this.method);
|
|
6893
|
-
}
|
|
6894
6988
|
/**
|
|
6895
6989
|
* 处理请求发送参数
|
|
6896
6990
|
*
|
|
6897
6991
|
* @author chitanda
|
|
6898
6992
|
* @date 2022-10-11 14:10:22
|
|
6899
|
-
* @param {
|
|
6993
|
+
* @param {IContext} context
|
|
6900
6994
|
* @param {IData} data
|
|
6901
6995
|
* @return {*} {Promise<IData>}
|
|
6902
6996
|
*/
|
|
@@ -6913,15 +7007,19 @@ import { isNilOrEmpty as isNilOrEmpty5 } from "qx-util";
|
|
|
6913
7007
|
var MethodReturn = class {
|
|
6914
7008
|
/**
|
|
6915
7009
|
* Creates an instance of MethodReturn.
|
|
7010
|
+
*
|
|
6916
7011
|
* @author chitanda
|
|
6917
|
-
* @date 2023-
|
|
7012
|
+
* @date 2023-12-22 13:12:24
|
|
7013
|
+
* @param {IAppDEService} service
|
|
6918
7014
|
* @param {IAppDataEntity} entity
|
|
6919
7015
|
* @param {IAppDEMethod} method
|
|
6920
|
-
* @param {
|
|
7016
|
+
* @param {boolean} [isLocalMode=false]
|
|
6921
7017
|
*/
|
|
6922
|
-
constructor(entity, method) {
|
|
7018
|
+
constructor(service, entity, method, isLocalMode = false) {
|
|
7019
|
+
this.service = service;
|
|
6923
7020
|
this.entity = entity;
|
|
6924
7021
|
this.method = method;
|
|
7022
|
+
this.isLocalMode = isLocalMode;
|
|
6925
7023
|
const output = method.appDEMethodReturn;
|
|
6926
7024
|
if (output) {
|
|
6927
7025
|
const methodDto = findModelChild(
|
|
@@ -6929,19 +7027,16 @@ var MethodReturn = class {
|
|
|
6929
7027
|
output.appDEMethodDTOId
|
|
6930
7028
|
);
|
|
6931
7029
|
if (methodDto) {
|
|
6932
|
-
this.dto = new MethodDto(entity, this.isLocalMode, methodDto);
|
|
7030
|
+
this.dto = new MethodDto(service, entity, this.isLocalMode, methodDto);
|
|
6933
7031
|
}
|
|
6934
7032
|
}
|
|
6935
7033
|
}
|
|
6936
|
-
get isLocalMode() {
|
|
6937
|
-
return isLocalMode(this.method);
|
|
6938
|
-
}
|
|
6939
7034
|
/**
|
|
6940
7035
|
* 处理请求返回参数
|
|
6941
7036
|
*
|
|
6942
7037
|
* @author chitanda
|
|
6943
7038
|
* @date 2022-10-19 21:10:06
|
|
6944
|
-
* @param {
|
|
7039
|
+
* @param {IContext} context
|
|
6945
7040
|
* @param {IData} data
|
|
6946
7041
|
* @return {*} {Promise<IDataEntity>}
|
|
6947
7042
|
*/
|
|
@@ -6963,17 +7058,19 @@ var Method = class {
|
|
|
6963
7058
|
* Creates an instance of Method.
|
|
6964
7059
|
*
|
|
6965
7060
|
* @author chitanda
|
|
6966
|
-
* @date
|
|
7061
|
+
* @date 2023-12-22 12:12:06
|
|
7062
|
+
* @param {IAppDEService} service 当前服务实例
|
|
6967
7063
|
* @param {IAppDataEntity} entity
|
|
6968
7064
|
* @param {IAppDEMethod} method
|
|
6969
|
-
* @param {ServicePathItem[][]} paths
|
|
6970
7065
|
*/
|
|
6971
|
-
constructor(entity, method) {
|
|
7066
|
+
constructor(service, entity, method, isLocalMode = false) {
|
|
7067
|
+
this.service = service;
|
|
6972
7068
|
this.entity = entity;
|
|
6973
7069
|
this.method = method;
|
|
7070
|
+
this.isLocalMode = isLocalMode;
|
|
6974
7071
|
this.app = ibiz.hub.getApp(entity.appId);
|
|
6975
|
-
this.input = new MethodInput(entity, method);
|
|
6976
|
-
this.result = new MethodReturn(entity, method);
|
|
7072
|
+
this.input = new MethodInput(service, entity, method);
|
|
7073
|
+
this.result = new MethodReturn(service, entity, method);
|
|
6977
7074
|
}
|
|
6978
7075
|
/**
|
|
6979
7076
|
* 发送请求
|
|
@@ -6982,7 +7079,7 @@ var Method = class {
|
|
|
6982
7079
|
* @date 2022-10-10 17:10:44
|
|
6983
7080
|
* @protected
|
|
6984
7081
|
* @param {string} path
|
|
6985
|
-
* @param {
|
|
7082
|
+
* @param {IContext} context
|
|
6986
7083
|
* @param {IData} data
|
|
6987
7084
|
* @param {IParams} params
|
|
6988
7085
|
* @return {*} {Promise<HttpResponse<any>>}
|
|
@@ -7041,7 +7138,7 @@ var Method = class {
|
|
|
7041
7138
|
* @author chitanda
|
|
7042
7139
|
* @date 2022-08-24 18:08:46
|
|
7043
7140
|
* @protected
|
|
7044
|
-
* @param {
|
|
7141
|
+
* @param {IContext} context
|
|
7045
7142
|
* @return {*} {string} 拼接结果说明: /祖父实体/祖父实体主键/爷爷实体/爷爷实体主键/父实体/父实体主键/当前实体
|
|
7046
7143
|
*/
|
|
7047
7144
|
calcPath(context) {
|
|
@@ -7049,20 +7146,6 @@ var Method = class {
|
|
|
7049
7146
|
const resPath = calcResPath(context, this.entity);
|
|
7050
7147
|
return resPath + curPath;
|
|
7051
7148
|
}
|
|
7052
|
-
/**
|
|
7053
|
-
* 获取当前实体服务
|
|
7054
|
-
*
|
|
7055
|
-
* @author chitanda
|
|
7056
|
-
* @date 2022-10-11 21:10:12
|
|
7057
|
-
* @protected
|
|
7058
|
-
* @return {*} {Promise<IAppDEService>}
|
|
7059
|
-
*/
|
|
7060
|
-
async getService() {
|
|
7061
|
-
if (!this.service) {
|
|
7062
|
-
this.service = await this.app.deService.getService(this.entity.id);
|
|
7063
|
-
}
|
|
7064
|
-
return this.service;
|
|
7065
|
-
}
|
|
7066
7149
|
/**
|
|
7067
7150
|
* 创建实体
|
|
7068
7151
|
* @author lxm
|
|
@@ -7101,7 +7184,7 @@ var DELogicContext = class {
|
|
|
7101
7184
|
* @author lxm
|
|
7102
7185
|
* @date 2023-03-24 09:15:14
|
|
7103
7186
|
* @param {Map<string, DELogicParam>} deLogicParams 实体逻辑参数集合
|
|
7104
|
-
* @param {
|
|
7187
|
+
* @param {IContext} context 上下文
|
|
7105
7188
|
* @param {IData} data 数据对象
|
|
7106
7189
|
* @param {IParams} params 视图参数
|
|
7107
7190
|
*/
|
|
@@ -7271,7 +7354,7 @@ var DELogicLinkSingleCond = class extends DELogicLinkCond {
|
|
|
7271
7354
|
* @author lxm
|
|
7272
7355
|
* @date 2023-02-15 18:02:05
|
|
7273
7356
|
* @param {DELogicContext} ctx
|
|
7274
|
-
* @param {
|
|
7357
|
+
* @param {IContext} context
|
|
7275
7358
|
* @param {IData} data
|
|
7276
7359
|
* @return {*} {boolean}
|
|
7277
7360
|
*/
|
|
@@ -7346,7 +7429,7 @@ var DELogicLinkGroupCond = class _DELogicLinkGroupCond extends DELogicLinkCond {
|
|
|
7346
7429
|
* @author lxm
|
|
7347
7430
|
* @date 2023-02-15 17:02:19
|
|
7348
7431
|
* @param {DELogicContext} ctx
|
|
7349
|
-
* @param {
|
|
7432
|
+
* @param {IContext} context
|
|
7350
7433
|
* @param {IData} data
|
|
7351
7434
|
* @return {*} {boolean}
|
|
7352
7435
|
*/
|
|
@@ -7417,7 +7500,7 @@ var DELogicLink = class {
|
|
|
7417
7500
|
* @author lxm
|
|
7418
7501
|
* @date 2023-02-08 22:02:18
|
|
7419
7502
|
* @param {DELogicContext} ctx
|
|
7420
|
-
* @param {
|
|
7503
|
+
* @param {IContext} context
|
|
7421
7504
|
* @param {IData} data
|
|
7422
7505
|
* @return {*} {Promise<boolean>} 是否连接成功
|
|
7423
7506
|
*/
|
|
@@ -7879,7 +7962,7 @@ var DELogicParam = class {
|
|
|
7879
7962
|
* @author lxm
|
|
7880
7963
|
* @date 2023-02-08 20:02:33
|
|
7881
7964
|
* @param {DELogicContext} ctx
|
|
7882
|
-
* @param {
|
|
7965
|
+
* @param {IContext} context
|
|
7883
7966
|
* @param {IData} data
|
|
7884
7967
|
* @param {IParams} [opt]
|
|
7885
7968
|
*/
|
|
@@ -8050,7 +8133,7 @@ var DELogic = class {
|
|
|
8050
8133
|
* @date 2023-02-08 21:02:58
|
|
8051
8134
|
* @protected
|
|
8052
8135
|
* @param {DELogicContext} ctx
|
|
8053
|
-
* @param {
|
|
8136
|
+
* @param {IContext} context
|
|
8054
8137
|
* @param {IData} data
|
|
8055
8138
|
* @param {IParams} [opt]
|
|
8056
8139
|
*/
|
|
@@ -8067,7 +8150,7 @@ var DELogic = class {
|
|
|
8067
8150
|
*
|
|
8068
8151
|
* @author lxm
|
|
8069
8152
|
* @date 2023-02-08 21:02:09
|
|
8070
|
-
* @param {
|
|
8153
|
+
* @param {IContext} context
|
|
8071
8154
|
* @param {IData} data
|
|
8072
8155
|
* @param {IParams} [opt]
|
|
8073
8156
|
* @return {*} {Promise<IData>}
|
|
@@ -8187,23 +8270,11 @@ async function execFieldLogics(entity, type, context, data, params = {}) {
|
|
|
8187
8270
|
|
|
8188
8271
|
// src/service/service/entity/method/de-action.ts
|
|
8189
8272
|
var DEActionMethod = class extends Method {
|
|
8190
|
-
/**
|
|
8191
|
-
* 是否为本地模式
|
|
8192
|
-
*
|
|
8193
|
-
* @author chitanda
|
|
8194
|
-
* @date 2023-04-19 16:04:46
|
|
8195
|
-
* @readonly
|
|
8196
|
-
* @protected
|
|
8197
|
-
* @type {boolean}
|
|
8198
|
-
*/
|
|
8199
|
-
get isLocalMode() {
|
|
8200
|
-
return isLocalMode(this.method);
|
|
8201
|
-
}
|
|
8202
8273
|
/**
|
|
8203
8274
|
* 处理请求发送参数
|
|
8204
8275
|
* @author lxm
|
|
8205
8276
|
* @date 2023-10-19 02:50:36
|
|
8206
|
-
* @param {
|
|
8277
|
+
* @param {IContext} context 上下文
|
|
8207
8278
|
* @param {(IData | IData[])} data 数据对象
|
|
8208
8279
|
* @return {*} {(Promise<IData | IData[]>)}
|
|
8209
8280
|
*/
|
|
@@ -8292,7 +8363,7 @@ var DEActionMethod = class extends Method {
|
|
|
8292
8363
|
*
|
|
8293
8364
|
* @author chitanda
|
|
8294
8365
|
* @date 2022-08-24 20:08:01
|
|
8295
|
-
* @param {
|
|
8366
|
+
* @param {IContext} context
|
|
8296
8367
|
* @param {IData} data
|
|
8297
8368
|
* @return {*} {Promise<IHttpResponse<IData>>}
|
|
8298
8369
|
*/
|
|
@@ -8313,7 +8384,7 @@ var DEActionMethod = class extends Method {
|
|
|
8313
8384
|
*
|
|
8314
8385
|
* @author chitanda
|
|
8315
8386
|
* @date 2022-08-24 20:08:56
|
|
8316
|
-
* @param {
|
|
8387
|
+
* @param {IContext} context
|
|
8317
8388
|
* @param {IParams} [params]
|
|
8318
8389
|
* @return {*} {Promise<IHttpResponse<IDataEntity>>}
|
|
8319
8390
|
*/
|
|
@@ -8333,7 +8404,7 @@ var DEActionMethod = class extends Method {
|
|
|
8333
8404
|
*
|
|
8334
8405
|
* @author chitanda
|
|
8335
8406
|
* @date 2022-09-13 19:09:39
|
|
8336
|
-
* @param {
|
|
8407
|
+
* @param {IContext} context
|
|
8337
8408
|
* @param {(IData | IDataEntity)} data
|
|
8338
8409
|
* @param {IParams} [params={}]
|
|
8339
8410
|
* @return {*} {Promise<IHttpResponse<IDataEntity>>}
|
|
@@ -8359,7 +8430,7 @@ var DEActionMethod = class extends Method {
|
|
|
8359
8430
|
*
|
|
8360
8431
|
* @author chitanda
|
|
8361
8432
|
* @date 2022-08-24 20:08:07
|
|
8362
|
-
* @param {
|
|
8433
|
+
* @param {IContext} context
|
|
8363
8434
|
* @param {IParams} [params]
|
|
8364
8435
|
* @return {*} {Promise<IHttpResponse<IDataEntity>>}
|
|
8365
8436
|
*/
|
|
@@ -8380,7 +8451,7 @@ var DEActionMethod = class extends Method {
|
|
|
8380
8451
|
*
|
|
8381
8452
|
* @author chitanda
|
|
8382
8453
|
* @date 2022-08-24 20:08:26
|
|
8383
|
-
* @param {
|
|
8454
|
+
* @param {IContext} context
|
|
8384
8455
|
* @param {IParams} [params]
|
|
8385
8456
|
* @return {*} {Promise<IHttpResponse<IData>>}
|
|
8386
8457
|
*/
|
|
@@ -8398,21 +8469,20 @@ var DEActionMethod = class extends Method {
|
|
|
8398
8469
|
*
|
|
8399
8470
|
* @author chitanda
|
|
8400
8471
|
* @date 2022-08-21 17:08:45
|
|
8401
|
-
* @param {
|
|
8472
|
+
* @param {IContext} context
|
|
8402
8473
|
* @param {IData} entity
|
|
8403
8474
|
* @return {*} {Promise<IHttpResponse<IDataEntity>>}
|
|
8404
8475
|
*/
|
|
8405
8476
|
async createTemp(context, entity) {
|
|
8406
8477
|
try {
|
|
8407
|
-
const s = await this.getService();
|
|
8408
8478
|
const addData = this.createEntity(entity);
|
|
8409
8479
|
let resultData;
|
|
8410
8480
|
if (isArray7(addData)) {
|
|
8411
8481
|
resultData = await Promise.all(
|
|
8412
|
-
addData.map((item) =>
|
|
8482
|
+
addData.map((item) => this.service.local.add(context, item))
|
|
8413
8483
|
);
|
|
8414
8484
|
} else {
|
|
8415
|
-
resultData = await
|
|
8485
|
+
resultData = await this.service.local.add(context, addData);
|
|
8416
8486
|
}
|
|
8417
8487
|
return new HttpResponse3(resultData);
|
|
8418
8488
|
} catch (err) {
|
|
@@ -8424,7 +8494,7 @@ var DEActionMethod = class extends Method {
|
|
|
8424
8494
|
*
|
|
8425
8495
|
* @author chitanda
|
|
8426
8496
|
* @date 2022-08-21 17:08:56
|
|
8427
|
-
* @param {
|
|
8497
|
+
* @param {IContext} context
|
|
8428
8498
|
* @param {IParams} [params]
|
|
8429
8499
|
* @return {*} {Promise<IHttpResponse<IDataEntity>>}
|
|
8430
8500
|
*/
|
|
@@ -8444,7 +8514,7 @@ var DEActionMethod = class extends Method {
|
|
|
8444
8514
|
*
|
|
8445
8515
|
* @author chitanda
|
|
8446
8516
|
* @date 2022-08-21 17:08:11
|
|
8447
|
-
* @param {
|
|
8517
|
+
* @param {IContext} context
|
|
8448
8518
|
* @param {IParams} [params]
|
|
8449
8519
|
* @return {*} {Promise<IHttpResponse<IDataEntity>>}
|
|
8450
8520
|
*/
|
|
@@ -8456,8 +8526,7 @@ var DEActionMethod = class extends Method {
|
|
|
8456
8526
|
if (!key && context) {
|
|
8457
8527
|
key = context[this.entity.codeName.toLowerCase()];
|
|
8458
8528
|
}
|
|
8459
|
-
const
|
|
8460
|
-
const data = s.local.delete(context, key);
|
|
8529
|
+
const data = this.service.local.delete(context, key);
|
|
8461
8530
|
if (data) {
|
|
8462
8531
|
return new HttpResponse3(data);
|
|
8463
8532
|
}
|
|
@@ -8471,21 +8540,20 @@ var DEActionMethod = class extends Method {
|
|
|
8471
8540
|
*
|
|
8472
8541
|
* @author chitanda
|
|
8473
8542
|
* @date 2022-08-21 17:08:17
|
|
8474
|
-
* @param {
|
|
8543
|
+
* @param {IContext} context
|
|
8475
8544
|
* @param {IData} entity
|
|
8476
8545
|
* @return {*} {Promise<IHttpResponse<IDataEntity>>}
|
|
8477
8546
|
*/
|
|
8478
8547
|
async updateTemp(context, entity) {
|
|
8479
8548
|
try {
|
|
8480
|
-
const s = await this.getService();
|
|
8481
8549
|
const updateData = this.createEntity(entity);
|
|
8482
8550
|
let resultData;
|
|
8483
8551
|
if (isArray7(updateData)) {
|
|
8484
8552
|
resultData = await Promise.all(
|
|
8485
|
-
updateData.map((item) =>
|
|
8553
|
+
updateData.map((item) => this.service.local.update(context, item))
|
|
8486
8554
|
);
|
|
8487
8555
|
} else {
|
|
8488
|
-
resultData = await
|
|
8556
|
+
resultData = await this.service.local.update(context, updateData);
|
|
8489
8557
|
}
|
|
8490
8558
|
if (resultData) {
|
|
8491
8559
|
return new HttpResponse3(resultData);
|
|
@@ -8500,7 +8568,7 @@ var DEActionMethod = class extends Method {
|
|
|
8500
8568
|
*
|
|
8501
8569
|
* @author chitanda
|
|
8502
8570
|
* @date 2022-08-21 17:08:23
|
|
8503
|
-
* @param {
|
|
8571
|
+
* @param {IContext} context
|
|
8504
8572
|
* @param {IParams} [params]
|
|
8505
8573
|
* @return {*} {Promise<IHttpResponse<IDataEntity>>}
|
|
8506
8574
|
*/
|
|
@@ -8512,8 +8580,7 @@ var DEActionMethod = class extends Method {
|
|
|
8512
8580
|
if (!key && context) {
|
|
8513
8581
|
key = context[this.entity.codeName.toLowerCase()];
|
|
8514
8582
|
}
|
|
8515
|
-
const
|
|
8516
|
-
const data = s.local.get(context, key);
|
|
8583
|
+
const data = this.service.local.get(context, key);
|
|
8517
8584
|
if (data) {
|
|
8518
8585
|
return new HttpResponse3(data);
|
|
8519
8586
|
}
|
|
@@ -8525,7 +8592,7 @@ var DEActionMethod = class extends Method {
|
|
|
8525
8592
|
/**
|
|
8526
8593
|
* 批量删除本地数据
|
|
8527
8594
|
*
|
|
8528
|
-
* @param {
|
|
8595
|
+
* @param {IContext} context
|
|
8529
8596
|
* @param {IParams} [params]
|
|
8530
8597
|
* @return {*} {Promise<IHttpResponse>}
|
|
8531
8598
|
*/
|
|
@@ -8536,8 +8603,8 @@ var DEActionMethod = class extends Method {
|
|
|
8536
8603
|
|
|
8537
8604
|
// src/service/service/entity/method/provider/de-action-de-method.provider.ts
|
|
8538
8605
|
var DeActionDeMethodProvider = class {
|
|
8539
|
-
create(entity, method,
|
|
8540
|
-
return new DEActionMethod(entity, method);
|
|
8606
|
+
create(service, entity, method, opts) {
|
|
8607
|
+
return new DEActionMethod(service, entity, method, opts.localMode);
|
|
8541
8608
|
}
|
|
8542
8609
|
};
|
|
8543
8610
|
|
|
@@ -8548,12 +8615,9 @@ import {
|
|
|
8548
8615
|
RuntimeModelError as RuntimeModelError20
|
|
8549
8616
|
} from "@ibiz-template/core";
|
|
8550
8617
|
import { isArray as isArray8 } from "lodash-es";
|
|
8551
|
-
import { clone as clone13, isEmpty as
|
|
8618
|
+
import { clone as clone13, isEmpty as isEmpty7, isNil as isNil11 } from "ramda";
|
|
8552
8619
|
import { ascSort as ascSort2, descSort } from "qx-util";
|
|
8553
8620
|
var FetchMethod = class extends Method {
|
|
8554
|
-
get isLocalMode() {
|
|
8555
|
-
return isLocalMode(this.method);
|
|
8556
|
-
}
|
|
8557
8621
|
async exec(context, params, params2) {
|
|
8558
8622
|
const searchParams = params && !isArray8(params) ? params : params2 || {};
|
|
8559
8623
|
if (this.isLocalMode) {
|
|
@@ -8606,15 +8670,14 @@ var FetchMethod = class extends Method {
|
|
|
8606
8670
|
* @return {*} {Promise<IDataEntity[]>}
|
|
8607
8671
|
*/
|
|
8608
8672
|
async searchLocal(cond, filter, queryParamKeys = this.entity.quickSearchAppDEFieldIds) {
|
|
8609
|
-
const service = await this.getService();
|
|
8610
8673
|
let list = [];
|
|
8611
8674
|
if (cond) {
|
|
8612
|
-
list = service.local.getList(
|
|
8675
|
+
list = this.service.local.getList();
|
|
8613
8676
|
if (list.length > 0) {
|
|
8614
8677
|
list = list.filter((obj) => cond.test(obj, filter));
|
|
8615
8678
|
}
|
|
8616
8679
|
} else {
|
|
8617
|
-
list = await service.
|
|
8680
|
+
list = await this.service.local.select(filter.context, filter.data);
|
|
8618
8681
|
if (list.length > 0) {
|
|
8619
8682
|
if (filter.query && filter.query !== "") {
|
|
8620
8683
|
if (queryParamKeys) {
|
|
@@ -8633,7 +8696,7 @@ var FetchMethod = class extends Method {
|
|
|
8633
8696
|
}
|
|
8634
8697
|
}
|
|
8635
8698
|
}
|
|
8636
|
-
if (!isNil11(filter.sortField) && !
|
|
8699
|
+
if (!isNil11(filter.sortField) && !isEmpty7(filter.sortField)) {
|
|
8637
8700
|
if (filter.sortMode === "DESC") {
|
|
8638
8701
|
list = descSort(list, filter.sortField);
|
|
8639
8702
|
} else {
|
|
@@ -8650,7 +8713,7 @@ var FetchMethod = class extends Method {
|
|
|
8650
8713
|
* 获取代码表数据来源的集合
|
|
8651
8714
|
* @author lxm
|
|
8652
8715
|
* @date 2023-08-03 02:55:00
|
|
8653
|
-
* @param {
|
|
8716
|
+
* @param {IContext} context
|
|
8654
8717
|
* @param {IParams} params
|
|
8655
8718
|
* @return {*} {Promise<HttpResponse<IData[]>>}
|
|
8656
8719
|
*/
|
|
@@ -8682,11 +8745,11 @@ var AcFetchMethod = class extends FetchMethod {
|
|
|
8682
8745
|
|
|
8683
8746
|
// src/service/service/entity/method/provider/fetch-de-method.provider.ts
|
|
8684
8747
|
var FetchDeMethodProvider = class {
|
|
8685
|
-
create(entity, method, opts) {
|
|
8748
|
+
create(service, entity, method, opts) {
|
|
8686
8749
|
if (opts.acMode) {
|
|
8687
|
-
return new AcFetchMethod(entity, method);
|
|
8750
|
+
return new AcFetchMethod(service, entity, method, opts.localMode);
|
|
8688
8751
|
}
|
|
8689
|
-
return new FetchMethod(entity, method);
|
|
8752
|
+
return new FetchMethod(service, entity, method, opts.localMode);
|
|
8690
8753
|
}
|
|
8691
8754
|
};
|
|
8692
8755
|
|
|
@@ -8700,10 +8763,10 @@ function presetDEMethodProvider() {
|
|
|
8700
8763
|
}
|
|
8701
8764
|
|
|
8702
8765
|
// src/service/vo/tree-node-data/tree-node-data.ts
|
|
8703
|
-
import { createUUID as
|
|
8766
|
+
import { createUUID as createUUID5 } from "qx-util";
|
|
8704
8767
|
var TreeNodeData = class {
|
|
8705
8768
|
constructor(model, parentNodeData, opts) {
|
|
8706
|
-
this._uuid =
|
|
8769
|
+
this._uuid = createUUID5();
|
|
8707
8770
|
this.leaf = false;
|
|
8708
8771
|
this.leaf = opts.leaf === true;
|
|
8709
8772
|
this.parent = parentNodeData;
|
|
@@ -9165,7 +9228,7 @@ var PanelData = class {
|
|
|
9165
9228
|
};
|
|
9166
9229
|
|
|
9167
9230
|
// src/service/vo/chart-data/chart-data.ts
|
|
9168
|
-
import { createUUID as
|
|
9231
|
+
import { createUUID as createUUID6 } from "qx-util";
|
|
9169
9232
|
function updateKeyDefine3(target, keys) {
|
|
9170
9233
|
keys.forEach((key) => {
|
|
9171
9234
|
if (!Object.prototype.hasOwnProperty.call(target, key)) {
|
|
@@ -9183,7 +9246,7 @@ var ChartData = class {
|
|
|
9183
9246
|
this._seriesModelId = seriesModel == null ? void 0 : seriesModel.id;
|
|
9184
9247
|
this._catalog = catalog;
|
|
9185
9248
|
this._groupName = groupName;
|
|
9186
|
-
this._uuid =
|
|
9249
|
+
this._uuid = createUUID6();
|
|
9187
9250
|
return new Proxy(this, {
|
|
9188
9251
|
set(target, p, value) {
|
|
9189
9252
|
if (Object.prototype.hasOwnProperty.call(deData, p)) {
|
|
@@ -9342,7 +9405,7 @@ var GanttCodeListNodeData = class extends TreeCodeListNodeData {
|
|
|
9342
9405
|
};
|
|
9343
9406
|
|
|
9344
9407
|
// src/service/mqtt/mqtt.service.ts
|
|
9345
|
-
import { QXEvent as QXEvent3, createUUID as
|
|
9408
|
+
import { QXEvent as QXEvent3, createUUID as createUUID7, isNilOrEmpty as isNilOrEmpty6 } from "qx-util";
|
|
9346
9409
|
var MqttService = class {
|
|
9347
9410
|
/**
|
|
9348
9411
|
* Creates an instance of MqttService.
|
|
@@ -9376,7 +9439,7 @@ var MqttService = class {
|
|
|
9376
9439
|
// 超时时间
|
|
9377
9440
|
connectTimeout: 6e3,
|
|
9378
9441
|
// 认证信息
|
|
9379
|
-
clientId:
|
|
9442
|
+
clientId: createUUID7(),
|
|
9380
9443
|
username: "",
|
|
9381
9444
|
password: "",
|
|
9382
9445
|
// 心跳时间
|
|
@@ -9452,7 +9515,7 @@ var DEServiceUtil = class {
|
|
|
9452
9515
|
* @author chitanda
|
|
9453
9516
|
* @date 2022-08-17 23:08:36
|
|
9454
9517
|
* @protected
|
|
9455
|
-
* @type {Map<string, IAppDEService
|
|
9518
|
+
* @type {Map<string, Map<string, IAppDEService>>} Map<域标识, Map<实体标识, 实体服务>>
|
|
9456
9519
|
*/
|
|
9457
9520
|
this.cache = /* @__PURE__ */ new Map();
|
|
9458
9521
|
/**
|
|
@@ -9468,8 +9531,8 @@ var DEServiceUtil = class {
|
|
|
9468
9531
|
*
|
|
9469
9532
|
* @author chitanda
|
|
9470
9533
|
* @date 2023-06-14 10:06:31
|
|
9471
|
-
* @param {string} id
|
|
9472
|
-
* @param {
|
|
9534
|
+
* @param {string} id 实体标识
|
|
9535
|
+
* @param {DEServiceConstructor} constructor
|
|
9473
9536
|
*/
|
|
9474
9537
|
register(id, constructor) {
|
|
9475
9538
|
this.constructorCache.set(id, constructor);
|
|
@@ -9478,13 +9541,18 @@ var DEServiceUtil = class {
|
|
|
9478
9541
|
* 根据实体标识获取实体服务
|
|
9479
9542
|
*
|
|
9480
9543
|
* @author chitanda
|
|
9481
|
-
* @date
|
|
9544
|
+
* @date 2023-12-22 10:12:47
|
|
9545
|
+
* @param {IContext} context 上下文,用于计算模型所属沙箱环境
|
|
9482
9546
|
* @param {string} id 实体标识
|
|
9483
|
-
* @param {IParams} [context] 上下文,用于计算模型所属沙箱环境
|
|
9484
9547
|
* @return {*} {Promise<IAppDEService>}
|
|
9485
9548
|
*/
|
|
9486
|
-
async getService(id) {
|
|
9487
|
-
|
|
9549
|
+
async getService(context, id) {
|
|
9550
|
+
const sandboxId = context.srfsessionid;
|
|
9551
|
+
if (!this.cache.has(sandboxId)) {
|
|
9552
|
+
this.cache.set(sandboxId, /* @__PURE__ */ new Map());
|
|
9553
|
+
}
|
|
9554
|
+
const map = this.cache.get(sandboxId);
|
|
9555
|
+
if (!map.has(id)) {
|
|
9488
9556
|
const entityModel = await ibiz.hub.getAppDataEntity(
|
|
9489
9557
|
id,
|
|
9490
9558
|
this.appModel.appId
|
|
@@ -9495,13 +9563,32 @@ var DEServiceUtil = class {
|
|
|
9495
9563
|
const constructor = this.constructorCache.get(id);
|
|
9496
9564
|
let service;
|
|
9497
9565
|
if (constructor) {
|
|
9498
|
-
service = await constructor(entityModel);
|
|
9566
|
+
service = await constructor(sandboxId, entityModel);
|
|
9499
9567
|
} else {
|
|
9500
|
-
service = new DEService(entityModel);
|
|
9568
|
+
service = new DEService(sandboxId, entityModel);
|
|
9501
9569
|
}
|
|
9502
|
-
|
|
9570
|
+
map.set(id, service);
|
|
9503
9571
|
}
|
|
9504
|
-
return
|
|
9572
|
+
return map.get(id);
|
|
9573
|
+
}
|
|
9574
|
+
/**
|
|
9575
|
+
* 重置服务, 删除指定域下的所有服务缓存
|
|
9576
|
+
*
|
|
9577
|
+
* @author chitanda
|
|
9578
|
+
* @date 2023-12-22 13:12:47
|
|
9579
|
+
* @param {IContext} context
|
|
9580
|
+
* @return {*} {void}
|
|
9581
|
+
*/
|
|
9582
|
+
reset(context) {
|
|
9583
|
+
const sandboxId = context.srfsessionid;
|
|
9584
|
+
if (!this.cache.has(sandboxId)) {
|
|
9585
|
+
return;
|
|
9586
|
+
}
|
|
9587
|
+
const map = this.cache.get(sandboxId);
|
|
9588
|
+
map.forEach((service) => {
|
|
9589
|
+
service.destroy();
|
|
9590
|
+
});
|
|
9591
|
+
this.cache.delete(sandboxId);
|
|
9505
9592
|
}
|
|
9506
9593
|
/**
|
|
9507
9594
|
* 清理所有服务, 当前临时域下的所有临时数据缓存
|
|
@@ -9509,11 +9596,16 @@ var DEServiceUtil = class {
|
|
|
9509
9596
|
* @description 根据 srfsessionid 作为临时数据域
|
|
9510
9597
|
* @author chitanda
|
|
9511
9598
|
* @date 2022-08-18 14:08:48
|
|
9512
|
-
* @param {
|
|
9599
|
+
* @param {IContext} context
|
|
9513
9600
|
*/
|
|
9514
9601
|
clearTempCache(context) {
|
|
9515
|
-
|
|
9516
|
-
|
|
9602
|
+
const sandboxId = context.srfsessionid;
|
|
9603
|
+
if (!this.cache.has(sandboxId)) {
|
|
9604
|
+
return;
|
|
9605
|
+
}
|
|
9606
|
+
const map = this.cache.get(sandboxId);
|
|
9607
|
+
map.forEach((service) => {
|
|
9608
|
+
service.local.clear();
|
|
9517
9609
|
});
|
|
9518
9610
|
}
|
|
9519
9611
|
/**
|
|
@@ -9522,13 +9614,13 @@ var DEServiceUtil = class {
|
|
|
9522
9614
|
* @date 2023-04-26 02:02:43
|
|
9523
9615
|
* @param {string} appDataEntityId 实体名称
|
|
9524
9616
|
* @param {string} methodName 方法名
|
|
9525
|
-
* @param {
|
|
9617
|
+
* @param {IContext} context 上下文
|
|
9526
9618
|
* @param {(IData | undefined)} [params] 数据
|
|
9527
9619
|
* @param {(IParams | undefined)} [params2] 视图参数
|
|
9528
9620
|
* @return {*} {Promise<IHttpResponse<IData>>}
|
|
9529
9621
|
*/
|
|
9530
9622
|
async exec(appDataEntityId, methodName, context, params, params2) {
|
|
9531
|
-
const service = await this.getService(appDataEntityId);
|
|
9623
|
+
const service = await this.getService(context, appDataEntityId);
|
|
9532
9624
|
return service.exec(methodName, context, params, params2);
|
|
9533
9625
|
}
|
|
9534
9626
|
};
|
|
@@ -10105,9 +10197,9 @@ var PanelNotifyState = /* @__PURE__ */ ((PanelNotifyState2) => {
|
|
|
10105
10197
|
})(PanelNotifyState || {});
|
|
10106
10198
|
|
|
10107
10199
|
// src/controller/common/view/view.controller.ts
|
|
10108
|
-
import {
|
|
10200
|
+
import { notNilEmpty as notNilEmpty6 } from "qx-util";
|
|
10109
10201
|
import { IBizContext as IBizContext2, RuntimeError as RuntimeError31 } from "@ibiz-template/core";
|
|
10110
|
-
import { isEmpty as
|
|
10202
|
+
import { isEmpty as isEmpty8, isNil as isNil18, isNotNil as isNotNil2 } from "ramda";
|
|
10111
10203
|
|
|
10112
10204
|
// src/controller/utils/loading/loading.state.ts
|
|
10113
10205
|
import { NOOP } from "@ibiz-template/core";
|
|
@@ -10382,6 +10474,9 @@ var CTX = class {
|
|
|
10382
10474
|
}
|
|
10383
10475
|
};
|
|
10384
10476
|
|
|
10477
|
+
// src/controller/common/base.controller.ts
|
|
10478
|
+
import { createUUID as createUUID9 } from "qx-util";
|
|
10479
|
+
|
|
10385
10480
|
// src/controller/utils/counter/mounted-counter.ts
|
|
10386
10481
|
var ActivityCounter = class extends Counter {
|
|
10387
10482
|
constructor() {
|
|
@@ -10922,7 +11017,7 @@ var ValueExUtil = class {
|
|
|
10922
11017
|
// src/controller/utils/value-default/value-default.ts
|
|
10923
11018
|
import { RuntimeError as RuntimeError28, ModelError as ModelError16 } from "@ibiz-template/core";
|
|
10924
11019
|
import dayjs from "dayjs";
|
|
10925
|
-
import { createUUID as
|
|
11020
|
+
import { createUUID as createUUID8 } from "qx-util";
|
|
10926
11021
|
import { isNil as isNil16, isNotNil } from "ramda";
|
|
10927
11022
|
function getDefaultValue(opts, origins) {
|
|
10928
11023
|
var _a;
|
|
@@ -10967,7 +11062,7 @@ function getDefaultValue(opts, origins) {
|
|
|
10967
11062
|
case "CONTEXT":
|
|
10968
11063
|
return params[defaultValue];
|
|
10969
11064
|
case "UNIQUEID":
|
|
10970
|
-
return
|
|
11065
|
+
return createUUID8();
|
|
10971
11066
|
default:
|
|
10972
11067
|
throw new ModelError16({}, "\u9ED8\u8BA4\u503C\u7C7B\u578B[".concat(valueType, "]\u672A\u652F\u6301"));
|
|
10973
11068
|
}
|
|
@@ -11066,6 +11161,7 @@ var BaseController = class {
|
|
|
11066
11161
|
this.context = context;
|
|
11067
11162
|
this.params = params;
|
|
11068
11163
|
this.ctx = ctx;
|
|
11164
|
+
this.id = createUUID9();
|
|
11069
11165
|
this.state = {};
|
|
11070
11166
|
/**
|
|
11071
11167
|
* 控制器名称,作为检索控制器的唯一标识
|
|
@@ -11684,11 +11780,14 @@ var ViewController = class extends BaseController {
|
|
|
11684
11780
|
await Promise.all(this.engines.map((engine) => engine.onDestroyed()));
|
|
11685
11781
|
}
|
|
11686
11782
|
this.ctx.destroy();
|
|
11687
|
-
this.context.destroy();
|
|
11688
11783
|
this.engines = [];
|
|
11689
11784
|
if (this.scheduler) {
|
|
11690
11785
|
this.scheduler.destroy();
|
|
11691
11786
|
}
|
|
11787
|
+
if (this.id === this.context.srfsessionid) {
|
|
11788
|
+
ibiz.uiDomainManager.destroy(this.context.srfsessionid);
|
|
11789
|
+
}
|
|
11790
|
+
this.context.destroy();
|
|
11692
11791
|
ibiz.log.debug("\u89C6\u56FE[".concat(this.model.name, "](").concat(this.model.id, ")\u9500\u6BC1"));
|
|
11693
11792
|
}
|
|
11694
11793
|
/**
|
|
@@ -11700,8 +11799,9 @@ var ViewController = class extends BaseController {
|
|
|
11700
11799
|
*/
|
|
11701
11800
|
handleContextParams() {
|
|
11702
11801
|
this.context.srfappid = this.model.appId;
|
|
11703
|
-
if (isNil18(this.context.srfsessionid) ||
|
|
11704
|
-
|
|
11802
|
+
if (isNil18(this.context.srfsessionid) || isEmpty8(this.context.srfsessionid)) {
|
|
11803
|
+
const domain = ibiz.uiDomainManager.create(this.id);
|
|
11804
|
+
this.context.srfsessionid = domain.id;
|
|
11705
11805
|
}
|
|
11706
11806
|
const navContexts = this.model.appViewNavContexts;
|
|
11707
11807
|
let context = {};
|
|
@@ -11857,9 +11957,11 @@ var WFStepTraceViewController = class extends ViewController {
|
|
|
11857
11957
|
var _a;
|
|
11858
11958
|
await super.onCreated();
|
|
11859
11959
|
const app = ibiz.hub.getApp(this.context.srfappid);
|
|
11860
|
-
|
|
11960
|
+
const view = (_a = this.ctx.parent) == null ? void 0 : _a.view;
|
|
11961
|
+
if (view && view.model.appDataEntityId) {
|
|
11861
11962
|
const entityService = await app.deService.getService(
|
|
11862
|
-
|
|
11963
|
+
view.context,
|
|
11964
|
+
view.model.appDataEntityId
|
|
11863
11965
|
);
|
|
11864
11966
|
const params = Object.assign(this.context.clone(), this.params);
|
|
11865
11967
|
const res = await entityService.wf.getWFHistory(params);
|
|
@@ -12947,7 +13049,7 @@ var CalendarService = class extends MDControlService {
|
|
|
12947
13049
|
*
|
|
12948
13050
|
* @author zk
|
|
12949
13051
|
* @date 2023-08-08 10:08:47
|
|
12950
|
-
* @param {
|
|
13052
|
+
* @param {IContext} context
|
|
12951
13053
|
* @param {IParams} [params={}]
|
|
12952
13054
|
* @return {*} Promise<ICalendarItemData[]>
|
|
12953
13055
|
* @memberof CalendarService
|
|
@@ -13006,7 +13108,7 @@ var CalendarService = class extends MDControlService {
|
|
|
13006
13108
|
* @author zk
|
|
13007
13109
|
* @date 2023-08-08 06:08:49
|
|
13008
13110
|
* @param {string} methodName
|
|
13009
|
-
* @param {
|
|
13111
|
+
* @param {IContext} context
|
|
13010
13112
|
* @param {IData} [data={}]
|
|
13011
13113
|
* @param {IParams} [params={}]
|
|
13012
13114
|
* @param {string} [appDataEntityId=this.model.appDataEntityId!]
|
|
@@ -15466,7 +15568,7 @@ var UILogicParam = class {
|
|
|
15466
15568
|
const m = this.model;
|
|
15467
15569
|
const { parameters } = ctx;
|
|
15468
15570
|
const { context, params, data } = parameters;
|
|
15469
|
-
const app = ibiz.hub.getApp(
|
|
15571
|
+
const app = ibiz.hub.getApp(m.appId);
|
|
15470
15572
|
if (m.codeName === "layoutPanel") {
|
|
15471
15573
|
ctx.params[tag] = parameters.view.layoutPanel.panelItems;
|
|
15472
15574
|
return;
|
|
@@ -18543,7 +18645,7 @@ var FormService = class extends ControlService {
|
|
|
18543
18645
|
* @author lxm
|
|
18544
18646
|
* @date 2023-12-13 03:16:19
|
|
18545
18647
|
* @param {IData} data 表单数据
|
|
18546
|
-
* @param {
|
|
18648
|
+
* @param {IContext} context 上下文
|
|
18547
18649
|
* @param {IParams} params 视图参数
|
|
18548
18650
|
* @param {('create' | 'update')} type 新建还是更新
|
|
18549
18651
|
*/
|
|
@@ -18584,7 +18686,7 @@ var SearchFormService = class extends FormService {
|
|
|
18584
18686
|
*
|
|
18585
18687
|
* @author lxm
|
|
18586
18688
|
* @date 2022-08-31 17:08:41
|
|
18587
|
-
* @param {
|
|
18689
|
+
* @param {IContext} context 上下文
|
|
18588
18690
|
* @param {IParams} [params={}] 视图参数
|
|
18589
18691
|
* @returns {*} {Promise<IHttpResponse>}
|
|
18590
18692
|
*/
|
|
@@ -19354,7 +19456,7 @@ var FormButtonController = class extends FormDetailController {
|
|
|
19354
19456
|
|
|
19355
19457
|
// src/controller/control/form/form-detail/form-druipart/form-druipart.controller.ts
|
|
19356
19458
|
import { isOverlap as isOverlap2 } from "@ibiz-template/core";
|
|
19357
|
-
import { createUUID as
|
|
19459
|
+
import { createUUID as createUUID10, notNilEmpty as notNilEmpty8 } from "qx-util";
|
|
19358
19460
|
|
|
19359
19461
|
// src/controller/control/form/form-detail/form-druipart/form-druipart.state.ts
|
|
19360
19462
|
var FormDruipartState = class extends FormDetailState {
|
|
@@ -19467,7 +19569,7 @@ var FormDRUIPartController = class extends FormDetailController {
|
|
|
19467
19569
|
this.form.context
|
|
19468
19570
|
);
|
|
19469
19571
|
if (!this.state.viewComponentKey) {
|
|
19470
|
-
this.state.viewComponentKey =
|
|
19572
|
+
this.state.viewComponentKey = createUUID10();
|
|
19471
19573
|
this.navContext = newContext;
|
|
19472
19574
|
this.navParams = newParams;
|
|
19473
19575
|
} else if (JSON.stringify(this.navContext) !== JSON.stringify(newContext) || JSON.stringify(this.navParams) !== JSON.stringify(newParams)) {
|
|
@@ -20194,7 +20296,7 @@ var FormMDCtrlMDController = class extends FormMDCtrlController {
|
|
|
20194
20296
|
|
|
20195
20297
|
// src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.ts
|
|
20196
20298
|
import { RuntimeError as RuntimeError50, RuntimeModelError as RuntimeModelError54 } from "@ibiz-template/core";
|
|
20197
|
-
import { createUUID as
|
|
20299
|
+
import { createUUID as createUUID11 } from "qx-util";
|
|
20198
20300
|
|
|
20199
20301
|
// src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.state.ts
|
|
20200
20302
|
var FormMDCtrlFormState = class extends FormDetailState {
|
|
@@ -20330,7 +20432,7 @@ var FormMDCtrlFormController = class extends FormMDCtrlController {
|
|
|
20330
20432
|
this.state.items = [];
|
|
20331
20433
|
}
|
|
20332
20434
|
const item = {
|
|
20333
|
-
id:
|
|
20435
|
+
id: createUUID11(),
|
|
20334
20436
|
context,
|
|
20335
20437
|
params
|
|
20336
20438
|
};
|
|
@@ -20581,7 +20683,7 @@ import {
|
|
|
20581
20683
|
RuntimeError as RuntimeError51
|
|
20582
20684
|
} from "@ibiz-template/core";
|
|
20583
20685
|
import { debounce as debounce2 } from "lodash-es";
|
|
20584
|
-
import { createUUID as
|
|
20686
|
+
import { createUUID as createUUID12 } from "qx-util";
|
|
20585
20687
|
import { clone as clone21 } from "ramda";
|
|
20586
20688
|
|
|
20587
20689
|
// src/controller/control/form/edit-form/edit-form.service.ts
|
|
@@ -20595,7 +20697,7 @@ var EditFormService = class extends FormService {
|
|
|
20595
20697
|
*
|
|
20596
20698
|
* @author lxm
|
|
20597
20699
|
* @date 2022-08-31 17:08:41
|
|
20598
|
-
* @param {
|
|
20700
|
+
* @param {IContext} context 上下文
|
|
20599
20701
|
* @param {IParams} [params={}] 视图参数
|
|
20600
20702
|
* @returns {*} {Promise<IHttpResponse>}
|
|
20601
20703
|
*/
|
|
@@ -20618,7 +20720,7 @@ var EditFormService = class extends FormService {
|
|
|
20618
20720
|
*
|
|
20619
20721
|
* @author lxm
|
|
20620
20722
|
* @date 2022-08-31 17:08:41
|
|
20621
|
-
* @param {
|
|
20723
|
+
* @param {IContext} context 上下文
|
|
20622
20724
|
* @param {IParams} [params={}] 视图参数
|
|
20623
20725
|
* @returns {*} {Promise<IHttpResponse>}
|
|
20624
20726
|
*/
|
|
@@ -20641,7 +20743,7 @@ var EditFormService = class extends FormService {
|
|
|
20641
20743
|
*
|
|
20642
20744
|
* @author lxm
|
|
20643
20745
|
* @date 2022-09-07 19:09:48
|
|
20644
|
-
* @param {
|
|
20746
|
+
* @param {IContext} context 上下文
|
|
20645
20747
|
* @param {IParams} [params={}] 视图参数
|
|
20646
20748
|
* @returns {*}
|
|
20647
20749
|
*/
|
|
@@ -20660,7 +20762,7 @@ var EditFormService = class extends FormService {
|
|
|
20660
20762
|
*
|
|
20661
20763
|
* @author lxm
|
|
20662
20764
|
* @date 2022-09-07 19:09:11
|
|
20663
|
-
* @param {
|
|
20765
|
+
* @param {IContext} context 上下文
|
|
20664
20766
|
* @param {IData} data 数据
|
|
20665
20767
|
* @returns {*}
|
|
20666
20768
|
*/
|
|
@@ -20681,7 +20783,7 @@ var EditFormService = class extends FormService {
|
|
|
20681
20783
|
*
|
|
20682
20784
|
* @author lxm
|
|
20683
20785
|
* @date 2022-09-07 19:09:11
|
|
20684
|
-
* @param {
|
|
20786
|
+
* @param {IContext} context 上下文
|
|
20685
20787
|
* @param {IData} data 数据
|
|
20686
20788
|
* @returns {*}
|
|
20687
20789
|
*/
|
|
@@ -20702,7 +20804,7 @@ var EditFormService = class extends FormService {
|
|
|
20702
20804
|
*
|
|
20703
20805
|
* @author lxm
|
|
20704
20806
|
* @date 2022-09-07 19:09:11
|
|
20705
|
-
* @param {
|
|
20807
|
+
* @param {IContext} context 上下文
|
|
20706
20808
|
* @param {IData} data 数据
|
|
20707
20809
|
* @returns {*}
|
|
20708
20810
|
*/
|
|
@@ -20727,7 +20829,7 @@ var EditFormService = class extends FormService {
|
|
|
20727
20829
|
* @author lxm
|
|
20728
20830
|
* @date 2022-09-15 21:09:34
|
|
20729
20831
|
* @param {string} methodName
|
|
20730
|
-
* @param {
|
|
20832
|
+
* @param {IContext} context
|
|
20731
20833
|
* @param {IParams} [params={}]
|
|
20732
20834
|
* @returns {*} {Promise<IHttpResponse<ControlVO>>}
|
|
20733
20835
|
*/
|
|
@@ -20741,7 +20843,7 @@ var EditFormService = class extends FormService {
|
|
|
20741
20843
|
*
|
|
20742
20844
|
* @author lxm
|
|
20743
20845
|
* @date 2022-09-07 19:09:11
|
|
20744
|
-
* @param {
|
|
20846
|
+
* @param {IContext} context 上下文
|
|
20745
20847
|
* @param {IData} data 数据
|
|
20746
20848
|
* @param {IParams} [params={}] 视图参数
|
|
20747
20849
|
* @returns {*}
|
|
@@ -20751,6 +20853,7 @@ var EditFormService = class extends FormService {
|
|
|
20751
20853
|
const wfForm = this.model;
|
|
20752
20854
|
const methodName = ((_a = wfForm.wfstartControlAction) == null ? void 0 : _a.appDEMethodId) || "wfstart";
|
|
20753
20855
|
const entityService = await this.app.deService.getService(
|
|
20856
|
+
context,
|
|
20754
20857
|
this.model.appDataEntityId
|
|
20755
20858
|
);
|
|
20756
20859
|
return entityService.wf.exec(
|
|
@@ -20765,7 +20868,7 @@ var EditFormService = class extends FormService {
|
|
|
20765
20868
|
*
|
|
20766
20869
|
* @author lxm
|
|
20767
20870
|
* @date 2022-09-07 19:09:11
|
|
20768
|
-
* @param {
|
|
20871
|
+
* @param {IContext} context 上下文
|
|
20769
20872
|
* @param {IData} data 数据
|
|
20770
20873
|
* @param {IParams} [params={}] 视图参数
|
|
20771
20874
|
* @returns {*}
|
|
@@ -20780,6 +20883,7 @@ var EditFormService = class extends FormService {
|
|
|
20780
20883
|
methodName = ((_a = wfForm.wfsubmitControlAction) == null ? void 0 : _a.appDEMethodId) || "wfsubmit";
|
|
20781
20884
|
}
|
|
20782
20885
|
const entityService = await this.app.deService.getService(
|
|
20886
|
+
context,
|
|
20783
20887
|
this.model.appDataEntityId
|
|
20784
20888
|
);
|
|
20785
20889
|
return entityService.wf.exec(
|
|
@@ -20962,7 +21066,7 @@ var EditFormController = class extends FormController {
|
|
|
20962
21066
|
await this.endLoading();
|
|
20963
21067
|
}
|
|
20964
21068
|
res.data.srfkey = void 0;
|
|
20965
|
-
res.data.tempsrfkey =
|
|
21069
|
+
res.data.tempsrfkey = createUUID12();
|
|
20966
21070
|
this.state.modified = false;
|
|
20967
21071
|
this.state.data = res.data;
|
|
20968
21072
|
this.formStateNotify("LOAD" /* LOAD */);
|
|
@@ -21579,12 +21683,13 @@ var GridService = class extends MDControlService {
|
|
|
21579
21683
|
* @author lxm
|
|
21580
21684
|
* @date 2022-09-15 21:09:34
|
|
21581
21685
|
* @param {string} methodName
|
|
21582
|
-
* @param {
|
|
21686
|
+
* @param {IContext} context
|
|
21583
21687
|
* @param {IParams} [params={}]
|
|
21584
21688
|
* @returns {*} {Promise<IHttpResponse<ControlVO>>}
|
|
21585
21689
|
*/
|
|
21586
21690
|
async updateGridEditItem(methodName, context, params = {}) {
|
|
21587
21691
|
const entityService = await this.app.deService.getService(
|
|
21692
|
+
context,
|
|
21588
21693
|
this.model.appDataEntityId
|
|
21589
21694
|
);
|
|
21590
21695
|
let res = await entityService.exec(methodName, context, params);
|
|
@@ -22331,7 +22436,8 @@ var GridController = class extends MDControlController {
|
|
|
22331
22436
|
if (item.codeListId) {
|
|
22332
22437
|
tempExportColumn.codeList = app.codeList.getCodeList(item.codeListId);
|
|
22333
22438
|
tempExportColumn.codeListItems = await app.codeList.get(
|
|
22334
|
-
item.codeListId
|
|
22439
|
+
item.codeListId,
|
|
22440
|
+
this.context
|
|
22335
22441
|
);
|
|
22336
22442
|
}
|
|
22337
22443
|
return tempExportColumn;
|
|
@@ -25523,7 +25629,7 @@ var WizardPanelService = class extends ControlService {
|
|
|
25523
25629
|
*
|
|
25524
25630
|
* @author lxm
|
|
25525
25631
|
* @date 2022-08-31 17:08:41
|
|
25526
|
-
* @param {
|
|
25632
|
+
* @param {IContext} context 上下文
|
|
25527
25633
|
* @param {IParams} [params={}] 视图参数
|
|
25528
25634
|
* @returns {*} {Promise<IHttpResponse>}
|
|
25529
25635
|
*/
|
|
@@ -25539,7 +25645,7 @@ var WizardPanelService = class extends ControlService {
|
|
|
25539
25645
|
*
|
|
25540
25646
|
* @author lxm
|
|
25541
25647
|
* @date 2022-08-31 17:08:41
|
|
25542
|
-
* @param {
|
|
25648
|
+
* @param {IContext} context 上下文
|
|
25543
25649
|
* @param {IParams} [params={}] 视图参数
|
|
25544
25650
|
* @returns {*} {Promise<IHttpResponse>}
|
|
25545
25651
|
*/
|
|
@@ -26199,7 +26305,7 @@ var KanbanService = class extends DataViewControlService {
|
|
|
26199
26305
|
*
|
|
26200
26306
|
* @author lxm
|
|
26201
26307
|
* @date 2022-09-07 19:09:11
|
|
26202
|
-
* @param {
|
|
26308
|
+
* @param {IContext} context 上下文
|
|
26203
26309
|
* @param {ControlVO} data 数据
|
|
26204
26310
|
* @returns {*}
|
|
26205
26311
|
*/
|
|
@@ -27079,7 +27185,7 @@ var TreeGridService = class extends GridService {
|
|
|
27079
27185
|
|
|
27080
27186
|
// src/controller/control/medit-view-panel/medit-view-panel.controller.ts
|
|
27081
27187
|
import { RuntimeError as RuntimeError58 } from "@ibiz-template/core";
|
|
27082
|
-
import { createUUID as
|
|
27188
|
+
import { createUUID as createUUID13 } from "qx-util";
|
|
27083
27189
|
|
|
27084
27190
|
// src/controller/control/medit-view-panel/medit-view-panel.service.ts
|
|
27085
27191
|
var MEditViewPanelService = class extends MDControlService {
|
|
@@ -27166,7 +27272,7 @@ var MEditViewPanelController = class extends MDControlController {
|
|
|
27166
27272
|
*/
|
|
27167
27273
|
handlePanelItemParams(arg) {
|
|
27168
27274
|
const [{ parameterName }] = this.parameters;
|
|
27169
|
-
const id = arg[parameterName] ? arg[parameterName] : "mockId:".concat(
|
|
27275
|
+
const id = arg[parameterName] ? arg[parameterName] : "mockId:".concat(createUUID13());
|
|
27170
27276
|
const item = {
|
|
27171
27277
|
id,
|
|
27172
27278
|
context: this.context.clone(),
|
|
@@ -27318,7 +27424,7 @@ var MapService = class extends MDControlService {
|
|
|
27318
27424
|
* 加载所有地图项的数据
|
|
27319
27425
|
* @author lxm
|
|
27320
27426
|
* @date 2023-10-30 06:27:32
|
|
27321
|
-
* @param {
|
|
27427
|
+
* @param {IContext} context
|
|
27322
27428
|
* @param {IParams} [params={}]
|
|
27323
27429
|
* @return {*} {Promise<IHttpResponse<IMapData[]>>}
|
|
27324
27430
|
*/
|
|
@@ -27499,7 +27605,7 @@ var ReportPanelService = class extends ControlService {
|
|
|
27499
27605
|
/**
|
|
27500
27606
|
* 执行查询报表数据的方法
|
|
27501
27607
|
*
|
|
27502
|
-
* @param {
|
|
27608
|
+
* @param {IContext} context 上下文
|
|
27503
27609
|
* @param {IParams} [params={}] 视图参数
|
|
27504
27610
|
* @returns {*} {Promise<IHttpResponse>}
|
|
27505
27611
|
*/
|
|
@@ -28851,6 +28957,19 @@ var AppHub = class {
|
|
|
28851
28957
|
}
|
|
28852
28958
|
return this.appMap.get(key);
|
|
28853
28959
|
}
|
|
28960
|
+
/**
|
|
28961
|
+
* 获取所有应用实例
|
|
28962
|
+
*
|
|
28963
|
+
* @author chitanda
|
|
28964
|
+
* @date 2023-12-22 16:12:28
|
|
28965
|
+
* @return {*} {IAppService[]}
|
|
28966
|
+
*/
|
|
28967
|
+
getAllApps() {
|
|
28968
|
+
if (this.appMap.size > 0) {
|
|
28969
|
+
return Array.from(this.appMap.values());
|
|
28970
|
+
}
|
|
28971
|
+
return [];
|
|
28972
|
+
}
|
|
28854
28973
|
};
|
|
28855
28974
|
|
|
28856
28975
|
// src/engine/engine-factory.ts
|
|
@@ -30655,6 +30774,7 @@ function install2() {
|
|
|
30655
30774
|
ibiz2.auth = new V7AuthService();
|
|
30656
30775
|
ibiz2.asyncAction = new AsyncActionService();
|
|
30657
30776
|
ibiz2.engine = new EngineFactory();
|
|
30777
|
+
ibiz2.uiDomainManager = new UIDomainManager();
|
|
30658
30778
|
installCommand();
|
|
30659
30779
|
presetUIActionProvider();
|
|
30660
30780
|
presetDEMethodProvider();
|
|
@@ -30938,6 +31058,8 @@ export {
|
|
|
30938
31058
|
UIActionButtonState,
|
|
30939
31059
|
UIActionProviderBase,
|
|
30940
31060
|
UIActionUtil,
|
|
31061
|
+
UIDomain,
|
|
31062
|
+
UIDomainManager,
|
|
30941
31063
|
UILOGINNODE_PROVIDER_PREFIX,
|
|
30942
31064
|
UIMapField,
|
|
30943
31065
|
V7AuthService,
|