@ibiz-template/runtime 0.1.29-dev.0 → 0.1.30
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 +866 -603
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/command/app/open-app-view/open-app-view.d.ts +1 -1
- package/out/command/app/open-app-view/open-app-view.d.ts.map +1 -1
- package/out/command/app/open-app-view/open-app-view.js +16 -5
- package/out/config/global-config.js +1 -1
- package/out/controller/common/control/control.controller.d.ts +18 -0
- package/out/controller/common/control/control.controller.d.ts.map +1 -1
- package/out/controller/common/control/control.controller.js +29 -1
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +2 -1
- package/out/controller/control/dashboard/dashboard.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/dashboard.controller.js +2 -6
- package/out/controller/control/dashboard/portlet/index.d.ts +1 -0
- package/out/controller/control/dashboard/portlet/index.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/index.js +1 -0
- package/out/controller/control/dashboard/portlet/menu-portlet/index.d.ts +2 -0
- package/out/controller/control/dashboard/portlet/menu-portlet/index.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/menu-portlet/index.js +1 -0
- package/out/controller/control/dashboard/portlet/menu-portlet/menu-portlet.controller.d.ts +5 -0
- package/out/controller/control/dashboard/portlet/menu-portlet/menu-portlet.controller.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/menu-portlet/menu-portlet.controller.js +3 -0
- package/out/controller/control/exp-bar/exp-bar.controller.d.ts +10 -0
- package/out/controller/control/exp-bar/exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/exp-bar.controller.js +29 -2
- package/out/controller/control/exp-bar/tree-exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/tree-exp-bar.controller.js +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts +11 -2
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.js +56 -2
- package/out/controller/control/form/edit-form/edit-form.service.js +1 -1
- package/out/controller/control/form/form/form.controller.d.ts.map +1 -1
- package/out/controller/control/form/form/form.controller.js +2 -6
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +5 -10
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts +10 -0
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts.map +1 -1
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.js +19 -0
- package/out/controller/control/toolbar/toolbar.controllerr.d.ts.map +1 -1
- package/out/controller/control/toolbar/toolbar.controllerr.js +8 -8
- package/out/controller/control/tree/tree.service.d.ts.map +1 -1
- package/out/controller/control/tree/tree.service.js +6 -11
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +5 -4
- package/out/global/global-util/global-util.d.ts +8 -0
- package/out/global/global-util/global-util.d.ts.map +1 -1
- package/out/global/global-util/global-util.js +8 -0
- package/out/interface/common/i-error-handler/i-error-handler.d.ts +17 -0
- package/out/interface/common/i-error-handler/i-error-handler.d.ts.map +1 -0
- package/out/interface/common/i-error-handler/i-error-handler.js +1 -0
- package/out/interface/common/i-global-config/i-global-view-config.d.ts +5 -3
- package/out/interface/common/i-global-config/i-global-view-config.d.ts.map +1 -1
- package/out/interface/common/index.d.ts +1 -0
- package/out/interface/common/index.d.ts.map +1 -1
- package/out/interface/controller/common/i-nav-view-msg/i-nav-view-msg.d.ts +9 -0
- package/out/interface/controller/common/i-nav-view-msg/i-nav-view-msg.d.ts.map +1 -1
- package/out/interface/controller/state/view/i-edit-view.state.d.ts +8 -0
- package/out/interface/controller/state/view/i-edit-view.state.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.js +10 -4
- package/out/logic-scheduler/trigger/item-dyna-logic-trigger.d.ts.map +1 -1
- package/out/logic-scheduler/trigger/item-dyna-logic-trigger.js +1 -4
- package/out/model/data-entity/data-entity.js +2 -2
- package/out/register/helper/control-register.d.ts.map +1 -1
- package/out/register/helper/control-register.js +6 -1
- package/out/service/app-data-entity/app-data-entity.d.ts.map +1 -1
- package/out/service/app-data-entity/app-data-entity.js +4 -0
- package/out/service/service/entity/method/method-renturn.d.ts.map +1 -1
- package/out/service/service/entity/method/method-renturn.js +4 -0
- package/out/ui-action/provider/ui-action-provider-base.js +1 -1
- package/out/utils/error-handler/default-error-handler.d.ts +13 -0
- package/out/utils/error-handler/default-error-handler.d.ts.map +1 -0
- package/out/utils/error-handler/default-error-handler.js +36 -0
- package/out/utils/error-handler/error-handler-center.d.ts +41 -0
- package/out/utils/error-handler/error-handler-center.d.ts.map +1 -0
- package/out/utils/error-handler/error-handler-center.js +59 -0
- package/out/utils/error-handler/index.d.ts +3 -0
- package/out/utils/error-handler/index.d.ts.map +1 -0
- package/out/utils/error-handler/index.js +2 -0
- package/out/utils/index.d.ts +1 -0
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +1 -0
- package/out/utils/promise/promise.d.ts +15 -0
- package/out/utils/promise/promise.d.ts.map +1 -0
- package/out/utils/promise/promise.js +38 -0
- package/package.json +2 -2
- package/src/command/app/open-app-view/open-app-view.ts +18 -5
- package/src/config/global-config.ts +1 -1
- package/src/controller/common/control/control.controller.ts +31 -2
- package/src/controller/common/control/md-control.controller.ts +2 -1
- package/src/controller/control/dashboard/dashboard.controller.ts +2 -6
- package/src/controller/control/dashboard/portlet/index.ts +1 -0
- package/src/controller/control/dashboard/portlet/menu-portlet/index.ts +1 -0
- package/src/controller/control/dashboard/portlet/menu-portlet/menu-portlet.controller.ts +4 -0
- package/src/controller/control/exp-bar/exp-bar.controller.ts +30 -2
- package/src/controller/control/exp-bar/tree-exp-bar.controller.ts +1 -0
- package/src/controller/control/form/edit-form/edit-form.controller.ts +71 -3
- package/src/controller/control/form/edit-form/edit-form.service.ts +1 -1
- package/src/controller/control/form/form/form.controller.ts +2 -6
- package/src/controller/control/grid/grid/grid.controller.ts +5 -9
- package/src/controller/control/tab-exp-panel/tab-exp-panel.controller.ts +20 -0
- package/src/controller/control/toolbar/toolbar.controllerr.ts +14 -8
- package/src/controller/control/tree/tree.service.ts +8 -9
- package/src/engine/md-view.engine.ts +6 -4
- package/src/global/global-util/global-util.ts +15 -0
- package/src/interface/common/i-error-handler/i-error-handler.ts +16 -0
- package/src/interface/common/i-global-config/i-global-view-config.ts +5 -3
- package/src/interface/common/index.ts +1 -0
- package/src/interface/controller/common/i-nav-view-msg/i-nav-view-msg.ts +10 -0
- package/src/interface/controller/state/view/i-edit-view.state.ts +10 -1
- package/src/logic-scheduler/executor/app-ui-logic-executor.ts +13 -4
- package/src/logic-scheduler/trigger/item-dyna-logic-trigger.ts +1 -4
- package/src/model/data-entity/data-entity.ts +2 -2
- package/src/register/helper/control-register.ts +6 -1
- package/src/service/app-data-entity/app-data-entity.ts +5 -0
- package/src/service/service/entity/method/method-renturn.ts +4 -0
- package/src/ui-action/provider/ui-action-provider-base.ts +1 -1
- package/src/utils/error-handler/default-error-handler.ts +40 -0
- package/src/utils/error-handler/error-handler-center.ts +61 -0
- package/src/utils/error-handler/index.ts +2 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/promise/promise.ts +41 -0
package/dist/index.esm.js
CHANGED
|
@@ -6159,7 +6159,7 @@ var GlobalConfig = class {
|
|
|
6159
6159
|
// 全局视图配置
|
|
6160
6160
|
this.view = {
|
|
6161
6161
|
enableDataInfoBar: true,
|
|
6162
|
-
|
|
6162
|
+
expCacheMode: "TABEXPPANEL:"
|
|
6163
6163
|
};
|
|
6164
6164
|
// 全局表格配置
|
|
6165
6165
|
this.grid = {
|
|
@@ -6225,7 +6225,7 @@ var RegisterCenter = class {
|
|
|
6225
6225
|
};
|
|
6226
6226
|
|
|
6227
6227
|
// src/command/app/app-func/app-func.ts
|
|
6228
|
-
import { ModelError as
|
|
6228
|
+
import { ModelError as ModelError15, RuntimeError as RuntimeError17 } from "@ibiz-template/core";
|
|
6229
6229
|
|
|
6230
6230
|
// src/utils/handlebars/utils/helper/helper.ts
|
|
6231
6231
|
var HelperUtil = class {
|
|
@@ -6772,7 +6772,7 @@ function calcNavParams(model, originParams) {
|
|
|
6772
6772
|
|
|
6773
6773
|
// src/utils/open-redirect-view/open-redirect-view.ts
|
|
6774
6774
|
import { RuntimeError, RuntimeModelError } from "@ibiz-template/core";
|
|
6775
|
-
import { isNilOrEmpty as isNilOrEmpty2, notNilEmpty as
|
|
6775
|
+
import { isNilOrEmpty as isNilOrEmpty2, notNilEmpty as notNilEmpty3 } from "qx-util";
|
|
6776
6776
|
import qs from "qs";
|
|
6777
6777
|
|
|
6778
6778
|
// src/model/utils/util.ts
|
|
@@ -6983,14 +6983,14 @@ function calcMainStateOPPrivsStrs(mainState, appDataEntity) {
|
|
|
6983
6983
|
}
|
|
6984
6984
|
|
|
6985
6985
|
// src/model/data-entity/data-entity.ts
|
|
6986
|
-
import {
|
|
6986
|
+
import { notNilEmpty as notNilEmpty2 } from "qx-util";
|
|
6987
6987
|
function calcDeCodeNameById(id) {
|
|
6988
6988
|
const arr = id.split(".");
|
|
6989
6989
|
return arr.pop();
|
|
6990
6990
|
}
|
|
6991
6991
|
function hasDeCodeName(params, entityId) {
|
|
6992
6992
|
const codeName = calcDeCodeNameById(entityId);
|
|
6993
|
-
return
|
|
6993
|
+
return notNilEmpty2(params[codeName]);
|
|
6994
6994
|
}
|
|
6995
6995
|
async function getDeACMode(appDEACModeId, entityId, srfappid) {
|
|
6996
6996
|
var _a;
|
|
@@ -7256,7 +7256,7 @@ async function calcDERdTag(entity, rdView, params, data) {
|
|
|
7256
7256
|
if (typeFieldId) {
|
|
7257
7257
|
const { codeName } = findFieldById(entity, typeFieldId);
|
|
7258
7258
|
const value = data[codeName.toLowerCase()];
|
|
7259
|
-
if (
|
|
7259
|
+
if (notNilEmpty3(value)) {
|
|
7260
7260
|
return "".concat(value);
|
|
7261
7261
|
}
|
|
7262
7262
|
ibiz.log.warn(
|
|
@@ -7266,8 +7266,8 @@ async function calcDERdTag(entity, rdView, params, data) {
|
|
|
7266
7266
|
}
|
|
7267
7267
|
const defView = "".concat(ibiz.env.isMob ? "MOB" : "", "EDITVIEW");
|
|
7268
7268
|
const srfWf = params.srfwf;
|
|
7269
|
-
if (
|
|
7270
|
-
if (
|
|
7269
|
+
if (notNilEmpty3(srfWf)) {
|
|
7270
|
+
if (notNilEmpty3(params.wf)) {
|
|
7271
7271
|
return "".concat(defView, ":").concat(srfWf.toUpperCase(), ":").concat(params.wf.toUpperCase());
|
|
7272
7272
|
}
|
|
7273
7273
|
return "".concat(defView, ":").concat(srfWf.toUpperCase());
|
|
@@ -7283,7 +7283,7 @@ async function calcDERdTag(entity, rdView, params, data) {
|
|
|
7283
7283
|
typeValue = data[codeName.toLowerCase()];
|
|
7284
7284
|
}
|
|
7285
7285
|
}
|
|
7286
|
-
if (
|
|
7286
|
+
if (notNilEmpty3(typeValue)) {
|
|
7287
7287
|
rdTag = "".concat(defView, ":").concat(typeValue.toString().toUpperCase());
|
|
7288
7288
|
} else {
|
|
7289
7289
|
rdTag = "".concat(defView);
|
|
@@ -7293,7 +7293,7 @@ async function calcDERdTag(entity, rdView, params, data) {
|
|
|
7293
7293
|
|
|
7294
7294
|
// src/utils/verify/verify.ts
|
|
7295
7295
|
import { RuntimeError as RuntimeError2 } from "@ibiz-template/core";
|
|
7296
|
-
import { isNilOrEmpty as isNilOrEmpty3, notNilEmpty as
|
|
7296
|
+
import { isNilOrEmpty as isNilOrEmpty3, notNilEmpty as notNilEmpty4 } from "qx-util";
|
|
7297
7297
|
import { isNil } from "ramda";
|
|
7298
7298
|
function testCond(value, op, value2) {
|
|
7299
7299
|
if (Object.is(op, "IN")) {
|
|
@@ -7318,7 +7318,7 @@ function testCond(value, op, value2) {
|
|
|
7318
7318
|
case "ISNULL":
|
|
7319
7319
|
return isNilOrEmpty3(value);
|
|
7320
7320
|
case "ISNOTNULL":
|
|
7321
|
-
return
|
|
7321
|
+
return notNilEmpty4(value);
|
|
7322
7322
|
case "TESTNULL":
|
|
7323
7323
|
return isNil(value);
|
|
7324
7324
|
case "IN":
|
|
@@ -8623,400 +8623,153 @@ var RawValueUtil = class {
|
|
|
8623
8623
|
}
|
|
8624
8624
|
};
|
|
8625
8625
|
|
|
8626
|
-
// src/
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
* @date 2022-08-25 23:08:08
|
|
8637
|
-
* @param {string} appViewId
|
|
8638
|
-
* @param {IContext} [context]
|
|
8639
|
-
* @param {IParams} [params={}]
|
|
8640
|
-
* @param {IData} [_opts={}]
|
|
8641
|
-
* @return {*} {(Promise<IModalData | void>)}
|
|
8642
|
-
*/
|
|
8643
|
-
async exec(appViewId, context, params = {}, opts = {}) {
|
|
8644
|
-
const appView = await ibiz.hub.config.view.get(appViewId);
|
|
8645
|
-
if (!appView) {
|
|
8646
|
-
throw new RuntimeError4("\u5E94\u7528\u89C6\u56FE[".concat(appViewId, "]\u4E0D\u5B58\u5728"));
|
|
8647
|
-
}
|
|
8648
|
-
if (context.srfkey && appView.appDataEntityId) {
|
|
8649
|
-
const deName = calcDeCodeNameById(appView.appDataEntityId);
|
|
8650
|
-
context[deName] = context.srfkey;
|
|
8651
|
-
context.srfkey = void 0;
|
|
8652
|
-
}
|
|
8653
|
-
if (appView.redirectView) {
|
|
8654
|
-
const fullViewModel = await ibiz.hub.getAppView(appViewId);
|
|
8655
|
-
return openRedirectView(
|
|
8656
|
-
fullViewModel,
|
|
8657
|
-
context,
|
|
8658
|
-
params,
|
|
8659
|
-
opts
|
|
8660
|
-
);
|
|
8626
|
+
// src/utils/promise/promise.ts
|
|
8627
|
+
async function handleAllSettled(values, isThrow = true) {
|
|
8628
|
+
const allResults = await Promise.allSettled(values);
|
|
8629
|
+
const successResult = [];
|
|
8630
|
+
const errorResult = [];
|
|
8631
|
+
allResults.forEach((item) => {
|
|
8632
|
+
if (item.status === "fulfilled") {
|
|
8633
|
+
successResult.push(item.value);
|
|
8634
|
+
} else {
|
|
8635
|
+
errorResult.push(item.reason);
|
|
8661
8636
|
}
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
return this.openIndexViewTab(appView, context, params);
|
|
8670
|
-
case "POPUP":
|
|
8671
|
-
throw new ModelError3(appView, "\u672A\u652F\u6301\u7684\u89C6\u56FE\u6253\u5F00\u6A21\u5F0F: POPUP");
|
|
8672
|
-
case "POPUPMODAL":
|
|
8673
|
-
return this.openModal(appView, context, params);
|
|
8674
|
-
case "POPUPAPP":
|
|
8675
|
-
throw new ModelError3(appView, "\u672A\u652F\u6301\u7684\u89C6\u56FE\u6253\u5F00\u6A21\u5F0F: POPUPAPP");
|
|
8676
|
-
case "POPOVER":
|
|
8677
|
-
return this.openPopover(appView, opts.event, context, params);
|
|
8678
|
-
case "DRAWER_LEFT":
|
|
8679
|
-
case "DRAWER_RIGHT":
|
|
8680
|
-
case "DRAWER_TOP":
|
|
8681
|
-
case "DRAWER_BOTTOM":
|
|
8682
|
-
return this.openDrawer(appView, context, params);
|
|
8683
|
-
case "USER":
|
|
8684
|
-
return this.openUserCustom(appView, context, params);
|
|
8685
|
-
default:
|
|
8686
|
-
return this.openIndexViewTab(appView, context, params);
|
|
8637
|
+
});
|
|
8638
|
+
if (errorResult.length > 0) {
|
|
8639
|
+
const error = errorResult.length === 1 ? errorResult[0] : errorResult;
|
|
8640
|
+
if (isThrow) {
|
|
8641
|
+
throw error;
|
|
8642
|
+
} else {
|
|
8643
|
+
ibiz.util.error.handle(error);
|
|
8687
8644
|
}
|
|
8688
8645
|
}
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
* @param {IParams} [params={}]
|
|
8711
|
-
* @return {*} {Promise<IModalData>}
|
|
8712
|
-
*/
|
|
8713
|
-
async openModal(appView, context, params = {}) {
|
|
8714
|
-
return ibiz.openView.modal(appView.id, context, params);
|
|
8646
|
+
return successResult;
|
|
8647
|
+
}
|
|
8648
|
+
|
|
8649
|
+
// src/command/app/open-app-view/open-app-view.ts
|
|
8650
|
+
import { ModelError as ModelError14, RuntimeError as RuntimeError16 } from "@ibiz-template/core";
|
|
8651
|
+
import { clone as clone11 } from "ramda";
|
|
8652
|
+
|
|
8653
|
+
// src/service/utils/de-dq-cond/ps-de-dq-cond-engine.ts
|
|
8654
|
+
import { isEmpty as isEmpty3 } from "ramda";
|
|
8655
|
+
|
|
8656
|
+
// src/service/utils/de-dq-cond/ps-model-cond-engine-base.ts
|
|
8657
|
+
var PSModelCondEngineBase = class {
|
|
8658
|
+
constructor() {
|
|
8659
|
+
/**
|
|
8660
|
+
* 根分组条件
|
|
8661
|
+
*
|
|
8662
|
+
* @private
|
|
8663
|
+
* @type {(PSModelGroupCondBase | null)}
|
|
8664
|
+
* @memberof PSModelCondEngineBase
|
|
8665
|
+
*/
|
|
8666
|
+
this.psModelGroupCondBase = null;
|
|
8715
8667
|
}
|
|
8716
8668
|
/**
|
|
8717
|
-
*
|
|
8669
|
+
* 解析条件
|
|
8718
8670
|
*
|
|
8719
|
-
* @
|
|
8720
|
-
* @
|
|
8721
|
-
* @protected
|
|
8722
|
-
* @param {IViewConfig} appView
|
|
8723
|
-
* @param {IContext} [context]
|
|
8724
|
-
* @param {IParams} [params={}]
|
|
8725
|
-
* @return {*} {Promise<IModalData>}
|
|
8671
|
+
* @param {IData[]} obj
|
|
8672
|
+
* @memberof PSModelCondEngineBase
|
|
8726
8673
|
*/
|
|
8727
|
-
|
|
8728
|
-
if (
|
|
8729
|
-
|
|
8674
|
+
parse(obj) {
|
|
8675
|
+
if (obj instanceof Array) {
|
|
8676
|
+
const psModelGroupCondBase = this.createPSModelGroupCond();
|
|
8677
|
+
psModelGroupCondBase.parse(obj);
|
|
8678
|
+
this.psModelGroupCondBase = psModelGroupCondBase;
|
|
8730
8679
|
}
|
|
8731
|
-
return ibiz.openView.popover(appView.id, event, context, params);
|
|
8732
8680
|
}
|
|
8733
8681
|
/**
|
|
8734
|
-
*
|
|
8682
|
+
* 测试项
|
|
8735
8683
|
*
|
|
8736
|
-
* @author chitanda
|
|
8737
|
-
* @date 2022-07-25 20:07:08
|
|
8738
8684
|
* @protected
|
|
8739
|
-
* @param {
|
|
8740
|
-
* @param {
|
|
8741
|
-
* @param {
|
|
8742
|
-
* @return {*} {
|
|
8685
|
+
* @param {string} strCondOp
|
|
8686
|
+
* @param {*} objValue
|
|
8687
|
+
* @param {*} objCondValue
|
|
8688
|
+
* @return {*} {boolean}
|
|
8689
|
+
* @memberof PSModelCondEngineBase
|
|
8743
8690
|
*/
|
|
8744
|
-
|
|
8745
|
-
|
|
8691
|
+
testSingleCond(strCondOp, objValue, objCondValue) {
|
|
8692
|
+
try {
|
|
8693
|
+
if ("ISNULL" /* CONDOP_ISNULL */ === strCondOp) {
|
|
8694
|
+
return objValue == null;
|
|
8695
|
+
}
|
|
8696
|
+
if ("ISNOTNULL" /* CONDOP_ISNOTNULL */ === strCondOp) {
|
|
8697
|
+
return objValue != null;
|
|
8698
|
+
}
|
|
8699
|
+
if ("EQ" /* CONDOP_EQ */ === strCondOp || "ABSEQ" /* CONDOP_ABSEQ */ === strCondOp || "GT" /* CONDOP_GT */ === strCondOp || "GTANDEQ" /* CONDOP_GTANDEQ */ === strCondOp || "LT" /* CONDOP_LT */ === strCondOp || "LTANDEQ" /* CONDOP_LTANDEQ */ === strCondOp || "NOTEQ" /* CONDOP_NOTEQ */ === strCondOp) {
|
|
8700
|
+
let nRet = -1;
|
|
8701
|
+
if (objValue == objCondValue) {
|
|
8702
|
+
nRet = 0;
|
|
8703
|
+
} else if (objValue > objCondValue) {
|
|
8704
|
+
nRet = 1;
|
|
8705
|
+
}
|
|
8706
|
+
if ("EQ" /* CONDOP_EQ */ === strCondOp || "ABSEQ" /* CONDOP_ABSEQ */ === strCondOp) {
|
|
8707
|
+
return nRet === 0;
|
|
8708
|
+
}
|
|
8709
|
+
if ("GT" /* CONDOP_GT */ === strCondOp) {
|
|
8710
|
+
return nRet > 0;
|
|
8711
|
+
}
|
|
8712
|
+
if ("GTANDEQ" /* CONDOP_GTANDEQ */ === strCondOp) {
|
|
8713
|
+
return nRet >= 0;
|
|
8714
|
+
}
|
|
8715
|
+
if ("LT" /* CONDOP_LT */ === strCondOp) {
|
|
8716
|
+
return nRet < 0;
|
|
8717
|
+
}
|
|
8718
|
+
if ("LTANDEQ" /* CONDOP_LTANDEQ */ === strCondOp) {
|
|
8719
|
+
return nRet <= 0;
|
|
8720
|
+
}
|
|
8721
|
+
if ("NOTEQ" /* CONDOP_NOTEQ */ === strCondOp) {
|
|
8722
|
+
return nRet !== 0;
|
|
8723
|
+
}
|
|
8724
|
+
}
|
|
8725
|
+
if ("LIKE" /* CONDOP_LIKE */ === strCondOp) {
|
|
8726
|
+
if (objValue != null && objCondValue != null) {
|
|
8727
|
+
return objValue.toString().toUpperCase().indexOf(objCondValue.toString().toUpperCase()) !== -1;
|
|
8728
|
+
}
|
|
8729
|
+
return false;
|
|
8730
|
+
}
|
|
8731
|
+
if ("LEFTLIKE" /* CONDOP_LEFTLIKE */ === strCondOp) {
|
|
8732
|
+
if (objValue != null && objCondValue != null) {
|
|
8733
|
+
return objValue.toString().toUpperCase().indexOf(objCondValue.toString().toUpperCase()) === 0;
|
|
8734
|
+
}
|
|
8735
|
+
return false;
|
|
8736
|
+
}
|
|
8737
|
+
} catch (err) {
|
|
8738
|
+
ibiz.log.error(err);
|
|
8739
|
+
}
|
|
8740
|
+
return false;
|
|
8746
8741
|
}
|
|
8747
8742
|
/**
|
|
8748
|
-
*
|
|
8743
|
+
* 获取根分组条件
|
|
8749
8744
|
*
|
|
8750
|
-
* @
|
|
8751
|
-
* @
|
|
8752
|
-
* @protected
|
|
8753
|
-
* @param {IViewConfig} appView
|
|
8754
|
-
* @param {IContext} [context]
|
|
8755
|
-
* @param {IParams} [params={}]
|
|
8756
|
-
* @return {*} {Promise<void>}
|
|
8745
|
+
* @return {*} {PSModelGroupCondBase}
|
|
8746
|
+
* @memberof PSModelCondEngineBase
|
|
8757
8747
|
*/
|
|
8758
|
-
|
|
8759
|
-
return
|
|
8748
|
+
getPSModelGroupCondBase() {
|
|
8749
|
+
return this.psModelGroupCondBase;
|
|
8760
8750
|
}
|
|
8761
8751
|
};
|
|
8762
|
-
_OpenAppViewCommand.TAG = "ibiz.app-view.open";
|
|
8763
|
-
var OpenAppViewCommand = _OpenAppViewCommand;
|
|
8764
8752
|
|
|
8765
|
-
// src/
|
|
8766
|
-
|
|
8753
|
+
// src/service/utils/de-dq-cond/ps-model-group-cond-base.ts
|
|
8754
|
+
import { RuntimeError as RuntimeError4 } from "@ibiz-template/core";
|
|
8755
|
+
|
|
8756
|
+
// src/service/utils/de-dq-cond/ps-model-cond-base.ts
|
|
8757
|
+
var PSModelCondBase = class {
|
|
8767
8758
|
constructor() {
|
|
8768
|
-
|
|
8759
|
+
this.strCondOp = null;
|
|
8769
8760
|
}
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
* @param {IAppFunc} appFunc 应用功能模型
|
|
8776
|
-
* @param {IContext} [context] 执行上下文
|
|
8777
|
-
* @param {IParams} [params={}] 参数
|
|
8778
|
-
* @param {IData} [opts={}] 额外参数,与具体执行对象规划好的额外参数。如需要给飘窗使用的 event 事件对象.
|
|
8779
|
-
* @return {*} {Promise<void>}
|
|
8780
|
-
*/
|
|
8781
|
-
async exec(appFuncId, context, params = {}, opts = {}) {
|
|
8782
|
-
const appFunc = ibiz.hub.getApp(context.srfappid).getAppFunc(appFuncId);
|
|
8783
|
-
if (!appFunc) {
|
|
8784
|
-
throw new RuntimeError5("\u627E\u4E0D\u5230\u53EB".concat(appFuncId, "\u7684\u5E94\u7528\u529F\u80FD"));
|
|
8785
|
-
}
|
|
8786
|
-
const { navigateContexts, navigateParams, appFuncType } = appFunc;
|
|
8787
|
-
const _context = context.clone();
|
|
8788
|
-
Object.assign(_context, convertNavData(navigateContexts, params, context));
|
|
8789
|
-
const _params = convertNavData(navigateParams, params, context);
|
|
8790
|
-
switch (appFuncType) {
|
|
8791
|
-
case "APPVIEW":
|
|
8792
|
-
return this.openAppView(appFunc, _context, _params, opts);
|
|
8793
|
-
case "OPENHTMLPAGE":
|
|
8794
|
-
return this.openHtmlPage(appFunc);
|
|
8795
|
-
case "PDTAPPFUNC":
|
|
8796
|
-
return this.openPdAppFunc(appFunc, _context, _params);
|
|
8797
|
-
case "JAVASCRIPT":
|
|
8798
|
-
return this.executeJavaScript(appFunc, _context, _params);
|
|
8799
|
-
case "CUSTOM":
|
|
8800
|
-
return this.custom(appFunc, _context, _params);
|
|
8801
|
-
default:
|
|
8802
|
-
throw new ModelError4(appFunc, "\u672A\u652F\u6301\u7684\u5E94\u7528\u529F\u80FD\u7C7B\u578B: ".concat(appFuncType));
|
|
8803
|
-
}
|
|
8761
|
+
getCondOp() {
|
|
8762
|
+
return this.strCondOp;
|
|
8763
|
+
}
|
|
8764
|
+
setCondOp(strCondOp) {
|
|
8765
|
+
this.strCondOp = strCondOp;
|
|
8804
8766
|
}
|
|
8767
|
+
};
|
|
8768
|
+
|
|
8769
|
+
// src/service/utils/de-dq-cond/ps-model-single-cond-base.ts
|
|
8770
|
+
var PSModelSingleCondBase = class extends PSModelCondBase {
|
|
8805
8771
|
/**
|
|
8806
|
-
*
|
|
8807
|
-
*
|
|
8808
|
-
* @author chitanda
|
|
8809
|
-
* @date 2022-07-25 18:07:49
|
|
8810
|
-
* @protected
|
|
8811
|
-
* @param {IAppFunc} appFunc
|
|
8812
|
-
* @param {IContext} [context]
|
|
8813
|
-
* @param {IParams} [params]
|
|
8814
|
-
* @return {*} {Promise<void>}
|
|
8815
|
-
*/
|
|
8816
|
-
async openAppView(appFunc, context, params, opts) {
|
|
8817
|
-
if (!appFunc.appViewId) {
|
|
8818
|
-
throw new RuntimeError5("\u5E94\u7528\u89C6\u56FE[".concat(appFunc.appViewId, "]\u4E0D\u5B58\u5728"));
|
|
8819
|
-
}
|
|
8820
|
-
return ibiz.commands.execute(
|
|
8821
|
-
OpenAppViewCommand.TAG,
|
|
8822
|
-
appFunc.appViewId,
|
|
8823
|
-
context,
|
|
8824
|
-
params,
|
|
8825
|
-
opts
|
|
8826
|
-
);
|
|
8827
|
-
}
|
|
8828
|
-
/**
|
|
8829
|
-
* 打开HTML页面
|
|
8830
|
-
*
|
|
8831
|
-
* @author chitanda
|
|
8832
|
-
* @date 2022-07-25 18:07:56
|
|
8833
|
-
* @protected
|
|
8834
|
-
* @param {IAppFunc} appFunc
|
|
8835
|
-
*/
|
|
8836
|
-
openHtmlPage(appFunc) {
|
|
8837
|
-
const url = appFunc.htmlPageUrl;
|
|
8838
|
-
window.open(url, "_blank");
|
|
8839
|
-
}
|
|
8840
|
-
/**
|
|
8841
|
-
* 应用预置功能
|
|
8842
|
-
*
|
|
8843
|
-
* @author chitanda
|
|
8844
|
-
* @date 2022-07-25 18:07:22
|
|
8845
|
-
* @protected
|
|
8846
|
-
* @param {IAppFunc} appFunc
|
|
8847
|
-
* @param {IContext} [context]
|
|
8848
|
-
* @param {IParams} [params]
|
|
8849
|
-
*/
|
|
8850
|
-
openPdAppFunc(appFunc, context, params) {
|
|
8851
|
-
ibiz.log.warn("openPdAppFunc", appFunc, context, params);
|
|
8852
|
-
throw new RuntimeError5("\u672A\u5B9E\u73B0");
|
|
8853
|
-
}
|
|
8854
|
-
/**
|
|
8855
|
-
* 执行 JavaScript 脚本
|
|
8856
|
-
*
|
|
8857
|
-
* @author chitanda
|
|
8858
|
-
* @date 2022-07-25 18:07:09
|
|
8859
|
-
* @protected
|
|
8860
|
-
* @param {IAppFunc} appFunc
|
|
8861
|
-
* @param {IContext} [context]
|
|
8862
|
-
* @param {IParams} [params]
|
|
8863
|
-
*/
|
|
8864
|
-
executeJavaScript(appFunc, context, params) {
|
|
8865
|
-
ibiz.log.warn("executeJavaScript", appFunc, context, params);
|
|
8866
|
-
throw new RuntimeError5("\u672A\u5B9E\u73B0");
|
|
8867
|
-
}
|
|
8868
|
-
/**
|
|
8869
|
-
* 自定义应用功能
|
|
8870
|
-
*
|
|
8871
|
-
* @author chitanda
|
|
8872
|
-
* @date 2022-07-25 18:07:51
|
|
8873
|
-
* @protected
|
|
8874
|
-
* @param {IAppFunc} appFunc
|
|
8875
|
-
* @param {IContext} [context]
|
|
8876
|
-
* @param {IParams} [params]
|
|
8877
|
-
*/
|
|
8878
|
-
custom(appFunc, context, params) {
|
|
8879
|
-
ibiz.log.warn("custom", appFunc, context, params);
|
|
8880
|
-
throw new RuntimeError5("\u672A\u5B9E\u73B0");
|
|
8881
|
-
}
|
|
8882
|
-
};
|
|
8883
|
-
/**
|
|
8884
|
-
* 指令标识
|
|
8885
|
-
*
|
|
8886
|
-
* @author chitanda
|
|
8887
|
-
* @date 2022-07-25 17:07:20
|
|
8888
|
-
* @see 具体实现 {@link AppFuncCommand.exec}
|
|
8889
|
-
* @static
|
|
8890
|
-
*/
|
|
8891
|
-
_AppFuncCommand.TAG = "ibiz.app-func.exec";
|
|
8892
|
-
var AppFuncCommand = _AppFuncCommand;
|
|
8893
|
-
|
|
8894
|
-
// src/command/index.ts
|
|
8895
|
-
function installCommand() {
|
|
8896
|
-
new AppFuncCommand();
|
|
8897
|
-
new OpenAppViewCommand();
|
|
8898
|
-
}
|
|
8899
|
-
|
|
8900
|
-
// src/service/utils/de-dq-cond/ps-de-dq-cond-engine.ts
|
|
8901
|
-
import { isEmpty as isEmpty3 } from "ramda";
|
|
8902
|
-
|
|
8903
|
-
// src/service/utils/de-dq-cond/ps-model-cond-engine-base.ts
|
|
8904
|
-
var PSModelCondEngineBase = class {
|
|
8905
|
-
constructor() {
|
|
8906
|
-
/**
|
|
8907
|
-
* 根分组条件
|
|
8908
|
-
*
|
|
8909
|
-
* @private
|
|
8910
|
-
* @type {(PSModelGroupCondBase | null)}
|
|
8911
|
-
* @memberof PSModelCondEngineBase
|
|
8912
|
-
*/
|
|
8913
|
-
this.psModelGroupCondBase = null;
|
|
8914
|
-
}
|
|
8915
|
-
/**
|
|
8916
|
-
* 解析条件
|
|
8917
|
-
*
|
|
8918
|
-
* @param {IData[]} obj
|
|
8919
|
-
* @memberof PSModelCondEngineBase
|
|
8920
|
-
*/
|
|
8921
|
-
parse(obj) {
|
|
8922
|
-
if (obj instanceof Array) {
|
|
8923
|
-
const psModelGroupCondBase = this.createPSModelGroupCond();
|
|
8924
|
-
psModelGroupCondBase.parse(obj);
|
|
8925
|
-
this.psModelGroupCondBase = psModelGroupCondBase;
|
|
8926
|
-
}
|
|
8927
|
-
}
|
|
8928
|
-
/**
|
|
8929
|
-
* 测试项
|
|
8930
|
-
*
|
|
8931
|
-
* @protected
|
|
8932
|
-
* @param {string} strCondOp
|
|
8933
|
-
* @param {*} objValue
|
|
8934
|
-
* @param {*} objCondValue
|
|
8935
|
-
* @return {*} {boolean}
|
|
8936
|
-
* @memberof PSModelCondEngineBase
|
|
8937
|
-
*/
|
|
8938
|
-
testSingleCond(strCondOp, objValue, objCondValue) {
|
|
8939
|
-
try {
|
|
8940
|
-
if ("ISNULL" /* CONDOP_ISNULL */ === strCondOp) {
|
|
8941
|
-
return objValue == null;
|
|
8942
|
-
}
|
|
8943
|
-
if ("ISNOTNULL" /* CONDOP_ISNOTNULL */ === strCondOp) {
|
|
8944
|
-
return objValue != null;
|
|
8945
|
-
}
|
|
8946
|
-
if ("EQ" /* CONDOP_EQ */ === strCondOp || "ABSEQ" /* CONDOP_ABSEQ */ === strCondOp || "GT" /* CONDOP_GT */ === strCondOp || "GTANDEQ" /* CONDOP_GTANDEQ */ === strCondOp || "LT" /* CONDOP_LT */ === strCondOp || "LTANDEQ" /* CONDOP_LTANDEQ */ === strCondOp || "NOTEQ" /* CONDOP_NOTEQ */ === strCondOp) {
|
|
8947
|
-
let nRet = -1;
|
|
8948
|
-
if (objValue == objCondValue) {
|
|
8949
|
-
nRet = 0;
|
|
8950
|
-
} else if (objValue > objCondValue) {
|
|
8951
|
-
nRet = 1;
|
|
8952
|
-
}
|
|
8953
|
-
if ("EQ" /* CONDOP_EQ */ === strCondOp || "ABSEQ" /* CONDOP_ABSEQ */ === strCondOp) {
|
|
8954
|
-
return nRet === 0;
|
|
8955
|
-
}
|
|
8956
|
-
if ("GT" /* CONDOP_GT */ === strCondOp) {
|
|
8957
|
-
return nRet > 0;
|
|
8958
|
-
}
|
|
8959
|
-
if ("GTANDEQ" /* CONDOP_GTANDEQ */ === strCondOp) {
|
|
8960
|
-
return nRet >= 0;
|
|
8961
|
-
}
|
|
8962
|
-
if ("LT" /* CONDOP_LT */ === strCondOp) {
|
|
8963
|
-
return nRet < 0;
|
|
8964
|
-
}
|
|
8965
|
-
if ("LTANDEQ" /* CONDOP_LTANDEQ */ === strCondOp) {
|
|
8966
|
-
return nRet <= 0;
|
|
8967
|
-
}
|
|
8968
|
-
if ("NOTEQ" /* CONDOP_NOTEQ */ === strCondOp) {
|
|
8969
|
-
return nRet !== 0;
|
|
8970
|
-
}
|
|
8971
|
-
}
|
|
8972
|
-
if ("LIKE" /* CONDOP_LIKE */ === strCondOp) {
|
|
8973
|
-
if (objValue != null && objCondValue != null) {
|
|
8974
|
-
return objValue.toString().toUpperCase().indexOf(objCondValue.toString().toUpperCase()) !== -1;
|
|
8975
|
-
}
|
|
8976
|
-
return false;
|
|
8977
|
-
}
|
|
8978
|
-
if ("LEFTLIKE" /* CONDOP_LEFTLIKE */ === strCondOp) {
|
|
8979
|
-
if (objValue != null && objCondValue != null) {
|
|
8980
|
-
return objValue.toString().toUpperCase().indexOf(objCondValue.toString().toUpperCase()) === 0;
|
|
8981
|
-
}
|
|
8982
|
-
return false;
|
|
8983
|
-
}
|
|
8984
|
-
} catch (err) {
|
|
8985
|
-
ibiz.log.error(err);
|
|
8986
|
-
}
|
|
8987
|
-
return false;
|
|
8988
|
-
}
|
|
8989
|
-
/**
|
|
8990
|
-
* 获取根分组条件
|
|
8991
|
-
*
|
|
8992
|
-
* @return {*} {PSModelGroupCondBase}
|
|
8993
|
-
* @memberof PSModelCondEngineBase
|
|
8994
|
-
*/
|
|
8995
|
-
getPSModelGroupCondBase() {
|
|
8996
|
-
return this.psModelGroupCondBase;
|
|
8997
|
-
}
|
|
8998
|
-
};
|
|
8999
|
-
|
|
9000
|
-
// src/service/utils/de-dq-cond/ps-model-group-cond-base.ts
|
|
9001
|
-
import { RuntimeError as RuntimeError6 } from "@ibiz-template/core";
|
|
9002
|
-
|
|
9003
|
-
// src/service/utils/de-dq-cond/ps-model-cond-base.ts
|
|
9004
|
-
var PSModelCondBase = class {
|
|
9005
|
-
constructor() {
|
|
9006
|
-
this.strCondOp = null;
|
|
9007
|
-
}
|
|
9008
|
-
getCondOp() {
|
|
9009
|
-
return this.strCondOp;
|
|
9010
|
-
}
|
|
9011
|
-
setCondOp(strCondOp) {
|
|
9012
|
-
this.strCondOp = strCondOp;
|
|
9013
|
-
}
|
|
9014
|
-
};
|
|
9015
|
-
|
|
9016
|
-
// src/service/utils/de-dq-cond/ps-model-single-cond-base.ts
|
|
9017
|
-
var PSModelSingleCondBase = class extends PSModelCondBase {
|
|
9018
|
-
/**
|
|
9019
|
-
* 编译条件
|
|
8772
|
+
* 编译条件
|
|
9020
8773
|
*
|
|
9021
8774
|
* @author chitanda
|
|
9022
8775
|
* @date 2022-08-17 23:08:35
|
|
@@ -9151,7 +8904,7 @@ var PSModelGroupCondBase = class _PSModelGroupCondBase extends PSModelCondBase {
|
|
|
9151
8904
|
}
|
|
9152
8905
|
});
|
|
9153
8906
|
} else {
|
|
9154
|
-
throw new
|
|
8907
|
+
throw new RuntimeError4("\u503C\u5FC5\u987B\u4E3A\u6570\u7EC4");
|
|
9155
8908
|
}
|
|
9156
8909
|
}
|
|
9157
8910
|
}
|
|
@@ -9325,7 +9078,12 @@ async function getControlProvider(model) {
|
|
|
9325
9078
|
}
|
|
9326
9079
|
provider = getProvider(controlType);
|
|
9327
9080
|
if (!provider) {
|
|
9328
|
-
|
|
9081
|
+
switch (controlType) {
|
|
9082
|
+
case "DATAINFOBAR":
|
|
9083
|
+
return;
|
|
9084
|
+
default:
|
|
9085
|
+
ibiz.log.error("\u627E\u4E0D\u5230\u90E8\u4EF6\u7C7B\u578B".concat(controlType, "\u5BF9\u5E94\u7684\u9002\u914D\u5668"));
|
|
9086
|
+
}
|
|
9329
9087
|
} else {
|
|
9330
9088
|
return provider;
|
|
9331
9089
|
}
|
|
@@ -9514,7 +9272,7 @@ async function getPanelItemProvider(model) {
|
|
|
9514
9272
|
}
|
|
9515
9273
|
|
|
9516
9274
|
// src/register/helper/ui-action-register.ts
|
|
9517
|
-
import { RuntimeError as
|
|
9275
|
+
import { RuntimeError as RuntimeError5 } from "@ibiz-template/core";
|
|
9518
9276
|
var UIACTION_PROVIDER_PREFIX = "UIACTION";
|
|
9519
9277
|
function registerUIActionProvider(key, callback) {
|
|
9520
9278
|
ibiz.register.register("".concat(UIACTION_PROVIDER_PREFIX, "_").concat(key), callback);
|
|
@@ -9540,7 +9298,7 @@ async function getUIActionProvider(model) {
|
|
|
9540
9298
|
}
|
|
9541
9299
|
provider = getProvider6(uiactionMode);
|
|
9542
9300
|
if (!provider) {
|
|
9543
|
-
throw new
|
|
9301
|
+
throw new RuntimeError5("\u627E\u4E0D\u754C\u9762\u884C\u4E3A\u6A21\u5F0F".concat(uiactionMode, "\u5BF9\u5E94\u7684\u9002\u914D\u5668"));
|
|
9544
9302
|
} else {
|
|
9545
9303
|
return provider;
|
|
9546
9304
|
}
|
|
@@ -9622,7 +9380,7 @@ async function getPortletProvider(model) {
|
|
|
9622
9380
|
}
|
|
9623
9381
|
|
|
9624
9382
|
// src/register/helper/app-counter-register.ts
|
|
9625
|
-
import { RuntimeError as
|
|
9383
|
+
import { RuntimeError as RuntimeError6 } from "@ibiz-template/core";
|
|
9626
9384
|
var APP_COUNTER_PROVIDER_PREFIX = "APPCOUNTER";
|
|
9627
9385
|
function registerAppCounterProvider(key, callback) {
|
|
9628
9386
|
ibiz.register.register("".concat(APP_COUNTER_PROVIDER_PREFIX, "_").concat(key), callback);
|
|
@@ -9649,22 +9407,22 @@ async function getAppCounterProvider(model) {
|
|
|
9649
9407
|
if (counterType === "CUSTOM") {
|
|
9650
9408
|
provider = getProvider9(codeName);
|
|
9651
9409
|
if (!provider) {
|
|
9652
|
-
throw new
|
|
9410
|
+
throw new RuntimeError6("\u627E\u4E0D\u5230\u81EA\u5B9A\u4E49\u7CFB\u7EDF\u8BA1\u6570\u5668".concat(codeName, "\u5BF9\u5E94\u7684\u9002\u914D\u5668"));
|
|
9653
9411
|
} else {
|
|
9654
9412
|
return provider;
|
|
9655
9413
|
}
|
|
9656
9414
|
}
|
|
9657
9415
|
provider = getProvider9(counterType);
|
|
9658
9416
|
if (!provider) {
|
|
9659
|
-
throw new
|
|
9417
|
+
throw new RuntimeError6("\u627E\u4E0D\u7CFB\u7EDF\u8BA1\u6570\u5668\u7C7B\u578B".concat(counterType, "\u5BF9\u5E94\u7684\u9002\u914D\u5668"));
|
|
9660
9418
|
} else {
|
|
9661
9419
|
return provider;
|
|
9662
9420
|
}
|
|
9663
9421
|
}
|
|
9664
9422
|
|
|
9665
9423
|
// src/service/utils/app-counter/app-counter.ts
|
|
9666
|
-
import { IBizContext, RuntimeError as
|
|
9667
|
-
import { notNilEmpty as
|
|
9424
|
+
import { IBizContext, RuntimeError as RuntimeError7 } from "@ibiz-template/core";
|
|
9425
|
+
import { notNilEmpty as notNilEmpty5, QXEvent } from "qx-util";
|
|
9668
9426
|
import { clone as clone2 } from "ramda";
|
|
9669
9427
|
var AppCounter = class {
|
|
9670
9428
|
/**
|
|
@@ -9768,7 +9526,7 @@ var AppCounter = class {
|
|
|
9768
9526
|
* @return {*} {Promise<IData>}
|
|
9769
9527
|
*/
|
|
9770
9528
|
async load() {
|
|
9771
|
-
throw new
|
|
9529
|
+
throw new RuntimeError7("\u672A\u5B9E\u73B0\u8BA1\u6570\u5668\u52A0\u8F7D\u65B9\u6CD5");
|
|
9772
9530
|
}
|
|
9773
9531
|
/**
|
|
9774
9532
|
* 计数器刷新
|
|
@@ -9793,7 +9551,7 @@ var AppCounter = class {
|
|
|
9793
9551
|
*/
|
|
9794
9552
|
onChange(fn, immediate = true) {
|
|
9795
9553
|
this.evt.on("change", fn);
|
|
9796
|
-
if (immediate &&
|
|
9554
|
+
if (immediate && notNilEmpty5(this.data)) {
|
|
9797
9555
|
fn(this.data);
|
|
9798
9556
|
}
|
|
9799
9557
|
}
|
|
@@ -9889,7 +9647,7 @@ function presetAppCounterProvider() {
|
|
|
9889
9647
|
}
|
|
9890
9648
|
|
|
9891
9649
|
// src/service/utils/de-dq-cond-util/de-dq-cond-util.ts
|
|
9892
|
-
import { ModelError as
|
|
9650
|
+
import { ModelError as ModelError3 } from "@ibiz-template/core";
|
|
9893
9651
|
var DEDQCondUtil = class {
|
|
9894
9652
|
/**
|
|
9895
9653
|
* 根据数据查询获取查询
|
|
@@ -9946,7 +9704,7 @@ var DEDQCondUtil = class {
|
|
|
9946
9704
|
condArr.push("");
|
|
9947
9705
|
}
|
|
9948
9706
|
} else {
|
|
9949
|
-
throw new
|
|
9707
|
+
throw new ModelError3(item, "\u6682\u672A\u652F\u6301\u7684\u67E5\u8BE2\u6761\u4EF6\u7C7B\u578B: ".concat(item.condType));
|
|
9950
9708
|
}
|
|
9951
9709
|
arr.push(condArr);
|
|
9952
9710
|
});
|
|
@@ -9965,7 +9723,7 @@ var DEDQCondUtil = class {
|
|
|
9965
9723
|
DEDQCondUtil.map = /* @__PURE__ */ new WeakMap();
|
|
9966
9724
|
|
|
9967
9725
|
// src/service/utils/dynamic-code-list/dynamic-code-list.ts
|
|
9968
|
-
import { ModelError as
|
|
9726
|
+
import { ModelError as ModelError4, RuntimeModelError as RuntimeModelError5 } from "@ibiz-template/core";
|
|
9969
9727
|
import { isNil as isNil3 } from "ramda";
|
|
9970
9728
|
var DynamicCodeListCache = class {
|
|
9971
9729
|
constructor(codeList) {
|
|
@@ -10001,7 +9759,7 @@ var DynamicCodeListCache = class {
|
|
|
10001
9759
|
if (predefinedType) {
|
|
10002
9760
|
this.isPredefined = true;
|
|
10003
9761
|
if (!["OPERATOR", "RUNTIME"].includes(predefinedType)) {
|
|
10004
|
-
throw new
|
|
9762
|
+
throw new ModelError4(
|
|
10005
9763
|
this.codeList,
|
|
10006
9764
|
"\u9884\u5B9A\u4E49\u7C7B\u578B".concat(predefinedType, "\u6682\u4E0D\u652F\u6301")
|
|
10007
9765
|
);
|
|
@@ -10118,7 +9876,7 @@ import { where, equals, clone as clone3, isNil as isNil5, isEmpty as isEmpty5 }
|
|
|
10118
9876
|
import { createUUID } from "qx-util";
|
|
10119
9877
|
|
|
10120
9878
|
// src/service/utils/service-exist-util/service-exist-util.ts
|
|
10121
|
-
import { RuntimeError as
|
|
9879
|
+
import { RuntimeError as RuntimeError8 } from "@ibiz-template/core";
|
|
10122
9880
|
import { isEmpty as isEmpty4, isNil as isNil4 } from "ramda";
|
|
10123
9881
|
function isExistSrfKey(funcName, entity) {
|
|
10124
9882
|
if (entity != null) {
|
|
@@ -10127,14 +9885,14 @@ function isExistSrfKey(funcName, entity) {
|
|
|
10127
9885
|
return true;
|
|
10128
9886
|
}
|
|
10129
9887
|
}
|
|
10130
|
-
throw new
|
|
9888
|
+
throw new RuntimeError8("\u6267\u884C\u300C".concat(funcName, "\u300D\u4E0D\u5B58\u5728\u300Csrfkey\u300D\u65E0\u6CD5\u5904\u7406"));
|
|
10131
9889
|
}
|
|
10132
9890
|
function isExistSessionId(funcName, context) {
|
|
10133
9891
|
const { srfsessionid } = context;
|
|
10134
9892
|
if (!isNil4(srfsessionid) && !isEmpty4(srfsessionid)) {
|
|
10135
9893
|
return true;
|
|
10136
9894
|
}
|
|
10137
|
-
throw new
|
|
9895
|
+
throw new RuntimeError8("\u6267\u884C\u300C".concat(funcName, "\u300D\u4E0D\u5B58\u5728\u300Csrfsessionid\u300D\u65E0\u6CD5\u5904\u7406"));
|
|
10138
9896
|
}
|
|
10139
9897
|
|
|
10140
9898
|
// src/service/utils/de-cache/de-cache.ts
|
|
@@ -10623,7 +10381,7 @@ var SearchFilter = class {
|
|
|
10623
10381
|
};
|
|
10624
10382
|
|
|
10625
10383
|
// src/service/service/code-list/code-list.service.ts
|
|
10626
|
-
import { RuntimeError as
|
|
10384
|
+
import { RuntimeError as RuntimeError9 } from "@ibiz-template/core";
|
|
10627
10385
|
var CodeListService = class {
|
|
10628
10386
|
constructor(appModel) {
|
|
10629
10387
|
this.appModel = appModel;
|
|
@@ -10758,7 +10516,7 @@ var CodeListService = class {
|
|
|
10758
10516
|
async get(tag, context, params) {
|
|
10759
10517
|
const codeList = this.allCodeLists.get(tag);
|
|
10760
10518
|
if (!codeList) {
|
|
10761
|
-
throw new
|
|
10519
|
+
throw new RuntimeError9("\u627E\u4E0D\u5230".concat(tag, "\u4EE3\u7801\u8868"));
|
|
10762
10520
|
}
|
|
10763
10521
|
if (codeList.codeListType === "STATIC") {
|
|
10764
10522
|
return this.getStatic(codeList);
|
|
@@ -10878,10 +10636,10 @@ var CounterService = class {
|
|
|
10878
10636
|
CounterService.counterMap = /* @__PURE__ */ new Map();
|
|
10879
10637
|
|
|
10880
10638
|
// src/service/service/entity/de.service.ts
|
|
10881
|
-
import { ModelError as
|
|
10639
|
+
import { ModelError as ModelError13, RuntimeError as RuntimeError12 } from "@ibiz-template/core";
|
|
10882
10640
|
|
|
10883
10641
|
// src/service/service/work-flow/work-flow.service.ts
|
|
10884
|
-
import { RuntimeError as
|
|
10642
|
+
import { RuntimeError as RuntimeError10 } from "@ibiz-template/core";
|
|
10885
10643
|
var WorkFlowService = class {
|
|
10886
10644
|
/**
|
|
10887
10645
|
* Creates an instance of WorkFlowService.
|
|
@@ -11184,7 +10942,7 @@ var WorkFlowService = class {
|
|
|
11184
10942
|
case "sendcopy":
|
|
11185
10943
|
return this.wfSendCopy(context, params, data);
|
|
11186
10944
|
default: {
|
|
11187
|
-
throw new
|
|
10945
|
+
throw new RuntimeError10("\u300C".concat(methodName, "\u300D\u672A\u5B9E\u73B0"));
|
|
11188
10946
|
}
|
|
11189
10947
|
}
|
|
11190
10948
|
}
|
|
@@ -11231,7 +10989,7 @@ import {
|
|
|
11231
10989
|
|
|
11232
10990
|
// src/service/service/entity/method/method.ts
|
|
11233
10991
|
import { RuntimeModelError as RuntimeModelError7 } from "@ibiz-template/core";
|
|
11234
|
-
import { notNilEmpty as
|
|
10992
|
+
import { notNilEmpty as notNilEmpty6 } from "qx-util";
|
|
11235
10993
|
|
|
11236
10994
|
// src/service/app-data-entity/app-data-entity.ts
|
|
11237
10995
|
import { clone as clone4, isNil as isNil7 } from "ramda";
|
|
@@ -11409,6 +11167,9 @@ var AppDataEntity = class _AppDataEntity {
|
|
|
11409
11167
|
* @return {*} {unknown}
|
|
11410
11168
|
*/
|
|
11411
11169
|
convertVal(value, dataType) {
|
|
11170
|
+
if (value == null) {
|
|
11171
|
+
return value;
|
|
11172
|
+
}
|
|
11412
11173
|
if (isNil7(dataType)) {
|
|
11413
11174
|
return value;
|
|
11414
11175
|
}
|
|
@@ -11425,7 +11186,7 @@ var AppDataEntity = class _AppDataEntity {
|
|
|
11425
11186
|
};
|
|
11426
11187
|
|
|
11427
11188
|
// src/service/dto/method.dto.ts
|
|
11428
|
-
import { ModelError as
|
|
11189
|
+
import { ModelError as ModelError5 } from "@ibiz-template/core";
|
|
11429
11190
|
var MethodDto = class _MethodDto {
|
|
11430
11191
|
constructor(entity, isLocalMode2, dto) {
|
|
11431
11192
|
this.entity = entity;
|
|
@@ -11479,7 +11240,7 @@ var MethodDto = class _MethodDto {
|
|
|
11479
11240
|
break;
|
|
11480
11241
|
}
|
|
11481
11242
|
default:
|
|
11482
|
-
throw new
|
|
11243
|
+
throw new ModelError5(
|
|
11483
11244
|
field,
|
|
11484
11245
|
"\u672A\u652F\u6301\u7684\u5E94\u7528\u5B9E\u4F53\u65B9\u6CD5\u8F93\u5165\u5C5E\u6027\u7C7B\u578B: ".concat(field.type)
|
|
11485
11246
|
);
|
|
@@ -11603,6 +11364,7 @@ var MethodInput = class {
|
|
|
11603
11364
|
};
|
|
11604
11365
|
|
|
11605
11366
|
// src/service/service/entity/method/method-renturn.ts
|
|
11367
|
+
import { isNilOrEmpty as isNilOrEmpty5 } from "qx-util";
|
|
11606
11368
|
var MethodReturn = class {
|
|
11607
11369
|
/**
|
|
11608
11370
|
* Creates an instance of MethodReturn.
|
|
@@ -11643,6 +11405,9 @@ var MethodReturn = class {
|
|
|
11643
11405
|
const items = await this.dto.sets(context, [data]);
|
|
11644
11406
|
return items[0];
|
|
11645
11407
|
}
|
|
11408
|
+
if (isNilOrEmpty5(data)) {
|
|
11409
|
+
data = {};
|
|
11410
|
+
}
|
|
11646
11411
|
return new AppDataEntity(this.entity, data);
|
|
11647
11412
|
}
|
|
11648
11413
|
};
|
|
@@ -11686,7 +11451,7 @@ var Method = class {
|
|
|
11686
11451
|
case "POST":
|
|
11687
11452
|
res = await this.app.net.post(
|
|
11688
11453
|
"".concat(path2, "/").concat(methodName),
|
|
11689
|
-
|
|
11454
|
+
notNilEmpty6(data) ? data : params
|
|
11690
11455
|
);
|
|
11691
11456
|
break;
|
|
11692
11457
|
case "GET":
|
|
@@ -11695,7 +11460,7 @@ var Method = class {
|
|
|
11695
11460
|
case "PUT": {
|
|
11696
11461
|
res = await this.app.net.put(
|
|
11697
11462
|
"".concat(path2, "/").concat(methodName),
|
|
11698
|
-
|
|
11463
|
+
notNilEmpty6(data) ? data : params
|
|
11699
11464
|
);
|
|
11700
11465
|
break;
|
|
11701
11466
|
}
|
|
@@ -11765,10 +11530,10 @@ var Method = class {
|
|
|
11765
11530
|
};
|
|
11766
11531
|
|
|
11767
11532
|
// src/de-logic/index.ts
|
|
11768
|
-
import { HttpError as HttpError2, HttpResponse as HttpResponse2, RuntimeError as
|
|
11533
|
+
import { HttpError as HttpError2, HttpResponse as HttpResponse2, RuntimeError as RuntimeError11 } from "@ibiz-template/core";
|
|
11769
11534
|
|
|
11770
11535
|
// src/de-logic/de-logic.ts
|
|
11771
|
-
import { ModelError as
|
|
11536
|
+
import { ModelError as ModelError11, RuntimeModelError as RuntimeModelError17 } from "@ibiz-template/core";
|
|
11772
11537
|
|
|
11773
11538
|
// src/de-logic/de-logic-context.ts
|
|
11774
11539
|
var DELogicContext = class {
|
|
@@ -11887,7 +11652,7 @@ var DELogicLinkCond = class {
|
|
|
11887
11652
|
};
|
|
11888
11653
|
|
|
11889
11654
|
// src/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.ts
|
|
11890
|
-
import { ModelError as
|
|
11655
|
+
import { ModelError as ModelError6, RuntimeModelError as RuntimeModelError8 } from "@ibiz-template/core";
|
|
11891
11656
|
var DELogicLinkSingleCond = class extends DELogicLinkCond {
|
|
11892
11657
|
constructor(model) {
|
|
11893
11658
|
super();
|
|
@@ -11953,7 +11718,7 @@ var DELogicLinkSingleCond = class extends DELogicLinkCond {
|
|
|
11953
11718
|
return testCond(dst[this.dstField], this.op, src[this.value]);
|
|
11954
11719
|
}
|
|
11955
11720
|
case "CURTIME":
|
|
11956
|
-
throw new
|
|
11721
|
+
throw new ModelError6(this.model, "\u6682\u672A\u652F\u6301\u6761\u4EF6\u503C\u7C7B\u578B\u4E3A[\u5F53\u524D\u65F6\u95F4]");
|
|
11957
11722
|
default:
|
|
11958
11723
|
return testCond(dst[this.dstField], this.op, this.value);
|
|
11959
11724
|
}
|
|
@@ -12137,7 +11902,7 @@ var StartNode = class extends DELogicNode {
|
|
|
12137
11902
|
};
|
|
12138
11903
|
|
|
12139
11904
|
// src/de-logic/de-logic-node/end-node/end-node.ts
|
|
12140
|
-
import { ModelError as
|
|
11905
|
+
import { ModelError as ModelError7 } from "@ibiz-template/core";
|
|
12141
11906
|
var EndNode = class extends DELogicNode {
|
|
12142
11907
|
async exec(ctx) {
|
|
12143
11908
|
ctx.isEndNode = true;
|
|
@@ -12161,7 +11926,7 @@ var EndNode = class extends DELogicNode {
|
|
|
12161
11926
|
case "LOGICPARAMFIELD":
|
|
12162
11927
|
case "BREAK":
|
|
12163
11928
|
default:
|
|
12164
|
-
throw new
|
|
11929
|
+
throw new ModelError7(
|
|
12165
11930
|
this.model,
|
|
12166
11931
|
"\u6682\u672A\u652F\u6301\u7684\u7ED3\u675F\u8282\u70B9\u8FD4\u56DE\u503C\u7C7B\u578B: ".concat(returnType)
|
|
12167
11932
|
);
|
|
@@ -12170,11 +11935,11 @@ var EndNode = class extends DELogicNode {
|
|
|
12170
11935
|
};
|
|
12171
11936
|
|
|
12172
11937
|
// src/de-logic/de-logic-node/prepare-param-node/prepare-param-node.ts
|
|
12173
|
-
import { ModelError as
|
|
11938
|
+
import { ModelError as ModelError9 } from "@ibiz-template/core";
|
|
12174
11939
|
import { clone as clone6 } from "ramda";
|
|
12175
11940
|
|
|
12176
11941
|
// src/de-logic/utils/handle-src-val.ts
|
|
12177
|
-
import { ModelError as
|
|
11942
|
+
import { ModelError as ModelError8 } from "@ibiz-template/core";
|
|
12178
11943
|
import { clone as clone5 } from "ramda";
|
|
12179
11944
|
function handleSrcVal(ctx, srcValParams) {
|
|
12180
11945
|
const { srcDELogicParamId, srcFieldName, srcValue } = srcValParams;
|
|
@@ -12208,7 +11973,7 @@ function handleSrcVal(ctx, srcValParams) {
|
|
|
12208
11973
|
value = clone5(ibiz.env);
|
|
12209
11974
|
break;
|
|
12210
11975
|
default:
|
|
12211
|
-
throw new
|
|
11976
|
+
throw new ModelError8(srcValParams, "\u6682\u672A\u652F\u6301\u6E90\u503C\u7C7B\u578B".concat(srcValueType));
|
|
12212
11977
|
}
|
|
12213
11978
|
if (value && srcField) {
|
|
12214
11979
|
try {
|
|
@@ -12251,7 +12016,7 @@ var PrepareParamNode = class extends DELogicNode {
|
|
|
12251
12016
|
case "SORTPARAM":
|
|
12252
12017
|
return this.sortParam(nodeParam, ctx);
|
|
12253
12018
|
default:
|
|
12254
|
-
throw new
|
|
12019
|
+
throw new ModelError9(
|
|
12255
12020
|
nodeParam,
|
|
12256
12021
|
"\u6682\u672A\u652F\u6301\u903B\u8F91\u5904\u7406\u53C2\u6570\u64CD\u4F5C".concat(nodeParam.paramAction)
|
|
12257
12022
|
);
|
|
@@ -12511,7 +12276,7 @@ var ThrowExceptionNode = class extends DELogicNode {
|
|
|
12511
12276
|
};
|
|
12512
12277
|
|
|
12513
12278
|
// src/de-logic/de-logic-param/de-logic-param.ts
|
|
12514
|
-
import { ModelError as
|
|
12279
|
+
import { ModelError as ModelError10 } from "@ibiz-template/core";
|
|
12515
12280
|
import { clone as clone8 } from "ramda";
|
|
12516
12281
|
var DELogicParam = class {
|
|
12517
12282
|
/**
|
|
@@ -12544,7 +12309,7 @@ var DELogicParam = class {
|
|
|
12544
12309
|
} else if (m.entityListParam) {
|
|
12545
12310
|
ctx.params[tag] = [];
|
|
12546
12311
|
} else if (m.entityPageParam) {
|
|
12547
|
-
throw new
|
|
12312
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u5206\u9875\u67E5\u8BE2\u7ED3\u679C");
|
|
12548
12313
|
} else if (m.entityParam) {
|
|
12549
12314
|
ctx.params[tag] = {};
|
|
12550
12315
|
} else if (m.lastReturnParam) {
|
|
@@ -12558,19 +12323,19 @@ var DELogicParam = class {
|
|
|
12558
12323
|
} else if (m.cloneParam) {
|
|
12559
12324
|
ctx.params[tag] = clone8(ctx.data || {});
|
|
12560
12325
|
} else if (m.envParam) {
|
|
12561
|
-
throw new
|
|
12326
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u7CFB\u7EDF\u73AF\u5883\u53D8\u91CF");
|
|
12562
12327
|
} else if (m.fileListParam) {
|
|
12563
|
-
throw new
|
|
12328
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u6587\u4EF6\u5BF9\u8C61\u5217\u8868\u53D8\u91CF");
|
|
12564
12329
|
} else if (m.fileParam) {
|
|
12565
|
-
throw new
|
|
12330
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u6587\u4EF6\u5BF9\u8C61\u53D8\u91CF");
|
|
12566
12331
|
} else if (m.filterParam) {
|
|
12567
|
-
throw new
|
|
12332
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u8FC7\u6EE4\u5668\u5BF9\u8C61\u53D8\u91CF");
|
|
12568
12333
|
} else if (m.lastParam) {
|
|
12569
|
-
throw new
|
|
12334
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u6700\u540E\u6570\u636E\u53D8\u91CF");
|
|
12570
12335
|
} else if (m.originEntity) {
|
|
12571
|
-
throw new
|
|
12336
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u539F\u59CB\u6570\u636E\u5BF9\u8C61");
|
|
12572
12337
|
} else if (m.sessionParam) {
|
|
12573
|
-
throw new
|
|
12338
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u64CD\u4F5C\u4F1A\u8BDD\u53D8\u91CF");
|
|
12574
12339
|
}
|
|
12575
12340
|
}
|
|
12576
12341
|
/**
|
|
@@ -12587,7 +12352,7 @@ var DELogicParam = class {
|
|
|
12587
12352
|
} else if (m.simpleParam || m.entityParam) {
|
|
12588
12353
|
ctx.params[tag] = {};
|
|
12589
12354
|
} else {
|
|
12590
|
-
throw new
|
|
12355
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B\u91CD\u65B0\u5EFA\u7ACB\u53D8\u91CF");
|
|
12591
12356
|
}
|
|
12592
12357
|
}
|
|
12593
12358
|
};
|
|
@@ -12674,7 +12439,7 @@ var DELogic = class {
|
|
|
12674
12439
|
logicNode = new SortParamNode(node);
|
|
12675
12440
|
break;
|
|
12676
12441
|
default:
|
|
12677
|
-
throw new
|
|
12442
|
+
throw new ModelError11(node, "\u672A\u652F\u6301\u7684\u903B\u8F91\u8282\u70B9\u7C7B\u578B: ".concat(logicNodeType));
|
|
12678
12443
|
}
|
|
12679
12444
|
this.nodes.set(node.id, logicNode);
|
|
12680
12445
|
});
|
|
@@ -12786,7 +12551,7 @@ async function execDELogicById(deDELogicId, dataEntityId, context, data, params)
|
|
|
12786
12551
|
context.srfappid
|
|
12787
12552
|
);
|
|
12788
12553
|
if (!deLogic) {
|
|
12789
|
-
throw new
|
|
12554
|
+
throw new RuntimeError11("".concat(dataEntityId, "\u627E\u4E0D\u5230\u5B9E\u4F53\u903B\u8F91").concat(deDELogicId));
|
|
12790
12555
|
}
|
|
12791
12556
|
return execDELogic(deLogic, context, data, params);
|
|
12792
12557
|
}
|
|
@@ -13122,7 +12887,7 @@ var DEActionMethod = class extends Method {
|
|
|
13122
12887
|
// src/service/service/entity/method/fetch.ts
|
|
13123
12888
|
import {
|
|
13124
12889
|
HttpResponse as HttpResponse4,
|
|
13125
|
-
ModelError as
|
|
12890
|
+
ModelError as ModelError12,
|
|
13126
12891
|
RuntimeModelError as RuntimeModelError19
|
|
13127
12892
|
} from "@ibiz-template/core";
|
|
13128
12893
|
import { ascSort, descSort } from "qx-util";
|
|
@@ -13153,7 +12918,7 @@ var FetchMethod = class extends Method {
|
|
|
13153
12918
|
}
|
|
13154
12919
|
break;
|
|
13155
12920
|
default:
|
|
13156
|
-
throw new
|
|
12921
|
+
throw new ModelError12(
|
|
13157
12922
|
this.method,
|
|
13158
12923
|
"\u6570\u636E\u6765\u6E90\u7C7B\u578B".concat(this.method.dataSetType, "\u6682\u672A\u652F\u6301")
|
|
13159
12924
|
);
|
|
@@ -13356,7 +13121,7 @@ var DEService = class {
|
|
|
13356
13121
|
method = new FetchMethod(this.model, model);
|
|
13357
13122
|
break;
|
|
13358
13123
|
default:
|
|
13359
|
-
throw new
|
|
13124
|
+
throw new ModelError13(
|
|
13360
13125
|
model,
|
|
13361
13126
|
"\u672A\u652F\u6301\u7684\u670D\u52A1\u65B9\u6CD5\u7C7B\u578B: ".concat(model.methodType)
|
|
13362
13127
|
);
|
|
@@ -13380,7 +13145,7 @@ var DEService = class {
|
|
|
13380
13145
|
if (method) {
|
|
13381
13146
|
return method.exec(context, params, params2);
|
|
13382
13147
|
}
|
|
13383
|
-
throw new
|
|
13148
|
+
throw new RuntimeError12("".concat(this.model.codeName, "\u672A\u652F\u6301\u300C").concat(id, "\u300D\u65B9\u6CD5"));
|
|
13384
13149
|
}
|
|
13385
13150
|
};
|
|
13386
13151
|
|
|
@@ -13646,7 +13411,7 @@ var ControlService = class {
|
|
|
13646
13411
|
};
|
|
13647
13412
|
|
|
13648
13413
|
// src/service/service/control/md-control.service.ts
|
|
13649
|
-
import { RuntimeError as
|
|
13414
|
+
import { RuntimeError as RuntimeError13 } from "@ibiz-template/core";
|
|
13650
13415
|
import { isArray as isArray3 } from "qx-util";
|
|
13651
13416
|
var MDControlService = class extends ControlService {
|
|
13652
13417
|
/**
|
|
@@ -13755,7 +13520,7 @@ var MDControlService = class extends ControlService {
|
|
|
13755
13520
|
* @returns {*} {Promise<IHttpResponse>}
|
|
13756
13521
|
*/
|
|
13757
13522
|
async exportData(_dataExport, _context, _params = {}) {
|
|
13758
|
-
throw new
|
|
13523
|
+
throw new RuntimeError13("\u672A\u5B9E\u73B0");
|
|
13759
13524
|
}
|
|
13760
13525
|
/**
|
|
13761
13526
|
* 处理响应
|
|
@@ -13790,7 +13555,7 @@ var MDControlService = class extends ControlService {
|
|
|
13790
13555
|
};
|
|
13791
13556
|
|
|
13792
13557
|
// src/service/service/authority/authority.service.ts
|
|
13793
|
-
import { RuntimeError as
|
|
13558
|
+
import { RuntimeError as RuntimeError14 } from "@ibiz-template/core";
|
|
13794
13559
|
|
|
13795
13560
|
// src/service/service/authority/de-authority.service.ts
|
|
13796
13561
|
var DeAuthorityService = class {
|
|
@@ -13926,7 +13691,7 @@ var AuthorityService = class {
|
|
|
13926
13691
|
this.appModel.appId
|
|
13927
13692
|
);
|
|
13928
13693
|
if (!entityModel) {
|
|
13929
|
-
throw new
|
|
13694
|
+
throw new RuntimeError14("\u672A\u627E\u5230\u5E94\u7528\u5B9E\u4F53[".concat(id, "]"));
|
|
13930
13695
|
}
|
|
13931
13696
|
const constructor = this.constructorCache.get(id);
|
|
13932
13697
|
let service;
|
|
@@ -14311,7 +14076,7 @@ var CalendarItemData = class {
|
|
|
14311
14076
|
};
|
|
14312
14077
|
|
|
14313
14078
|
// src/service/de-service-util.ts
|
|
14314
|
-
import { RuntimeError as
|
|
14079
|
+
import { RuntimeError as RuntimeError15 } from "@ibiz-template/core";
|
|
14315
14080
|
var DEServiceUtil = class {
|
|
14316
14081
|
/**
|
|
14317
14082
|
* Creates an instance of DEServiceUtil.
|
|
@@ -14351,63 +14116,343 @@ var DEServiceUtil = class {
|
|
|
14351
14116
|
this.constructorCache.set(id, constructor);
|
|
14352
14117
|
}
|
|
14353
14118
|
/**
|
|
14354
|
-
* 根据实体标识获取实体服务
|
|
14119
|
+
* 根据实体标识获取实体服务
|
|
14120
|
+
*
|
|
14121
|
+
* @author chitanda
|
|
14122
|
+
* @date 2022-12-23 10:12:24
|
|
14123
|
+
* @param {string} id 实体标识
|
|
14124
|
+
* @param {IParams} [context] 上下文,用于计算模型所属沙箱环境
|
|
14125
|
+
* @return {*} {Promise<IAppDEService>}
|
|
14126
|
+
*/
|
|
14127
|
+
async getService(id) {
|
|
14128
|
+
if (!this.cache.has(id)) {
|
|
14129
|
+
const entityModel = await ibiz.hub.getAppDataEntity(
|
|
14130
|
+
id,
|
|
14131
|
+
this.appModel.appId
|
|
14132
|
+
);
|
|
14133
|
+
if (!entityModel) {
|
|
14134
|
+
throw new RuntimeError15("\u672A\u627E\u5230\u5E94\u7528\u5B9E\u4F53[".concat(id, "]"));
|
|
14135
|
+
}
|
|
14136
|
+
const constructor = this.constructorCache.get(id);
|
|
14137
|
+
let service;
|
|
14138
|
+
if (constructor) {
|
|
14139
|
+
service = await constructor(entityModel);
|
|
14140
|
+
} else {
|
|
14141
|
+
service = new DEService(entityModel);
|
|
14142
|
+
}
|
|
14143
|
+
this.cache.set(id, service);
|
|
14144
|
+
}
|
|
14145
|
+
return this.cache.get(id);
|
|
14146
|
+
}
|
|
14147
|
+
/**
|
|
14148
|
+
* 清理所有服务, 当前临时域下的所有临时数据缓存
|
|
14149
|
+
*
|
|
14150
|
+
* @description 根据 srfsessionid 作为临时数据域
|
|
14151
|
+
* @author chitanda
|
|
14152
|
+
* @date 2022-08-18 14:08:48
|
|
14153
|
+
* @param {IParams} context
|
|
14154
|
+
*/
|
|
14155
|
+
clearTempCache(context) {
|
|
14156
|
+
this.cache.forEach((service) => {
|
|
14157
|
+
service.local.clear(context);
|
|
14158
|
+
});
|
|
14159
|
+
}
|
|
14160
|
+
/**
|
|
14161
|
+
* 执行服务方法
|
|
14162
|
+
* @author lxm
|
|
14163
|
+
* @date 2023-04-26 02:02:43
|
|
14164
|
+
* @param {string} appDataEntityId 实体名称
|
|
14165
|
+
* @param {string} methodName 方法名
|
|
14166
|
+
* @param {IParams} context 上下文
|
|
14167
|
+
* @param {(IData | undefined)} [params] 数据
|
|
14168
|
+
* @param {(IParams | undefined)} [params2] 视图参数
|
|
14169
|
+
* @return {*} {Promise<IHttpResponse<IData>>}
|
|
14170
|
+
*/
|
|
14171
|
+
async exec(appDataEntityId, methodName, context, params, params2) {
|
|
14172
|
+
const service = await this.getService(appDataEntityId);
|
|
14173
|
+
return service.exec(methodName, context, params, params2);
|
|
14174
|
+
}
|
|
14175
|
+
};
|
|
14176
|
+
|
|
14177
|
+
// src/command/app/open-app-view/open-app-view.ts
|
|
14178
|
+
var _OpenAppViewCommand = class _OpenAppViewCommand {
|
|
14179
|
+
constructor() {
|
|
14180
|
+
ibiz.commands.register(_OpenAppViewCommand.TAG, this.exec.bind(this));
|
|
14181
|
+
}
|
|
14182
|
+
/**
|
|
14183
|
+
* xhr模式打开
|
|
14184
|
+
*
|
|
14185
|
+
* @author chitanda
|
|
14186
|
+
* @date 2022-08-25 23:08:08
|
|
14187
|
+
* @param {string} appViewId
|
|
14188
|
+
* @param {IContext} [context]
|
|
14189
|
+
* @param {IParams} [params={}]
|
|
14190
|
+
* @param {IData} [_opts={}]
|
|
14191
|
+
* @return {*} {(Promise<IModalData | void>)}
|
|
14192
|
+
*/
|
|
14193
|
+
async exec(appViewId, _context, params = {}, opts = {}) {
|
|
14194
|
+
const context = clone11(_context);
|
|
14195
|
+
const appView = await ibiz.hub.config.view.get(appViewId);
|
|
14196
|
+
if (!appView) {
|
|
14197
|
+
throw new RuntimeError16("\u5E94\u7528\u89C6\u56FE[".concat(appViewId, "]\u4E0D\u5B58\u5728"));
|
|
14198
|
+
}
|
|
14199
|
+
if ((context.srfkey || params.srfuf === 0 /* CREATE */) && appView.appDataEntityId) {
|
|
14200
|
+
const deName = calcDeCodeNameById(appView.appDataEntityId);
|
|
14201
|
+
if (context.srfkey) {
|
|
14202
|
+
context[deName] = context.srfkey;
|
|
14203
|
+
context.srfkey = void 0;
|
|
14204
|
+
}
|
|
14205
|
+
if (params.srfuf === 0 /* CREATE */) {
|
|
14206
|
+
context[deName] = void 0;
|
|
14207
|
+
delete params.srfuf;
|
|
14208
|
+
}
|
|
14209
|
+
}
|
|
14210
|
+
if (appView.redirectView) {
|
|
14211
|
+
const fullViewModel = await ibiz.hub.getAppView(appViewId);
|
|
14212
|
+
return openRedirectView(
|
|
14213
|
+
fullViewModel,
|
|
14214
|
+
context,
|
|
14215
|
+
params,
|
|
14216
|
+
opts
|
|
14217
|
+
);
|
|
14218
|
+
}
|
|
14219
|
+
const { openMode = "INDEXVIEWTAB" } = appView;
|
|
14220
|
+
switch (opts.openMode || openMode) {
|
|
14221
|
+
case "INDEXVIEWTAB":
|
|
14222
|
+
if (opts.noWaitRoute) {
|
|
14223
|
+
this.openIndexViewTab(appView, context, params);
|
|
14224
|
+
return { ok: true };
|
|
14225
|
+
}
|
|
14226
|
+
return this.openIndexViewTab(appView, context, params);
|
|
14227
|
+
case "POPUP":
|
|
14228
|
+
throw new ModelError14(appView, "\u672A\u652F\u6301\u7684\u89C6\u56FE\u6253\u5F00\u6A21\u5F0F: POPUP");
|
|
14229
|
+
case "POPUPMODAL":
|
|
14230
|
+
return this.openModal(appView, context, params);
|
|
14231
|
+
case "POPUPAPP":
|
|
14232
|
+
throw new ModelError14(appView, "\u672A\u652F\u6301\u7684\u89C6\u56FE\u6253\u5F00\u6A21\u5F0F: POPUPAPP");
|
|
14233
|
+
case "POPOVER":
|
|
14234
|
+
return this.openPopover(appView, opts.event, context, params);
|
|
14235
|
+
case "DRAWER_LEFT":
|
|
14236
|
+
case "DRAWER_RIGHT":
|
|
14237
|
+
case "DRAWER_TOP":
|
|
14238
|
+
case "DRAWER_BOTTOM":
|
|
14239
|
+
return this.openDrawer(appView, context, params);
|
|
14240
|
+
case "USER":
|
|
14241
|
+
return this.openUserCustom(appView, context, params);
|
|
14242
|
+
default:
|
|
14243
|
+
return this.openIndexViewTab(appView, context, params);
|
|
14244
|
+
}
|
|
14245
|
+
}
|
|
14246
|
+
/**
|
|
14247
|
+
* 首页导航模式打开
|
|
14248
|
+
*
|
|
14249
|
+
* @author chitanda
|
|
14250
|
+
* @date 2022-07-25 20:07:43
|
|
14251
|
+
* @protected
|
|
14252
|
+
* @param {IViewConfig} appView
|
|
14253
|
+
* @param {IContext} [context]
|
|
14254
|
+
* @param {IParams} [params={}]
|
|
14255
|
+
*/
|
|
14256
|
+
openIndexViewTab(appView, context, params = {}) {
|
|
14257
|
+
return ibiz.openView.root(appView.id, context, params);
|
|
14258
|
+
}
|
|
14259
|
+
/**
|
|
14260
|
+
* 模态窗口打开
|
|
14261
|
+
*
|
|
14262
|
+
* @author chitanda
|
|
14263
|
+
* @date 2022-07-25 20:07:55
|
|
14264
|
+
* @protected
|
|
14265
|
+
* @param {IViewConfig} appView
|
|
14266
|
+
* @param {IContext} [context]
|
|
14267
|
+
* @param {IParams} [params={}]
|
|
14268
|
+
* @return {*} {Promise<IModalData>}
|
|
14269
|
+
*/
|
|
14270
|
+
async openModal(appView, context, params = {}) {
|
|
14271
|
+
return ibiz.openView.modal(appView.id, context, params);
|
|
14272
|
+
}
|
|
14273
|
+
/**
|
|
14274
|
+
* 气泡模式打开
|
|
14275
|
+
*
|
|
14276
|
+
* @author chitanda
|
|
14277
|
+
* @date 2022-07-25 20:07:17
|
|
14278
|
+
* @protected
|
|
14279
|
+
* @param {IViewConfig} appView
|
|
14280
|
+
* @param {IContext} [context]
|
|
14281
|
+
* @param {IParams} [params={}]
|
|
14282
|
+
* @return {*} {Promise<IModalData>}
|
|
14283
|
+
*/
|
|
14284
|
+
async openPopover(appView, event, context, params = {}) {
|
|
14285
|
+
if (!event) {
|
|
14286
|
+
throw new RuntimeError16("\u6C14\u6CE1\u6253\u5F00\u7F3A\u5C11event");
|
|
14287
|
+
}
|
|
14288
|
+
return ibiz.openView.popover(appView.id, event, context, params);
|
|
14289
|
+
}
|
|
14290
|
+
/**
|
|
14291
|
+
* 抽屉模式打开
|
|
14292
|
+
*
|
|
14293
|
+
* @author chitanda
|
|
14294
|
+
* @date 2022-07-25 20:07:08
|
|
14295
|
+
* @protected
|
|
14296
|
+
* @param {IViewConfig} appView
|
|
14297
|
+
* @param {IContext} [context]
|
|
14298
|
+
* @param {IParams} [params={}]
|
|
14299
|
+
* @return {*} {Promise<void>}
|
|
14300
|
+
*/
|
|
14301
|
+
async openDrawer(appView, context, params = {}) {
|
|
14302
|
+
return ibiz.openView.drawer(appView.id, context, params);
|
|
14303
|
+
}
|
|
14304
|
+
/**
|
|
14305
|
+
* 用户自定义
|
|
14306
|
+
*
|
|
14307
|
+
* @author chitanda
|
|
14308
|
+
* @date 2022-07-25 20:07:41
|
|
14309
|
+
* @protected
|
|
14310
|
+
* @param {IViewConfig} appView
|
|
14311
|
+
* @param {IContext} [context]
|
|
14312
|
+
* @param {IParams} [params={}]
|
|
14313
|
+
* @return {*} {Promise<void>}
|
|
14314
|
+
*/
|
|
14315
|
+
async openUserCustom(appView, context, params = {}) {
|
|
14316
|
+
return ibiz.openView.custom(appView.id, context, params);
|
|
14317
|
+
}
|
|
14318
|
+
};
|
|
14319
|
+
_OpenAppViewCommand.TAG = "ibiz.app-view.open";
|
|
14320
|
+
var OpenAppViewCommand = _OpenAppViewCommand;
|
|
14321
|
+
|
|
14322
|
+
// src/command/app/app-func/app-func.ts
|
|
14323
|
+
var _AppFuncCommand = class _AppFuncCommand {
|
|
14324
|
+
constructor() {
|
|
14325
|
+
ibiz.commands.register(_AppFuncCommand.TAG, this.exec.bind(this));
|
|
14326
|
+
}
|
|
14327
|
+
/**
|
|
14328
|
+
* 执行应用功能
|
|
14329
|
+
*
|
|
14330
|
+
* @author chitanda
|
|
14331
|
+
* @date 2022-07-25 17:07:35
|
|
14332
|
+
* @param {IAppFunc} appFunc 应用功能模型
|
|
14333
|
+
* @param {IContext} [context] 执行上下文
|
|
14334
|
+
* @param {IParams} [params={}] 参数
|
|
14335
|
+
* @param {IData} [opts={}] 额外参数,与具体执行对象规划好的额外参数。如需要给飘窗使用的 event 事件对象.
|
|
14336
|
+
* @return {*} {Promise<void>}
|
|
14337
|
+
*/
|
|
14338
|
+
async exec(appFuncId, context, params = {}, opts = {}) {
|
|
14339
|
+
const appFunc = ibiz.hub.getApp(context.srfappid).getAppFunc(appFuncId);
|
|
14340
|
+
if (!appFunc) {
|
|
14341
|
+
throw new RuntimeError17("\u627E\u4E0D\u5230\u53EB".concat(appFuncId, "\u7684\u5E94\u7528\u529F\u80FD"));
|
|
14342
|
+
}
|
|
14343
|
+
const { navigateContexts, navigateParams, appFuncType } = appFunc;
|
|
14344
|
+
const _context = context.clone();
|
|
14345
|
+
Object.assign(_context, convertNavData(navigateContexts, params, context));
|
|
14346
|
+
const _params = convertNavData(navigateParams, params, context);
|
|
14347
|
+
switch (appFuncType) {
|
|
14348
|
+
case "APPVIEW":
|
|
14349
|
+
return this.openAppView(appFunc, _context, _params, opts);
|
|
14350
|
+
case "OPENHTMLPAGE":
|
|
14351
|
+
return this.openHtmlPage(appFunc);
|
|
14352
|
+
case "PDTAPPFUNC":
|
|
14353
|
+
return this.openPdAppFunc(appFunc, _context, _params);
|
|
14354
|
+
case "JAVASCRIPT":
|
|
14355
|
+
return this.executeJavaScript(appFunc, _context, _params);
|
|
14356
|
+
case "CUSTOM":
|
|
14357
|
+
return this.custom(appFunc, _context, _params);
|
|
14358
|
+
default:
|
|
14359
|
+
throw new ModelError15(appFunc, "\u672A\u652F\u6301\u7684\u5E94\u7528\u529F\u80FD\u7C7B\u578B: ".concat(appFuncType));
|
|
14360
|
+
}
|
|
14361
|
+
}
|
|
14362
|
+
/**
|
|
14363
|
+
* 打开应用视图
|
|
14364
|
+
*
|
|
14365
|
+
* @author chitanda
|
|
14366
|
+
* @date 2022-07-25 18:07:49
|
|
14367
|
+
* @protected
|
|
14368
|
+
* @param {IAppFunc} appFunc
|
|
14369
|
+
* @param {IContext} [context]
|
|
14370
|
+
* @param {IParams} [params]
|
|
14371
|
+
* @return {*} {Promise<void>}
|
|
14372
|
+
*/
|
|
14373
|
+
async openAppView(appFunc, context, params, opts) {
|
|
14374
|
+
if (!appFunc.appViewId) {
|
|
14375
|
+
throw new RuntimeError17("\u5E94\u7528\u89C6\u56FE[".concat(appFunc.appViewId, "]\u4E0D\u5B58\u5728"));
|
|
14376
|
+
}
|
|
14377
|
+
return ibiz.commands.execute(
|
|
14378
|
+
OpenAppViewCommand.TAG,
|
|
14379
|
+
appFunc.appViewId,
|
|
14380
|
+
context,
|
|
14381
|
+
params,
|
|
14382
|
+
opts
|
|
14383
|
+
);
|
|
14384
|
+
}
|
|
14385
|
+
/**
|
|
14386
|
+
* 打开HTML页面
|
|
14387
|
+
*
|
|
14388
|
+
* @author chitanda
|
|
14389
|
+
* @date 2022-07-25 18:07:56
|
|
14390
|
+
* @protected
|
|
14391
|
+
* @param {IAppFunc} appFunc
|
|
14392
|
+
*/
|
|
14393
|
+
openHtmlPage(appFunc) {
|
|
14394
|
+
const url = appFunc.htmlPageUrl;
|
|
14395
|
+
window.open(url, "_blank");
|
|
14396
|
+
}
|
|
14397
|
+
/**
|
|
14398
|
+
* 应用预置功能
|
|
14355
14399
|
*
|
|
14356
14400
|
* @author chitanda
|
|
14357
|
-
* @date 2022-
|
|
14358
|
-
* @
|
|
14359
|
-
* @param {
|
|
14360
|
-
* @
|
|
14401
|
+
* @date 2022-07-25 18:07:22
|
|
14402
|
+
* @protected
|
|
14403
|
+
* @param {IAppFunc} appFunc
|
|
14404
|
+
* @param {IContext} [context]
|
|
14405
|
+
* @param {IParams} [params]
|
|
14361
14406
|
*/
|
|
14362
|
-
|
|
14363
|
-
|
|
14364
|
-
|
|
14365
|
-
id,
|
|
14366
|
-
this.appModel.appId
|
|
14367
|
-
);
|
|
14368
|
-
if (!entityModel) {
|
|
14369
|
-
throw new RuntimeError17("\u672A\u627E\u5230\u5E94\u7528\u5B9E\u4F53[".concat(id, "]"));
|
|
14370
|
-
}
|
|
14371
|
-
const constructor = this.constructorCache.get(id);
|
|
14372
|
-
let service;
|
|
14373
|
-
if (constructor) {
|
|
14374
|
-
service = await constructor(entityModel);
|
|
14375
|
-
} else {
|
|
14376
|
-
service = new DEService(entityModel);
|
|
14377
|
-
}
|
|
14378
|
-
this.cache.set(id, service);
|
|
14379
|
-
}
|
|
14380
|
-
return this.cache.get(id);
|
|
14407
|
+
openPdAppFunc(appFunc, context, params) {
|
|
14408
|
+
ibiz.log.warn("openPdAppFunc", appFunc, context, params);
|
|
14409
|
+
throw new RuntimeError17("\u672A\u5B9E\u73B0");
|
|
14381
14410
|
}
|
|
14382
14411
|
/**
|
|
14383
|
-
*
|
|
14412
|
+
* 执行 JavaScript 脚本
|
|
14384
14413
|
*
|
|
14385
|
-
* @description 根据 srfsessionid 作为临时数据域
|
|
14386
14414
|
* @author chitanda
|
|
14387
|
-
* @date 2022-
|
|
14388
|
-
* @
|
|
14415
|
+
* @date 2022-07-25 18:07:09
|
|
14416
|
+
* @protected
|
|
14417
|
+
* @param {IAppFunc} appFunc
|
|
14418
|
+
* @param {IContext} [context]
|
|
14419
|
+
* @param {IParams} [params]
|
|
14389
14420
|
*/
|
|
14390
|
-
|
|
14391
|
-
|
|
14392
|
-
|
|
14393
|
-
});
|
|
14421
|
+
executeJavaScript(appFunc, context, params) {
|
|
14422
|
+
ibiz.log.warn("executeJavaScript", appFunc, context, params);
|
|
14423
|
+
throw new RuntimeError17("\u672A\u5B9E\u73B0");
|
|
14394
14424
|
}
|
|
14395
14425
|
/**
|
|
14396
|
-
*
|
|
14397
|
-
*
|
|
14398
|
-
* @
|
|
14399
|
-
* @
|
|
14400
|
-
* @
|
|
14401
|
-
* @param {
|
|
14402
|
-
* @param {
|
|
14403
|
-
* @param {
|
|
14404
|
-
* @return {*} {Promise<IHttpResponse<IData>>}
|
|
14426
|
+
* 自定义应用功能
|
|
14427
|
+
*
|
|
14428
|
+
* @author chitanda
|
|
14429
|
+
* @date 2022-07-25 18:07:51
|
|
14430
|
+
* @protected
|
|
14431
|
+
* @param {IAppFunc} appFunc
|
|
14432
|
+
* @param {IContext} [context]
|
|
14433
|
+
* @param {IParams} [params]
|
|
14405
14434
|
*/
|
|
14406
|
-
|
|
14407
|
-
|
|
14408
|
-
|
|
14435
|
+
custom(appFunc, context, params) {
|
|
14436
|
+
ibiz.log.warn("custom", appFunc, context, params);
|
|
14437
|
+
throw new RuntimeError17("\u672A\u5B9E\u73B0");
|
|
14409
14438
|
}
|
|
14410
14439
|
};
|
|
14440
|
+
/**
|
|
14441
|
+
* 指令标识
|
|
14442
|
+
*
|
|
14443
|
+
* @author chitanda
|
|
14444
|
+
* @date 2022-07-25 17:07:20
|
|
14445
|
+
* @see 具体实现 {@link AppFuncCommand.exec}
|
|
14446
|
+
* @static
|
|
14447
|
+
*/
|
|
14448
|
+
_AppFuncCommand.TAG = "ibiz.app-func.exec";
|
|
14449
|
+
var AppFuncCommand = _AppFuncCommand;
|
|
14450
|
+
|
|
14451
|
+
// src/command/index.ts
|
|
14452
|
+
function installCommand() {
|
|
14453
|
+
new AppFuncCommand();
|
|
14454
|
+
new OpenAppViewCommand();
|
|
14455
|
+
}
|
|
14411
14456
|
|
|
14412
14457
|
// src/app-hub.ts
|
|
14413
14458
|
import { RuntimeError as RuntimeError48 } from "@ibiz-template/core";
|
|
@@ -14657,9 +14702,9 @@ var PanelNotifyState = /* @__PURE__ */ ((PanelNotifyState2) => {
|
|
|
14657
14702
|
})(PanelNotifyState || {});
|
|
14658
14703
|
|
|
14659
14704
|
// src/controller/common/view/view.controller.ts
|
|
14660
|
-
import { createUUID as createUUID3, notNilEmpty as
|
|
14705
|
+
import { createUUID as createUUID3, notNilEmpty as notNilEmpty7 } from "qx-util";
|
|
14661
14706
|
import { IBizContext as IBizContext2, RuntimeError as RuntimeError24 } from "@ibiz-template/core";
|
|
14662
|
-
import { isEmpty as isEmpty8, isNil as isNil15, isNotNil as
|
|
14707
|
+
import { isEmpty as isEmpty8, isNil as isNil15, isNotNil as isNotNil2 } from "ramda";
|
|
14663
14708
|
|
|
14664
14709
|
// src/controller/utils/loading/loading.state.ts
|
|
14665
14710
|
import { NOOP } from "@ibiz-template/core";
|
|
@@ -15283,7 +15328,7 @@ function getOriginData(data) {
|
|
|
15283
15328
|
|
|
15284
15329
|
// src/controller/utils/value-rule/value-rule.ts
|
|
15285
15330
|
import { RuntimeError as RuntimeError20 } from "@ibiz-template/core";
|
|
15286
|
-
import { isNilOrEmpty as
|
|
15331
|
+
import { isNilOrEmpty as isNilOrEmpty6 } from "qx-util";
|
|
15287
15332
|
function generateRules(itemVRs, name, valueItemName) {
|
|
15288
15333
|
const rules = [];
|
|
15289
15334
|
itemVRs.forEach((item) => {
|
|
@@ -15322,7 +15367,7 @@ function generateRules(itemVRs, name, valueItemName) {
|
|
|
15322
15367
|
const valueName = valueItemName || name;
|
|
15323
15368
|
rules.push({
|
|
15324
15369
|
validator: (rule, value, callback, source) => {
|
|
15325
|
-
if (
|
|
15370
|
+
if (isNilOrEmpty6(source[valueName])) {
|
|
15326
15371
|
return true;
|
|
15327
15372
|
}
|
|
15328
15373
|
const { isPast, infoMessage } = verifyDeRules(
|
|
@@ -15394,7 +15439,7 @@ var ValueExUtil = class {
|
|
|
15394
15439
|
import { RuntimeError as RuntimeError22, ModelError as ModelError16 } from "@ibiz-template/core";
|
|
15395
15440
|
import dayjs from "dayjs";
|
|
15396
15441
|
import { createUUID as createUUID2 } from "qx-util";
|
|
15397
|
-
import { isNil as isNil13, isNotNil
|
|
15442
|
+
import { isNil as isNil13, isNotNil } from "ramda";
|
|
15398
15443
|
function getDefaultValue(opts, origins) {
|
|
15399
15444
|
var _a;
|
|
15400
15445
|
const { name, valueType, defaultValue, valueFormat } = opts;
|
|
@@ -15406,7 +15451,7 @@ function getDefaultValue(opts, origins) {
|
|
|
15406
15451
|
return null;
|
|
15407
15452
|
}
|
|
15408
15453
|
const value = data[name];
|
|
15409
|
-
if (
|
|
15454
|
+
if (isNotNil(value)) {
|
|
15410
15455
|
return;
|
|
15411
15456
|
}
|
|
15412
15457
|
if (!valueType && defaultValue) {
|
|
@@ -15989,7 +16034,7 @@ var ViewController = class extends BaseController {
|
|
|
15989
16034
|
async onCreated() {
|
|
15990
16035
|
await super.onCreated();
|
|
15991
16036
|
this.modal.hooks.beforeDismiss.tapPromise(async (modalData) => {
|
|
15992
|
-
if (
|
|
16037
|
+
if (isNotNil2(this.state.closeOK)) {
|
|
15993
16038
|
modalData.ok = this.state.closeOK;
|
|
15994
16039
|
}
|
|
15995
16040
|
await this._evt.emit("onCloseView", { ...modalData });
|
|
@@ -16065,13 +16110,13 @@ var ViewController = class extends BaseController {
|
|
|
16065
16110
|
}
|
|
16066
16111
|
const navContexts = this.model.appViewNavContexts;
|
|
16067
16112
|
let context = {};
|
|
16068
|
-
if (
|
|
16113
|
+
if (notNilEmpty7(navContexts)) {
|
|
16069
16114
|
context = convertNavData(navContexts, this.params, this.context);
|
|
16070
16115
|
}
|
|
16071
16116
|
Object.assign(this.context, context);
|
|
16072
16117
|
const navParams = this.model.appViewNavParams;
|
|
16073
16118
|
let params = {};
|
|
16074
|
-
if (
|
|
16119
|
+
if (notNilEmpty7(navParams)) {
|
|
16075
16120
|
params = convertNavData(navParams, this.params, this.context);
|
|
16076
16121
|
}
|
|
16077
16122
|
Object.assign(this.params, params);
|
|
@@ -16373,6 +16418,7 @@ var CodeListEditorController = class extends EditorController {
|
|
|
16373
16418
|
// src/controller/common/control/control.controller.ts
|
|
16374
16419
|
import { NoticeError } from "@ibiz-template/core";
|
|
16375
16420
|
import { isNil as isNil16 } from "ramda";
|
|
16421
|
+
import { notNilEmpty as notNilEmpty8 } from "qx-util";
|
|
16376
16422
|
var ControlController = class extends BaseController {
|
|
16377
16423
|
/**
|
|
16378
16424
|
* Creates an instance of ControlController.
|
|
@@ -16385,6 +16431,15 @@ var ControlController = class extends BaseController {
|
|
|
16385
16431
|
*/
|
|
16386
16432
|
constructor(model, context, params, ctx) {
|
|
16387
16433
|
super(model, context, params, ctx);
|
|
16434
|
+
/**
|
|
16435
|
+
* 部件参数
|
|
16436
|
+
*
|
|
16437
|
+
* @author zk
|
|
16438
|
+
* @date 2023-09-26 03:09:21
|
|
16439
|
+
* @type {IData}
|
|
16440
|
+
* @memberof ControlController
|
|
16441
|
+
*/
|
|
16442
|
+
this.controlParams = {};
|
|
16388
16443
|
/**
|
|
16389
16444
|
* 子适配器
|
|
16390
16445
|
* @author lxm
|
|
@@ -16440,6 +16495,7 @@ var ControlController = class extends BaseController {
|
|
|
16440
16495
|
const provider = await getControlProvider(this.controlPanel);
|
|
16441
16496
|
this.providers[this.controlPanel.name] = provider;
|
|
16442
16497
|
}
|
|
16498
|
+
this.handleControlParams();
|
|
16443
16499
|
this.initControlScheduler(this.model.controlLogics);
|
|
16444
16500
|
}
|
|
16445
16501
|
async onDestroyed() {
|
|
@@ -16518,6 +16574,22 @@ var ControlController = class extends BaseController {
|
|
|
16518
16574
|
});
|
|
16519
16575
|
}
|
|
16520
16576
|
}
|
|
16577
|
+
/**
|
|
16578
|
+
* 部件参数解析
|
|
16579
|
+
*
|
|
16580
|
+
* @author zk
|
|
16581
|
+
* @date 2023-09-27 07:09:08
|
|
16582
|
+
* @protected
|
|
16583
|
+
* @memberof ControlController
|
|
16584
|
+
*/
|
|
16585
|
+
handleControlParams() {
|
|
16586
|
+
const { ctrlParams } = this.model.controlParam;
|
|
16587
|
+
let params = {};
|
|
16588
|
+
if (notNilEmpty8(ctrlParams)) {
|
|
16589
|
+
params = convertNavData(ctrlParams, this.params, this.context);
|
|
16590
|
+
}
|
|
16591
|
+
Object.assign(this.controlParams, params);
|
|
16592
|
+
}
|
|
16521
16593
|
/**
|
|
16522
16594
|
* 初始化部件逻辑调度器
|
|
16523
16595
|
* @author lxm
|
|
@@ -16789,7 +16861,7 @@ var MDControlController = class extends ControlController {
|
|
|
16789
16861
|
let needRefresh = false;
|
|
16790
16862
|
try {
|
|
16791
16863
|
const deName = calcDeCodeNameById(this.model.appDataEntityId);
|
|
16792
|
-
await
|
|
16864
|
+
await handleAllSettled(
|
|
16793
16865
|
data.map(async (item) => {
|
|
16794
16866
|
if (item.srfuf !== 0 /* CREATE */) {
|
|
16795
16867
|
const tempContext = context.clone();
|
|
@@ -17346,7 +17418,7 @@ import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
|
|
|
17346
17418
|
import quarterOfYear from "dayjs/plugin/quarterOfYear";
|
|
17347
17419
|
import weekOfYear from "dayjs/plugin/weekOfYear";
|
|
17348
17420
|
import isoWeek from "dayjs/plugin/isoWeek";
|
|
17349
|
-
import { clone as
|
|
17421
|
+
import { clone as clone12, isNil as isNil17, mergeDeepRight } from "ramda";
|
|
17350
17422
|
dayjs3.extend(minMax);
|
|
17351
17423
|
dayjs3.extend(isSameOrBefore);
|
|
17352
17424
|
dayjs3.extend(quarterOfYear);
|
|
@@ -17569,7 +17641,7 @@ var BaseSeriesGenerator = class {
|
|
|
17569
17641
|
dataPreprocess(data) {
|
|
17570
17642
|
const tempData = [];
|
|
17571
17643
|
data.forEach((singleData) => {
|
|
17572
|
-
tempData.push(
|
|
17644
|
+
tempData.push(clone12(singleData));
|
|
17573
17645
|
});
|
|
17574
17646
|
const { groupMode } = this.model;
|
|
17575
17647
|
if (groupMode) {
|
|
@@ -18909,11 +18981,11 @@ var EndNode2 = class extends UILogicNode {
|
|
|
18909
18981
|
|
|
18910
18982
|
// src/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.ts
|
|
18911
18983
|
import { ModelError as ModelError21 } from "@ibiz-template/core";
|
|
18912
|
-
import { clone as
|
|
18984
|
+
import { clone as clone14 } from "ramda";
|
|
18913
18985
|
|
|
18914
18986
|
// src/ui-logic/utils/handle-src-val.ts
|
|
18915
18987
|
import { ModelError as ModelError20 } from "@ibiz-template/core";
|
|
18916
|
-
import { clone as
|
|
18988
|
+
import { clone as clone13 } from "ramda";
|
|
18917
18989
|
function handleSrcVal2(ctx, srcValParams) {
|
|
18918
18990
|
const { srcDEUILogicParamId, srcFieldName, srcValue } = srcValParams;
|
|
18919
18991
|
const srcValueType = srcValParams.srcValueType || "SRCDLPARAM";
|
|
@@ -18943,7 +19015,7 @@ function handleSrcVal2(ctx, srcValParams) {
|
|
|
18943
19015
|
value = ctx.context;
|
|
18944
19016
|
break;
|
|
18945
19017
|
case "ENVPARAM":
|
|
18946
|
-
value =
|
|
19018
|
+
value = clone13(ibiz.env);
|
|
18947
19019
|
break;
|
|
18948
19020
|
default:
|
|
18949
19021
|
throw new ModelError20(srcValParams, "\u6682\u672A\u652F\u6301\u6E90\u503C\u7C7B\u578B".concat(srcValueType));
|
|
@@ -19037,7 +19109,7 @@ var PrepareJSParamNode = class extends UILogicNode {
|
|
|
19037
19109
|
copyParam(nodeParam, ctx) {
|
|
19038
19110
|
const { dstDEUILogicParamId } = nodeParam;
|
|
19039
19111
|
const srcVal = handleSrcVal2(ctx, nodeParam);
|
|
19040
|
-
ctx.params[dstDEUILogicParamId] =
|
|
19112
|
+
ctx.params[dstDEUILogicParamId] = clone14(srcVal);
|
|
19041
19113
|
}
|
|
19042
19114
|
/**
|
|
19043
19115
|
* 绑定参数
|
|
@@ -19254,7 +19326,7 @@ var ResetParamNode2 = class extends UILogicNode {
|
|
|
19254
19326
|
|
|
19255
19327
|
// src/ui-logic/ui-logic-node/copy-param-node/copy-param-node.ts
|
|
19256
19328
|
import { RuntimeModelError as RuntimeModelError37 } from "@ibiz-template/core";
|
|
19257
|
-
import { clone as
|
|
19329
|
+
import { clone as clone15 } from "ramda";
|
|
19258
19330
|
var CopyParamNode2 = class extends UILogicNode {
|
|
19259
19331
|
async exec(ctx) {
|
|
19260
19332
|
const { dstDEUILogicParamId, srcDEUILogicParamId } = this.model;
|
|
@@ -19265,7 +19337,7 @@ var CopyParamNode2 = class extends UILogicNode {
|
|
|
19265
19337
|
);
|
|
19266
19338
|
}
|
|
19267
19339
|
const srcVal = handleSrcVal2(ctx, this.model);
|
|
19268
|
-
ctx.params[dstDEUILogicParamId] =
|
|
19340
|
+
ctx.params[dstDEUILogicParamId] = clone15(srcVal);
|
|
19269
19341
|
}
|
|
19270
19342
|
};
|
|
19271
19343
|
|
|
@@ -19843,7 +19915,7 @@ var UIActionProviderBase = class {
|
|
|
19843
19915
|
async isConfirm(action, args) {
|
|
19844
19916
|
const confirmMsg = this.calcMessage("confirm", action, args);
|
|
19845
19917
|
if (action.enableConfirm && confirmMsg) {
|
|
19846
|
-
return ibiz.
|
|
19918
|
+
return ibiz.confirm.warning({ title: "\u64CD\u4F5C\u786E\u8BA4", desc: confirmMsg });
|
|
19847
19919
|
}
|
|
19848
19920
|
return true;
|
|
19849
19921
|
}
|
|
@@ -20288,7 +20360,7 @@ var ToolbarController = class extends ControlController {
|
|
|
20288
20360
|
},
|
|
20289
20361
|
{ childrenFields: ["detoolbarItems"] }
|
|
20290
20362
|
);
|
|
20291
|
-
await this.
|
|
20363
|
+
await this.calcButtonState();
|
|
20292
20364
|
}
|
|
20293
20365
|
/**
|
|
20294
20366
|
* 工具栏按钮点击事件
|
|
@@ -20318,23 +20390,29 @@ var ToolbarController = class extends ControlController {
|
|
|
20318
20390
|
_data = data.getOrigin();
|
|
20319
20391
|
}
|
|
20320
20392
|
await this.state.buttonsState.update(_data, appDeId);
|
|
20321
|
-
if (this.scheduler
|
|
20393
|
+
if (this.scheduler) {
|
|
20394
|
+
const logicParams = {};
|
|
20395
|
+
if (_data) {
|
|
20396
|
+
logicParams.data = [_data];
|
|
20397
|
+
}
|
|
20322
20398
|
recursiveIterate(
|
|
20323
20399
|
this.model,
|
|
20324
20400
|
(item) => {
|
|
20325
20401
|
const itemState = this.state.buttonsState[item.id];
|
|
20326
20402
|
if (itemState.visible) {
|
|
20327
|
-
const dynaVisible = this.scheduler.triggerItemVisible(
|
|
20328
|
-
|
|
20329
|
-
|
|
20403
|
+
const dynaVisible = this.scheduler.triggerItemVisible(
|
|
20404
|
+
item.id,
|
|
20405
|
+
logicParams
|
|
20406
|
+
);
|
|
20330
20407
|
if (dynaVisible !== void 0) {
|
|
20331
20408
|
itemState.visible = dynaVisible;
|
|
20332
20409
|
}
|
|
20333
20410
|
}
|
|
20334
20411
|
if (!itemState.disabled) {
|
|
20335
|
-
const dynaEnable = this.scheduler.triggerItemEnable(
|
|
20336
|
-
|
|
20337
|
-
|
|
20412
|
+
const dynaEnable = this.scheduler.triggerItemEnable(
|
|
20413
|
+
item.id,
|
|
20414
|
+
logicParams
|
|
20415
|
+
);
|
|
20338
20416
|
if (dynaEnable !== void 0) {
|
|
20339
20417
|
itemState.disabled = !dynaEnable;
|
|
20340
20418
|
}
|
|
@@ -20456,16 +20534,11 @@ var DashboardController = class extends ControlController {
|
|
|
20456
20534
|
* @param {string[]} names
|
|
20457
20535
|
*/
|
|
20458
20536
|
async dataChangeNotify(data) {
|
|
20459
|
-
|
|
20537
|
+
await handleAllSettled(
|
|
20460
20538
|
Object.values(this.portlets).map(async (portlet) => {
|
|
20461
20539
|
return portlet.dataChangeNotify(data);
|
|
20462
20540
|
})
|
|
20463
20541
|
);
|
|
20464
|
-
const rejectedValue = values.find((item) => item.status === "rejected");
|
|
20465
|
-
if (rejectedValue) {
|
|
20466
|
-
ibiz.log.error("dataChangeNotify\u62A5\u9519", values);
|
|
20467
|
-
throw rejectedValue.reason;
|
|
20468
|
-
}
|
|
20469
20542
|
}
|
|
20470
20543
|
};
|
|
20471
20544
|
|
|
@@ -20774,6 +20847,10 @@ var ContainerPortletController = class extends PortletPartController {
|
|
|
20774
20847
|
var ViewPortletController = class extends PortletPartController {
|
|
20775
20848
|
};
|
|
20776
20849
|
|
|
20850
|
+
// src/controller/control/dashboard/portlet/menu-portlet/menu-portlet.controller.ts
|
|
20851
|
+
var MenuPortletController = class extends PortletPartController {
|
|
20852
|
+
};
|
|
20853
|
+
|
|
20777
20854
|
// src/controller/control/data-view/data-view.controller.ts
|
|
20778
20855
|
import { RuntimeModelError as RuntimeModelError47 } from "@ibiz-template/core";
|
|
20779
20856
|
import { isNil as isNil18 } from "ramda";
|
|
@@ -21285,6 +21362,24 @@ var ExpBarControlController = class extends ControlController {
|
|
|
21285
21362
|
);
|
|
21286
21363
|
return control;
|
|
21287
21364
|
}
|
|
21365
|
+
/**
|
|
21366
|
+
* 是否缓存
|
|
21367
|
+
*
|
|
21368
|
+
* @author zk
|
|
21369
|
+
* @date 2023-09-27 09:09:59
|
|
21370
|
+
* @readonly
|
|
21371
|
+
* @type {boolean}
|
|
21372
|
+
* @memberof ExpBarControlController
|
|
21373
|
+
*/
|
|
21374
|
+
get isCache() {
|
|
21375
|
+
if (this.controlParams.expcache === "CACHE") {
|
|
21376
|
+
return true;
|
|
21377
|
+
}
|
|
21378
|
+
if (this.controlParams.expcache === "NO_CACHE") {
|
|
21379
|
+
return false;
|
|
21380
|
+
}
|
|
21381
|
+
return ibiz.config.view.expCacheMode.includes(this.model.controlType);
|
|
21382
|
+
}
|
|
21288
21383
|
/**
|
|
21289
21384
|
* 创建完成
|
|
21290
21385
|
*
|
|
@@ -21391,7 +21486,10 @@ var ExpBarControlController = class extends ControlController {
|
|
|
21391
21486
|
this.xDataController.setSelection([selectItem]);
|
|
21392
21487
|
}
|
|
21393
21488
|
this._evt.emit("onNavViewChange", {
|
|
21394
|
-
navViewMsg: {
|
|
21489
|
+
navViewMsg: {
|
|
21490
|
+
key: this.state.srfnav,
|
|
21491
|
+
isCache: this.isCache
|
|
21492
|
+
},
|
|
21395
21493
|
context: this.context
|
|
21396
21494
|
});
|
|
21397
21495
|
} else if (selectItem) {
|
|
@@ -21411,7 +21509,12 @@ var ExpBarControlController = class extends ControlController {
|
|
|
21411
21509
|
const data = this.xDataController.state.items[0];
|
|
21412
21510
|
if (!data) {
|
|
21413
21511
|
this.state.srfnav = "";
|
|
21414
|
-
this._evt.emit("onNavViewChange", {
|
|
21512
|
+
this._evt.emit("onNavViewChange", {
|
|
21513
|
+
navViewMsg: {
|
|
21514
|
+
key: "",
|
|
21515
|
+
isCache: this.isCache
|
|
21516
|
+
}
|
|
21517
|
+
});
|
|
21415
21518
|
return;
|
|
21416
21519
|
}
|
|
21417
21520
|
this.xDataController.setActive(data);
|
|
@@ -21498,7 +21601,8 @@ var ExpBarControlController = class extends ControlController {
|
|
|
21498
21601
|
key: data[this.navKeyName],
|
|
21499
21602
|
context: result.context,
|
|
21500
21603
|
params: result.params,
|
|
21501
|
-
viewId: viewModelId
|
|
21604
|
+
viewId: viewModelId,
|
|
21605
|
+
isCache: this.isCache
|
|
21502
21606
|
};
|
|
21503
21607
|
}
|
|
21504
21608
|
/**
|
|
@@ -21705,6 +21809,7 @@ var TreeExpBarController = class extends ExpBarControlController {
|
|
|
21705
21809
|
return {
|
|
21706
21810
|
key: nodeId,
|
|
21707
21811
|
viewId: nodeModel.navAppViewId,
|
|
21812
|
+
isCache: this.isCache,
|
|
21708
21813
|
...result
|
|
21709
21814
|
};
|
|
21710
21815
|
}
|
|
@@ -21809,16 +21914,11 @@ var FormController = class extends ControlController {
|
|
|
21809
21914
|
* @param {string[]} names
|
|
21810
21915
|
*/
|
|
21811
21916
|
async dataChangeNotify(names) {
|
|
21812
|
-
|
|
21917
|
+
await handleAllSettled(
|
|
21813
21918
|
Object.values(this.details).map(async (detail) => {
|
|
21814
21919
|
return detail.dataChangeNotify(names);
|
|
21815
21920
|
})
|
|
21816
21921
|
);
|
|
21817
|
-
const rejectedValue = values.find((item) => item.status === "rejected");
|
|
21818
|
-
if (rejectedValue) {
|
|
21819
|
-
ibiz.log.error("dataChangeNotify\u62A5\u9519", values);
|
|
21820
|
-
throw rejectedValue.reason;
|
|
21821
|
-
}
|
|
21822
21922
|
}
|
|
21823
21923
|
/**
|
|
21824
21924
|
* 表单状态变更通知
|
|
@@ -22442,7 +22542,7 @@ var FormButtonController = class extends FormDetailController {
|
|
|
22442
22542
|
|
|
22443
22543
|
// src/controller/control/form/form-detail/form-druipart/form-druipart.controller.ts
|
|
22444
22544
|
import { isOverlap as isOverlap2 } from "@ibiz-template/core";
|
|
22445
|
-
import { createUUID as createUUID4, notNilEmpty as
|
|
22545
|
+
import { createUUID as createUUID4, notNilEmpty as notNilEmpty9 } from "qx-util";
|
|
22446
22546
|
|
|
22447
22547
|
// src/controller/control/form/form-detail/form-druipart/form-druipart.state.ts
|
|
22448
22548
|
var FormDruipartState = class extends FormDetailState {
|
|
@@ -22537,7 +22637,7 @@ var FormDRUIPartController = class extends FormDetailController {
|
|
|
22537
22637
|
calcViewParams() {
|
|
22538
22638
|
let newContext = this.form.context.clone();
|
|
22539
22639
|
const navContexts = this.model.navigateContexts;
|
|
22540
|
-
if (
|
|
22640
|
+
if (notNilEmpty9(navContexts)) {
|
|
22541
22641
|
newContext = Object.assign(
|
|
22542
22642
|
newContext,
|
|
22543
22643
|
convertNavData(
|
|
@@ -22706,7 +22806,7 @@ var FormGroupPanelController = class extends FormDetailController {
|
|
|
22706
22806
|
|
|
22707
22807
|
// src/controller/control/form/form-detail/form-item/form-item.controller.ts
|
|
22708
22808
|
import Schema from "async-validator";
|
|
22709
|
-
import { isNilOrEmpty as
|
|
22809
|
+
import { isNilOrEmpty as isNilOrEmpty7 } from "qx-util";
|
|
22710
22810
|
|
|
22711
22811
|
// src/controller/control/form/form-detail/form-item/form-item.state.ts
|
|
22712
22812
|
var FormItemState = class extends FormDetailState {
|
|
@@ -22944,7 +23044,7 @@ var FormItemController = class extends FormDetailController {
|
|
|
22944
23044
|
this.state.error = null;
|
|
22945
23045
|
return true;
|
|
22946
23046
|
}
|
|
22947
|
-
if (this.state.required &&
|
|
23047
|
+
if (this.state.required && isNilOrEmpty7(this.data[this.name])) {
|
|
22948
23048
|
this.state.error = "\u8BF7\u586B\u5199".concat(this.model.caption || "");
|
|
22949
23049
|
return false;
|
|
22950
23050
|
}
|
|
@@ -23235,6 +23335,7 @@ import {
|
|
|
23235
23335
|
mergeDefaultInLeft as mergeDefaultInLeft2
|
|
23236
23336
|
} from "@ibiz-template/core";
|
|
23237
23337
|
import { debounce } from "lodash-es";
|
|
23338
|
+
import { clone as clone16 } from "ramda";
|
|
23238
23339
|
|
|
23239
23340
|
// src/controller/control/form/edit-form/edit-form.service.ts
|
|
23240
23341
|
import {
|
|
@@ -23477,7 +23578,7 @@ var EditFormService = class extends ControlService {
|
|
|
23477
23578
|
}
|
|
23478
23579
|
},
|
|
23479
23580
|
{
|
|
23480
|
-
childrenFields: ["deformPages", "deformDetails"]
|
|
23581
|
+
childrenFields: ["deformPages", "deformTabPages", "deformDetails"]
|
|
23481
23582
|
}
|
|
23482
23583
|
);
|
|
23483
23584
|
}
|
|
@@ -23516,6 +23617,9 @@ var EditFormService = class extends ControlService {
|
|
|
23516
23617
|
|
|
23517
23618
|
// src/controller/control/form/edit-form/edit-form.controller.ts
|
|
23518
23619
|
var EditFormController = class extends FormController {
|
|
23620
|
+
get view() {
|
|
23621
|
+
return this.ctx.view;
|
|
23622
|
+
}
|
|
23519
23623
|
/**
|
|
23520
23624
|
* 初始化方法
|
|
23521
23625
|
*
|
|
@@ -23570,6 +23674,51 @@ var EditFormController = class extends FormController {
|
|
|
23570
23674
|
this.state.isLoaded = true;
|
|
23571
23675
|
return this.data;
|
|
23572
23676
|
}
|
|
23677
|
+
/**
|
|
23678
|
+
* 拷贝模式加载数据
|
|
23679
|
+
*
|
|
23680
|
+
* @author chitanda
|
|
23681
|
+
* @date 2023-09-26 19:09:21
|
|
23682
|
+
* @return {*} {Promise<IData>}
|
|
23683
|
+
*/
|
|
23684
|
+
async copy() {
|
|
23685
|
+
const context = clone16(this.context);
|
|
23686
|
+
const queryParams = clone16(this.params);
|
|
23687
|
+
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
23688
|
+
this.model.appDataEntityId
|
|
23689
|
+
);
|
|
23690
|
+
const key = appDataEntity.keyAppDEFieldId;
|
|
23691
|
+
if (key && this.params[key]) {
|
|
23692
|
+
const deCodeName = calcDeCodeNameById(this.model.appDataEntityId);
|
|
23693
|
+
context[deCodeName] = this.params[key];
|
|
23694
|
+
delete queryParams[key];
|
|
23695
|
+
delete this.params[key];
|
|
23696
|
+
delete queryParams.srfcopymode;
|
|
23697
|
+
delete this.params.srfcopymode;
|
|
23698
|
+
}
|
|
23699
|
+
let res;
|
|
23700
|
+
try {
|
|
23701
|
+
await this.startLoading();
|
|
23702
|
+
await this.evt.emit("onBeforeLoad", void 0);
|
|
23703
|
+
res = await this.service.get(context, queryParams);
|
|
23704
|
+
} catch (error) {
|
|
23705
|
+
await this.evt.emit("onLoadError", void 0);
|
|
23706
|
+
this.actionNotification("GETERROR", {
|
|
23707
|
+
error
|
|
23708
|
+
});
|
|
23709
|
+
throw error;
|
|
23710
|
+
} finally {
|
|
23711
|
+
await this.endLoading();
|
|
23712
|
+
}
|
|
23713
|
+
res.data.$origin.srfsourcekey = void 0;
|
|
23714
|
+
this.state.modified = false;
|
|
23715
|
+
this.state.data = res.data;
|
|
23716
|
+
this.formStateNotify("LOAD" /* LOAD */);
|
|
23717
|
+
await this.evt.emit("onLoadSuccess", void 0);
|
|
23718
|
+
this.actionNotification("GETSUCCESS");
|
|
23719
|
+
this.state.isLoaded = true;
|
|
23720
|
+
return this.data;
|
|
23721
|
+
}
|
|
23573
23722
|
/**
|
|
23574
23723
|
* 部件加载数据行为
|
|
23575
23724
|
*
|
|
@@ -23577,6 +23726,10 @@ var EditFormController = class extends FormController {
|
|
|
23577
23726
|
* @date 2022-08-19 14:08:50
|
|
23578
23727
|
*/
|
|
23579
23728
|
async load() {
|
|
23729
|
+
const copyMode = this.params.srfcopymode;
|
|
23730
|
+
if (copyMode) {
|
|
23731
|
+
return this.copy();
|
|
23732
|
+
}
|
|
23580
23733
|
const isLoadDraft = !hasDeCodeName(
|
|
23581
23734
|
this.context,
|
|
23582
23735
|
this.model.appDataEntityId
|
|
@@ -23584,7 +23737,7 @@ var EditFormController = class extends FormController {
|
|
|
23584
23737
|
if (isLoadDraft) {
|
|
23585
23738
|
return this.loadDraft();
|
|
23586
23739
|
}
|
|
23587
|
-
const queryParams =
|
|
23740
|
+
const queryParams = clone16(this.params);
|
|
23588
23741
|
let res;
|
|
23589
23742
|
try {
|
|
23590
23743
|
await this.startLoading();
|
|
@@ -24857,7 +25010,7 @@ import {
|
|
|
24857
25010
|
RuntimeError as RuntimeError43,
|
|
24858
25011
|
RuntimeModelError as RuntimeModelError52
|
|
24859
25012
|
} from "@ibiz-template/core";
|
|
24860
|
-
import { clone as
|
|
25013
|
+
import { clone as clone17 } from "ramda";
|
|
24861
25014
|
|
|
24862
25015
|
// src/controller/control/grid/grid/grid.service.ts
|
|
24863
25016
|
var GridService = class extends MDControlService {
|
|
@@ -25087,10 +25240,11 @@ var GridController = class extends MDControlController {
|
|
|
25087
25240
|
}
|
|
25088
25241
|
async afterLoad(args, items) {
|
|
25089
25242
|
await super.afterLoad(args, items);
|
|
25090
|
-
await
|
|
25243
|
+
await handleAllSettled(
|
|
25091
25244
|
Object.values(this.fieldColumns).map(async (fieldColumn) => {
|
|
25092
25245
|
await fieldColumn.loadCodeList();
|
|
25093
|
-
})
|
|
25246
|
+
}),
|
|
25247
|
+
false
|
|
25094
25248
|
);
|
|
25095
25249
|
this.state.rows = items.map((item) => {
|
|
25096
25250
|
const row = new GridRowState(item, this);
|
|
@@ -25316,7 +25470,7 @@ var GridController = class extends MDControlController {
|
|
|
25316
25470
|
if (!needSaveData.length) {
|
|
25317
25471
|
return;
|
|
25318
25472
|
}
|
|
25319
|
-
|
|
25473
|
+
await handleAllSettled(
|
|
25320
25474
|
needSaveData.map((data) => {
|
|
25321
25475
|
return this.save(data);
|
|
25322
25476
|
})
|
|
@@ -25452,16 +25606,11 @@ var GridController = class extends MDControlController {
|
|
|
25452
25606
|
* @param {string[]} names 更新的属性
|
|
25453
25607
|
*/
|
|
25454
25608
|
async dataChangeNotify(row, names) {
|
|
25455
|
-
|
|
25609
|
+
await handleAllSettled(
|
|
25456
25610
|
Object.values(this.editColumns).map(async (column) => {
|
|
25457
25611
|
return column.dataChangeNotify(row, names);
|
|
25458
25612
|
})
|
|
25459
25613
|
);
|
|
25460
|
-
const rejectedValue = values.find((item) => item.status === "rejected");
|
|
25461
|
-
if (rejectedValue) {
|
|
25462
|
-
ibiz.log.error("dataChangeNotify\u62A5\u9519", values);
|
|
25463
|
-
throw rejectedValue.reason;
|
|
25464
|
-
}
|
|
25465
25614
|
}
|
|
25466
25615
|
/**
|
|
25467
25616
|
* 表格状态变更通知
|
|
@@ -25526,7 +25675,7 @@ var GridController = class extends MDControlController {
|
|
|
25526
25675
|
throw new RuntimeError43("\u540C\u65F6\u53EA\u80FD\u6709\u4E00\u884C\u5F00\u542F\u884C\u7F16\u8F91");
|
|
25527
25676
|
}
|
|
25528
25677
|
if (row.data.srfuf === 1 /* UPDATE */) {
|
|
25529
|
-
row.cacheData =
|
|
25678
|
+
row.cacheData = clone17(row.data);
|
|
25530
25679
|
const defaultVal = this.calcDefaultValue(row.data, false);
|
|
25531
25680
|
Object.assign(row.data, defaultVal);
|
|
25532
25681
|
}
|
|
@@ -25643,7 +25792,7 @@ var GridController = class extends MDControlController {
|
|
|
25643
25792
|
codeListMap.set(key, items[key].codeListItems);
|
|
25644
25793
|
}
|
|
25645
25794
|
});
|
|
25646
|
-
const cloneData =
|
|
25795
|
+
const cloneData = clone17(
|
|
25647
25796
|
data2.map((item) => {
|
|
25648
25797
|
return item.getOrigin();
|
|
25649
25798
|
})
|
|
@@ -25753,7 +25902,7 @@ var GridController = class extends MDControlController {
|
|
|
25753
25902
|
// src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
|
|
25754
25903
|
import { DataTypes as DataTypes3, ModelError as ModelError26 } from "@ibiz-template/core";
|
|
25755
25904
|
import dayjs4 from "dayjs";
|
|
25756
|
-
import { clone as
|
|
25905
|
+
import { clone as clone18 } from "ramda";
|
|
25757
25906
|
var GridFieldColumnController = class extends GridColumnController {
|
|
25758
25907
|
constructor() {
|
|
25759
25908
|
super(...arguments);
|
|
@@ -25849,7 +25998,7 @@ var GridFieldColumnController = class extends GridColumnController {
|
|
|
25849
25998
|
srfkey: value,
|
|
25850
25999
|
...wfContext
|
|
25851
26000
|
});
|
|
25852
|
-
const tempParams =
|
|
26001
|
+
const tempParams = clone18(this.params);
|
|
25853
26002
|
const { context: newContext, params: newParams } = this.handlePublicParams(
|
|
25854
26003
|
row.data,
|
|
25855
26004
|
tempContext,
|
|
@@ -26042,7 +26191,7 @@ var GridUAColumnController = class extends GridColumnController {
|
|
|
26042
26191
|
// src/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.ts
|
|
26043
26192
|
import { RuntimeError as RuntimeError44 } from "@ibiz-template/core";
|
|
26044
26193
|
import Schema2 from "async-validator";
|
|
26045
|
-
import { isNilOrEmpty as
|
|
26194
|
+
import { isNilOrEmpty as isNilOrEmpty8 } from "qx-util";
|
|
26046
26195
|
var GridFieldEditColumnController = class extends GridFieldColumnController {
|
|
26047
26196
|
constructor() {
|
|
26048
26197
|
super(...arguments);
|
|
@@ -26275,7 +26424,7 @@ var GridFieldEditColumnController = class extends GridFieldColumnController {
|
|
|
26275
26424
|
*/
|
|
26276
26425
|
async validate(row) {
|
|
26277
26426
|
const editName = this.fieldName;
|
|
26278
|
-
if (ibiz.config.grid.editShowMode !== "cell" && row.editColStates[editName].required &&
|
|
26427
|
+
if (ibiz.config.grid.editShowMode !== "cell" && row.editColStates[editName].required && isNilOrEmpty8(row.data[editName])) {
|
|
26279
26428
|
row.errors[editName] = "\u8BF7\u586B\u5199".concat(this.model.caption || "");
|
|
26280
26429
|
return false;
|
|
26281
26430
|
}
|
|
@@ -27271,6 +27420,24 @@ var TabExpPanelController = class extends ControlController {
|
|
|
27271
27420
|
*/
|
|
27272
27421
|
this.isShowIcon = false;
|
|
27273
27422
|
}
|
|
27423
|
+
/**
|
|
27424
|
+
* 是否缓存
|
|
27425
|
+
*
|
|
27426
|
+
* @author zk
|
|
27427
|
+
* @date 2023-09-27 09:09:59
|
|
27428
|
+
* @readonly
|
|
27429
|
+
* @type {boolean}
|
|
27430
|
+
* @memberof ExpBarControlController
|
|
27431
|
+
*/
|
|
27432
|
+
get isCache() {
|
|
27433
|
+
if (this.controlParams.expcache === "CACHE") {
|
|
27434
|
+
return true;
|
|
27435
|
+
}
|
|
27436
|
+
if (this.controlParams.expcache === "NO_CACHE") {
|
|
27437
|
+
return false;
|
|
27438
|
+
}
|
|
27439
|
+
return ibiz.config.view.expCacheMode.includes(this.model.controlType);
|
|
27440
|
+
}
|
|
27274
27441
|
/**
|
|
27275
27442
|
* 初始化state的属性
|
|
27276
27443
|
*
|
|
@@ -27450,7 +27617,8 @@ var TabExpPanelController = class extends ControlController {
|
|
|
27450
27617
|
key: tabViewPanel.codeName.toLowerCase(),
|
|
27451
27618
|
context,
|
|
27452
27619
|
params,
|
|
27453
|
-
viewId: tabViewPanel.embeddedAppDEViewId
|
|
27620
|
+
viewId: tabViewPanel.embeddedAppDEViewId,
|
|
27621
|
+
isCache: this.isCache
|
|
27454
27622
|
};
|
|
27455
27623
|
}
|
|
27456
27624
|
};
|
|
@@ -27488,7 +27656,7 @@ var TreeService = class extends MDControlService {
|
|
|
27488
27656
|
if (childNodeRSs.length === 0) {
|
|
27489
27657
|
return;
|
|
27490
27658
|
}
|
|
27491
|
-
const results = await
|
|
27659
|
+
const results = await handleAllSettled(
|
|
27492
27660
|
childNodeRSs.map(async (childNodeRS) => {
|
|
27493
27661
|
const childNode = getTreeNode(
|
|
27494
27662
|
this.model,
|
|
@@ -27500,14 +27668,11 @@ var TreeService = class extends MDControlService {
|
|
|
27500
27668
|
parentNodeData,
|
|
27501
27669
|
opts
|
|
27502
27670
|
);
|
|
27503
|
-
})
|
|
27671
|
+
}),
|
|
27672
|
+
false
|
|
27504
27673
|
);
|
|
27505
27674
|
results.forEach((result) => {
|
|
27506
|
-
|
|
27507
|
-
childrenNodes.push(...result.value);
|
|
27508
|
-
} else if (result.status === "rejected") {
|
|
27509
|
-
ibiz.log.error(result.reason);
|
|
27510
|
-
}
|
|
27675
|
+
childrenNodes.push(...result);
|
|
27511
27676
|
});
|
|
27512
27677
|
}
|
|
27513
27678
|
return childrenNodes;
|
|
@@ -27678,9 +27843,9 @@ var TreeService = class extends MDControlService {
|
|
|
27678
27843
|
navParams: {}
|
|
27679
27844
|
};
|
|
27680
27845
|
params.size = nodeModel.maxSize || 1e3;
|
|
27681
|
-
if (nodeModel.sortAppDEFieldId
|
|
27846
|
+
if (nodeModel.sortAppDEFieldId) {
|
|
27682
27847
|
Object.assign(params, {
|
|
27683
|
-
sort: "".concat(nodeModel.sortAppDEFieldId.toLowerCase(), ",").concat(nodeModel.sortDir.toLowerCase())
|
|
27848
|
+
sort: "".concat(nodeModel.sortAppDEFieldId.toLowerCase(), ",").concat(nodeModel.sortDir ? nodeModel.sortDir.toLowerCase() : "asc")
|
|
27684
27849
|
});
|
|
27685
27850
|
}
|
|
27686
27851
|
const response = await this.app.deService.exec(
|
|
@@ -29670,6 +29835,7 @@ var ViewEngineBase = class {
|
|
|
29670
29835
|
|
|
29671
29836
|
// src/engine/md-view.engine.ts
|
|
29672
29837
|
import { RuntimeModelError as RuntimeModelError55 } from "@ibiz-template/core";
|
|
29838
|
+
import { clone as clone19 } from "ramda";
|
|
29673
29839
|
var MDViewEngine = class extends ViewEngineBase {
|
|
29674
29840
|
/**
|
|
29675
29841
|
* 多数据部件名称
|
|
@@ -29866,13 +30032,13 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
29866
30032
|
if (!openAppViewLogic) {
|
|
29867
30033
|
throw new RuntimeModelError55(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
|
|
29868
30034
|
}
|
|
29869
|
-
const
|
|
30035
|
+
const params = clone19(this.view.params);
|
|
29870
30036
|
if (copyMode) {
|
|
29871
|
-
|
|
30037
|
+
params.srfcopymode = copyMode;
|
|
29872
30038
|
}
|
|
29873
30039
|
const result = await ((_c = this.view.scheduler) == null ? void 0 : _c.triggerCustom("newdata", {
|
|
29874
|
-
context,
|
|
29875
|
-
params
|
|
30040
|
+
context: this.view.context,
|
|
30041
|
+
params,
|
|
29876
30042
|
data,
|
|
29877
30043
|
event,
|
|
29878
30044
|
view: this.view
|
|
@@ -30016,6 +30182,90 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
30016
30182
|
}
|
|
30017
30183
|
};
|
|
30018
30184
|
|
|
30185
|
+
// src/utils/error-handler/default-error-handler.ts
|
|
30186
|
+
import {
|
|
30187
|
+
RuntimeModelError as RuntimeModelError56,
|
|
30188
|
+
ModelError as ModelError28,
|
|
30189
|
+
HttpError as HttpError4,
|
|
30190
|
+
NoticeError as NoticeError2,
|
|
30191
|
+
RuntimeError as RuntimeError50
|
|
30192
|
+
} from "@ibiz-template/core";
|
|
30193
|
+
var DefaultErrorHandler = class {
|
|
30194
|
+
handle(error) {
|
|
30195
|
+
if (error instanceof RuntimeModelError56 || error instanceof ModelError28) {
|
|
30196
|
+
ibiz.message.error(error.message, 10, true);
|
|
30197
|
+
} else if (error instanceof HttpError4) {
|
|
30198
|
+
if (error.status === 401) {
|
|
30199
|
+
ibiz.message.error("\u6CA1\u6709\u6CE8\u518C\u65E0\u6743\u9650\u9519\u8BEF\u5904\u7406\u5668");
|
|
30200
|
+
} else {
|
|
30201
|
+
ibiz.notification.error({
|
|
30202
|
+
title: "",
|
|
30203
|
+
desc: error.message,
|
|
30204
|
+
duration: 10
|
|
30205
|
+
});
|
|
30206
|
+
}
|
|
30207
|
+
} else if (error instanceof NoticeError2) {
|
|
30208
|
+
ibiz.message.error(error.message, error.duration, error.duration === 0);
|
|
30209
|
+
} else if (error instanceof RuntimeError50) {
|
|
30210
|
+
ibiz.message.error(error.message, 10, true);
|
|
30211
|
+
}
|
|
30212
|
+
ibiz.log.error(error);
|
|
30213
|
+
return true;
|
|
30214
|
+
}
|
|
30215
|
+
};
|
|
30216
|
+
|
|
30217
|
+
// src/utils/error-handler/error-handler-center.ts
|
|
30218
|
+
var ErrorHandlerCenter = class {
|
|
30219
|
+
constructor() {
|
|
30220
|
+
/**
|
|
30221
|
+
* 处理器集合
|
|
30222
|
+
* @author lxm
|
|
30223
|
+
* @date 2023-09-26 04:56:29
|
|
30224
|
+
* @type {IErrorHandler[]}
|
|
30225
|
+
*/
|
|
30226
|
+
this.handlers = [];
|
|
30227
|
+
}
|
|
30228
|
+
/**
|
|
30229
|
+
* 注册处理器(后注册的优先级更高)
|
|
30230
|
+
* @author lxm
|
|
30231
|
+
* @date 2023-09-26 04:59:06
|
|
30232
|
+
* @param {IErrorHandler} handler
|
|
30233
|
+
*/
|
|
30234
|
+
register(handler) {
|
|
30235
|
+
this.handlers.unshift(handler);
|
|
30236
|
+
}
|
|
30237
|
+
/**
|
|
30238
|
+
* 处理单个报错
|
|
30239
|
+
* @author lxm
|
|
30240
|
+
* @date 2023-09-26 05:18:18
|
|
30241
|
+
* @protected
|
|
30242
|
+
* @param {unknown} error
|
|
30243
|
+
*/
|
|
30244
|
+
handleSingle(error) {
|
|
30245
|
+
const find = this.handlers.find((item) => {
|
|
30246
|
+
return !!item.handle(error);
|
|
30247
|
+
});
|
|
30248
|
+
if (!find) {
|
|
30249
|
+
ibiz.log.error("\u6CA1\u6709\u627E\u5230\u80FD\u5904\u7406\u8BE5\u9519\u8BEF\u7684\u5904\u7406\u5668", error);
|
|
30250
|
+
}
|
|
30251
|
+
}
|
|
30252
|
+
/**
|
|
30253
|
+
* 按顺序检测处理器,最先满足条件的处理该异常
|
|
30254
|
+
* @author lxm
|
|
30255
|
+
* @date 2023-09-26 05:01:08
|
|
30256
|
+
* @param {unknown} error
|
|
30257
|
+
*/
|
|
30258
|
+
handle(error) {
|
|
30259
|
+
if (error instanceof Array) {
|
|
30260
|
+
error.forEach((item) => {
|
|
30261
|
+
this.handleSingle(item);
|
|
30262
|
+
});
|
|
30263
|
+
} else {
|
|
30264
|
+
this.handleSingle(error);
|
|
30265
|
+
}
|
|
30266
|
+
}
|
|
30267
|
+
};
|
|
30268
|
+
|
|
30019
30269
|
// src/global/global-util/global-util.ts
|
|
30020
30270
|
var GlobalUtil = class {
|
|
30021
30271
|
constructor() {
|
|
@@ -30047,6 +30297,13 @@ var GlobalUtil = class {
|
|
|
30047
30297
|
* @date 2023-08-24 11:08:28
|
|
30048
30298
|
*/
|
|
30049
30299
|
this.rawValue = new RawValueUtil();
|
|
30300
|
+
/**
|
|
30301
|
+
* 错误处理中心
|
|
30302
|
+
* @author lxm
|
|
30303
|
+
* @date 2023-09-26 05:04:26
|
|
30304
|
+
*/
|
|
30305
|
+
this.error = new ErrorHandlerCenter();
|
|
30306
|
+
this.error.register(new DefaultErrorHandler());
|
|
30050
30307
|
}
|
|
30051
30308
|
/**
|
|
30052
30309
|
* 显示应用级别的加载提示
|
|
@@ -30077,7 +30334,7 @@ var GlobalUtil = class {
|
|
|
30077
30334
|
};
|
|
30078
30335
|
|
|
30079
30336
|
// src/logic-scheduler/executor/logic-executor.ts
|
|
30080
|
-
import { RuntimeError as
|
|
30337
|
+
import { RuntimeError as RuntimeError51 } from "@ibiz-template/core";
|
|
30081
30338
|
var LogicExecutor = class {
|
|
30082
30339
|
/**
|
|
30083
30340
|
* @author lxm
|
|
@@ -30098,7 +30355,7 @@ var LogicExecutor = class {
|
|
|
30098
30355
|
*/
|
|
30099
30356
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30100
30357
|
execute(_executeParams) {
|
|
30101
|
-
throw new
|
|
30358
|
+
throw new RuntimeError51("Method not implemented.");
|
|
30102
30359
|
}
|
|
30103
30360
|
/**
|
|
30104
30361
|
* 销毁方法
|
|
@@ -30110,7 +30367,7 @@ var LogicExecutor = class {
|
|
|
30110
30367
|
};
|
|
30111
30368
|
|
|
30112
30369
|
// src/logic-scheduler/executor/logic-executor-factory.ts
|
|
30113
|
-
import { ModelError as
|
|
30370
|
+
import { ModelError as ModelError29 } from "@ibiz-template/core";
|
|
30114
30371
|
var LogicExecutorFactory = class {
|
|
30115
30372
|
constructor() {
|
|
30116
30373
|
/**
|
|
@@ -30140,7 +30397,7 @@ var LogicExecutorFactory = class {
|
|
|
30140
30397
|
createExecutor(logic, scheduler) {
|
|
30141
30398
|
const constructor = this.constructorMap.get(logic.logicType);
|
|
30142
30399
|
if (!constructor) {
|
|
30143
|
-
throw new
|
|
30400
|
+
throw new ModelError29(logic, "\u903B\u8F91\u7C7B\u578B ".concat(logic.logicType, " \u6682\u672A\u652F\u6301\uFF01"));
|
|
30144
30401
|
}
|
|
30145
30402
|
return constructor(logic, scheduler);
|
|
30146
30403
|
}
|
|
@@ -30189,13 +30446,13 @@ var ScriptExecutor = class extends LogicExecutor {
|
|
|
30189
30446
|
};
|
|
30190
30447
|
|
|
30191
30448
|
// src/logic-scheduler/executor/app-de-ui-logic-executor.ts
|
|
30192
|
-
import { RuntimeModelError as
|
|
30449
|
+
import { RuntimeModelError as RuntimeModelError57 } from "@ibiz-template/core";
|
|
30193
30450
|
var AppDEUILogicExecutor = class extends LogicExecutor {
|
|
30194
30451
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30195
30452
|
execute(executeParams) {
|
|
30196
30453
|
const { appDEUILogicId, appDataEntityId } = this.logic;
|
|
30197
30454
|
if (!appDEUILogicId) {
|
|
30198
|
-
throw new
|
|
30455
|
+
throw new RuntimeModelError57(this.logic, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
|
|
30199
30456
|
}
|
|
30200
30457
|
execUILogic(appDEUILogicId, appDataEntityId, executeParams);
|
|
30201
30458
|
}
|
|
@@ -30453,7 +30710,7 @@ var ViewLogicScheduler = class extends LogicScheduler {
|
|
|
30453
30710
|
};
|
|
30454
30711
|
|
|
30455
30712
|
// src/logic-scheduler/trigger/logic-trigger-factory.ts
|
|
30456
|
-
import { ModelError as
|
|
30713
|
+
import { ModelError as ModelError30 } from "@ibiz-template/core";
|
|
30457
30714
|
var LogicTriggerFactory = class {
|
|
30458
30715
|
constructor() {
|
|
30459
30716
|
/**
|
|
@@ -30483,7 +30740,7 @@ var LogicTriggerFactory = class {
|
|
|
30483
30740
|
createTrigger(logic, scheduler) {
|
|
30484
30741
|
const constructor = this.constructorMap.get(logic.triggerType);
|
|
30485
30742
|
if (!constructor) {
|
|
30486
|
-
throw new
|
|
30743
|
+
throw new ModelError30(logic, "\u89E6\u53D1\u5668\u7C7B\u578B ".concat(logic.triggerType, " \u6682\u672A\u652F\u6301\uFF01"));
|
|
30487
30744
|
}
|
|
30488
30745
|
return constructor(logic, scheduler);
|
|
30489
30746
|
}
|
|
@@ -30530,7 +30787,7 @@ var LogicSchedulerCenter = class {
|
|
|
30530
30787
|
};
|
|
30531
30788
|
|
|
30532
30789
|
// src/logic-scheduler/trigger/logic-trigger.ts
|
|
30533
|
-
import { RuntimeError as
|
|
30790
|
+
import { RuntimeError as RuntimeError52 } from "@ibiz-template/core";
|
|
30534
30791
|
var LogicTrigger = class {
|
|
30535
30792
|
/**
|
|
30536
30793
|
* @author lxm
|
|
@@ -30590,7 +30847,7 @@ var LogicTrigger = class {
|
|
|
30590
30847
|
if (this.executor) {
|
|
30591
30848
|
return this.executor.execute(executeParams);
|
|
30592
30849
|
}
|
|
30593
|
-
throw new
|
|
30850
|
+
throw new RuntimeError52("".concat(this.logic.id, "\u6CA1\u6709\u7ED1\u5B9Aexecutor"));
|
|
30594
30851
|
}
|
|
30595
30852
|
/**
|
|
30596
30853
|
* 销毁方法
|
|
@@ -30607,12 +30864,12 @@ var CustomTrigger = class extends LogicTrigger {
|
|
|
30607
30864
|
};
|
|
30608
30865
|
|
|
30609
30866
|
// src/logic-scheduler/trigger/item-dyna-logic-trigger.ts
|
|
30610
|
-
import { RuntimeError as
|
|
30867
|
+
import { RuntimeError as RuntimeError53 } from "@ibiz-template/core";
|
|
30611
30868
|
var ItemDynaLogicTrigger = class extends LogicTrigger {
|
|
30612
30869
|
bindExecutor(executor) {
|
|
30613
30870
|
super.bindExecutor(executor);
|
|
30614
30871
|
if (this.executor.type !== "SCRIPT") {
|
|
30615
|
-
throw new
|
|
30872
|
+
throw new RuntimeError53(
|
|
30616
30873
|
"\u9884\u5B9A\u4E49\u903B\u8F91\u7C7B\u578B".concat(this.type, "\u7684\u89E6\u53D1\u5668\u7C7B\u578B\u53EA\u80FD\u662F\u811A\u672C")
|
|
30617
30874
|
);
|
|
30618
30875
|
}
|
|
@@ -30643,15 +30900,12 @@ var ItemDynaLogicTrigger = class extends LogicTrigger {
|
|
|
30643
30900
|
}
|
|
30644
30901
|
execute(executeParams) {
|
|
30645
30902
|
const result = this.executor.execute(executeParams);
|
|
30646
|
-
|
|
30647
|
-
return result;
|
|
30648
|
-
}
|
|
30649
|
-
throw new RuntimeError52("".concat(this.logic.id, "\u903B\u8F91\u8FD4\u56DE\u503C\u4E0D\u662F\u5E03\u5C14\u503C"));
|
|
30903
|
+
return !!result;
|
|
30650
30904
|
}
|
|
30651
30905
|
};
|
|
30652
30906
|
|
|
30653
30907
|
// src/logic-scheduler/trigger/timer-trigger.ts
|
|
30654
|
-
import { RuntimeError as
|
|
30908
|
+
import { RuntimeError as RuntimeError54 } from "@ibiz-template/core";
|
|
30655
30909
|
var TimerTrigger = class extends LogicTrigger {
|
|
30656
30910
|
constructor() {
|
|
30657
30911
|
super(...arguments);
|
|
@@ -30660,7 +30914,7 @@ var TimerTrigger = class extends LogicTrigger {
|
|
|
30660
30914
|
start() {
|
|
30661
30915
|
this.timer = setInterval(() => {
|
|
30662
30916
|
if (!this.scheduler.defaultParamsCb) {
|
|
30663
|
-
throw new
|
|
30917
|
+
throw new RuntimeError54("\u5B9A\u65F6\u5668\u7F3A\u5C11\u9ED8\u8BA4\u53C2\u6570\u56DE\u8C03");
|
|
30664
30918
|
}
|
|
30665
30919
|
const params = this.scheduler.defaultParamsCb();
|
|
30666
30920
|
this.executor.execute(params);
|
|
@@ -30676,11 +30930,11 @@ var TimerTrigger = class extends LogicTrigger {
|
|
|
30676
30930
|
|
|
30677
30931
|
// src/logic-scheduler/executor/app-ui-logic-executor.ts
|
|
30678
30932
|
import {
|
|
30679
|
-
ModelError as
|
|
30680
|
-
RuntimeError as
|
|
30681
|
-
RuntimeModelError as
|
|
30933
|
+
ModelError as ModelError31,
|
|
30934
|
+
RuntimeError as RuntimeError55,
|
|
30935
|
+
RuntimeModelError as RuntimeModelError58
|
|
30682
30936
|
} from "@ibiz-template/core";
|
|
30683
|
-
import { notNilEmpty as
|
|
30937
|
+
import { notNilEmpty as notNilEmpty10 } from "qx-util";
|
|
30684
30938
|
var AppUILogicExecutor = class extends LogicExecutor {
|
|
30685
30939
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30686
30940
|
execute(executeParams) {
|
|
@@ -30713,7 +30967,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30713
30967
|
const { context, params, ...rest } = parameters;
|
|
30714
30968
|
const { data } = parameters;
|
|
30715
30969
|
if (!(data == null ? void 0 : data[0])) {
|
|
30716
|
-
throw new
|
|
30970
|
+
throw new RuntimeError55("opendata\u6CA1\u6709\u53EF\u64CD\u4F5C\u6570\u636E\uFF01");
|
|
30717
30971
|
}
|
|
30718
30972
|
const openViewRefs = appUILogic.openDataAppViews;
|
|
30719
30973
|
let openViewRef;
|
|
@@ -30722,7 +30976,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30722
30976
|
} else {
|
|
30723
30977
|
openViewRef = appUILogic.openDataAppView;
|
|
30724
30978
|
if (!openViewRef) {
|
|
30725
|
-
throw new
|
|
30979
|
+
throw new RuntimeModelError58(
|
|
30726
30980
|
appUILogic,
|
|
30727
30981
|
"opendata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE"
|
|
30728
30982
|
);
|
|
@@ -30730,7 +30984,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30730
30984
|
}
|
|
30731
30985
|
const openView = openViewRef.refAppViewId;
|
|
30732
30986
|
if (!openView) {
|
|
30733
|
-
throw new
|
|
30987
|
+
throw new RuntimeModelError58(
|
|
30734
30988
|
appUILogic,
|
|
30735
30989
|
"opendata\u89C6\u56FE\u903B\u8F91\u7684\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE\u6CA1\u6709\u5B9E\u9645\u5F15\u7528\u89C6\u56FE"
|
|
30736
30990
|
);
|
|
@@ -30742,7 +30996,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30742
30996
|
);
|
|
30743
30997
|
let tempParams = {};
|
|
30744
30998
|
const navParams = openViewRef.navigateParams;
|
|
30745
|
-
if (
|
|
30999
|
+
if (notNilEmpty10(navParams)) {
|
|
30746
31000
|
tempParams = convertNavData(navParams, data[0], params, context);
|
|
30747
31001
|
}
|
|
30748
31002
|
return ibiz.commands.execute(
|
|
@@ -30757,7 +31011,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30757
31011
|
const appDataEntityId = parameters.view.model.appDataEntityId;
|
|
30758
31012
|
const formTypeName = await getFormTypeFieldName(appDataEntityId);
|
|
30759
31013
|
if (!formTypeName) {
|
|
30760
|
-
throw new
|
|
31014
|
+
throw new RuntimeModelError58(
|
|
30761
31015
|
appUILogic,
|
|
30762
31016
|
"".concat(appDataEntityId, "\u5B9E\u4F53\u7F3A\u5C11\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027")
|
|
30763
31017
|
);
|
|
@@ -30765,12 +31019,12 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30765
31019
|
const { data } = parameters;
|
|
30766
31020
|
const formTypeValue = data[0][formTypeName];
|
|
30767
31021
|
if (!formTypeValue) {
|
|
30768
|
-
throw new
|
|
31022
|
+
throw new RuntimeModelError58(appUILogic, "\u6570\u636E\u6E90\u65E0\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027\u503C");
|
|
30769
31023
|
}
|
|
30770
31024
|
const openViewRefs = appUILogic.openDataAppViews;
|
|
30771
31025
|
const findView = openViewRefs == null ? void 0 : openViewRefs.find((item) => item.refMode === formTypeValue);
|
|
30772
31026
|
if (!findView) {
|
|
30773
|
-
throw new
|
|
31027
|
+
throw new RuntimeError55(
|
|
30774
31028
|
"\u6CA1\u6709\u627E\u5230\u4E0E\u8868\u5355\u7C7B\u578B".concat(formTypeValue, "\u76F8\u5173\u7684\u5B9E\u4F53\u7684\u7F16\u8F91\u89C6\u56FE")
|
|
30775
31029
|
);
|
|
30776
31030
|
}
|
|
@@ -30807,17 +31061,17 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30807
31061
|
return viewRef.refMode.toLowerCase() !== parentDeName;
|
|
30808
31062
|
});
|
|
30809
31063
|
if (!newViewRef) {
|
|
30810
|
-
throw new
|
|
31064
|
+
throw new RuntimeModelError58(
|
|
30811
31065
|
appUILogic,
|
|
30812
31066
|
"\u6CA1\u6709\u627E\u5230\u6279\u6DFB\u52A0\u9700\u8981\u6253\u5F00\u7684\u9009\u62E9\u89C6\u56FE"
|
|
30813
31067
|
);
|
|
30814
31068
|
}
|
|
30815
31069
|
} else if (batchAddOnly) {
|
|
30816
|
-
throw new
|
|
31070
|
+
throw new ModelError31(appUILogic, "batchAddOnly\u6682\u672A\u652F\u6301");
|
|
30817
31071
|
} else {
|
|
30818
31072
|
newViewRef = newDataAppView;
|
|
30819
31073
|
if (!newViewRef || !newViewRef.refAppViewId) {
|
|
30820
|
-
throw new
|
|
31074
|
+
throw new RuntimeModelError58(
|
|
30821
31075
|
appUILogic,
|
|
30822
31076
|
"newdata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u65B0\u5EFA\u6570\u636E\u89C6\u56FE"
|
|
30823
31077
|
);
|
|
@@ -30827,18 +31081,25 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30827
31081
|
let tempParams = {};
|
|
30828
31082
|
const _data = (data == null ? void 0 : data[0]) || {};
|
|
30829
31083
|
const navContexts = newViewRef.navigateContexts;
|
|
30830
|
-
if (
|
|
31084
|
+
if (notNilEmpty10(navContexts)) {
|
|
30831
31085
|
tempContext = convertNavData(navContexts, _data, params, context);
|
|
30832
31086
|
}
|
|
30833
31087
|
tempContext = Object.assign(context, tempContext);
|
|
30834
31088
|
const navParams = newViewRef.navigateParams;
|
|
30835
|
-
if (
|
|
31089
|
+
if (notNilEmpty10(navParams)) {
|
|
30836
31090
|
tempParams = convertNavData(navParams, _data, params, context);
|
|
30837
31091
|
}
|
|
30838
|
-
if (
|
|
30839
|
-
|
|
30840
|
-
|
|
31092
|
+
if (params.srfcopymode) {
|
|
31093
|
+
const entity = await ibiz.hub.getAppDataEntity(
|
|
31094
|
+
view.model.appDataEntityId
|
|
31095
|
+
);
|
|
31096
|
+
const key = entity.keyAppDEFieldId;
|
|
31097
|
+
if (key && _data) {
|
|
31098
|
+
tempParams[key] = _data.srfkey;
|
|
31099
|
+
tempParams.srfcopymode = true;
|
|
31100
|
+
}
|
|
30841
31101
|
}
|
|
31102
|
+
tempParams.srfuf = 0 /* CREATE */;
|
|
30842
31103
|
const result = await ibiz.commands.execute(
|
|
30843
31104
|
OpenAppViewCommand.TAG,
|
|
30844
31105
|
newViewRef.refAppViewId,
|
|
@@ -30867,7 +31128,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30867
31128
|
const { wizardAppView, newDataAppViews } = appUILogic;
|
|
30868
31129
|
const { context, params, ...rest } = parameters;
|
|
30869
31130
|
if (!wizardAppView || !wizardAppView.refAppViewId) {
|
|
30870
|
-
throw new
|
|
31131
|
+
throw new RuntimeModelError58(appUILogic, "\u7F3A\u5C11\u9ED8\u8BA4\u7D22\u5F15\u5B9E\u4F53\u9009\u62E9\u89C6\u56FE");
|
|
30871
31132
|
}
|
|
30872
31133
|
const result = await ibiz.commands.execute(
|
|
30873
31134
|
OpenAppViewCommand.TAG,
|
|
@@ -30881,12 +31142,12 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30881
31142
|
}
|
|
30882
31143
|
const selectData = (_a = result.data) == null ? void 0 : _a[0];
|
|
30883
31144
|
if (!selectData) {
|
|
30884
|
-
throw new
|
|
31145
|
+
throw new RuntimeError55("\u8BF7\u9009\u4E2D\u4E00\u6761\u6570\u636E");
|
|
30885
31146
|
}
|
|
30886
31147
|
const indexType = selectData.srfkey;
|
|
30887
31148
|
const findView = newDataAppViews == null ? void 0 : newDataAppViews.find((item) => item.refMode === indexType);
|
|
30888
31149
|
if (!findView) {
|
|
30889
|
-
throw new
|
|
31150
|
+
throw new RuntimeError55(
|
|
30890
31151
|
"\u6CA1\u6709\u627E\u5230\u4E0E\u7D22\u5F15\u7C7B\u578B".concat(indexType, "\u76F8\u5173\u7684\u5B9E\u4F53\u7684\u7F16\u8F91\u89C6\u56FE")
|
|
30891
31152
|
);
|
|
30892
31153
|
}
|
|
@@ -30913,7 +31174,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30913
31174
|
const minorDERs = selfDe.minorAppDERSs;
|
|
30914
31175
|
const pickParentDeName = newViewRef.refMode.toLowerCase();
|
|
30915
31176
|
if (!minorDERs) {
|
|
30916
|
-
throw new
|
|
31177
|
+
throw new RuntimeModelError58(selfDe, "\u5B9E\u4F53\u6CA1\u6709\u4ECE\u5173\u7CFB\u96C6\u5408\uFF01");
|
|
30917
31178
|
}
|
|
30918
31179
|
let pickParentFieldName;
|
|
30919
31180
|
minorDERs == null ? void 0 : minorDERs.forEach((item) => {
|
|
@@ -31269,6 +31530,7 @@ export {
|
|
|
31269
31530
|
MDCtrlController,
|
|
31270
31531
|
MDCtrlService,
|
|
31271
31532
|
MDViewEngine,
|
|
31533
|
+
MenuPortletController,
|
|
31272
31534
|
MethodDto,
|
|
31273
31535
|
MobMDCtrlRowState,
|
|
31274
31536
|
MobViewController,
|
|
@@ -31387,6 +31649,7 @@ export {
|
|
|
31387
31649
|
getViewProvider,
|
|
31388
31650
|
getWFContext,
|
|
31389
31651
|
getWFSubmitViewId,
|
|
31652
|
+
handleAllSettled,
|
|
31390
31653
|
hasDeCodeName,
|
|
31391
31654
|
install,
|
|
31392
31655
|
installCommand,
|